1import ./make-test-python.nix (
2 { lib, pkgs, ... }:
3 {
4 name = "limesurvey";
5 meta.maintainers = [ lib.maintainers.aanderse ];
6
7 nodes.machine =
8 { ... }:
9 {
10 services.limesurvey = {
11 enable = true;
12 virtualHost = {
13 hostName = "example.local";
14 adminAddr = "root@example.local";
15 };
16 encryptionKeyFile = pkgs.writeText "key" (lib.strings.replicate 32 "0");
17 encryptionNonceFile = pkgs.writeText "nonce" (lib.strings.replicate 24 "0");
18 };
19
20 # limesurvey won't work without a dot in the hostname
21 networking.hosts."127.0.0.1" = [ "example.local" ];
22 };
23
24 testScript = ''
25 start_all()
26
27 machine.wait_for_unit("phpfpm-limesurvey.service")
28 assert "The following surveys are available" in machine.succeed(
29 "curl -f http://example.local/"
30 )
31 '';
32 }
33)