Unverified Commit b3f6a4ed authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

nixosTests.haproxy: migrate to runTest (#400184)

parents 00a57910 1c40626d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -594,7 +594,7 @@ in
    package = pkgs.hadoop2;
  };
  haste-server = handleTest ./haste-server.nix { };
  haproxy = handleTest ./haproxy.nix { };
  haproxy = runTest ./haproxy.nix;
  hardened = handleTest ./hardened.nix { };
  harmonia = runTest ./harmonia.nix;
  headscale = handleTest ./headscale.nix { };
+136 −138
Original line number Diff line number Diff line
import ./make-test-python.nix (
  { lib, pkgs, ... }:
{ lib, hostPkgs, ... }:
{
  name = "haproxy";
  nodes = {
    server =
        { ... }:
      { pkgs, ... }:
      {
        services.haproxy = {
          enable = true;
@@ -67,7 +66,7 @@ import ./make-test-python.nix (
        ];
      };
    client =
        { ... }:
      { pkgs, ... }:
      {
        environment.systemPackages = [ pkgs.curlHTTP3 ];
      };
@@ -81,7 +80,7 @@ import ./make-test-python.nix (
        raise Exception(f"Command {command} failed with exit code {r}")

    def openssl(command):
        cmd(f"${pkgs.openssl}/bin/openssl {command}")
      cmd(f"${lib.getExe hostPkgs.openssl} {command}")

    # Generate CA.
    openssl("req -new -newkey rsa:4096 -nodes -x509 -days 7 -subj '/C=ZZ/ST=Cloud/L=Unspecified/O=NixOS/OU=Tests/CN=CA Certificate' -keyout cacert.key -out cacert.crt")
@@ -137,4 +136,3 @@ import ./make-test-python.nix (
        assert "We are all good!" in client.succeed("curl -f http://server/index.txt")
  '';
}
)