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 9 imports = [ ./common/user-account.nix ]; 10 10 11 11 environment.systemPackages = with pkgs; [ 12 + wget 12 13 curl 13 14 pgadmin4-desktopmode 14 15 ]; ··· 40 41 with subtest("Check pgadmin module"): 41 42 machine.wait_for_unit("postgresql") 42 43 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") 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") 45 48 46 49 # pgadmin4 module saves the configuration to /etc/pgadmin/config_system.py 47 50 # pgadmin4-desktopmode tries to read that as well. This normally fails with a PermissionError, as the config file ··· 51 54 # because of the wrong config for desktopmode. 52 55 with subtest("Check pgadmin standalone desktop mode"): 53 56 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") 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") 56 60 ''; 57 61 })