From 60eaae1d78c70838a9def4cb4d8094c4c39a352e Mon Sep 17 00:00:00 2001 From: Philipp Bartsch Date: Fri, 11 Oct 2024 21:30:19 +0200 Subject: [PATCH] nixosTests.endlessh-go: fix to match current module Tests were not changed according to the new prometheus firewall port settings. With this change we now check that the port is not accessible form the outside, while everything still works from localhost. --- nixos/tests/endlessh-go.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nixos/tests/endlessh-go.nix b/nixos/tests/endlessh-go.nix index b261dbf1c560..70ec7d816612 100644 --- a/nixos/tests/endlessh-go.nix +++ b/nixos/tests/endlessh-go.nix @@ -44,15 +44,19 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: server.wait_for_unit("endlessh-go.service") server.wait_for_open_port(2222) server.wait_for_open_port(9229) + server.fail("curl -sSf server:9229/metrics | grep -q endlessh_client_closed_count_total") client.succeed("nc -dvW5 server 2222") - client.succeed("curl -kv server:9229/metrics") + server.succeed("curl -sSf server:9229/metrics | grep -q endlessh_client_closed_count_total") + client.fail("curl -sSfm 5 server:9229/metrics") with subtest("Privileged"): activate_specialisation("privileged") server.wait_for_unit("endlessh-go.service") server.wait_for_open_port(22) server.wait_for_open_port(92) + server.fail("curl -sSf server:92/metrics | grep -q endlessh_client_closed_count_total") client.succeed("nc -dvW5 server 22") - client.succeed("curl -kv server:92/metrics") + server.succeed("curl -sSf server:92/metrics | grep -q endlessh_client_closed_count_total") + client.fail("curl -sSfm 5 server:92/metrics") ''; })