nixosTests.lighttpd: migrate to runTest (#396014)

authored by Pol Dellaiera and committed by GitHub 394ed796 eb3ca1d5

+21 -23
+1 -1
nixos/tests/all-tests.nix
··· 703 703 libvirtd = handleTest ./libvirtd.nix { }; 704 704 lidarr = handleTest ./lidarr.nix { }; 705 705 lightdm = handleTest ./lightdm.nix { }; 706 - lighttpd = handleTest ./lighttpd.nix { }; 706 + lighttpd = runTest ./lighttpd.nix; 707 707 limesurvey = handleTest ./limesurvey.nix { }; 708 708 limine = import ./limine { inherit runTest; }; 709 709 listmonk = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./listmonk.nix { };
+20 -22
nixos/tests/lighttpd.nix
··· 1 - import ./make-test-python.nix ( 2 - { lib, pkgs, ... }: 3 - { 4 - name = "lighttpd"; 5 - meta.maintainers = with lib.maintainers; [ bjornfor ]; 1 + { lib, pkgs, ... }: 2 + { 3 + name = "lighttpd"; 4 + meta.maintainers = with lib.maintainers; [ bjornfor ]; 6 5 7 - nodes = { 8 - server = { 9 - services.lighttpd.enable = true; 10 - services.lighttpd.document-root = pkgs.runCommand "document-root" { } '' 11 - mkdir -p "$out" 12 - echo "hello nixos test" > "$out/file.txt" 13 - ''; 14 - }; 6 + nodes = { 7 + server = { 8 + services.lighttpd.enable = true; 9 + services.lighttpd.document-root = pkgs.runCommand "document-root" { } '' 10 + mkdir -p "$out" 11 + echo "hello nixos test" > "$out/file.txt" 12 + ''; 15 13 }; 14 + }; 16 15 17 - testScript = '' 18 - start_all() 19 - server.wait_for_unit("lighttpd.service") 20 - res = server.succeed("curl --fail http://localhost/file.txt") 21 - assert "hello nixos test" in res, f"bad server response: '{res}'" 22 - server.succeed("systemctl reload lighttpd") 23 - ''; 24 - } 25 - ) 16 + testScript = '' 17 + start_all() 18 + server.wait_for_unit("lighttpd.service") 19 + res = server.succeed("curl --fail http://localhost/file.txt") 20 + assert "hello nixos test" in res, f"bad server response: '{res}'" 21 + server.succeed("systemctl reload lighttpd") 22 + ''; 23 + }