Browse Source

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

(cherry picked from commit 76aeb20d91)
wip-nanopi-m4v2
Martin Weinelt 6 years ago
parent
commit
94ee827023
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      nixos/tests/magnetico.nix

+ 4
- 3
nixos/tests/magnetico.nix 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()


Loading…
Cancel
Save