Skip to content

Commit

Permalink
nixosTests.magnetico: wait for open port and make curl actually fail
Browse files Browse the repository at this point in the history
  • Loading branch information
mweinelt authored and Jon committed Sep 23, 2020
1 parent 1aa888b commit 76aeb20
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 76aeb20

Please sign in to comment.