[LTP] [PATCH v1] mpls01.sh: Add --allow-unsupported for modprobe

Petr Vorel pvorel@suse.cz
Fri Aug 30 12:38:35 CEST 2024


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


More information about the ltp mailing list