mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
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.
This commit is contained in:
parent
cd6b650cc0
commit
60eaae1d78
@ -44,15 +44,19 @@ import ./make-test-python.nix ({ lib, pkgs, ... }:
|
|||||||
server.wait_for_unit("endlessh-go.service")
|
server.wait_for_unit("endlessh-go.service")
|
||||||
server.wait_for_open_port(2222)
|
server.wait_for_open_port(2222)
|
||||||
server.wait_for_open_port(9229)
|
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("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"):
|
with subtest("Privileged"):
|
||||||
activate_specialisation("privileged")
|
activate_specialisation("privileged")
|
||||||
server.wait_for_unit("endlessh-go.service")
|
server.wait_for_unit("endlessh-go.service")
|
||||||
server.wait_for_open_port(22)
|
server.wait_for_open_port(22)
|
||||||
server.wait_for_open_port(92)
|
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("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")
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user