diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index b92e76ed60af..802e2030bc4c 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -546,7 +546,7 @@ in ft2-clone = runTest ./ft2-clone.nix; legit = runTest ./legit.nix; mimir = runTest ./mimir.nix; - galene = discoverTests (import ./galene.nix); + galene = discoverTests (import ./galene.nix { inherit runTest; }); gancio = runTest ./gancio.nix; garage_1 = import ./garage { inherit runTest; diff --git a/nixos/tests/galene.nix b/nixos/tests/galene.nix index a05dea24eb01..3918e1048147 100644 --- a/nixos/tests/galene.nix +++ b/nixos/tests/galene.nix @@ -1,5 +1,6 @@ +{ runTest }: + let - makeTest = import ./make-test-python.nix; galeneTestGroupsDir = "/var/lib/galene/groups"; galeneTestGroupFile = "galene-test-config.json"; galenePort = 8443; @@ -7,7 +8,7 @@ let galeneTestGroupAdminPassword = "1234"; in { - basic = makeTest ( + basic = runTest ( { pkgs, lib, ... }: { name = "galene-works"; @@ -56,10 +57,7 @@ in with subtest("galene starts"): # Starts? machine.wait_for_unit("galene") - - # Keeps running after startup? - machine.sleep(10) - machine.wait_for_unit("galene") + machine.wait_for_open_port(${builtins.toString galenePort}) # Reponds fine? machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2") @@ -93,7 +91,7 @@ in } ); - file-transfer = makeTest ( + file-transfer = runTest ( { pkgs, lib, ... }: { name = "galene-file-transfer-works"; @@ -143,10 +141,7 @@ in with subtest("galene starts"): # Starts? machine.wait_for_unit("galene") - - # Keeps running after startup? - machine.sleep(10) - machine.wait_for_unit("galene") + machine.wait_for_open_port(${builtins.toString galenePort}) # Reponds fine? machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2") @@ -209,7 +204,7 @@ in } ); - stream = makeTest ( + stream = runTest ( { pkgs, lib, ... }: let galeneTestGroupBotName = "bot"; @@ -281,10 +276,7 @@ in with subtest("galene starts"): # Starts? machine.wait_for_unit("galene") - - # Keeps running after startup? - machine.sleep(10) - machine.wait_for_unit("galene") + machine.wait_for_open_port(${builtins.toString galenePort}) # Reponds fine? machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2")