From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: Re: [PATCH v2 4/4] test: Rewrite test_iperf3 Date: Wed, 07 Sep 2022 10:41:39 +1000 Message-ID: In-Reply-To: <20220906182300.4fc52cdc@elisabeth> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1389163504885542092==" --===============1389163504885542092== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, Sep 06, 2022 at 06:23:00PM +0200, Stefano Brivio wrote: > On Fri, 2 Sep 2022 12:04:34 +1000 > David Gibson wrote: > > > [...] > > > > --- a/test/lib/test > > +++ b/test/lib/test > > @@ -30,54 +30,40 @@ test_iperf3() { > > __procs="$((${1} - 1))"; shift > > __time="${1}"; shift > > > > - pane_run "${__spane}" 'for i in $(seq 0 '${__procs}'); do' \ > > - ':> s${i}.bw; done' > > + pane_run "${__spane}" \ > > + '(' \ > > + ' for i in $(seq 0 '${__procs}'); do' \ > > + ' iperf3 -s1J -p'${__port}' -i'${__time} \ > > + ' > s${i}.json &' \ > > + ' done;' \ > > + ' wait' \ > > + ')' > > + > > + pane_run "${__cpane}" \ > > + '(' \ > > + ' for i in $(seq 0 '${__procs}'); do' \ > > + ' iperf3 -c '${__dest}' -p '${__port} \ > > + ' -t'${__time}' -T s${i} '"${@}"' &' \ > > + ' done;' \ > > + ' wait' \ > > + ')' > > + > > + pane_status "${__cpane}" > > pane_status "${__spane}" > > > > - __udp=0 > > + __jval=".end.sum_received.bits_per_second" > > for __opt in ${@}; do > > - [ "${__opt}" = "-u" ] && __udp=1 > > + # UDP test > > + [ "${__opt}" = "-u" ] && __jval=".intervals[0].sum.bits_per_second" > > done > > > > - ( > > - sleep 2 > > - pane_run "${__cpane}" 'for i in $(seq 0 '${__procs}');' \ > > - 'do ( iperf3 -c '"${__dest}"' -p '"${__port}" \ > > - '-t'${__time} "${@}" ' -T s${i} & echo $! > c${i}.pid & ); done' > > - sleep $(echo ${__time} + 10 | bc -l) > > - pane_run "${__cpane}" 'for i in $(seq 0 '${__procs}'); do'\ > > - 'kill -INT $(cat c${i}.pid) 2>/dev/null; done' > > - ) & > > - > > - if [ ${__udp} -eq 0 ]; then > > - pane_run "${__spane}" 'for i in $(seq 0 '${__procs}');' \ > > - 'do ( ( iperf3 -s1J -p '"${__port}" \ > > - '& echo $! > s${i}.pid ) 2>/dev/null' \ > > - '| jq -rM ".end.sum_received.bits_per_second"' \ > > - '> s${i}.bw & );' \ > > - 'done' > > - else > > - pane_run "${__spane}" 'for i in $(seq 0 '${__procs}');' \ > > - 'do ( ( iperf3 -s1J -i '${__time}' -p '"${__port}" \ > > - '& echo $! > s${i}.pid ) 2>/dev/null' \ > > - '| jq -rM ".intervals[0].sum.bits_per_second"' \ > > - '> s${i}.bw & );' \ > > - 'done' > > - fi > > - > > - pane_status "${__spane}" > > - sleep $(echo ${__time} + 15 | bc -l) > > - pane_run "${__spane}" 'for i in $(seq 0 '${__procs}'); do' \ > > - 'kill -INT $(cat s${i}.pid) 2>/dev/null; done' > > - sleep 4 > > - pane_wait "${__spane}" > > - pane_run "${__spane}" '(cat s*.bw |' \ > > - 'sed '"'"'s/\(.*\)/\1\+/g'"'"' |' \ > > - 'tr -d "\n"; echo 0) | bc -l' > > At this point we can probably drop the "ugly" from: > > # test_iperf3() - Ugly helper for iperf3 directive Heh, yeah I guess so. > :) but I guess your opinion might differ, so I'll leave it for now. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --===============1389163504885542092== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUVCQ0FBZEZpRUVvVUx4V3U0L1dz MGRCK1h0Z3lwWTRnRXdZU0lGQW1NWDZMc0FDZ2tRZ3lwWTRnRXcKWVNJQ2JoQ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