Skip to content

Commit 5b32321

Browse files
xmmukuba-moo
authored andcommitted
selftests: rtnetlink.sh: remove esp4_offload after test
The esp4_offload module, loaded during IPsec offload tests, should be reset to its default settings after testing. Otherwise, leaving it enabled could unintentionally affect subsequence test cases by keeping offload active. Without this fix: $ lsmod | grep offload; ./rtnetlink.sh -t kci_test_ipsec_offload ; lsmod | grep offload; PASS: ipsec_offload esp4_offload 12288 0 esp4 32768 1 esp4_offload With this fix: $ lsmod | grep offload; ./rtnetlink.sh -t kci_test_ipsec_offload ; lsmod | grep offload; PASS: ipsec_offload Fixes: 2766a11 ("selftests: rtnetlink: add ipsec offload API test") Signed-off-by: Xiumei Mu <[email protected]> Reviewed-by: Shannon Nelson <[email protected]> Reviewed-by: Hangbin Liu <[email protected]> Link: https://patch.msgid.link/6d3a1d777c4de4eb0ca94ced9e77be8d48c5b12f.1753415428.git.xmu@redhat.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 002f79a commit 5b32321

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/testing/selftests/net/rtnetlink.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,11 @@ kci_test_ipsec_offload()
720720
sysfsf=$sysfsd/ipsec
721721
sysfsnet=/sys/bus/netdevsim/devices/netdevsim0/net/
722722
probed=false
723+
esp4_offload_probed_default=false
724+
725+
if lsmod | grep -q esp4_offload; then
726+
esp4_offload_probed_default=true
727+
fi
723728

724729
if ! mount | grep -q debugfs; then
725730
mount -t debugfs none /sys/kernel/debug/ &> /dev/null
@@ -813,6 +818,7 @@ EOF
813818
fi
814819

815820
# clean up any leftovers
821+
! "$esp4_offload_probed_default" && lsmod | grep -q esp4_offload && rmmod esp4_offload
816822
echo 0 > /sys/bus/netdevsim/del_device
817823
$probed && rmmod netdevsim
818824

0 commit comments

Comments
 (0)