summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/runtime/cases/ksample.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/meta/lib/oeqa/runtime/cases/ksample.py b/meta/lib/oeqa/runtime/cases/ksample.py
index 260bc3cfbd..26fbe9d8cb 100644
--- a/meta/lib/oeqa/runtime/cases/ksample.py
+++ b/meta/lib/oeqa/runtime/cases/ksample.py
@@ -18,7 +18,8 @@ class KSample(OERuntimeTestCase):
18 else: 18 else:
19 # check result 19 # check result
20 result = ("%s" % match_string) in output 20 result = ("%s" % match_string) in output
21 self.assertTrue(result) 21 msg = output
22 self.assertTrue(result, msg)
22 self.assertEqual(status, 0, cmd) 23 self.assertEqual(status, 0, cmd)
23 24
24 def check_config(self, config_opt=''): 25 def check_config(self, config_opt=''):
@@ -126,7 +127,16 @@ class KSampleTest(KSample):
126 self.cmd_and_check("echo 1 > /sys/kernel/debug/tracing/events/sample-trace/enable") 127 self.cmd_and_check("echo 1 > /sys/kernel/debug/tracing/events/sample-trace/enable")
127 self.cmd_and_check("cat /sys/kernel/debug/tracing/events/sample-trace/enable") 128 self.cmd_and_check("cat /sys/kernel/debug/tracing/events/sample-trace/enable")
128 # check result 129 # check result
129 self.cmd_and_check("cat /sys/kernel/debug/tracing/trace | grep hello | head -n1 | cut -d\':\' -f2", " foo_bar") 130 status = 1
131 count = 0
132 while status != 0:
133 time.sleep(1)
134 status, output = self.target.run('cat /sys/kernel/debug/tracing/trace | grep hello | head -n1 | cut -d\':\' -f2')
135 if " foo_bar" in output:
136 break
137 count = count + 1
138 if count > 5:
139 self.assertTrue(False, "Time out when check result")
130 # disable trace 140 # disable trace
131 self.cmd_and_check("echo 0 > /sys/kernel/debug/tracing/events/sample-trace/enable") 141 self.cmd_and_check("echo 0 > /sys/kernel/debug/tracing/events/sample-trace/enable")
132 # clean up trace 142 # clean up trace