[Fuego] [PATCH v2] iperf3: manage mutual exclusion when using the same server

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Fri Mar 23 07:01:39 UTC 2018


When multiple boards try to connect to the same server
perform up to 6 retries with 60 seconds wait before giving up.
Note, that the default specs use a test duration of about 64
seconds (first 4 are discarded from the final results).

Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
 engine/tests/Benchmark.iperf3/fuego_test.sh | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/engine/tests/Benchmark.iperf3/fuego_test.sh b/engine/tests/Benchmark.iperf3/fuego_test.sh
index 4c27ce1..6876d90 100755
--- a/engine/tests/Benchmark.iperf3/fuego_test.sh
+++ b/engine/tests/Benchmark.iperf3/fuego_test.sh
@@ -19,9 +19,24 @@ function test_run {
         echo "ERROR: set the server ip on the spec or board file"
         return 1
     fi
-    echo "Using server ip address: $IPERF3_SERVER_IP"
-    echo "Starting iperf3 client on the target (CLIENT IP: $IPADDR)"
-    cmd "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./iperf3 -V -c $IPERF3_SERVER_IP -f M -J --logfile $BOARD_TESTDIR/fuego.$TESTDIR/output.json --get-server-output $BENCHMARK_IPERF3_CLIENT_PARAMS"
+
+    echo "Starting iperf3 client on the target (CLIENT IP: $IPADDR, SERVER IP: $IPERF3_SERVER_IP)"
+    json_file=$(mktemp)
+    for i in 1 2 3 4 5 6; do
+        cmd "$BOARD_TESTDIR/fuego.$TESTDIR/iperf3 -V -c $IPERF3_SERVER_IP -J --logfile $BOARD_TESTDIR/fuego.$TESTDIR/output.json --get-server-output $BENCHMARK_IPERF3_CLIENT_PARAMS" && break || \
+            echo "The server seems busy running another iperf3 test. Trying again in 30 seconds"
+
+        # that was our last try so abort the job
+        if [ $i -eq 6 ]; then
+            abort_job "The server seems busy running another iperf3 test."
+        fi
+
+        # remove the json file before retrying, otherwise it gets appended
+        cmd "rm -f $BOARD_TESTDIR/fuego.$TESTDIR/output.json"
+        sleep 60
+    done
+    rm -f $json_file
+
     report "cat $BOARD_TESTDIR/fuego.$TESTDIR/output.json"
 }
 
-- 
2.7.4




More information about the Fuego mailing list