mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-07-21 00:30:04 +00:00
Rename test
This commit is contained in:
parent
02d90291bf
commit
6395da590a
@ -1,4 +1,4 @@
|
||||
# NAT hole-punching scenario
|
||||
# NAT connection-reversal scenario
|
||||
|
||||
## Scenario
|
||||
|
||||
@ -6,6 +6,9 @@ A node behind a NAT is reachable only through A's relay. When the reachable node
|
||||
C dials it through the relay, the relayed node dials C back directly (C is
|
||||
public) and the relayed connection is upgraded to a direct one.
|
||||
|
||||
This is a unilateral reversal — only the NATed node dials, because C is public.
|
||||
It is not a coordinated hole punch; see `../hole-punch` for the both-NATed case.
|
||||
|
||||
## Topology
|
||||
|
||||
```
|
||||
@ -25,7 +28,7 @@ node B ──── lan ──── router (NAT) ──── wan ────
|
||||
|
||||
```bash
|
||||
make testNatIntegration \
|
||||
STORAGE_INTEGRATION_TEST_INCLUDES=tests/integration/nat/hole-punching/testholepunching.nim
|
||||
STORAGE_INTEGRATION_TEST_INCLUDES=tests/integration/nat/connection-reversal/testconnectionreversal.nim
|
||||
```
|
||||
|
||||
Builds the shared image and brings the compose topology up and down. Rootless, but
|
||||
@ -36,8 +39,8 @@ needs the host netfilter modules — if the router fails on iptables:
|
||||
|
||||
B is `NotReachable` behind the relay, C is `Reachable`. C downloads from B
|
||||
through the relay, which opens a relayed connection; B then dials C back
|
||||
directly. Hole punching has no REST surface, so the test asserts on B's log line
|
||||
`Direct connection created.`.
|
||||
directly. The direct upgrade has no REST surface, so the test asserts on B's log
|
||||
line `Direct connection created.`.
|
||||
|
||||
Per-run container logs (router, bootstrap, client, node) are written before teardown to
|
||||
`tests/integration/logs/<timestamp>__NAT_hole_punching/<test>/<service>.log`.
|
||||
`tests/integration/logs/<timestamp>__NAT_connection_reversal/<test>/<service>.log`.
|
||||
@ -1,5 +1,5 @@
|
||||
# NAT hole-punching scenario — see README.md. Run via testholepunching.nim.
|
||||
name: nat-hole-punching
|
||||
# NAT connection-reversal scenario — see README.md. Run via testconnectionreversal.nim.
|
||||
name: nat-connection-reversal
|
||||
|
||||
# Topology addresses, named for their role (defined once, referenced below).
|
||||
x-addresses:
|
||||
@ -1,4 +1,4 @@
|
||||
## NAT hole-punching scenario. See README.md.
|
||||
## NAT connection-reversal scenario. See README.md.
|
||||
|
||||
import std/[json, os, sequtils, strutils, times]
|
||||
import pkg/chronos
|
||||
@ -15,12 +15,12 @@ proc announcesCircuitAddr(info: JsonNode): bool =
|
||||
## A node behind the relay announces its circuit (p2p-circuit) address.
|
||||
info{"announceAddresses"}.getElems.anyIt("p2p-circuit" in it.getStr)
|
||||
|
||||
asyncchecksuite "NAT hole punching":
|
||||
asyncchecksuite "NAT connection reversal":
|
||||
let
|
||||
composeFile = currentSourcePath.parentDir / "compose.yml"
|
||||
nodeApiUrl = "http://127.0.0.1:18088/api/storage/v1"
|
||||
clientApiUrl = "http://127.0.0.1:18089/api/storage/v1"
|
||||
suiteName = "NAT hole punching"
|
||||
suiteName = "NAT connection reversal"
|
||||
testName = "a relayed node is upgraded to a direct connection"
|
||||
services = ["router", "bootstrap", "client", "node"]
|
||||
startTime = now().format("yyyy-MM-dd'_'HH:mm:ss")
|
||||
Loading…
x
Reference in New Issue
Block a user