Skip to content

Commit 8f0d422

Browse files
nixosTests.lighttpd: migrate to runTest
Part of NixOS#386873
1 parent 569c914 commit 8f0d422

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

nixos/tests/all-tests.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ in
703703
libvirtd = handleTest ./libvirtd.nix { };
704704
lidarr = handleTest ./lidarr.nix { };
705705
lightdm = handleTest ./lightdm.nix { };
706-
lighttpd = handleTest ./lighttpd.nix { };
706+
lighttpd = runTest ./lighttpd.nix;
707707
limesurvey = handleTest ./limesurvey.nix { };
708708
limine = import ./limine { inherit runTest; };
709709
listmonk = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./listmonk.nix { };

nixos/tests/lighttpd.nix

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
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 ];
65

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+
'';
1513
};
14+
};
1615

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+
}

0 commit comments

Comments
 (0)