nixpkgs/nixos/tests/postfixadmin.nix

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

35 lines
997 B
Nix
Raw Permalink Normal View History

{ pkgs, ... }:
{
name = "postfixadmin";
meta = with pkgs.lib.maintainers; {
maintainers = [ globin ];
};
2021-05-18 23:34:03 -05:00
nodes = {
postfixadmin =
{ config, pkgs, ... }:
{
services.postfixadmin = {
enable = true;
hostName = "postfixadmin";
setupPasswordFile = pkgs.writeText "insecure-test-setup-pw-file" "$2y$10$r0p63YCjd9rb9nHrV9UtVuFgGTmPDLKu.0UIJoQTkWCZZze2iuB1m";
2021-05-18 23:34:03 -05:00
};
services.nginx.virtualHosts.postfixadmin = {
forceSSL = false;
enableACME = false;
};
};
};
2021-05-18 23:34:03 -05:00
testScript = ''
postfixadmin.start
postfixadmin.wait_for_unit("postgresql.service")
postfixadmin.wait_for_unit("phpfpm-postfixadmin.service")
postfixadmin.wait_for_unit("nginx.service")
postfixadmin.succeed(
"curl -sSfL http://postfixadmin/setup.php -X POST -F 'setup_password=not production'"
)
postfixadmin.succeed("curl -sSfL http://postfixadmin/ | grep 'Mail admins login here'")
'';
}