Enable cyclictest:
 - test execute cyclictest, retrieve the maximum latency captured inside log 
and compare it to the
   target latency
 - cyclictest arguments based on public cyclictest arguments used for intel 
corei7
   
https://www.osadl.org/Latency-plot-of-system-in-rack-9-slot.qa-latencyplot-r9s5.0.html?shadow=1
 - set default target latency based on 24 us (captured from public cyclictest 
execution) multiple
   by 1.2 (buffer)
 - enable user defined target latency by configuring 'RTKERNEL_TARGET_LATENCY' 
as bitbake config
   example, inside local.conf: RTKERNEL_TARGET_LATENCY = "25"

Signed-off-by: Yeoh Ee Peng <[email protected]>
---
 lib/oeqa/runtime/cases/cyclictest.py | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 lib/oeqa/runtime/cases/cyclictest.py

diff --git a/lib/oeqa/runtime/cases/cyclictest.py 
b/lib/oeqa/runtime/cases/cyclictest.py
new file mode 100644
index 0000000..244e97d
--- /dev/null
+++ b/lib/oeqa/runtime/cases/cyclictest.py
@@ -0,0 +1,36 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.runtime.decorator.package import OEHasPackage
+import os
+import subprocess
+import datetime
+
+class CyclicTest(OERuntimeTestCase):
+
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_cyclic(self):
+        status, __ = self.target.run('which cyclictest')
+        if status:
+            self.skipTest("Cyclictest package are not installed in the image.")
+        # Cyclictest command and argument based on public setup for Intel(R) 
Core(TM) i7-6700
+        # 
https://www.osadl.org/Latency-plot-of-system-in-rack-9-slot.qa-latencyplot-r9s5.0.html?shadow=1
+        # Command line: cyclictest -l100000000 -m -Sp99 -i200 -h400 -q
+        status, output = self.target.run('cyclictest -l100000000 -m -Sp99 
-i200 -h400')
+        test_log_dir = self.td.get('TEST_LOG_DIR', '')
+        if not test_log_dir:
+            test_log_dir = os.path.join(self.td.get('WORKDIR', ''), 
'testimage')
+        cyclic_log_dir = os.path.join(test_log_dir, '%s.%s' % ('cyclic_test', 
datetime.datetime.now().strftime('%Y%m%d%H%M%S')))
+        os.makedirs(cyclic_log_dir)
+        log_path = os.path.join(cyclic_log_dir, 'cyclic_log')
+        with open(log_path, 'w') as f:
+            f.write(output)
+        max_latency = subprocess.check_output(('grep "Max Latencies" %s | tr " 
" "\n" | sort -n | tail -1 | sed s/^0*//') % log_path, shell=True).strip()
+        max_latency = int(max_latency)
+        # Default target latency based on max latency (24us) captured at 
public execution multiple by 1.2 (buffer) 
+        # 
https://www.osadl.org/Latency-plot-of-system-in-rack-9-slot.qa-latencyplot-r9s5.0.html?shadow=1
+        target_latency = 1.2*24
+        user_defined_target_latency = self.tc.td.get("RTKERNEL_TARGET_LATENCY")
+        if user_defined_target_latency:
+            target_latency = int(user_defined_target_latency)
+        self.assertTrue(max_latency < target_latency,
+                        msg="Max latency (%sus) is greater than target 
(%sus)." % (max_latency, target_latency))
-- 
2.7.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#6450): 
https://lists.yoctoproject.org/g/meta-intel/message/6450
Mute This Topic: https://lists.yoctoproject.org/mt/72670038/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to