All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] mpls01.sh: Add --allow-unsupported for modprobe
Date: Fri, 30 Aug 2024 12:38:35 +0200	[thread overview]
Message-ID: <20240830103835.GA42409@pevik> (raw)
In-Reply-To: <20240830095758.20018-1-wegao@suse.com>

Hi Wei,

> In sle-micro we encounter following error when do modprobe:
> root# modprobe mpls_router
> modprobe: ERROR: module 'mpls_router' is unsupported
> modprobe: ERROR: Use --allow-unsupported or set allow_unsupported_modules 1 in
> modprobe: ERROR: /etc/modprobe.d/10-unsupported-modules.conf
> modprobe: ERROR: could not insert 'mpls_router': Operation not permitted

> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
>  testcases/network/mpls/mpls01.sh | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

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

>  setup()
>  {
> -	ROD modprobe mpls_router
> +	if ! modprobe mpls_router > /dev/null 2>&1; then
> +		ROD modprobe mpls_router --allow-unsupported

I'm not sure with ROD.  --allow-unsupported is SUSE specific modprobe extension,
which is used for SLES.  It is also on Tumbleweed [1] [2] where does nothing.

If you try to run it with ROD, which quits testing on failure, all distros
except SUSE products/openSUSE (e.g. Debian, Fedora, ...) which don't have
mpls_router will TBROK in setup:

	modprobe: unrecognised option '--allow-unsupported'.

And I'm not talking about these small distros which use busybox kmod
implementation, which would also fail.

Also you remove /dev/null 2>&1 from the first command, thus other distros would
not see error message about missing mpls_router module. Without looking into the
source the tester will be pretty confused.

I would do:

	if grep -q suse /etc/os-release; then
		ROD modprobe --allow-unsupported mpls_router
	else
		ROD modprobe mpls_router
	fi

(nit: better to put the option before the module name.)

With this, you can put in the next version:
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

> +	fi
>  }

>  test1()

[1] https://build.opensuse.org/projects/Base:System/packages/kmod/files/0002-modprobe-Recognize-allow-unsupported-modules-on-comm.patch?expand=1

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

  reply	other threads:[~2024-08-30 10:39 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 [this message]
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
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=20240830103835.GA42409@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=wegao@suse.com \
    /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.