Use separate port for second iperf3 daemon

Avoids race condition when the first daemon's port release is delayed

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
This commit is contained in:
Grigory Trenin
2026-01-22 04:51:50 -05:00
parent 1c156d8325
commit 016c1b7f51
3 changed files with 17 additions and 9 deletions

View File

@@ -43,7 +43,7 @@ if test "$(id -u)" != "0";then
exit 77
fi
echo "Testing ocserv connection via haproxy... "
echo "Testing LZ4 compression... "
function finish {
set +e
@@ -104,13 +104,16 @@ ${CMDNS1} iperf3 -t 6 -c ${VPNADDR}
# IPv6
${CMDNS2} iperf3 -s -D -1
# iperf3 might not release the port immediately; get an alternative port
set +e; eval "${GETPORT}"; set -e
${CMDNS2} iperf3 -s -D -1 -p ${PORT}
${CMDNS1} ping -6 -c 3 ${VPNADDR6}
echo " * Receiving with iperf3"
${CMDNS1} iperf3 -t 6 -R -c ${VPNADDR}
${CMDNS1} iperf3 -t 6 -R -c ${VPNADDR} -p ${PORT}
set +e

View File

@@ -43,7 +43,7 @@ if test "$(id -u)" != "0";then
exit 77
fi
echo "Testing ocserv connection via haproxy... "
echo "Testing LZS compression... "
function finish {
set +e
@@ -104,13 +104,16 @@ ${CMDNS1} iperf3 -t 6 -c ${VPNADDR}
# IPv6
${CMDNS2} iperf3 -s -D -1
# iperf3 might not release the port immediately; get an alternative port
set +e; eval "${GETPORT}"; set -e
${CMDNS2} iperf3 -s -D -1 -p ${PORT}
${CMDNS1} ping -6 -c 3 ${VPNADDR6}
echo " * Receiving with iperf3"
${CMDNS1} iperf3 -t 6 -R -c ${VPNADDR}
${CMDNS1} iperf3 -t 6 -R -c ${VPNADDR} -p ${PORT}
set +e

View File

@@ -41,7 +41,7 @@ if test "$(id -u)" != "0";then
exit 77
fi
echo "Testing ocserv connection via haproxy... "
echo "Testing ocserv traffic... "
function finish {
set +e
@@ -100,10 +100,12 @@ echo " * Transmitting with iperf3"
${CMDNS1} iperf3 -t 6 -c ${VPNADDR}
${CMDNS2} iperf3 -s -D -1
# iperf3 might not release the port immediately; get an alternative port
set +e; eval "${GETPORT}"; set -e
${CMDNS2} iperf3 -s -D -1 -p ${PORT}
${CMDNS1} iperf3 -t 6 -R -c ${VPNADDR}
${CMDNS1} iperf3 -t 6 -R -c ${VPNADDR} -p ${PORT}
echo " * ping ipv6 address"