From 580370666239e426df70ab4996dc5b5512a2c303 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sat, 11 Jun 2022 14:22:53 +0200 Subject: [PATCH] nixos/tests: fix type mismatch in wait_for_open_port Fix some fallout from de3e423 (PR #171280). --- nixos/tests/3proxy.nix | 6 +++--- nixos/tests/bazarr.nix | 2 +- nixos/tests/caddy.nix | 8 ++++---- nixos/tests/convos.nix | 2 +- nixos/tests/cryptpad.nix | 2 +- nixos/tests/deluge.nix | 2 +- nixos/tests/docker-registry.nix | 2 +- nixos/tests/freeswitch.nix | 2 +- nixos/tests/gocd-agent.nix | 2 +- nixos/tests/isso.nix | 2 +- nixos/tests/libreddit.nix | 2 +- nixos/tests/lidarr.nix | 2 +- nixos/tests/mailcatcher.nix | 2 +- nixos/tests/mailhog.nix | 4 ++-- nixos/tests/meilisearch.nix | 2 +- nixos/tests/minidlna.nix | 2 +- nixos/tests/navidrome.nix | 2 +- nixos/tests/ncdns.nix | 4 ++-- nixos/tests/nghttpx.nix | 4 ++-- nixos/tests/node-red.nix | 2 +- nixos/tests/ombi.nix | 2 +- nixos/tests/pdns-recursor.nix | 2 +- nixos/tests/pict-rs.nix | 2 +- nixos/tests/plikd.nix | 2 +- nixos/tests/podgrab.nix | 4 ++-- nixos/tests/privoxy.nix | 8 ++++---- nixos/tests/prometheus-exporters.nix | 2 +- nixos/tests/prowlarr.nix | 2 +- nixos/tests/rabbitmq.nix | 2 +- nixos/tests/redis.nix | 2 +- nixos/tests/sonarr.nix | 2 +- nixos/tests/teleport.nix | 12 ++++++------ nixos/tests/vsftpd.nix | 2 +- 33 files changed, 50 insertions(+), 50 deletions(-) diff --git a/nixos/tests/3proxy.nix b/nixos/tests/3proxy.nix index dfc4b35a772d..8127438fabd9 100644 --- a/nixos/tests/3proxy.nix +++ b/nixos/tests/3proxy.nix @@ -139,7 +139,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { peer0.wait_for_unit("network-online.target") peer1.wait_for_unit("3proxy.service") - peer1.wait_for_open_port("9999") + peer1.wait_for_open_port(9999) # test none auth peer0.succeed( @@ -153,7 +153,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { ) peer2.wait_for_unit("3proxy.service") - peer2.wait_for_open_port("9999") + peer2.wait_for_open_port(9999) # test iponly auth peer0.succeed( @@ -167,7 +167,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { ) peer3.wait_for_unit("3proxy.service") - peer3.wait_for_open_port("9999") + peer3.wait_for_open_port(9999) # test strong auth peer0.succeed( diff --git a/nixos/tests/bazarr.nix b/nixos/tests/bazarr.nix index c3337611aa29..efcd9de01080 100644 --- a/nixos/tests/bazarr.nix +++ b/nixos/tests/bazarr.nix @@ -20,7 +20,7 @@ in testScript = '' machine.wait_for_unit("bazarr.service") - machine.wait_for_open_port("${toString port}") + machine.wait_for_open_port(port) machine.succeed("curl --fail http://localhost:${toString port}/") ''; }) diff --git a/nixos/tests/caddy.nix b/nixos/tests/caddy.nix index 16436ab52800..c4abd33d0395 100644 --- a/nixos/tests/caddy.nix +++ b/nixos/tests/caddy.nix @@ -61,7 +61,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { '' url = "http://localhost/example.html" webserver.wait_for_unit("caddy") - webserver.wait_for_open_port("80") + webserver.wait_for_open_port(80) def check_etag(url): @@ -95,13 +95,13 @@ import ./make-test-python.nix ({ pkgs, ... }: { webserver.succeed( "${justReloadSystem}/bin/switch-to-configuration test >&2" ) - webserver.wait_for_open_port("8080") + webserver.wait_for_open_port(8080) with subtest("multiple configs are correctly merged"): webserver.succeed( "${multipleConfigs}/bin/switch-to-configuration test >&2" ) - webserver.wait_for_open_port("8080") - webserver.wait_for_open_port("8081") + webserver.wait_for_open_port(8080) + webserver.wait_for_open_port(8081) ''; }) diff --git a/nixos/tests/convos.nix b/nixos/tests/convos.nix index a13870d17084..72275ab390d9 100644 --- a/nixos/tests/convos.nix +++ b/nixos/tests/convos.nix @@ -23,7 +23,7 @@ in testScript = '' machine.wait_for_unit("convos") - machine.wait_for_open_port("${toString port}") + machine.wait_for_open_port(port) machine.succeed("journalctl -u convos | grep -q 'Listening at.*${toString port}'") machine.succeed("curl -f http://localhost:${toString port}/") ''; diff --git a/nixos/tests/cryptpad.nix b/nixos/tests/cryptpad.nix index 895f291abaca..db271f937ef4 100644 --- a/nixos/tests/cryptpad.nix +++ b/nixos/tests/cryptpad.nix @@ -12,7 +12,7 @@ with lib; testScript = '' machine.wait_for_unit("cryptpad.service") - machine.wait_for_open_port("3000") + machine.wait_for_open_port(3000) machine.succeed("curl -L --fail http://localhost:3000/sheet") ''; }) diff --git a/nixos/tests/deluge.nix b/nixos/tests/deluge.nix index 33c57ce7c36c..0cd1d21870ad 100644 --- a/nixos/tests/deluge.nix +++ b/nixos/tests/deluge.nix @@ -47,7 +47,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { simple.wait_for_unit("deluged") simple.wait_for_unit("delugeweb") - simple.wait_for_open_port("8112") + simple.wait_for_open_port(8112) declarative.wait_for_unit("network.target") declarative.wait_until_succeeds("curl --fail http://simple:8112") diff --git a/nixos/tests/docker-registry.nix b/nixos/tests/docker-registry.nix index 1d449db45191..316b7c9b9727 100644 --- a/nixos/tests/docker-registry.nix +++ b/nixos/tests/docker-registry.nix @@ -35,7 +35,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { registry.start() registry.wait_for_unit("docker-registry.service") - registry.wait_for_open_port("8080") + registry.wait_for_open_port(8080) client1.succeed("docker push registry:8080/scratch") client2.start() diff --git a/nixos/tests/freeswitch.nix b/nixos/tests/freeswitch.nix index bcc6a9cb3586..bfb7339ec3c0 100644 --- a/nixos/tests/freeswitch.nix +++ b/nixos/tests/freeswitch.nix @@ -24,6 +24,6 @@ import ./make-test-python.nix ({ pkgs, ...} : { testScript = '' node0.wait_for_unit("freeswitch.service") # Wait for SIP port to be open - node0.wait_for_open_port("5060") + node0.wait_for_open_port(5060) ''; }) diff --git a/nixos/tests/gocd-agent.nix b/nixos/tests/gocd-agent.nix index 686d0b971d30..9301a88ec05d 100644 --- a/nixos/tests/gocd-agent.nix +++ b/nixos/tests/gocd-agent.nix @@ -36,7 +36,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { testScript = '' start_all() agent.wait_for_unit("gocd-server") - agent.wait_for_open_port("8153") + agent.wait_for_open_port(8153) agent.wait_for_unit("gocd-agent") agent.wait_until_succeeds( "curl ${serverUrl} -H '${header}' | ${pkgs.jq}/bin/jq -e ._embedded.agents[0].uuid" diff --git a/nixos/tests/isso.nix b/nixos/tests/isso.nix index 65bae5f5dced..f4560ba3e635 100644 --- a/nixos/tests/isso.nix +++ b/nixos/tests/isso.nix @@ -22,7 +22,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { '' machine.wait_for_unit("isso.service") - machine.wait_for_open_port("${toString port}") + machine.wait_for_open_port(port) machine.succeed("curl --fail http://localhost:${toString port}/?uri") machine.succeed("curl --fail http://localhost:${toString port}/js/embed.min.js") diff --git a/nixos/tests/libreddit.nix b/nixos/tests/libreddit.nix index 01f6aeffb366..82a44cb4e9cb 100644 --- a/nixos/tests/libreddit.nix +++ b/nixos/tests/libreddit.nix @@ -14,7 +14,7 @@ with lib; testScript = '' machine.wait_for_unit("libreddit.service") - machine.wait_for_open_port("80") + machine.wait_for_open_port(80) # Query a page that does not require Internet access machine.succeed("curl --fail http://localhost:80/settings") ''; diff --git a/nixos/tests/lidarr.nix b/nixos/tests/lidarr.nix index d3f83e5d9145..7fbaea62f80e 100644 --- a/nixos/tests/lidarr.nix +++ b/nixos/tests/lidarr.nix @@ -14,7 +14,7 @@ with lib; start_all() machine.wait_for_unit("lidarr.service") - machine.wait_for_open_port("8686") + machine.wait_for_open_port(8686) machine.succeed("curl --fail http://localhost:8686/") ''; }) diff --git a/nixos/tests/mailcatcher.nix b/nixos/tests/mailcatcher.nix index f23b749a021e..627ef56617e9 100644 --- a/nixos/tests/mailcatcher.nix +++ b/nixos/tests/mailcatcher.nix @@ -24,7 +24,7 @@ import ./make-test-python.nix ({ lib, ... }: start_all() machine.wait_for_unit("mailcatcher.service") - machine.wait_for_open_port("1025") + machine.wait_for_open_port(1025) machine.succeed( 'echo "this is the body of the email" | mail -s "subject" root@example.org' ) diff --git a/nixos/tests/mailhog.nix b/nixos/tests/mailhog.nix index 3508c2c0a5ea..e3c2da37a3c8 100644 --- a/nixos/tests/mailhog.nix +++ b/nixos/tests/mailhog.nix @@ -12,8 +12,8 @@ import ./make-test-python.nix ({ lib, ... }: { start_all() machine.wait_for_unit("mailhog.service") - machine.wait_for_open_port("1025") - machine.wait_for_open_port("8025") + machine.wait_for_open_port(1025) + machine.wait_for_open_port(8025) machine.succeed( 'echo "this is the body of the email" | swaks --to root@example.org --body - --server localhost:1025' ) diff --git a/nixos/tests/meilisearch.nix b/nixos/tests/meilisearch.nix index 05109a944bc4..6d7514a1cc0a 100644 --- a/nixos/tests/meilisearch.nix +++ b/nixos/tests/meilisearch.nix @@ -27,7 +27,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: start_all() machine.wait_for_unit("meilisearch") - machine.wait_for_open_port("7700") + machine.wait_for_open_port(7700) with subtest("check version"): version = json.loads(machine.succeed("curl ${apiUrl}/version")) diff --git a/nixos/tests/minidlna.nix b/nixos/tests/minidlna.nix index 104b79078fd5..76039b0bb42c 100644 --- a/nixos/tests/minidlna.nix +++ b/nixos/tests/minidlna.nix @@ -32,7 +32,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { start_all() server.succeed("mkdir -p /tmp/stuff && chown minidlna: /tmp/stuff") server.wait_for_unit("minidlna") - server.wait_for_open_port("8200") + server.wait_for_open_port(8200) # requests must be made *by IP* to avoid triggering minidlna's # DNS-rebinding protection server.succeed("curl --fail http://$(getent ahostsv4 localhost | head -n1 | cut -f 1 -d ' '):8200/") diff --git a/nixos/tests/navidrome.nix b/nixos/tests/navidrome.nix index 62290d50fc7e..7315aef62401 100644 --- a/nixos/tests/navidrome.nix +++ b/nixos/tests/navidrome.nix @@ -7,6 +7,6 @@ import ./make-test-python.nix ({ pkgs, ... }: { testScript = '' machine.wait_for_unit("navidrome") - machine.wait_for_open_port("4533") + machine.wait_for_open_port(4533) ''; }) diff --git a/nixos/tests/ncdns.nix b/nixos/tests/ncdns.nix index 5099d697e035..3ce39ed3cb55 100644 --- a/nixos/tests/ncdns.nix +++ b/nixos/tests/ncdns.nix @@ -73,14 +73,14 @@ in with subtest("DNSKEY bit record is present"): server.wait_for_unit("pdns-recursor") - server.wait_for_open_port("53") + server.wait_for_open_port(53) server.succeed("host -t DNSKEY bit") '') + '' with subtest("can resolve a .bit name"): server.wait_for_unit("namecoind") server.wait_for_unit("ncdns") - server.wait_for_open_port("8332") + server.wait_for_open_port(8332) assert "1.2.3.4" in server.succeed("dig @localhost -p 5333 test.bit") with subtest("SOA record has identity information"): diff --git a/nixos/tests/nghttpx.nix b/nixos/tests/nghttpx.nix index d83c1c4cae63..11cac332827d 100644 --- a/nixos/tests/nghttpx.nix +++ b/nixos/tests/nghttpx.nix @@ -54,8 +54,8 @@ in testScript = '' start_all() - webserver.wait_for_open_port("80") - proxy.wait_for_open_port("80") + webserver.wait_for_open_port(80) + proxy.wait_for_open_port(80) client.wait_until_succeeds("curl -s --fail http://proxy/hello-world.txt") ''; }) diff --git a/nixos/tests/node-red.nix b/nixos/tests/node-red.nix index 7660bc32f4c9..5f5960d68295 100644 --- a/nixos/tests/node-red.nix +++ b/nixos/tests/node-red.nix @@ -19,7 +19,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { testScript = '' start_all() nodered.wait_for_unit("node-red.service") - nodered.wait_for_open_port("1880") + nodered.wait_for_open_port(1880) client.wait_for_unit("multi-user.target") diff --git a/nixos/tests/ombi.nix b/nixos/tests/ombi.nix index bfca86af8175..ce3064ce6ac6 100644 --- a/nixos/tests/ombi.nix +++ b/nixos/tests/ombi.nix @@ -12,7 +12,7 @@ with lib; testScript = '' machine.wait_for_unit("ombi.service") - machine.wait_for_open_port("5000") + machine.wait_for_open_port(5000) machine.succeed("curl --fail http://localhost:5000/") ''; }) diff --git a/nixos/tests/pdns-recursor.nix b/nixos/tests/pdns-recursor.nix index cf473a064313..14f1b7ea8a35 100644 --- a/nixos/tests/pdns-recursor.nix +++ b/nixos/tests/pdns-recursor.nix @@ -9,7 +9,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { testScript = '' server.wait_for_unit("pdns-recursor") - server.wait_for_open_port("53") + server.wait_for_open_port(53) assert "192.0.2.1" in server.succeed("host example.com localhost") ''; }) diff --git a/nixos/tests/pict-rs.nix b/nixos/tests/pict-rs.nix index 90f01d6d5d02..4315e9fb6e90 100644 --- a/nixos/tests/pict-rs.nix +++ b/nixos/tests/pict-rs.nix @@ -12,6 +12,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: start_all() machine.wait_for_unit("pict-rs") - machine.wait_for_open_port("8080") + machine.wait_for_open_port(8080) ''; }) diff --git a/nixos/tests/plikd.nix b/nixos/tests/plikd.nix index 643fd5bfcd37..97c254a5f7b0 100644 --- a/nixos/tests/plikd.nix +++ b/nixos/tests/plikd.nix @@ -15,7 +15,7 @@ import ./make-test-python.nix ({ lib, ... }: { machine.wait_for_unit("plikd") # Network test - machine.wait_for_open_port("8080") + machine.wait_for_open_port(8080) machine.succeed("curl --fail -v http://localhost:8080") # Application test diff --git a/nixos/tests/podgrab.nix b/nixos/tests/podgrab.nix index e927e25fea56..e5a340dc2ac8 100644 --- a/nixos/tests/podgrab.nix +++ b/nixos/tests/podgrab.nix @@ -22,11 +22,11 @@ import ./make-test-python.nix ({ pkgs, ... }: { start_all() default.wait_for_unit("podgrab") - default.wait_for_open_port("${toString defaultPort}") + default.wait_for_open_port(defaultPort) default.succeed("curl --fail http://localhost:${toString defaultPort}") customized.wait_for_unit("podgrab") - customized.wait_for_open_port("${toString customPort}") + customized.wait_for_open_port(customPort) customized.succeed("curl --fail http://localhost:${toString customPort}") ''; diff --git a/nixos/tests/privoxy.nix b/nixos/tests/privoxy.nix index 47072ce4b0af..2d95c4522a01 100644 --- a/nixos/tests/privoxy.nix +++ b/nixos/tests/privoxy.nix @@ -81,23 +81,23 @@ in '' with subtest("Privoxy is running"): machine.wait_for_unit("privoxy") - machine.wait_for_open_port("8118") + machine.wait_for_open_port(8118) machine.succeed("curl -f http://config.privoxy.org") with subtest("Privoxy can filter http requests"): - machine.wait_for_open_port("80") + machine.wait_for_open_port(80) assert "great day" in machine.succeed( "curl -sfL http://example.com/how-are-you? | tee /dev/stderr" ) with subtest("Privoxy can filter https requests"): - machine.wait_for_open_port("443") + machine.wait_for_open_port(443) assert "great day" in machine.succeed( "curl -sfL https://example.com/how-are-you? | tee /dev/stderr" ) with subtest("Blocks are working"): - machine.wait_for_open_port("443") + machine.wait_for_open_port(443) machine.fail("curl -f https://example.com/ads 1>&2") machine.succeed("curl -f https://example.com/PRIVOXY-FORCE/ads 1>&2") diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index ce3b3fbf3bf3..849f5ee159f0 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -52,7 +52,7 @@ let * testScript = '' * .start() * .wait_for_unit("prometheus--exporter.service") - * .wait_for_open_port("1234") + * .wait_for_open_port(1234) * .succeed("curl -sSf 'localhost:1234/metrics'") * .shutdown() * ''; diff --git a/nixos/tests/prowlarr.nix b/nixos/tests/prowlarr.nix index 4cbca107568f..144cbd5fc95d 100644 --- a/nixos/tests/prowlarr.nix +++ b/nixos/tests/prowlarr.nix @@ -12,7 +12,7 @@ with lib; testScript = '' machine.wait_for_unit("prowlarr.service") - machine.wait_for_open_port("9696") + machine.wait_for_open_port(9696) machine.succeed("curl --fail http://localhost:9696/") ''; }) diff --git a/nixos/tests/rabbitmq.nix b/nixos/tests/rabbitmq.nix index 831335d8c518..f8e8e61c47d2 100644 --- a/nixos/tests/rabbitmq.nix +++ b/nixos/tests/rabbitmq.nix @@ -22,6 +22,6 @@ import ./make-test-python.nix ({ pkgs, ... }: { machine.wait_until_succeeds( 'su -s ${pkgs.runtimeShell} rabbitmq -c "rabbitmqctl status"' ) - machine.wait_for_open_port("15672") + machine.wait_for_open_port(15672) ''; }) diff --git a/nixos/tests/redis.nix b/nixos/tests/redis.nix index 7b70c239ad6e..abea1657f3ea 100644 --- a/nixos/tests/redis.nix +++ b/nixos/tests/redis.nix @@ -30,7 +30,7 @@ import ./make-test-python.nix ({ pkgs, ... }: machine.wait_for_unit("redis-test") # The unnamed Redis server still opens a port for backward-compatibility - machine.wait_for_open_port("6379") + machine.wait_for_open_port(6379) machine.wait_for_file("${redis.servers."".unixSocket}") machine.wait_for_file("${redis.servers."test".unixSocket}") diff --git a/nixos/tests/sonarr.nix b/nixos/tests/sonarr.nix index 764a4d05b381..bdfc8916cb7f 100644 --- a/nixos/tests/sonarr.nix +++ b/nixos/tests/sonarr.nix @@ -12,7 +12,7 @@ with lib; testScript = '' machine.wait_for_unit("sonarr.service") - machine.wait_for_open_port("8989") + machine.wait_for_open_port(8989) machine.succeed("curl --fail http://localhost:8989/") ''; }) diff --git a/nixos/tests/teleport.nix b/nixos/tests/teleport.nix index 15b16e44409d..34bf1bc0c70d 100644 --- a/nixos/tests/teleport.nix +++ b/nixos/tests/teleport.nix @@ -72,9 +72,9 @@ in nodes = { inherit minimal; }; testScript = '' - minimal.wait_for_open_port("3025") - minimal.wait_for_open_port("3080") - minimal.wait_for_open_port("3022") + minimal.wait_for_open_port(3025) + minimal.wait_for_open_port(3080) + minimal.wait_for_open_port(3022) ''; }; @@ -86,12 +86,12 @@ in testScript = '' with subtest("teleport ready"): - server.wait_for_open_port("3025") - client.wait_for_open_port("3022") + server.wait_for_open_port(3025) + client.wait_for_open_port(3022) with subtest("check applied configuration"): server.wait_until_succeeds("tctl get nodes --format=json | ${pkgs.jq}/bin/jq -e '.[] | select(.spec.hostname==\"client\") | .metadata.labels.role==\"client\"'") - server.wait_for_open_port("3000") + server.wait_for_open_port(3000) client.succeed("journalctl -u teleport.service --grep='DEBU'") server.succeed("journalctl -u teleport.service --grep='Starting teleport in insecure mode.'") ''; diff --git a/nixos/tests/vsftpd.nix b/nixos/tests/vsftpd.nix index 4bea27f0eb10..6eaf32b22583 100644 --- a/nixos/tests/vsftpd.nix +++ b/nixos/tests/vsftpd.nix @@ -29,7 +29,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { testScript = '' client.start() server.wait_for_unit("vsftpd") - server.wait_for_open_port("21") + server.wait_for_open_port(21) client.succeed("curl -u ftp-test-user:ftp-test-password ftp://server") client.succeed('echo "this is a test" > /tmp/test.file.up')