Skip to content

Commit 256b91a

Browse files
author
CKI Backport Bot
committed
selftests: rtnetlink.sh: remove esp4_offload after test
JIRA: https://issues.redhat.com/browse/RHEL-115594 commit 5b32321 Author: Xiumei Mu <xmu@redhat.com> Date: Fri Jul 25 11:50:28 2025 +0800 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 <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> Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
1 parent 29a25ba commit 256b91a

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
@@ -673,6 +673,11 @@ kci_test_ipsec_offload()
673673
sysfsf=$sysfsd/ipsec
674674
sysfsnet=/sys/bus/netdevsim/devices/netdevsim0/net/
675675
probed=false
676+
esp4_offload_probed_default=false
677+
678+
if lsmod | grep -q esp4_offload; then
679+
esp4_offload_probed_default=true
680+
fi
676681

677682
if ! mount | grep -q debugfs; then
678683
mount -t debugfs none /sys/kernel/debug/ &> /dev/null
@@ -766,6 +771,7 @@ EOF
766771
fi
767772

768773
# clean up any leftovers
774+
! "$esp4_offload_probed_default" && lsmod | grep -q esp4_offload && rmmod esp4_offload
769775
echo 0 > /sys/bus/netdevsim/del_device
770776
$probed && rmmod netdevsim
771777

0 commit comments

Comments
 (0)