public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH] test/lib/test: Clean up iperf3 JSON files before starting the server
Date: Wed, 16 Nov 2022 14:53:31 +0100	[thread overview]
Message-ID: <20221116135331.248003-1-sbrivio@redhat.com> (raw)

...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 <sbrivio@redhat.com>
---
 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}" )"
 
-- 
@@ -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


             reply	other threads:[~2022-11-16 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 13:53 Stefano Brivio [this message]
2022-11-16 23:02 ` [PATCH] test/lib/test: Clean up iperf3 JSON files before starting the server David Gibson
2022-11-17  7:25   ` Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221116135331.248003-1-sbrivio@redhat.com \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).