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