From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top
Subject: Re: [PATCH v2 4/4] test: Rewrite test_iperf3
Date: Wed, 07 Sep 2022 10:41:39 +1000 [thread overview]
Message-ID: <Yxfow7ELh307gS5i@yekko> (raw)
In-Reply-To: <20220906182300.4fc52cdc@elisabeth>
[-- Attachment #1: Type: text/plain, Size: 3037 bytes --]
On Tue, Sep 06, 2022 at 06:23:00PM +0200, Stefano Brivio wrote:
> On Fri, 2 Sep 2022 12:04:34 +1000
> David Gibson <david(a)gibson.dropbear.id.au> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-09-07 0:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-02 2:04 [PATCH v2 0/4] Cleanups to performance tests David Gibson
2022-09-02 2:04 ` [PATCH v2 1/4] gitignore pidfiles other than passt.pid David Gibson
2022-09-02 2:04 ` [PATCH v2 2/4] test: Combine iperf3c and iperf3s into a single DSL command David Gibson
2022-09-02 2:04 ` [PATCH v2 3/4] test: Parameterize run time for throughput performance tests David Gibson
2022-09-06 16:22 ` Stefano Brivio
2022-09-07 0:40 ` David Gibson
2022-09-02 2:04 ` [PATCH v2 4/4] test: Rewrite test_iperf3 David Gibson
2022-09-06 16:23 ` Stefano Brivio
2022-09-07 0:41 ` David Gibson [this message]
2022-09-07 19:35 ` [PATCH v2 0/4] Cleanups to performance tests 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=Yxfow7ELh307gS5i@yekko \
--to=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).