nixos/tests/nginx-sso: add subtests for each assertion
This commit is contained in:
parent
abbce768dc
commit
495b0b581c
|
@ -32,13 +32,15 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
||||||
machine.wait_for_unit("nginx-sso.service")
|
machine.wait_for_unit("nginx-sso.service")
|
||||||
machine.wait_for_open_port(8080)
|
machine.wait_for_open_port(8080)
|
||||||
|
|
||||||
# No valid user -> 401.
|
with subtest("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.
|
with subtest("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.
|
with subtest("Valid user and matching ACL -> 200"):
|
||||||
machine.succeed(
|
machine.succeed(
|
||||||
"curl -sSf -H 'Authorization: Token MyToken' -H 'X-Application: MyApp' http://localhost:8080/auth"
|
"curl -sSf -H 'Authorization: Token MyToken' -H 'X-Application: MyApp' http://localhost:8080/auth"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue