mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
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: 2766a11161 ("selftests: rtnetlink: add ipsec offload API test")
Signed-off-by: Xiumei Mu <xmu@redhat.com>
Reviewed-by: Shannon Nelson <sln@onemain.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://patch.msgid.link/6d3a1d777c4de4eb0ca94ced9e77be8d48c5b12f.1753415428.git.xmu@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
002f79a5f0
commit
5b32321fda
|
|
@ -720,6 +720,11 @@ kci_test_ipsec_offload()
|
|||
sysfsf=$sysfsd/ipsec
|
||||
sysfsnet=/sys/bus/netdevsim/devices/netdevsim0/net/
|
||||
probed=false
|
||||
esp4_offload_probed_default=false
|
||||
|
||||
if lsmod | grep -q esp4_offload; then
|
||||
esp4_offload_probed_default=true
|
||||
fi
|
||||
|
||||
if ! mount | grep -q debugfs; then
|
||||
mount -t debugfs none /sys/kernel/debug/ &> /dev/null
|
||||
|
|
@ -813,6 +818,7 @@ EOF
|
|||
fi
|
||||
|
||||
# clean up any leftovers
|
||||
! "$esp4_offload_probed_default" && lsmod | grep -q esp4_offload && rmmod esp4_offload
|
||||
echo 0 > /sys/bus/netdevsim/del_device
|
||||
$probed && rmmod netdevsim
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user