From 06b5a623f961cc982bbe7f0f67e19cede2431696 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Wed, 18 Feb 2026 01:07:04 +0000 Subject: [PATCH] Fix iperf-test.sh bandwidth extraction in non-live mode The awk pattern used $(NF-2) which picked up the retransmit count (0) instead of the bandwidth value, because the retransmit field sits between the bandwidth unit and "sender". Search for the bits/sec field by content instead of position. --- examples/docker-network/scripts/iperf-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/docker-network/scripts/iperf-test.sh b/examples/docker-network/scripts/iperf-test.sh index 4babbd2..13efbb4 100755 --- a/examples/docker-network/scripts/iperf-test.sh +++ b/examples/docker-network/scripts/iperf-test.sh @@ -65,7 +65,7 @@ iperf_test() { # Check if we got valid results if echo "$output" | grep -q "sender"; then # Extract and display results (get SUM line for aggregate bandwidth) - local bandwidth=$(echo "$output" | grep "\[SUM\].*sender" | tail -1 | awk '{print $(NF-2), $(NF-1)}') + local bandwidth=$(echo "$output" | grep "\[SUM\].*sender" | tail -1 | awk '{for(i=1;i<=NF;i++) if($i ~ /bits\/sec/) {print $(i-1), $i; exit}}') echo "OK" echo "Bandwidth: $bandwidth" PASSED=$((PASSED + 1))