[LTP] [PATCH] locking/lock_torture: accept optional "[debug]" in result string
Vincent Chen
vincent.chen@sifive.com
Wed Jan 14 11:18:34 CET 2026
lock_torture.sh parses the lock_torture result from dmesg by
matching the "End of test: <RESULT>:" line.
When the kernel is built with lock debugging enabled (e.g.
CONFIG_DEBUG_MUTEXES, CONFIG_DEBUG_RT_MUTEXES, CONFIG_DEBUG_SPINLOCK),
lock_torture may print "End of test: SUCCESS [debug]: ...".
The current regexp expects "SUCCESS:" and fails to match, causing the
test to be reported as failure.
Allow an optional " [debug]" token between the result string and the
colon so the test can correctly detect SUCCESS on debug kernels.
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
---
testcases/kernel/device-drivers/locking/lock_torture.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/device-drivers/locking/lock_torture.sh b/testcases/kernel/device-drivers/locking/lock_torture.sh
index dfa57373f..d9bd95da2 100755
--- a/testcases/kernel/device-drivers/locking/lock_torture.sh
+++ b/testcases/kernel/device-drivers/locking/lock_torture.sh
@@ -83,7 +83,7 @@ for type in $lock_type; do
tst_brkm TBROK "failed to unload module"
# check module status in dmesg
- result_str=`dmesg | sed -nE '$s/.*End of test: ([A-Z]+):.*/\1/p'`
+ result_str=`dmesg | sed -nE '$s/.*End of test: ([A-Z]+)([[:space:]]+\[debug\])?:.*/\1/p'`
if [ "$result_str" = "SUCCESS" ]; then
tst_resm TPASS "$type: completed"
else
--
2.34.1
More information about the ltp
mailing list