mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-08-03 07:23:20 +00:00
Add autonat server check for bootstrap nodes in tests
This commit is contained in:
parent
6a454490b1
commit
690b086508
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user