1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 04:02:10 +00:00

nixosTests.magnetico: wait for open port and make curl actually fail

This commit is contained in:
Martin Weinelt 2020-09-19 02:31:41 +02:00 committed by Jon
parent 1aa888ba53
commit 76aeb20d91

View file

@ -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()