All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] if-mtu-change.sh: Lower CHANGE_INTERVAL for netns
Date: Mon, 8 Feb 2021 15:49:10 +0300	[thread overview]
Message-ID: <c5322d13-c69d-aa4d-193c-7c047a405d9a@oracle.com> (raw)
In-Reply-To: <20210205142051.32055-2-pvorel@suse.cz>

On 05.02.2021 17:20, Petr Vorel wrote:
> to make testing faster.
> 
> NOTE: the default sleep 5s is needed for ssh based testing to prevent
> link-flap errors on the switch. It can be lower down by user.
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  .../network/stress/interface/if-mtu-change.sh      | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/testcases/network/stress/interface/if-mtu-change.sh b/testcases/network/stress/interface/if-mtu-change.sh
> index d2816606b..49ac5e3fc 100755
> --- a/testcases/network/stress/interface/if-mtu-change.sh
> +++ b/testcases/network/stress/interface/if-mtu-change.sh
> @@ -1,6 +1,6 @@
>  #!/bin/sh
>  # SPDX-License-Identifier: GPL-2.0-or-later
> -# Copyright (c) 2017-2019 Petr Vorel <pvorel@suse.cz>
> +# Copyright (c) 2017-2021 Petr Vorel <pvorel@suse.cz>
>  # Copyright (c) 2015-2017 Oracle and/or its affiliates. All Rights Reserved.
>  # Copyright (c) International Business Machines  Corp., 2005
>  # Author: Mitsuru Chinen <mitch@jp.ibm.com>
> @@ -12,9 +12,13 @@ TST_CLEANUP="do_cleanup"
>  
>  # The interval of the mtu change [second]
>  CHANGE_INTERVAL=${CHANGE_INTERVAL:-5}
> -
>  TST_TIMEOUT=$(((CHANGE_INTERVAL + 30) * MTU_CHANGE_TIMES))
>  
> +if tst_net_use_netns; then
> +	CHANGE_INTERVAL="100ms"

Hi Petr,

What about adding the option to change this value too for netns,
for example like this:

TST_TIMEOUT=1
if tst_net_use_netns; then
    CHANGE_INTERVAL=${CHANGE_INTERVAL:-100ms}
else
    CHANGE_INTERVAL=${CHANGE_INTERVAL:-5}
    tst_is_int $CHANGE_INTERVAL && TST_TIMEOUT=$CHANGE_INTERVAL
fi

TST_TIMEOUT=$(((TST_TIMEOUT + 30) * MTU_CHANGE_TIMES))


> +	TST_TIMEOUT=$((30 * MTU_CHANGE_TIMES))
> +fi
> +
>  # The array of the value which MTU is changed into sequentially
>  # 552 - net.ipv4.route.min_pmtu
>  CHANGE_VALUES="784 1142 552 1500 552 1500 552 748 552 1142 1500"
> @@ -65,6 +69,7 @@ find_ipv4_max_packet_size()
>  
>  do_setup()
>  {
> +

empty new line?

>  	[ "$TST_IPV6" ] && CHANGE_VALUES=$CHANGE6_VALUES
>  	if_setup
>  	saved_mtu="$(cat /sys/class/net/$(tst_iface)/mtu)"
> @@ -83,9 +88,10 @@ do_cleanup()
>  test_body()
>  {
>  	local cmd="$CMD"
> +	local msg="'$cmd' changes MTU $MTU_CHANGE_TIMES times every $CHANGE_INTERVAL"
>  
> -	tst_res TINFO "'$cmd' changes MTU $MTU_CHANGE_TIMES times" \
> -	               "every $CHANGE_INTERVAL seconds"
> +	tst_is_int $CHANGE_INTERVAL && msg="$msg seconds"
> +	tst_res TINFO "$msg"
>  
>  	mtu_array_len=$(echo $CHANGE_VALUES | wc -w)
>  	local cnt=0
>

  reply	other threads:[~2021-02-08 12:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 14:20 [LTP] [PATCH 1/2] tst_net.sh: Add API function to check netns use Petr Vorel
2021-02-05 14:20 ` [LTP] [PATCH 2/2] if-mtu-change.sh: Lower CHANGE_INTERVAL for netns Petr Vorel
2021-02-08 12:49   ` Alexey Kodanev [this message]
2021-02-08 16:04     ` Petr Vorel
2021-02-09 12:45       ` Alexey Kodanev
2021-02-09 14:12         ` Petr Vorel

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=c5322d13-c69d-aa4d-193c-7c047a405d9a@oracle.com \
    --to=alexey.kodanev@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.