Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Matthew" <matthew.zeng@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Cc: Randy MacLeod <randy.macleod@windriver.com>
Subject: ltp.py: compare dmesg before and after test
Date: Fri, 24 Jul 2020 13:05:45 -0400	[thread overview]
Message-ID: <87tuxzl6ww.fsf@windriver.com> (raw)

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

                 reply	other threads:[~2020-07-24 17:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tuxzl6ww.fsf@windriver.com \
    --to=matthew.zeng@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=randy.macleod@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox