1 import ./make-test-python.nix ({ pkgs, lib, ... }:
6 password = "correcthorsebatterystaple";
8 defaultUsername = "admin";
9 defaultPassword = "password";
10 adminCredentialsFile = pkgs.writeText "admin-credentials" ''
11 ADMIN_USERNAME=${defaultUsername}
12 ADMIN_PASSWORD=${defaultPassword}
14 customAdminCredentialsFile = pkgs.writeText "admin-credentials" ''
15 ADMIN_USERNAME=${username}
16 ADMIN_PASSWORD=${password}
23 meta.maintainers = with pkgs.lib.maintainers; [ ];
31 inherit adminCredentialsFile;
40 inherit adminCredentialsFile;
42 security.sudo.enable = false;
51 CLEANUP_FREQUENCY = "48";
52 LISTEN_ADDR = "localhost:${toString port}";
54 adminCredentialsFile = customAdminCredentialsFile;
61 default.wait_for_unit("miniflux.service")
62 default.wait_for_open_port(${toString defaultPort})
63 default.succeed("curl --fail 'http://localhost:${toString defaultPort}/healthcheck' | grep OK")
65 "curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep '\"is_admin\":true'"
68 withoutSudo.wait_for_unit("miniflux.service")
69 withoutSudo.wait_for_open_port(${toString defaultPort})
70 withoutSudo.succeed("curl --fail 'http://localhost:${toString defaultPort}/healthcheck' | grep OK")
72 "curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep '\"is_admin\":true'"
75 customized.wait_for_unit("miniflux.service")
76 customized.wait_for_open_port(${toString port})
77 customized.succeed("curl --fail 'http://localhost:${toString port}/healthcheck' | grep OK")
79 "curl 'http://localhost:${toString port}/v1/me' -u '${username}:${password}' -H Content-Type:application/json | grep '\"is_admin\":true'"