nixosTests.pgadmin4: increase test coverage (#229632)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

authored by

Florian
Sandro
and committed by
GitHub
391b059c 7780f8c3

+8 -4
+8 -4
nixos/tests/pgadmin4.nix
··· 9 imports = [ ./common/user-account.nix ]; 10 11 environment.systemPackages = with pkgs; [ 12 curl 13 pgadmin4-desktopmode 14 ]; ··· 40 with subtest("Check pgadmin module"): 41 machine.wait_for_unit("postgresql") 42 machine.wait_for_unit("pgadmin") 43 - machine.wait_until_succeeds("curl -s localhost:5051") 44 - machine.wait_until_succeeds("curl -s localhost:5051/login | grep \"<title>pgAdmin 4</title>\" > /dev/null") 45 46 # pgadmin4 module saves the configuration to /etc/pgadmin/config_system.py 47 # pgadmin4-desktopmode tries to read that as well. This normally fails with a PermissionError, as the config file ··· 51 # because of the wrong config for desktopmode. 52 with subtest("Check pgadmin standalone desktop mode"): 53 machine.execute("sudo -u alice pgadmin4 >&2 &", timeout=60) 54 - machine.wait_until_succeeds("curl -s localhost:5050") 55 - machine.wait_until_succeeds("curl -s localhost:5050/browser/ | grep \"<title>pgAdmin 4</title>\" > /dev/null") 56 ''; 57 })
··· 9 imports = [ ./common/user-account.nix ]; 10 11 environment.systemPackages = with pkgs; [ 12 + wget 13 curl 14 pgadmin4-desktopmode 15 ]; ··· 41 with subtest("Check pgadmin module"): 42 machine.wait_for_unit("postgresql") 43 machine.wait_for_unit("pgadmin") 44 + machine.wait_until_succeeds("curl -sS localhost:5051") 45 + machine.wait_until_succeeds("curl -sS localhost:5051/login | grep \"<title>pgAdmin 4</title>\" > /dev/null") 46 + # 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 47 + machine.succeed("wget -nv --level=1 --spider --recursive localhost:5051/login") 48 49 # pgadmin4 module saves the configuration to /etc/pgadmin/config_system.py 50 # pgadmin4-desktopmode tries to read that as well. This normally fails with a PermissionError, as the config file ··· 54 # because of the wrong config for desktopmode. 55 with subtest("Check pgadmin standalone desktop mode"): 56 machine.execute("sudo -u alice pgadmin4 >&2 &", timeout=60) 57 + machine.wait_until_succeeds("curl -sS localhost:5050") 58 + machine.wait_until_succeeds("curl -sS localhost:5050/browser/ | grep \"<title>pgAdmin 4</title>\" > /dev/null") 59 + machine.succeed("wget -nv --level=1 --spider --recursive localhost:5050/browser") 60 ''; 61 })