From 37d8904d67111beae5c65ad5a0fc6e0734050f63 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Mon, 15 Jun 2026 09:41:55 +0400 Subject: [PATCH] Cleanup --- tests/integration/nat/node-entrypoint.sh | 3 ++- .../nat/not-reachable/testnotreachable.nim | 17 ++++++----------- .../nat/reachable/testreachable.nim | 19 ++++++------------- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/tests/integration/nat/node-entrypoint.sh b/tests/integration/nat/node-entrypoint.sh index b8b08ce4..d8279976 100644 --- a/tests/integration/nat/node-entrypoint.sh +++ b/tests/integration/nat/node-entrypoint.sh @@ -23,4 +23,5 @@ exec /app/build/storage \ --bootstrap-node="$spr" \ --nat-num-peers-to-ask=1 --nat-max-queue-size=1 \ --nat-min-confidence=1.0 --nat-schedule-interval=30s \ - --data-dir=/data --log-level=DEBUG + --data-dir=/data --log-level=DEBUG \ + ${EXTRA_STORAGE_ARGS:-} diff --git a/tests/integration/nat/not-reachable/testnotreachable.nim b/tests/integration/nat/not-reachable/testnotreachable.nim index 74b83f2c..eefd47ab 100644 --- a/tests/integration/nat/not-reachable/testnotreachable.nim +++ b/tests/integration/nat/not-reachable/testnotreachable.nim @@ -14,24 +14,19 @@ import ../../storageclient import ../composehelper const - composeFile = currentSourcePath.parentDir / "compose.yml" - nodeApiUrl = "http://127.0.0.1:18080/api/storage/v1" - suiteName = "NAT not reachable" - testName = "node behind NAT is NotReachable and falls back to relay" - services = ["router", "bootstrap", "node"] detectTimeout = 300_000 # ms pollInterval = 5_000 # ms proc announcesCircuitAddr(info: JsonNode): bool = info{"announceAddresses"}.getElems.anyIt("p2p-circuit" in it.getStr) -asyncchecksuite suiteName: +asyncchecksuite "NAT not reachable": let - composeFile = composeFile - nodeApiUrl = nodeApiUrl - suiteName = suiteName - testName = testName - services = services + composeFile = currentSourcePath.parentDir / "compose.yml" + nodeApiUrl = "http://127.0.0.1:18080/api/storage/v1" + suiteName = "NAT not reachable" + testName = "node behind NAT is NotReachable and falls back to relay" + services = ["router", "bootstrap", "node"] startTime = now().format("yyyy-MM-dd'_'HH:mm:ss") var client: StorageClient diff --git a/tests/integration/nat/reachable/testreachable.nim b/tests/integration/nat/reachable/testreachable.nim index 93e26bdb..adefe598 100644 --- a/tests/integration/nat/reachable/testreachable.nim +++ b/tests/integration/nat/reachable/testreachable.nim @@ -20,11 +20,6 @@ import ../../storageclient import ../composehelper const - composeFile = currentSourcePath.parentDir / "compose.yml" - nodeApiUrl = "http://127.0.0.1:18081/api/storage/v1" - suiteName = "NAT reachable" - testName = "node behind NAT with a forwarded port is Reachable" - services = ["router", "bootstrap", "node"] detectTimeout = 120_000 # ms pollInterval = 5_000 # ms @@ -32,15 +27,13 @@ proc announcesDirectAddr(info: JsonNode): bool = ## A reachable node announces at least one direct (non-circuit) address. info{"announceAddresses"}.getElems.anyIt("p2p-circuit" notin it.getStr) -asyncchecksuite suiteName: - # chronos' async setup/teardown cannot reference module-level GC'ed consts - # (strings/seqs), so rebind the ones they use to suite locals. +asyncchecksuite "NAT reachable": let - composeFile = composeFile - nodeApiUrl = nodeApiUrl - suiteName = suiteName - testName = testName - services = services + composeFile = currentSourcePath.parentDir / "compose.yml" + nodeApiUrl = "http://127.0.0.1:18081/api/storage/v1" + suiteName = "NAT reachable" + testName = "node behind NAT with a forwarded port is Reachable" + services = ["router", "bootstrap", "node"] startTime = now().format("yyyy-MM-dd'_'HH:mm:ss") var client: StorageClient