diff options
author | rnhmjoj <rnhmjoj@inventati.org> | 2019-10-26 11:18:59 +0200 |
---|---|---|
committer | rnhmjoj <rnhmjoj@inventati.org> | 2019-11-16 22:02:41 +0100 |
commit | 6823199dbec1c14c69c65d063775599c62e77779 (patch) | |
tree | 215751e1979d6996d87b7b426902fc8410b78fbe /nixos/tests/magnetico.nix | |
parent | dda2f6415fc2b01bf3ee705e59778394c6edd0f9 (diff) | |
download | nixpkgs-6823199dbec1c14c69c65d063775599c62e77779.tar nixpkgs-6823199dbec1c14c69c65d063775599c62e77779.tar.gz nixpkgs-6823199dbec1c14c69c65d063775599c62e77779.tar.bz2 nixpkgs-6823199dbec1c14c69c65d063775599c62e77779.tar.lz nixpkgs-6823199dbec1c14c69c65d063775599c62e77779.tar.xz nixpkgs-6823199dbec1c14c69c65d063775599c62e77779.tar.zst nixpkgs-6823199dbec1c14c69c65d063775599c62e77779.zip |
nixos/tests/magnetico: check for different web port
Diffstat (limited to 'nixos/tests/magnetico.nix')
-rw-r--r-- | nixos/tests/magnetico.nix | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/nixos/tests/magnetico.nix b/nixos/tests/magnetico.nix index bc7aef653ee..2b1af8328da 100644 --- a/nixos/tests/magnetico.nix +++ b/nixos/tests/magnetico.nix @@ -1,4 +1,9 @@ -import ./make-test.nix ({ pkgs, ...} : { +import ./make-test.nix ({ pkgs, ...} : + +let + port = 8081; +in +{ name = "magnetico"; meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ rnhmjoj ]; @@ -12,6 +17,7 @@ import ./make-test.nix ({ pkgs, ...} : { services.magnetico = { enable = true; crawler.port = 9000; + web.port = port; web.credentials.user = "$2y$12$P88ZF6soFthiiAeXnz64aOWDsY3Dw7Yw8fZ6GtiqFNjknD70zDmNe"; }; }; @@ -21,8 +27,10 @@ import ./make-test.nix ({ pkgs, ...} : { startAll; $machine->waitForUnit("magneticod"); $machine->waitForUnit("magneticow"); - $machine->succeed("${pkgs.curl}/bin/curl -u user:password http://localhost:8080"); - $machine->succeed("${pkgs.curl}/bin/curl -u user:wrongpwd http://localhost:8080") =~ "Unauthorised." or die; + $machine->succeed("${pkgs.curl}/bin/curl ". + "-u user:password http://localhost:${toString port}"); + $machine->succeed("${pkgs.curl}/bin/curl ". + "-u user:wrongpwd http://localhost:${toString port}") =~ "Unauthorised." or die; $machine->shutdown(); ''; }) |