nixpkgs/nixos/tests/limesurvey.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
907 B
Nix
Raw Normal View History

import ./make-test-python.nix (
{ lib, pkgs, ... }:
{
2019-03-16 12:24:23 +00:00
name = "limesurvey";
meta.maintainers = [ lib.maintainers.aanderse ];
2019-03-16 12:24:23 +00:00
2022-03-20 23:15:30 +00:00
nodes.machine =
{ ... }:
{
2020-01-26 11:32:47 +00:00
services.limesurvey = {
enable = true;
virtualHost = {
hostName = "example.local";
adminAddr = "root@example.local";
};
encryptionKeyFile = pkgs.writeText "key" (lib.strings.replicate 32 "0");
encryptionNonceFile = pkgs.writeText "nonce" (lib.strings.replicate 24 "0");
2019-03-16 12:24:23 +00:00
};
2020-01-26 11:32:47 +00:00
# limesurvey won't work without a dot in the hostname
networking.hosts."127.0.0.1" = [ "example.local" ];
};
2019-03-16 12:24:23 +00:00
testScript = ''
2020-01-26 11:32:47 +00:00
start_all()
2019-03-16 12:24:23 +00:00
2020-01-26 11:32:47 +00:00
machine.wait_for_unit("phpfpm-limesurvey.service")
assert "The following surveys are available" in machine.succeed(
"curl -f http://example.local/"
2020-01-26 11:32:47 +00:00
)
2019-03-16 12:24:23 +00:00
'';
}
)