fix e2e tests with private destination

This commit is contained in:
kulikov0 committed 2026-09-16 13:03:31 +02:00
1 parent 9810dff788
commit ba84102774
4 files changed
+21 -8

No files matched your search

+14 -2
View File
@@ -12,8 +12,8 @@ SINK_PID=""
SINK_PORT="" SINK_PORT=""
SINK_FILE="" SINK_FILE=""
SINK_WRAP="${SINK_WRAP:-}" SINK_WRAP="${SINK_WRAP:-}"
SINK_BIND="${SINK_BIND:-127.0.0.1}" SINK_BIND="${SINK_BIND:-}"
SINK_TARGET="${SINK_TARGET:-127.0.0.1}" SINK_TARGET="${SINK_TARGET:-}"
PROBE_HOST="${PROBE_HOST:-127.0.0.1}" PROBE_HOST="${PROBE_HOST:-127.0.0.1}"
PORT_CURSOR="${PORT_BASE:-21080}" PORT_CURSOR="${PORT_BASE:-21080}"
@@ -55,7 +55,19 @@ alloc_port() {
PORT_CURSOR=$((PORT_CURSOR + 1)) PORT_CURSOR=$((PORT_CURSOR + 1))
} }
host_ip() {
if command -v ip >/dev/null 2>&1; then
ip -4 route get 1.1.1.1 2>/dev/null | sed -n 's/.* src \([0-9.]*\).*/\1/p' | head -1
elif command -v ipconfig >/dev/null 2>&1; then
_iface=$(route -n get default 2>/dev/null | sed -n 's/.*interface: *//p' | head -1)
[ -n "$_iface" ] && ipconfig getifaddr "$_iface" 2>/dev/null
fi
}
start_sink() { start_sink() {
[ -n "$SINK_BIND" ] || SINK_BIND=$(host_ip)
[ -n "$SINK_BIND" ] || die "cannot detect a non-loopback address for the sink, set SINK_BIND and SINK_TARGET"
[ -n "$SINK_TARGET" ] || SINK_TARGET="$SINK_BIND"
alloc_port alloc_port
SINK_PORT="$ALLOC_PORT" SINK_PORT="$ALLOC_PORT"
SINK_FILE=$(mktemp -t e2e-sink.XXXXXX) SINK_FILE=$(mktemp -t e2e-sink.XXXXXX)
+1 -1
View File
@@ -82,7 +82,7 @@ require_cmd ncat
trap cleanup EXIT INT TERM trap cleanup EXIT INT TERM
start_sink start_sink
log "sink on 127.0.0.1:$SINK_PORT" log "sink on $SINK_BIND:$SINK_PORT"
for _pf in $RUN_PLATFORMS; do for _pf in $RUN_PLATFORMS; do
run_platform "$_pf" run_platform "$_pf"
+2 -2
View File
@@ -46,8 +46,8 @@ JOINER_WRAP="ip netns exec joiner"
JOINER_SOCKS_HOST="0.0.0.0" JOINER_SOCKS_HOST="0.0.0.0"
PROBE_HOST="10.201.2.2" PROBE_HOST="10.201.2.2"
SINK_WRAP="ip netns exec creator" SINK_WRAP="ip netns exec creator"
SINK_BIND="127.0.0.1" SINK_BIND="10.201.1.2"
SINK_TARGET="127.0.0.1" SINK_TARGET="10.201.1.2"
cleanup_all() { cleanup_all() {
cleanup cleanup
+4 -3
View File
@@ -33,8 +33,8 @@ loopback - no external network, no rate limits.
Platforms: telemost wbstream dion bitrix (VK has no headless SOCKS joiner) Platforms: telemost wbstream dion bitrix (VK has no headless SOCKS joiner)
Scenarios: connect dc kcp dual kick Scenarios: connect dc kcp dual kick
Cookies are taken from cookies-<platform>.json at the repo root at build time. Cookies are mounted from cookies-<platform>.json at the repo root on run.
Rebuild after refreshing cookies. Examples: Examples:
stand.sh build stand.sh build
stand.sh run stand.sh run
stand.sh run bitrix dc kick stand.sh run bitrix dc kick
@@ -43,7 +43,8 @@ EOF
} }
build_context() { build_context() {
arch=$(docker version --format '{{.Server.Arch}}' 2>/dev/null || echo arm64) arch=$(docker version --format '{{.Server.Arch}}' 2>/dev/null | tr -d '[:space:]')
[ -n "$arch" ] || arch=arm64
rm -rf "$CTX" rm -rf "$CTX"
mkdir -p "$CTX/work/headless/tests/stand" mkdir -p "$CTX/work/headless/tests/stand"
for spec in $COMPONENTS; do for spec in $COMPONENTS; do