summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorFlorian <florian.brandes@posteo.de>2023-05-15 17:04:22 +0200
committerGitHub <noreply@github.com>2023-05-15 17:04:22 +0200
commit391b059c1d93889e597797841fa20148f7e6dd4c (patch)
tree3a9bb3577d38171bd61526c16fd0b01b40f4253e /nixos/tests
parent7780f8c3ccb7361dc5379ad6f0757bc787f2261b (diff)
nixosTests.pgadmin4: increase test coverage (#229632)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/pgadmin4.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/nixos/tests/pgadmin4.nix b/nixos/tests/pgadmin4.nix
index 6a9ce6ceae298..cb8de87c9ee31 100644
--- a/nixos/tests/pgadmin4.nix
+++ b/nixos/tests/pgadmin4.nix
@@ -9,6 +9,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
     imports = [ ./common/user-account.nix ];
 
     environment.systemPackages = with pkgs; [
+      wget
       curl
       pgadmin4-desktopmode
     ];
@@ -40,8 +41,10 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
     with subtest("Check pgadmin module"):
       machine.wait_for_unit("postgresql")
       machine.wait_for_unit("pgadmin")
-      machine.wait_until_succeeds("curl -s localhost:5051")
-      machine.wait_until_succeeds("curl -s localhost:5051/login | grep \"<title>pgAdmin 4</title>\" > /dev/null")
+      machine.wait_until_succeeds("curl -sS localhost:5051")
+      machine.wait_until_succeeds("curl -sS localhost:5051/login | grep \"<title>pgAdmin 4</title>\" > /dev/null")
+      # 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
+      machine.succeed("wget -nv --level=1 --spider --recursive localhost:5051/login")
 
     # pgadmin4 module saves the configuration to /etc/pgadmin/config_system.py
     # pgadmin4-desktopmode tries to read that as well. This normally fails with a PermissionError, as the config file
@@ -51,7 +54,8 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
     # because of the wrong config for desktopmode.
     with subtest("Check pgadmin standalone desktop mode"):
       machine.execute("sudo -u alice pgadmin4 >&2 &", timeout=60)
-      machine.wait_until_succeeds("curl -s localhost:5050")
-      machine.wait_until_succeeds("curl -s localhost:5050/browser/ | grep \"<title>pgAdmin 4</title>\" > /dev/null")
+      machine.wait_until_succeeds("curl -sS localhost:5050")
+      machine.wait_until_succeeds("curl -sS localhost:5050/browser/ | grep \"<title>pgAdmin 4</title>\" > /dev/null")
+      machine.succeed("wget -nv --level=1 --spider --recursive localhost:5050/browser")
   '';
 })