diff options
author | Robin Gloster <mail@glob.in> | 2019-11-24 20:42:54 +0100 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2019-12-26 17:59:25 +0100 |
commit | 1c2781d39c9b1dbac1e574795b83436891617b7e (patch) | |
tree | 646a99a103d2612908d7bfa1982d404e83653843 /nixos/tests/nginx-sso.nix | |
parent | 9842c4b1076a2f54de5e9a81fd91b2b91b1d051e (diff) | |
download | nixpkgs-1c2781d39c9b1dbac1e574795b83436891617b7e.tar nixpkgs-1c2781d39c9b1dbac1e574795b83436891617b7e.tar.gz nixpkgs-1c2781d39c9b1dbac1e574795b83436891617b7e.tar.bz2 nixpkgs-1c2781d39c9b1dbac1e574795b83436891617b7e.tar.lz nixpkgs-1c2781d39c9b1dbac1e574795b83436891617b7e.tar.xz nixpkgs-1c2781d39c9b1dbac1e574795b83436891617b7e.tar.zst nixpkgs-1c2781d39c9b1dbac1e574795b83436891617b7e.zip |
nixosTests.nginx*: port to python
Diffstat (limited to 'nixos/tests/nginx-sso.nix')
-rw-r--r-- | nixos/tests/nginx-sso.nix | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/nixos/tests/nginx-sso.nix b/nixos/tests/nginx-sso.nix index e19992cb6bf..067f196b16b 100644 --- a/nixos/tests/nginx-sso.nix +++ b/nixos/tests/nginx-sso.nix @@ -1,4 +1,4 @@ -import ./make-test.nix ({ pkgs, ... }: { +import ./make-test-python.nix ({ pkgs, ... }: { name = "nginx-sso"; meta = { maintainers = with pkgs.stdenv.lib.maintainers; [ delroth ]; @@ -27,18 +27,20 @@ import ./make-test.nix ({ pkgs, ... }: { }; testScript = '' - startAll; + start_all() - $machine->waitForUnit("nginx-sso.service"); - $machine->waitForOpenPort(8080); + machine.wait_for_unit("nginx-sso.service") + machine.wait_for_open_port(8080) # No valid user -> 401. - $machine->fail("curl -sSf http://localhost:8080/auth"); + machine.fail("curl -sSf http://localhost:8080/auth") # Valid user but no matching ACL -> 403. - $machine->fail("curl -sSf -H 'Authorization: Token MyToken' http://localhost:8080/auth"); + machine.fail("curl -sSf -H 'Authorization: Token MyToken' http://localhost:8080/auth") # Valid user and matching ACL -> 200. - $machine->succeed("curl -sSf -H 'Authorization: Token MyToken' -H 'X-Application: MyApp' http://localhost:8080/auth"); + machine.succeed( + "curl -sSf -H 'Authorization: Token MyToken' -H 'X-Application: MyApp' http://localhost:8080/auth" + ) ''; }) |