[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241121111135.2125391-5-dongtai.guo@linux.dev>
Date: Thu, 21 Nov 2024 19:11:34 +0800
From: George Guo <dongtai.guo@...ux.dev>
To: jpoimboe@...nel.org,
jikos@...nel.org,
mbenes@...e.cz,
pmladek@...e.com,
joe.lawrence@...hat.com,
shuah@...nel.org
Cc: live-patching@...r.kernel.org,
linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org,
George Guo <guodongtai@...inos.cn>
Subject: [PATCH livepatch/master v1 5/6] selftests/livepatch: fix test-syscall.sh execution error
From: George Guo <guodongtai@...inos.cn>
The script test-syscall.sh fails with the following error:
$ sudo ./test-syscall.sh
TEST: patch getpid syscall while being heavily hammered ... not ok
- expected
+ result
% insmod test_modules/test_klp_syscall.ko klp_pids=18484,18485,18486,18487,18488,18489,18490,...
livepatch: enabling patch 'test_klp_syscall'
-livepatch: 'test_klp_syscall': initializing patching transition
-livepatch: 'test_klp_syscall': starting patching transition
-livepatch: 'test_klp_syscall': completing patching transition
-livepatch: 'test_klp_syscall': patching complete
+transition: 'test_klp_syscall': initializing patching transition
+transition: 'test_klp_syscall': starting patching transition
+transition: 'test_klp_syscall': completing patching transition
+transition: 'test_klp_syscall': patching complete
test_klp_syscall: Remaining not livepatched processes: 0
% echo 0 > /sys/kernel/livepatch/test_klp_syscall/enabled
-livepatch: 'test_klp_syscall': initializing unpatching transition
-livepatch: 'test_klp_syscall': starting unpatching transition
-livepatch: 'test_klp_syscall': completing unpatching transition
-livepatch: 'test_klp_syscall': unpatching complete
+transition: 'test_klp_syscall': initializing unpatching transition
+transition: 'test_klp_syscall': starting unpatching transition
+transition: 'test_klp_syscall': completing unpatching transition
+transition: 'test_klp_syscall': unpatching complete
% rmmod test_klp_syscall
ERROR: livepatch kselftest(s) failed
The issue arises due to a mismatch in expected log output during livepatch
transition. Specifically, the logs previously contained "livepatch:" but have
now been updated to "transition:". This results in test failures when comparing
the output with the expected values.
This patch updates the expected test output to reflect the new log format.
Signed-off-by: George Guo <guodongtai@...inos.cn>
---
.../testing/selftests/livepatch/test-syscall.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/testing/selftests/livepatch/test-syscall.sh b/tools/testing/selftests/livepatch/test-syscall.sh
index 289eb7d4c4b3..6493e1115add 100755
--- a/tools/testing/selftests/livepatch/test-syscall.sh
+++ b/tools/testing/selftests/livepatch/test-syscall.sh
@@ -41,16 +41,16 @@ unload_lp $MOD_SYSCALL
check_result "% insmod test_modules/$MOD_SYSCALL.ko klp_pids=$pid_list
livepatch: enabling patch '$MOD_SYSCALL'
-livepatch: '$MOD_SYSCALL': initializing patching transition
-livepatch: '$MOD_SYSCALL': starting patching transition
-livepatch: '$MOD_SYSCALL': completing patching transition
-livepatch: '$MOD_SYSCALL': patching complete
+transition: '$MOD_SYSCALL': initializing patching transition
+transition: '$MOD_SYSCALL': starting patching transition
+transition: '$MOD_SYSCALL': completing patching transition
+transition: '$MOD_SYSCALL': patching complete
$MOD_SYSCALL: Remaining not livepatched processes: 0
% echo 0 > /sys/kernel/livepatch/$MOD_SYSCALL/enabled
-livepatch: '$MOD_SYSCALL': initializing unpatching transition
-livepatch: '$MOD_SYSCALL': starting unpatching transition
-livepatch: '$MOD_SYSCALL': completing unpatching transition
-livepatch: '$MOD_SYSCALL': unpatching complete
+transition: '$MOD_SYSCALL': initializing unpatching transition
+transition: '$MOD_SYSCALL': starting unpatching transition
+transition: '$MOD_SYSCALL': completing unpatching transition
+transition: '$MOD_SYSCALL': unpatching complete
% rmmod $MOD_SYSCALL"
exit 0
--
2.39.2
Powered by blists - more mailing lists