]> Git Repo - linux.git/commitdiff
selftests/livepatch: normalize sysctl error message
authorJoe Lawrence <[email protected]>
Thu, 11 Aug 2022 21:21:38 +0000 (17:21 -0400)
committerPetr Mladek <[email protected]>
Fri, 23 Sep 2022 13:16:48 +0000 (15:16 +0200)
The livepatch kselftests rely on comparing expected and actual output
from such commands as sysctl.  A recent commit in procps-ng v4.0.0 [1]
changed sysctl's output to emit key pathnames like:

  sysctl: setting key "/proc/sys/kernel/ftrace_enabled": Device or resource busy

versus previous dotted output:

  sysctl: setting key "kernel.ftrace_enabled": Device or resource busy

The modification in output was later reverted [2], but since the change
has been tagged in procps-ng v4.0.0, update the livepatch kselftest to
handle either case.

[1] https://gitlab.com/procps-ng/procps/-/commit/6389deca5bf667f5fab5912acde78ba8e0febbc7
[2] https://gitlab.com/procps-ng/procps/-/commit/b159c198c9160a8eb13254e2b631d0035b9b542c

Reported-by: Dennis(Zhuoheng) Li <[email protected]>
Signed-off-by: Joe Lawrence <[email protected]>
Reviewed-by: Kamalesh Babulal <[email protected]>
Signed-off-by: Petr Mladek <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
tools/testing/selftests/livepatch/functions.sh

index 9230b869371d951f33d2286690708889a7e86f92..d5001c9eb72eb57a5cd5d45b5efd89e08a3978b5 100644 (file)
@@ -86,7 +86,7 @@ function set_ftrace_enabled() {
 
        if [[ "$result" != "$1" ]] ; then
                if [[ $can_fail -eq 1 ]] ; then
-                       echo "livepatch: $err" > /dev/kmsg
+                       echo "livepatch: $err" | sed 's#/proc/sys/kernel/#kernel.#' > /dev/kmsg
                        return
                fi
 
This page took 0.048216 seconds and 4 git commands to generate.