Skip to content

Commit

Permalink
Merge pull request #98574 from mweinelt/20.09/nixos/tests/magnetico
Browse files Browse the repository at this point in the history
[20.09] nixosTests.magnetico: wait for open port and make curl actually fail
  • Loading branch information
rnhmjoj committed Sep 23, 2020
2 parents c0beb14 + 94ee827 commit 9eb814f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nixos/tests/magnetico.nix
Expand Up @@ -27,12 +27,13 @@ in
start_all()
machine.wait_for_unit("magneticod")
machine.wait_for_unit("magneticow")
machine.wait_for_open_port(${toString port})
machine.succeed(
"${pkgs.curl}/bin/curl "
"${pkgs.curl}/bin/curl --fail "
+ "-u user:password http://localhost:${toString port}"
)
assert "Unauthorised." in machine.succeed(
"${pkgs.curl}/bin/curl "
machine.fail(
"${pkgs.curl}/bin/curl --fail "
+ "-u user:wrongpwd http://localhost:${toString port}"
)
machine.shutdown()
Expand Down

0 comments on commit 9eb814f

Please sign in to comment.