1import ./make-test-python.nix (
2 { pkgs, ... }:
3 {
4 name = "postfixadmin";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ globin ];
7 };
8
9 nodes = {
10 postfixadmin =
11 { config, pkgs, ... }:
12 {
13 services.postfixadmin = {
14 enable = true;
15 hostName = "postfixadmin";
16 setupPasswordFile = pkgs.writeText "insecure-test-setup-pw-file" "$2y$10$r0p63YCjd9rb9nHrV9UtVuFgGTmPDLKu.0UIJoQTkWCZZze2iuB1m";
17 };
18 services.nginx.virtualHosts.postfixadmin = {
19 forceSSL = false;
20 enableACME = false;
21 };
22 };
23 };
24
25 testScript = ''
26 postfixadmin.start
27 postfixadmin.wait_for_unit("postgresql.service")
28 postfixadmin.wait_for_unit("phpfpm-postfixadmin.service")
29 postfixadmin.wait_for_unit("nginx.service")
30 postfixadmin.succeed(
31 "curl -sSfL http://postfixadmin/setup.php -X POST -F 'setup_password=not production'"
32 )
33 postfixadmin.succeed("curl -sSfL http://postfixadmin/ | grep 'Mail admins login here'")
34 '';
35 }
36)