From 6823199dbec1c14c69c65d063775599c62e77779 Mon Sep 17 00:00:00 2001
From: rnhmjoj <rnhmjoj@inventati.org>
Date: Sat, 26 Oct 2019 11:18:59 +0200
Subject: [PATCH] nixos/tests/magnetico: check for different web port
---
nixos/tests/magnetico.nix | 14 +++++++++++---
1 file 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();
'';
})