diff mbox series

[livepatch/master,v1,1/2] selftests/livepatch: Replace hardcoded path with variable in test-syscall.sh

Message ID 20241125112812.281018-1-dongtai.guo@linux.dev
State New
Headers show
Series [livepatch/master,v1,1/2] selftests/livepatch: Replace hardcoded path with variable in test-syscall.sh | expand

Commit Message

George Guo Nov. 25, 2024, 11:28 a.m. UTC
From: George Guo <guodongtai@kylinos.cn>

Updated test-syscall.sh to replace the path 
/sys/kernel/test_klp_syscall/npids with a variable $MOD_SYSCALL.

Signed-off-by: George Guo <guodongtai@kylinos.cn>
---
 tools/testing/selftests/livepatch/test-syscall.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Petr Mladek Nov. 26, 2024, 1:08 p.m. UTC | #1
On Mon 2024-11-25 19:28:11, George Guo wrote:
> From: George Guo <guodongtai@kylinos.cn>
> 
> Updated test-syscall.sh to replace the path 
> /sys/kernel/test_klp_syscall/npids with a variable $MOD_SYSCALL.
> 
> Signed-off-by: George Guo <guodongtai@kylinos.cn>

This has already been fixed by the commit 59766286b6e54f8ad33
("selftests: livepatch: save and restore kprobe state").
The change reached the mainline last week during the merge window
for 6.13.

Best Regards,
Petr
Petr Mladek Nov. 26, 2024, 1:18 p.m. UTC | #2
On Mon 2024-11-25 19:28:12, George Guo wrote:
> From: George Guo <guodongtai@kylinos.cn>
> 
> Replaced the hardcoded module name test_klp_callbacks_demo in the
> pre_patch_callback log message with the variable $MOD_LIVEPATCH.
> 
> Signed-off-by: George Guo <guodongtai@kylinos.cn>

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr
diff mbox series

Patch

diff --git a/tools/testing/selftests/livepatch/test-syscall.sh b/tools/testing/selftests/livepatch/test-syscall.sh
index b76a881d4..9cfa17b6b 100755
--- a/tools/testing/selftests/livepatch/test-syscall.sh
+++ b/tools/testing/selftests/livepatch/test-syscall.sh
@@ -24,9 +24,9 @@  pid_list=$(echo ${pids[@]} | tr ' ' ',')
 load_lp $MOD_SYSCALL klp_pids=$pid_list
 
 # wait for all tasks to transition to patched state
-loop_until 'grep -q '^0$' /sys/kernel/test_klp_syscall/npids'
+loop_until 'grep -q '^0$' /sys/kernel/$MOD_SYSCALL/npids'
 
-pending_pids=$(cat /sys/kernel/test_klp_syscall/npids)
+pending_pids=$(cat /sys/kernel/$MOD_SYSCALL/npids)
 log "$MOD_SYSCALL: Remaining not livepatched processes: $pending_pids"
 
 for pid in ${pids[@]}; do