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

Wei Gao wegao@suse.com
Fri Aug 30 11:57:58 CEST 2024


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
+	fi
 }
 
 test1()
-- 
2.35.3



More information about the ltp mailing list