public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3] mpls01.sh: Add --allow-unsupported for modprobe
Date: Tue, 3 Sep 2024 13:26:16 +0200	[thread overview]
Message-ID: <20240903112616.GA745263@pevik> (raw)
In-Reply-To: <Ztbh5qyDln_t5C18@yuki.lan>

Hi Cyril,

> Hi!
> > Signed-off-by: Wei Gao <wegao@suse.com>
> > Reviewed-by: Petr Vorel <pvorel@suse.cz>
> > ---
> >  testcases/network/mpls/mpls01.sh | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)

> > diff --git a/testcases/network/mpls/mpls01.sh b/testcases/network/mpls/mpls01.sh
> > index 196b5b2f9..892b5bd85 100755
> > --- a/testcases/network/mpls/mpls01.sh
> > +++ b/testcases/network/mpls/mpls01.sh
> > @@ -21,7 +21,11 @@ cleanup()

> >  setup()
> >  {
> > -	ROD modprobe mpls_router
> > +	if grep -q 'sl-micro' /etc/os-release; then

> I do not like how specific is this check. The --allow-unsupported should
> be at best no-op for SLE and openSUSE, right?

Yes. I would personally avoid it (not needed so far), but sure it can work.

> So I would go for the
> check of ID=suse rather than specifying just single variant.

$ grep ^ID /etc/os-release # SLE Micro
ID="sl-micro"
ID_LIKE="suse"

$ grep ID_ /etc/os-release # Tumbleweed
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"

$ grep ^ID /etc/os-release # SLES 15-SP6
ID="sles"
ID_LIKE="suse"

$ grep ^ID /etc/os-release # SLES 12-SP5 (still supported)
ID="sles"

If we dare to ignore SLE12-SP5 (and older), we could use:
=> grep -q -w ID_LIKE.*suse /etc/os-release
(Using -w to mitigate "suse" as part of longer word.)

There is another problem: mpls_setup() also tries to load modules

modprobe -a mpls_router mpls_iptunnel mpls_gso failed
on both lhost and rhost via:

tst_net_run -s "modprobe -a $TST_NEEDS_DRIVERS"

which is run on all mpls tests. And even mpls01.sh gets fixed,
the other 3 remaining tests fails due missing --allow-unsupported for other mpls
modules.

I guess we can expect both sides are the same distros, thus we could do
evaluation only on lhost. And, we could for simplicity run modprobe also on both
sides in mpls01.sh, thus putting it into function. This code could be in new
function and called in mpls_setup + in mpls01.sh:

	local module
	local args

	grep -q 'sl-micro' /etc/os-release && args='--allow-unsupported'

	if [ "$TST_NEEDS_DRIVERS" ]; then
		tst_net_run -s "modprobe $args -a $TST_NEEDS_DRIVERS"
	fi

Wei, feel free to add it into new version. I can fix your grep in your version
and send a follow up patch. Whatever you prefer.

Kind regards,
Petr

> > +		ROD modprobe --allow-unsupported mpls_router
> > +	else
> > +		ROD modprobe mpls_router
> > +	fi
> >  }

> >  test1()
> > -- 
> > 2.35.3


> > -- 
> > Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-09-03 11:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-30  9:57 [LTP] [PATCH v1] mpls01.sh: Add --allow-unsupported for modprobe Wei Gao via ltp
2024-08-30 10:38 ` Petr Vorel
2024-09-02 10:39   ` Cyril Hrubis
2024-09-02 11:00     ` Petr Vorel
2024-09-02  2:40 ` [LTP] [PATCH v2] " Wei Gao via ltp
2024-09-02 11:02   ` Petr Vorel
2024-09-03  8:19   ` [LTP] [PATCH v3] " Wei Gao via ltp
2024-09-03  9:49     ` Petr Vorel
2024-09-03 10:16     ` Cyril Hrubis
2024-09-03 11:26       ` Petr Vorel [this message]
2024-09-04  3:58     ` [LTP] [PATCH v4] " Wei Gao via ltp
2024-09-04  4:47       ` Petr Vorel
2024-09-04  6:50         ` Wei Gao via ltp
2024-09-04  6:48       ` [LTP] [PATCH v5] " Wei Gao via ltp
2024-09-04  6:56         ` [LTP] [PATCH v6] mpls01: Add --allow-unsupported for modprobe(fixing all mpls cases) Wei Gao via ltp
2024-09-05  5:12           ` Petr Vorel
2024-09-05  8:47             ` Cyril Hrubis
2024-09-05 12:02               ` 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=20240903112616.GA745263@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@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