···
1
-
import ./make-test-python.nix (
6
-
meta.maintainers = with lib.maintainers; [
5
+
meta.maintainers = with lib.maintainers; [
16
-
imports = [ ./common/user-account.nix ];
15
+
imports = [ ./common/user-account.nix ];
18
-
environment.systemPackages = with pkgs; [
21
-
pgadmin4-desktopmode
17
+
environment.systemPackages = with pkgs; [
20
+
pgadmin4-desktopmode
24
-
services.postgresql = {
27
-
host all all localhost trust
23
+
services.postgresql = {
26
+
host all all localhost trust
31
-
services.pgadmin = {
34
-
initialEmail = "bruh@localhost.de";
35
-
initialPasswordFile = pkgs.writeText "pw" "bruh2012!";
30
+
services.pgadmin = {
33
+
initialEmail = "bruh@localhost.de";
34
+
initialPasswordFile = pkgs.writeText "pw" "bruh2012!";
42
-
imports = [ ./common/user-account.nix ];
41
+
imports = [ ./common/user-account.nix ];
44
-
services.postgresql = {
43
+
services.postgresql = {
48
-
services.pgadmin = {
50
-
initialEmail = "bruh@localhost.de";
51
-
initialPasswordFile = pkgs.writeText "pw" "bruh2012!";
52
-
minimumPasswordLength = 12;
47
+
services.pgadmin = {
49
+
initialEmail = "bruh@localhost.de";
50
+
initialPasswordFile = pkgs.writeText "pw" "bruh2012!";
51
+
minimumPasswordLength = 12;
58
-
with subtest("Check pgadmin module"):
59
-
machine.wait_for_unit("postgresql")
60
-
machine.wait_for_unit("pgadmin")
61
-
machine.wait_until_succeeds("curl -sS localhost:5051")
62
-
machine.wait_until_succeeds("curl -sS localhost:5051/login | grep \"<title>pgAdmin 4</title>\" > /dev/null")
63
-
# check for missing support files (css, js etc). Should catch not-generated files during build. See e.g. https://github.com/NixOS/nixpkgs/pull/229184
64
-
machine.succeed("wget -nv --level=1 --spider --recursive localhost:5051/login")
65
-
# test idempotenceny
66
-
machine.systemctl("restart pgadmin.service")
67
-
machine.wait_for_unit("pgadmin")
68
-
machine.wait_until_succeeds("curl -sS localhost:5051")
69
-
machine.wait_until_succeeds("curl -sS localhost:5051/login | grep \"<title>pgAdmin 4</title>\" > /dev/null")
57
+
with subtest("Check pgadmin module"):
58
+
machine.wait_for_unit("postgresql")
59
+
machine.wait_for_unit("pgadmin")
60
+
machine.wait_until_succeeds("curl -sS localhost:5051")
61
+
machine.wait_until_succeeds("curl -sS localhost:5051/login | grep \"<title>pgAdmin 4</title>\" > /dev/null")
62
+
# check for missing support files (css, js etc). Should catch not-generated files during build. See e.g. https://github.com/NixOS/nixpkgs/pull/229184
63
+
machine.succeed("wget -nv --level=1 --spider --recursive localhost:5051/login")
64
+
# test idempotenceny
65
+
machine.systemctl("restart pgadmin.service")
66
+
machine.wait_for_unit("pgadmin")
67
+
machine.wait_until_succeeds("curl -sS localhost:5051")
68
+
machine.wait_until_succeeds("curl -sS localhost:5051/login | grep \"<title>pgAdmin 4</title>\" > /dev/null")
71
-
# pgadmin4 module saves the configuration to /etc/pgadmin/config_system.py
72
-
# pgadmin4-desktopmode tries to read that as well. This normally fails with a PermissionError, as the config file
73
-
# is owned by the user of the pgadmin module. With the check-system-config-dir.patch this will just throw a warning
74
-
# but will continue and not read the file.
75
-
# If we run pgadmin4-desktopmode as root (something one really shouldn't do), it can read the config file and fail,
76
-
# because of the wrong config for desktopmode.
77
-
with subtest("Check pgadmin standalone desktop mode"):
78
-
machine.execute("sudo -u alice pgadmin4 >&2 &", timeout=60)
79
-
machine.wait_until_succeeds("curl -sS localhost:5050")
80
-
machine.wait_until_succeeds("curl -sS localhost:5050/browser/ | grep \"<title>pgAdmin 4</title>\" > /dev/null")
81
-
machine.succeed("wget -nv --level=1 --spider --recursive localhost:5050/browser")
70
+
# pgadmin4 module saves the configuration to /etc/pgadmin/config_system.py
71
+
# pgadmin4-desktopmode tries to read that as well. This normally fails with a PermissionError, as the config file
72
+
# is owned by the user of the pgadmin module. With the check-system-config-dir.patch this will just throw a warning
73
+
# but will continue and not read the file.
74
+
# If we run pgadmin4-desktopmode as root (something one really shouldn't do), it can read the config file and fail,
75
+
# because of the wrong config for desktopmode.
76
+
with subtest("Check pgadmin standalone desktop mode"):
77
+
machine.execute("sudo -u alice pgadmin4 >&2 &", timeout=60)
78
+
machine.wait_until_succeeds("curl -sS localhost:5050")
79
+
machine.wait_until_succeeds("curl -sS localhost:5050/browser/ | grep \"<title>pgAdmin 4</title>\" > /dev/null")
80
+
machine.succeed("wget -nv --level=1 --spider --recursive localhost:5050/browser")
83
-
with subtest("Check pgadmin minimum password length"):
84
-
machine2.wait_for_unit("postgresql")
85
-
machine2.wait_for_console_text("Password must be at least 12 characters long")
82
+
with subtest("Check pgadmin minimum password length"):
83
+
machine2.wait_for_unit("postgresql")
84
+
machine2.wait_for_console_text("Password must be at least 12 characters long")