From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 241125A026D; Wed, 16 Nov 2022 14:53:31 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH] test/lib/test: Clean up iperf3 JSON files before starting the server Date: Wed, 16 Nov 2022 14:53:31 +0100 Message-Id: <20221116135331.248003-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: XO4WQG546GIBKHPYECZQGTWMFXCO4NCX X-Message-ID-Hash: XO4WQG546GIBKHPYECZQGTWMFXCO4NCX X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: ...instead of doing it after the test. Now that we have pre-built guest images, we might also have old JSON files from previous, interrupted test runs. Signed-off-by: Stefano Brivio --- test/lib/test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lib/test b/test/lib/test index df32178..29612c2 100755 --- a/test/lib/test +++ b/test/lib/test @@ -31,6 +31,8 @@ test_iperf3() { __procs="$((${1} - 1))"; shift __time="${1}"; shift + pane_or_context_run "${__sctx}" 'rm -f s*.json' + pane_or_context_run_bg "${__sctx}" \ 'for i in $(seq 0 '${__procs}'); do' \ ' (iperf3 -s1J -p'${__port}' -i'${__time} \ @@ -64,8 +66,6 @@ test_iperf3() { __bw=$(pane_or_context_output "${__sctx}" \ 'cat s*.json | jq -rMs "map('${__jval}') | add"') - pane_or_context_run "${__sctx}" \ - 'for i in $(seq 0 '${__procs}'); do rm s${i}.json; done' TEST_ONE_subs="$(list_add_pair "${TEST_ONE_subs}" "__${__var}__" "${__bw}" )" -- 2.35.1