From 690b08650865c41b898d30ba43c278c07eaf3915 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Mon, 25 May 2026 17:02:48 +0400 Subject: [PATCH] Add autonat server check for bootstrap nodes in tests --- tests/integration/storageconfig.nim | 5 +++-- tests/integration/twonodes.nim | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/integration/storageconfig.nim b/tests/integration/storageconfig.nim index c3ab9ea7..32d5b536 100644 --- a/tests/integration/storageconfig.nim +++ b/tests/integration/storageconfig.nim @@ -332,12 +332,13 @@ proc withRelay*( startConfig.configs[idx].addCliOption("--relay-server") return startConfig -# For testing, a node with extip (not behind nat) is a bootstrap node +# For testing, a node with extip (not behind nat) with autonat server +# enabled is a bootstrap node proc isBootstrapNode*(config: StorageConfig): bool {.raises: [].} = let opts = config.cliOptions.getOrDefault(StartUpCmd.noCmd) try: - if "--nat" in opts and "extip" in opts["--nat"].value: + if "--nat" in opts and "extip" in opts["--nat"].value and "--autonat-server" in opts: return true except KeyError: warn "Failed to look at the extip config" diff --git a/tests/integration/twonodes.nim b/tests/integration/twonodes.nim index 2398873a..e2553aa6 100644 --- a/tests/integration/twonodes.nim +++ b/tests/integration/twonodes.nim @@ -12,7 +12,10 @@ export multinodes template twonodessuite*(name: string, body: untyped) = multinodesuite name: let twoNodesConfig {.inject, used.} = - NodeConfigs(clients: StorageConfigs.init(nodes = 2).withExtIp(1).some) + # Disable Autonat for this suite + NodeConfigs( + clients: StorageConfigs.init(nodes = 2).withExtIp(1).withAutonatServer(0).some + ) var node1 {.inject, used.}: StorageProcess var node2 {.inject, used.}: StorageProcess