Skip to content

Commit 0300c80

Browse files
committed
nixos/octoprint: add tests for reachability over IPv6
1 parent 91dd36d commit 0300c80

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

nixos/tests/octoprint.nix

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,18 @@ in
5050
# used to fail early, in case octoprint first starts and then crashes
5151
with octoprint_running: # type: ignore[union-attr]
5252
with subtest("Check for web interface"):
53-
machine.wait_until_succeeds("curl -s localhost:5000")
53+
machine.wait_until_succeeds("curl -s -4 localhost:5000")
54+
machine.wait_until_succeeds("curl -s -6 localhost:5000")
5455
55-
with subtest("Check API"):
56-
version = json.loads(machine.succeed(curl_cmd + "localhost:5000/api/version"))
57-
server = json.loads(machine.succeed(curl_cmd + "localhost:5000/api/server"))
56+
with subtest("Check API IPv4"):
57+
version = json.loads(machine.succeed(curl_cmd + "-4 localhost:5000/api/version"))
58+
server = json.loads(machine.succeed(curl_cmd + "-4 localhost:5000/api/server"))
59+
assert version["server"] == str("${pkgs.octoprint.version}")
60+
assert server["safemode"] == None
61+
62+
with subtest("Check API IPv6"):
63+
version = json.loads(machine.succeed(curl_cmd + "-6 localhost:5000/api/version"))
64+
server = json.loads(machine.succeed(curl_cmd + "-6 localhost:5000/api/server"))
5865
assert version["server"] == str("${pkgs.octoprint.version}")
5966
assert server["safemode"] == None
6067
'';

0 commit comments

Comments
 (0)