Browse Source

Merge pull request #98574 from mweinelt/20.09/nixos/tests/magnetico

[20.09] nixosTests.magnetico: wait for open port and make curl actually fail
wip-nanopi-m4v2
Michele Guerini Rocco 6 years ago
committed by GitHub
parent
commit
9eb814f798
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
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