File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
tools/testing/selftests/livepatch Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -61,4 +61,38 @@ livepatch: '$MOD_LIVEPATCH': unpatching complete
61
61
% rmmod $MOD_LIVEPATCH "
62
62
63
63
64
+ # - verify livepatch can load
65
+ # - check if traces have a patched function
66
+ # - reset trace and unload livepatch
67
+
68
+ start_test " trace livepatched function and check that the live patch remains in effect"
69
+
70
+ FUNCTION_NAME=" livepatch_cmdline_proc_show"
71
+
72
+ load_lp $MOD_LIVEPATCH
73
+ trace_function " $FUNCTION_NAME "
74
+
75
+ if [[ " $( cat /proc/cmdline) " == " $MOD_LIVEPATCH : this has been live patched" ]] ; then
76
+ log " livepatch: ok"
77
+ fi
78
+
79
+ check_traced_functions " $FUNCTION_NAME "
80
+
81
+ disable_lp $MOD_LIVEPATCH
82
+ unload_lp $MOD_LIVEPATCH
83
+
84
+ check_result " % insmod test_modules/$MOD_LIVEPATCH .ko
85
+ livepatch: enabling patch '$MOD_LIVEPATCH '
86
+ livepatch: '$MOD_LIVEPATCH ': initializing patching transition
87
+ livepatch: '$MOD_LIVEPATCH ': starting patching transition
88
+ livepatch: '$MOD_LIVEPATCH ': completing patching transition
89
+ livepatch: '$MOD_LIVEPATCH ': patching complete
90
+ livepatch: ok
91
+ % echo 0 > $SYSFS_KLP_DIR /$MOD_LIVEPATCH /enabled
92
+ livepatch: '$MOD_LIVEPATCH ': initializing unpatching transition
93
+ livepatch: '$MOD_LIVEPATCH ': starting unpatching transition
94
+ livepatch: '$MOD_LIVEPATCH ': completing unpatching transition
95
+ livepatch: '$MOD_LIVEPATCH ': unpatching complete
96
+ % rmmod $MOD_LIVEPATCH "
97
+
64
98
exit 0
You can’t perform that action at this time.
0 commit comments