nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

nixosTests.zeronet-conservancy: migrate to runTest

Part Of #386873

+25 -24
+1 -1
nixos/tests/all-tests.nix
··· 1304 1304 your_spotify = handleTest ./your_spotify.nix {}; 1305 1305 zammad = handleTest ./zammad.nix {}; 1306 1306 zenohd = handleTest ./zenohd.nix {}; 1307 - zeronet-conservancy = handleTest ./zeronet-conservancy.nix {}; 1307 + zeronet-conservancy = runTest ./zeronet-conservancy.nix; 1308 1308 zfs = handleTest ./zfs.nix {}; 1309 1309 zigbee2mqtt_1 = runTest { 1310 1310 imports = [ ./zigbee2mqtt.nix ];
+24 -23
nixos/tests/zeronet-conservancy.nix
··· 1 + { 2 + lib, 3 + ... 4 + }: 1 5 let 2 6 port = 43110; 3 7 in 4 - import ./make-test-python.nix ( 5 - { pkgs, ... }: 6 - { 7 - name = "zeronet-conservancy"; 8 - meta = with pkgs.lib.maintainers; { 9 - maintainers = [ fgaz ]; 8 + { 9 + name = "zeronet-conservancy"; 10 + meta = with lib.maintainers; { 11 + maintainers = [ fgaz ]; 12 + }; 13 + 14 + nodes.machine = 15 + { pkgs, ... }: 16 + { 17 + services.zeronet = { 18 + enable = true; 19 + package = pkgs.zeronet-conservancy; 20 + inherit port; 21 + }; 10 22 }; 11 23 12 - nodes.machine = 13 - { config, pkgs, ... }: 14 - { 15 - services.zeronet = { 16 - enable = true; 17 - package = pkgs.zeronet-conservancy; 18 - inherit port; 19 - }; 20 - }; 24 + testScript = '' 25 + machine.wait_for_unit("zeronet.service") 21 26 22 - testScript = '' 23 - machine.wait_for_unit("zeronet.service") 27 + machine.wait_for_open_port(${toString port}) 24 28 25 - machine.wait_for_open_port(${toString port}) 26 - 27 - machine.succeed("curl --fail -H 'Accept: text/html, application/xml, */*' localhost:${toString port}/Stats") 28 - ''; 29 - } 30 - ) 29 + machine.succeed("curl --fail -H 'Accept: text/html, application/xml, */*' localhost:${toString port}/Stats") 30 + ''; 31 + }