From 3b5004cedf5cff7dd6b08f0bf82250808891609a Mon Sep 17 00:00:00 2001 From: Louis Tournayre Date: Thu, 23 Jun 2022 14:28:06 +0200 Subject: [PATCH] Fix waiting for iperf docker is running before launch test --- dist/functional-test.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dist/functional-test.sh b/dist/functional-test.sh index 02014a41b..a642c3a49 100755 --- a/dist/functional-test.sh +++ b/dist/functional-test.sh @@ -177,9 +177,18 @@ perf() { # Perf test - run iperf server on flannel1 and client on flannel2 docker rm -f flannel-e2e-test-flannel1-iperf 2>/dev/null docker run -d --name flannel-e2e-test-flannel1-iperf --net=container:flannel-e2e-test-flannel1 iperf3:latest >/dev/null + wait_for flannel-e2e-test-flannel1-iperf docker run --rm --net=container:flannel-e2e-test-flannel2 iperf3:latest -c $ping_dest1 -B $ping_dest2 } +wait_for() { + while ! docker inspect --format='{{json .State.Status}}' $1 >/dev/null + do + sleep 1 + done +} + + test_multi() { flannel_conf_vxlan='{"Network": "10.11.0.0/16", "Backend": {"Type": "vxlan"}}' flannel_conf_host_gw='{"Network": "10.12.0.0/16", "Backend": {"Type": "host-gw"}}'