lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

nixosTests.galene: Modernise / simplify test code

- makeTest -> passed-through runTest
- Drop hardcoded sleep & check if galene still runs, it's not really necessary

OPNA2608 6bfa191e 44661754

+9 -17
+1 -1
nixos/tests/all-tests.nix
··· 546 546 ft2-clone = runTest ./ft2-clone.nix; 547 547 legit = runTest ./legit.nix; 548 548 mimir = runTest ./mimir.nix; 549 - galene = discoverTests (import ./galene.nix); 549 + galene = discoverTests (import ./galene.nix { inherit runTest; }); 550 550 gancio = runTest ./gancio.nix; 551 551 garage_1 = import ./garage { 552 552 inherit runTest;
+8 -16
nixos/tests/galene.nix
··· 1 + { runTest }: 2 + 1 3 let 2 - makeTest = import ./make-test-python.nix; 3 4 galeneTestGroupsDir = "/var/lib/galene/groups"; 4 5 galeneTestGroupFile = "galene-test-config.json"; 5 6 galenePort = 8443; ··· 7 8 galeneTestGroupAdminPassword = "1234"; 8 9 in 9 10 { 10 - basic = makeTest ( 11 + basic = runTest ( 11 12 { pkgs, lib, ... }: 12 13 { 13 14 name = "galene-works"; ··· 56 57 with subtest("galene starts"): 57 58 # Starts? 58 59 machine.wait_for_unit("galene") 59 - 60 - # Keeps running after startup? 61 - machine.sleep(10) 62 - machine.wait_for_unit("galene") 60 + machine.wait_for_open_port(${builtins.toString galenePort}) 63 61 64 62 # Reponds fine? 65 63 machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2") ··· 93 91 } 94 92 ); 95 93 96 - file-transfer = makeTest ( 94 + file-transfer = runTest ( 97 95 { pkgs, lib, ... }: 98 96 { 99 97 name = "galene-file-transfer-works"; ··· 143 141 with subtest("galene starts"): 144 142 # Starts? 145 143 machine.wait_for_unit("galene") 146 - 147 - # Keeps running after startup? 148 - machine.sleep(10) 149 - machine.wait_for_unit("galene") 144 + machine.wait_for_open_port(${builtins.toString galenePort}) 150 145 151 146 # Reponds fine? 152 147 machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2") ··· 209 204 } 210 205 ); 211 206 212 - stream = makeTest ( 207 + stream = runTest ( 213 208 { pkgs, lib, ... }: 214 209 let 215 210 galeneTestGroupBotName = "bot"; ··· 281 276 with subtest("galene starts"): 282 277 # Starts? 283 278 machine.wait_for_unit("galene") 284 - 285 - # Keeps running after startup? 286 - machine.sleep(10) 287 - machine.wait_for_unit("galene") 279 + machine.wait_for_open_port(${builtins.toString galenePort}) 288 280 289 281 # Reponds fine? 290 282 machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2")