diff options
author | rnhmjoj <rnhmjoj@inventati.org> | 2019-11-13 19:17:32 +0100 |
---|---|---|
committer | rnhmjoj <rnhmjoj@inventati.org> | 2019-11-16 22:14:46 +0100 |
commit | f6a8eb2d00cd71e630484337cae29c37694037a6 (patch) | |
tree | bf9ee22b6c559f584bb52bbec3893c07d0b66643 | |
parent | 6823199dbec1c14c69c65d063775599c62e77779 (diff) | |
download | nixpkgs-f6a8eb2d00cd71e630484337cae29c37694037a6.tar nixpkgs-f6a8eb2d00cd71e630484337cae29c37694037a6.tar.gz nixpkgs-f6a8eb2d00cd71e630484337cae29c37694037a6.tar.bz2 nixpkgs-f6a8eb2d00cd71e630484337cae29c37694037a6.tar.lz nixpkgs-f6a8eb2d00cd71e630484337cae29c37694037a6.tar.xz nixpkgs-f6a8eb2d00cd71e630484337cae29c37694037a6.tar.zst nixpkgs-f6a8eb2d00cd71e630484337cae29c37694037a6.zip |
nixos/tests/magnetico: port to python
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/magnetico.nix | 22 |
2 files changed, 14 insertions, 9 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index a92a3ccd0d1..78bf7ea962a 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -148,6 +148,7 @@ in loki = handleTest ./loki.nix {}; #logstash = handleTest ./logstash.nix {}; lorri = handleTest ./lorri/default.nix {}; + magnetico = handleTest ./magnetico.nix {}; mailcatcher = handleTest ./mailcatcher.nix {}; mathics = handleTest ./mathics.nix {}; matomo = handleTest ./matomo.nix {}; diff --git a/nixos/tests/magnetico.nix b/nixos/tests/magnetico.nix index 2b1af8328da..6770d32358e 100644 --- a/nixos/tests/magnetico.nix +++ b/nixos/tests/magnetico.nix @@ -1,4 +1,4 @@ -import ./make-test.nix ({ pkgs, ...} : +import ./make-test-python.nix ({ pkgs, ...} : let port = 8081; @@ -24,13 +24,17 @@ in testScript = '' - startAll; - $machine->waitForUnit("magneticod"); - $machine->waitForUnit("magneticow"); - $machine->succeed("${pkgs.curl}/bin/curl ". - "-u user:password http://localhost:${toString port}"); - $machine->succeed("${pkgs.curl}/bin/curl ". - "-u user:wrongpwd http://localhost:${toString port}") =~ "Unauthorised." or die; - $machine->shutdown(); + start_all() + machine.wait_for_unit("magneticod") + machine.wait_for_unit("magneticow") + machine.succeed( + "${pkgs.curl}/bin/curl " + + "-u user:password http://localhost:${toString port}" + ) + assert "Unauthorised." in machine.succeed( + "${pkgs.curl}/bin/curl " + + "-u user:wrongpwd http://localhost:${toString port}" + ) + machine.shutdown() ''; }) |