pomerium: add test for UI

This commit is contained in:
Morgan Helton 2023-03-18 06:49:22 -05:00
parent d76601d559
commit 05655e8ad3

View File

@ -20,6 +20,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
}; in {
pomerium = { pkgs, lib, ... }: {
imports = [ (base "192.168.1.1") ];
environment.systemPackages = with pkgs; [ chromium ];
services.pomerium = {
enable = true;
settings = {
@ -98,5 +99,11 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
pomerium.succeed(
"curl -L --resolve login.required:80:127.0.0.1 http://login.required | grep 'hello I am login page'"
)
with subtest("ui"):
pomerium.succeed(
# check for a string that only appears if the UI is displayed correctly
"chromium --no-sandbox --headless --disable-gpu --dump-dom --host-resolver-rules='MAP login.required 127.0.0.1:80' http://login.required/.pomerium | grep 'contact your administrator'"
)
'';
})