[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240216152846.1850120-7-aconole@redhat.com>
Date: Fri, 16 Feb 2024 10:28:45 -0500
From: Aaron Conole <aconole@...hat.com>
To: netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Pravin B Shelar <pshelar@....org>,
dev@...nvswitch.org,
Ilya Maximets <i.maximets@....org>,
Simon Horman <horms@....org>,
Eelco Chaudron <echaudro@...hat.com>,
Shuah Khan <shuah@...nel.org>,
linux-kselftest@...r.kernel.org
Subject: [RFC 6/7] selftests: openvswitch: insert module when running the tests
The openvswitch tests do not attempt to insert the openvswitch module
automatically. Now the test will auto load the module and try to
unload it at the end. The test harness includes the option to not
load the module, which is helpful when developing changes and loading
the module from a different location.
Signed-off-by: Aaron Conole <aconole@...hat.com>
---
.../testing/selftests/net/openvswitch/openvswitch.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools/testing/selftests/net/openvswitch/openvswitch.sh
index a2c106104fb8..e7c9b4fc5591 100755
--- a/tools/testing/selftests/net/openvswitch/openvswitch.sh
+++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh
@@ -672,12 +672,14 @@ run_test() {
exitcode=0
desc=0
all_skipped=true
+LOAD_MOD=yes
while getopts :pvt o
do
case $o in
p) PAUSE_ON_FAIL=yes;;
v) VERBOSE=1;;
+ n) LOAD_MOD=no;;
t) if which tcpdump > /dev/null 2>&1; then
TRACING=1
else
@@ -697,6 +699,10 @@ for arg do
command -v > /dev/null "test_${arg}" || { echo "=== Test ${arg} not found"; usage; }
done
+if [ "$LOAD_MOD" == "yes" ]; then
+ modprobe openvswitch
+fi
+
name=""
desc=""
for t in ${tests}; do
@@ -716,4 +722,9 @@ for t in ${tests}; do
desc=""
done
+
+if [ "$LOAD_MOD" == "yes" ]; then
+ modprobe -r openvswitch
+fi
+
exit ${exitcode}
--
2.41.0
Powered by blists - more mailing lists