Some systems might disable unloading a livepatch and when running tests on
them they fail like the following:

$ ./run_kselftest.sh -c livepatch
  TAP version 13
  1..8
  # selftests: livepatch: test-livepatch.sh
  # TEST: basic function patching ... not ok
  #
  # --- expected
  # +++ result
  # @@ -5,6 +5,7 @@ livepatch: 'test_klp_livepatch': starting
  #  livepatch: 'test_klp_livepatch': completing patching transition
  #  livepatch: 'test_klp_livepatch': patching complete
  #  % echo 0 > /sys/kernel/livepatch/test_klp_livepatch/enabled
  # +livepatch: attempt to disable live patch test_klp_livepatch, setting
  NO_SUPPORT taint flag
  #  livepatch: 'test_klp_livepatch': initializing unpatching transition
  #  livepatch: 'test_klp_livepatch': starting unpatching transition
  #  livepatch: 'test_klp_livepatch': completing unpatching transition
  #
  # ERROR: livepatch kselftest(s) failed

Cc: Marcos Paulo de Souza <mpdeso...@suse.com>
Signed-off-by: Ricardo B. Marlière <r...@suse.com>
---
 tools/testing/selftests/livepatch/functions.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/livepatch/functions.sh 
b/tools/testing/selftests/livepatch/functions.sh
index 
46991a029f7c64ace3945727b3540521ffe2e529..13fc289962cdd77c9fc4eaf1ad336775d6db710d
 100644
--- a/tools/testing/selftests/livepatch/functions.sh
+++ b/tools/testing/selftests/livepatch/functions.sh
@@ -321,6 +321,7 @@ function check_result {
        result=$(dmesg | awk -v last_dmesg="$LAST_DMESG" 'p; $0 == last_dmesg { 
p=1 }' | \
                 grep -e 'livepatch:' -e 'test_klp' | \
                 grep -v '\(tainting\|taints\) kernel' | \
+                grep -v 'setting NO_SUPPORT taint flag' | \
                 sed 's/^\[[ 0-9.]*\] //' | \
                 sed 's/^\[[ ]*[CT][0-9]*\] //')
 

---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250819-selftests-lp_taint_flag-c96f5b9b2ed9

Best regards,
-- 
Ricardo B. Marlière <r...@suse.com>


Reply via email to