tmt
tmt copied to clipboard
Enhancement: Add tmt check for kmemleak
We are attempting to automate testing on a debug kernel and want to incorporate triggering a kmemleak scan at the end of each test. If there is memleak detected then save the trace cat /sys/kernel/debug/kmemlek > $TMT_PLAN_DATA/some_file.log
or any location tmt decides is best.
After reading about tmt.check functions I thought this would be a great next step.
So for each test, as with dmesg, we clear at the start:
echo clear > /sys/kernel/debug/kmemleak
Scan at the end:
echo scan > /sys/kernel/debug/kmemleak
(should happen before capturing dmesg)
Capture contents of kmemleak as mentioned above. This file maybe empty.
See https://www.kernel.org/doc/html/latest/dev-tools/kmemleak.html
It is essential we get this process automated and this tmt module seems like the right fit for it.
cc: @thrix