public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v6] mpls01: Add --allow-unsupported for modprobe(fixing all mpls cases)
Date: Wed,  4 Sep 2024 02:56:53 -0400	[thread overview]
Message-ID: <20240904065653.31086-1-wegao@suse.com> (raw)
In-Reply-To: <20240904064817.29813-1-wegao@suse.com>

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>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/network/mpls/mpls01.sh   |  4 ++--
 testcases/network/mpls/mpls_lib.sh | 12 +++++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/testcases/network/mpls/mpls01.sh b/testcases/network/mpls/mpls01.sh
index 196b5b2f9..e453f8130 100755
--- a/testcases/network/mpls/mpls01.sh
+++ b/testcases/network/mpls/mpls01.sh
@@ -21,7 +21,7 @@ cleanup()
 
 setup()
 {
-	ROD modprobe mpls_router
+	mpls_setup_driver
 }
 
 test1()
@@ -66,5 +66,5 @@ test3()
 	tst_res TPASS "created and removed mpls routes"
 }
 
-. tst_net.sh
+. mpls_lib.sh
 tst_run
diff --git a/testcases/network/mpls/mpls_lib.sh b/testcases/network/mpls/mpls_lib.sh
index 380b568bb..3c63e16a7 100755
--- a/testcases/network/mpls/mpls_lib.sh
+++ b/testcases/network/mpls/mpls_lib.sh
@@ -33,11 +33,21 @@ mpls_virt_cleanup()
 	mpls_cleanup
 }
 
+mpls_setup_driver()
+{
+	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
+}
+
 mpls_setup()
 {
 	local label="$1"
 
-	tst_net_run -s "modprobe -a $TST_NEEDS_DRIVERS"
+	mpls_setup_driver
 
 	ROD sysctl -q net.mpls.conf.$(tst_iface).input=1
 	tst_set_sysctl net.mpls.conf.lo.input 1 safe
-- 
2.35.3


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

  reply	other threads:[~2024-09-04  6:57 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
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         ` Wei Gao via ltp [this message]
2024-09-05  5:12           ` [LTP] [PATCH v6] mpls01: Add --allow-unsupported for modprobe(fixing all mpls cases) 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=20240904065653.31086-1-wegao@suse.com \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox