Add autonat server check for bootstrap nodes in tests

This commit is contained in:
Arnaud 2026-05-25 17:02:48 +04:00
parent 6a454490b1
commit 690b086508
No known key found for this signature in database
GPG Key ID: A6C7C781817146FA
2 changed files with 7 additions and 3 deletions

View File

@ -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"

View File

@ -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