Openembedded Core Discussions
 help / color / mirror / Atom feed
* ltp.py: compare dmesg before and after test
@ 2020-07-24 17:05 Matthew
  0 siblings, 0 replies; only message in thread
From: Matthew @ 2020-07-24 17:05 UTC (permalink / raw)
  To: openembedded-core; +Cc: Randy MacLeod

Hi,

I'm working on bugzilla 13802 by removing OOM killer test execution.

Randy was suggesting before running ltp, we should clear the dmesg ring buffer, run the test, and then collect dmesg ring buffer again afterwards.

Initially we would only print out the log, we could decide that a non-empty string indicating an error. Does this make sense for ltp and does it make sense to do it for each oeqa test?

This is entirely a proof-of-concept draft patch, any tips on where to insert dmesg clear and collect code would be greatly appreciated.

FYI: we've also considered adding a configure option (ie. --without-oom) to ltp that prevents the OOM tests (ltp/testcases/kernel/mem/oom) from compiling entirely. I talked with the upstream, and they suggested just skipping these tests using:
    runltp -S SKIPFILE     Skip tests specified in SKIPFILE

Signed-off-by: Mingde (Matthew) Zeng <matthewzmd@gmail.com>
---
 meta/lib/oeqa/runtime/cases/ltp.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/lib/oeqa/runtime/cases/ltp.py b/meta/lib/oeqa/runtime/cases/ltp.py
index 6dc5ef22ad..1e90df2086 100644
--- a/meta/lib/oeqa/runtime/cases/ltp.py
+++ b/meta/lib/oeqa/runtime/cases/ltp.py
@@ -65,11 +65,22 @@ class LtpTest(LtpTestBase):
     ltp_groups += ltp_fs

     def runltp(self, ltp_group):
+            (status, dmesg_c_output) = self.target.run("dmesg -c")
+            print("dmesg -c output:")
+            print(dmesg_c_output)
+
             cmd = '/opt/ltp/runltp -f %s -p -q -r /opt/ltp -l /opt/ltp/results/%s -I 1 -d /opt/ltp' % (ltp_group, ltp_group)
             starttime = time.time()
             (status, output) = self.target.run(cmd)
             endtime = time.time()

+            (status, output) = self.target.run("stat /proc/sysrq-trigger && echo f > /proc/sysrq-trigger || echo '/proc/sysrq-trigger does not exist'")
+            if output != '/proc/sysrq-trigger does not exist':
+                (status, dmesg_output) = self.target.run("dmesg")
+                print("dmesg output:")
+                print(dmesg_output)
+                self.assertEqual(dmesg_c_output, dmesg_output)
+
             with open(os.path.join(self.ltptest_log_dir, "%s-raw.log" % ltp_group), 'w') as f:
                 f.write(output)

--
2.27.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-24 17:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-24 17:05 ltp.py: compare dmesg before and after test Matthew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox