public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] netns_helper: Make iproute version check work correctly
Date: Wed, 10 Feb 2021 14:38:30 +0100	[thread overview]
Message-ID: <YCPh1qzZU51C0HY8@pevik> (raw)
In-Reply-To: <YCOUXtwBk0ZPjDL3@pevik>

Hi Zhu,

...
> FYI my shell version.

> Kind regards,
> Petr

> --- testcases/kernel/containers/netns/netns_helper.sh
> +++ testcases/kernel/containers/netns/netns_helper.sh
> @@ -47,16 +47,21 @@ IFCONF_IN6_ARG=

>  tst_check_iproute()
>  {
> -	local cur_ipver="$(ip -V)"
> -	local spe_ipver="$1"
> +	local current_ver="$(ip -V)"
> +	local expected_ver="111010"

> -	cur_ipver=${cur_ipver##*s}
> +	current_ver=${current_ver##*s}

> -	if [ -z "$cur_ipver" -o -z "$spe_ipver" ]; then
> +	if [ -z "$current_ver" -o -z "$expected_ver" ]; then
I'm sorry, this was supposed to be only this:
    if [ -z "$current_ver" ]; then
($expected_ver is set few lines above).

Kind regards,
Petr

>  		tst_brk TBROK "failed to obtain valid iproute version"
>  	fi

> -	if [ $cur_ipver -lt $spe_ipver ]; then
> +	# new version scheme since v5.7.0-77-gb687d1067169
> +	if echo "$current_ver" | grep -q 'iproute2-v\?[0-9]\+\.'; then
> +		return
> +	fi
> +
> +	if [ $current_ver -lt $expected_ver ]; then
>  		tst_brk TCONF "too old iproute version"
>  	fi
>  }

Kind regards,
Petr

      reply	other threads:[~2021-02-10 13:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08  8:14 [LTP] [PATCH] netns_helper: Make iproute version check work correctly Feiyu Zhu
2021-02-09 14:56 ` Cyril Hrubis
2021-02-09 15:55   ` Cyril Hrubis
2021-02-10  8:07 ` Petr Vorel
2021-02-10 13:38   ` Petr Vorel [this message]

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=YCPh1qzZU51C0HY8@pevik \
    --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