From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare()
Date: Tue, 20 Oct 2020 15:52:10 +0200 [thread overview]
Message-ID: <20201020135210.GA23197@dell5510> (raw)
In-Reply-To: <20201015122056.20715-1-alexey.kodanev@oracle.com>
Hi Alexey,
Reviewed-by: Petr Vorel <pvorel@suse.cz>
> * Remove duplicate code for comparing time-based results in
> network tests (bbr, busy_poll, sctp, tcp fastopen, virt tests)
> * Expand thresholds for sctp, bbr test-cases, in order to avoid
> false-positive failures.
I'm ok to keep more changes in single commit, but this change is affecting the
result, thus maybe put into separate commit?
(easier if somebody wants to bisect).
> * In virt_lib.sh, keep sign for VIRT_PERF_THRESHOLD.
> * TWARN when the base result is too bad (threshold_hi arg is set)
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
> testcases/lib/tst_net.sh | 31 +++++++++++++++++++
> testcases/network/busy_poll/busy_poll01.sh | 10 ++----
> testcases/network/busy_poll/busy_poll02.sh | 8 +----
> testcases/network/busy_poll/busy_poll03.sh | 8 +----
> testcases/network/dccp/dccp01.sh | 15 ++-------
> testcases/network/sctp/sctp01.sh | 8 +----
> testcases/network/tcp_cc/bbr01.sh | 2 +-
> testcases/network/tcp_cc/bbr02.sh | 2 +-
> testcases/network/tcp_cc/dctcp01.sh | 2 +-
> testcases/network/tcp_cc/tcp_cc_lib.sh | 8 +----
> .../network/tcp_fastopen/tcp_fastopen_run.sh | 15 ++-------
> testcases/network/virt/virt_lib.sh | 21 ++-----------
> 12 files changed, 46 insertions(+), 84 deletions(-)
> diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
> index d939a5780..b29e076c3 100644
> --- a/testcases/lib/tst_net.sh
> +++ b/testcases/lib/tst_net.sh
> @@ -741,6 +741,37 @@ tst_netload()
> return $ret
> }
> +# Compares results for netload runs.
> +# tst_netload_compare TIME_BASE TIME THRESHOLD_LOW [THRESHOLD_HI]
> +# TIME_BASE: time taken to run netstress load test - 100%
> +# TIME: time that is compared to the base one
> +# THRESHOD_LOW: lower limit for TFAIL
> +# THRESHOD_HIGH: upper limit for TWARN
> +tst_netload_compare()
> +{
> + local base_time=$1
> + local new_time=$2
> + local threshold_low=$3
> + local threshold_hi=$4
> +
> + if [ -z "$base_time" -o -z "$new_time" -o -z "$threshold_low" ]; then
> + tst_brk_ TBROK "tst_netload_compare: invalid argument(s)"
> + fi
> +
> + local res=$(((base_time - new_time) * 100 / base_time))
> + local msg="performance result is ${res}%"
> +
> + if [ "$res" -lt "$threshold_low" ]; then
> + tst_res_ TFAIL "$msg < threshold ${threshold_low}%"
> + return
> + fi
> +
> + [ "$threshold_hi" ] && [ "$res" -gt "$threshold_hi" ] && \
> + tst_res_ TWARN "$msg > threshold ${threshold_hi}%"
> +
> + tst_res_ TPASS "$msg, in range [${threshold_low}:${threshold_hi:-}]%"
Do you mean ${threshold_hi:--} (to print "-" when $threshold_hi not set?)
As ${threshold_hi:-} prints empty string when unset (equivalent of ${threshold_hi}).
> +}
...
Kind regards,
Petr
next prev parent reply other threads:[~2020-10-20 13:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-15 12:20 [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Alexey Kodanev
2020-10-15 12:20 ` [LTP] [PATCH 2/5] lib/tst_net: calc mean in tst_netload() Alexey Kodanev
2020-10-20 14:39 ` Petr Vorel
2020-10-21 9:56 ` Alexey Kodanev
2020-10-26 6:46 ` Petr Vorel
2020-10-15 12:20 ` [LTP] [PATCH 3/5] network/virt: skip setting neighbour table if tunnel doesn't have hwaddr Alexey Kodanev
2020-10-26 7:06 ` Petr Vorel
2020-10-15 12:20 ` [LTP] [PATCH 4/5] network/virt: add wireguard01 Alexey Kodanev
2020-10-26 8:49 ` Petr Vorel
2020-10-26 13:40 ` Alexey Kodanev
2020-10-26 13:45 ` Petr Vorel
2020-10-15 12:20 ` [LTP] [PATCH 5/5] network/virt: add wireguard02: ipsec vs wireguard Alexey Kodanev
2020-10-26 8:53 ` Petr Vorel
2020-10-30 15:20 ` Alexey Kodanev
2020-10-20 13:52 ` Petr Vorel [this message]
2020-10-21 9:18 ` [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() Alexey Kodanev
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=20201020135210.GA23197@dell5510 \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox