1 import ./make-test-python.nix ({ pkgs, lib, ... }:
5 meta.maintainers = with lib.maintainers; [ mkg20001 gador ];
7 nodes.machine = { pkgs, ... }: {
9 imports = [ ./common/user-account.nix ];
11 environment.systemPackages = with pkgs; [
17 services.postgresql = {
20 host all all localhost trust
27 initialEmail = "bruh@localhost.de";
28 initialPasswordFile = pkgs.writeText "pw" "bruh2012!";
33 with subtest("Check pgadmin module"):
34 machine.wait_for_unit("postgresql")
35 machine.wait_for_unit("pgadmin")
36 machine.wait_until_succeeds("curl -sS localhost:5051")
37 machine.wait_until_succeeds("curl -sS localhost:5051/login | grep \"<title>pgAdmin 4</title>\" > /dev/null")
38 # 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
39 machine.succeed("wget -nv --level=1 --spider --recursive localhost:5051/login")
41 # pgadmin4 module saves the configuration to /etc/pgadmin/config_system.py
42 # pgadmin4-desktopmode tries to read that as well. This normally fails with a PermissionError, as the config file
43 # is owned by the user of the pgadmin module. With the check-system-config-dir.patch this will just throw a warning
44 # but will continue and not read the file.
45 # If we run pgadmin4-desktopmode as root (something one really shouldn't do), it can read the config file and fail,
46 # because of the wrong config for desktopmode.
47 with subtest("Check pgadmin standalone desktop mode"):
48 machine.execute("sudo -u alice pgadmin4 >&2 &", timeout=60)
49 machine.wait_until_succeeds("curl -sS localhost:5050")
50 machine.wait_until_succeeds("curl -sS localhost:5050/browser/ | grep \"<title>pgAdmin 4</title>\" > /dev/null")
51 machine.succeed("wget -nv --level=1 --spider --recursive localhost:5050/browser")