summaryrefslogtreecommitdiffstats
path: root/lib/oeqa/runtime/cases
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oeqa/runtime/cases')
-rw-r--r--lib/oeqa/runtime/cases/cyclictest.py39
-rw-r--r--lib/oeqa/runtime/cases/dldt_inference_engine.py109
-rw-r--r--lib/oeqa/runtime/cases/dldt_model_optimizer.py38
-rw-r--r--lib/oeqa/runtime/cases/intel_mediasdk.py34
-rw-r--r--lib/oeqa/runtime/cases/intel_vaapi_driver.py27
-rw-r--r--lib/oeqa/runtime/cases/isal.py24
-rw-r--r--lib/oeqa/runtime/cases/libipt.py23
-rw-r--r--lib/oeqa/runtime/cases/libxcam.py37
-rw-r--r--lib/oeqa/runtime/cases/microcode.py31
-rw-r--r--lib/oeqa/runtime/cases/mkl_dnn.py67
-rw-r--r--lib/oeqa/runtime/cases/parselogs-ignores-intel-core2-32.txt9
-rw-r--r--lib/oeqa/runtime/cases/parselogs-ignores-intel-corei7-64.txt14
-rw-r--r--lib/oeqa/runtime/cases/thermald.py47
13 files changed, 499 insertions, 0 deletions
diff --git a/lib/oeqa/runtime/cases/cyclictest.py b/lib/oeqa/runtime/cases/cyclictest.py
new file mode 100644
index 00000000..8890651a
--- /dev/null
+++ b/lib/oeqa/runtime/cases/cyclictest.py
@@ -0,0 +1,39 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.core.decorator.depends import OETestDepends
3from oeqa.runtime.decorator.package import OEHasPackage
4import os
5import subprocess
6import datetime
7
8class CyclicTest(OERuntimeTestCase):
9
10 @OEHasPackage(['rt-tests'])
11 @OETestDepends(['ssh.SSHTest.test_ssh'])
12 def test_cyclic(self):
13 # Cyclictest command and argument based on public setup for Intel(R) Core(TM) i7-6700
14 # https://www.osadl.org/Latency-plot-of-system-in-rack-9-slot.qa-latencyplot-r9s5.0.html?shadow=1
15 # Command line: cyclictest -l100000000 -m -Sp99 -i200 -h400 -q
16 status, output = self.target.run('cyclictest -l100000000 -m -Sp99 -i200 -h400')
17 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
18 test_log_dir = self.td.get('TEST_LOG_DIR', '')
19
20 if not test_log_dir:
21 test_log_dir = os.path.join(self.td.get('WORKDIR', ''), 'testimage')
22
23 cyclic_log_dir = os.path.join(test_log_dir, '%s.%s' % ('cyclic_test', datetime.datetime.now().strftime('%Y%m%d%H%M%S')))
24 os.makedirs(cyclic_log_dir)
25 log_path = os.path.join(cyclic_log_dir, 'cyclic_log')
26 with open(log_path, 'w') as f:
27 f.write(output)
28
29 max_latency = subprocess.check_output(('grep "Max Latencies" %s | tr " " "\n" | sort -n | tail -1 | sed s/^0*//') % log_path, shell=True).strip()
30 max_latency = int(max_latency)
31
32 # Default target latency based on max latency (24us) captured at public execution multiple by 1.2 (20% buffer)
33 # https://www.osadl.org/Latency-plot-of-system-in-rack-9-slot.qa-latencyplot-r9s5.0.html?shadow=1
34 target_latency = 1.2*24
35 user_defined_target_latency = self.tc.td.get("RTKERNEL_TARGET_LATENCY")
36 if user_defined_target_latency:
37 target_latency = int(user_defined_target_latency)
38 self.assertTrue(max_latency < target_latency,
39 msg="Max latency (%sus) is greater than target (%sus)." % (max_latency, target_latency))
diff --git a/lib/oeqa/runtime/cases/dldt_inference_engine.py b/lib/oeqa/runtime/cases/dldt_inference_engine.py
new file mode 100644
index 00000000..fb35d52f
--- /dev/null
+++ b/lib/oeqa/runtime/cases/dldt_inference_engine.py
@@ -0,0 +1,109 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.runtime.decorator.package import OEHasPackage
3from oeqa.core.decorator.depends import OETestDepends
4from oeqa.runtime.miutils.targets.oeqatarget import OEQATarget
5from oeqa.runtime.miutils.tests.squeezenet_model_download_test import SqueezenetModelDownloadTest
6from oeqa.runtime.miutils.tests.dldt_model_optimizer_test import DldtModelOptimizerTest
7from oeqa.runtime.miutils.tests.dldt_inference_engine_test import DldtInferenceEngineTest
8from oeqa.runtime.miutils.dldtutils import get_testdata_config
9
10class DldtInferenceEngine(OERuntimeTestCase):
11
12 @classmethod
13 def setUpClass(cls):
14 cls.sqn_download = SqueezenetModelDownloadTest(OEQATarget(cls.tc.target), '/tmp/ie/md')
15 cls.sqn_download.setup()
16 cls.dldt_mo = DldtModelOptimizerTest(OEQATarget(cls.tc.target), '/tmp/ie/ir')
17 cls.dldt_mo.setup()
18 cls.dldt_ie = DldtInferenceEngineTest(OEQATarget(cls.tc.target), '/tmp/ie/inputs')
19 cls.dldt_ie.setup()
20 cls.ir_files_dir = cls.dldt_mo.work_dir
21
22 @classmethod
23 def tearDownClass(cls):
24 cls.dldt_ie.tear_down()
25 cls.dldt_mo.tear_down()
26 cls.sqn_download.tear_down()
27
28 @OEHasPackage(['dldt-model-optimizer'])
29 @OEHasPackage(['wget'])
30 def test_dldt_ie_can_create_ir_and_download_input(self):
31 proxy_port = get_testdata_config(self.tc.td, 'DLDT_PIP_PROXY')
32 if not proxy_port:
33 self.skipTest('Need to configure bitbake configuration (DLDT_PIP_PROXY="proxy.server:port").')
34 (status, output) = self.sqn_download.test_can_download_squeezenet_model(proxy_port)
35 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
36 (status, output) = self.sqn_download.test_can_download_squeezenet_prototxt(proxy_port)
37 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
38
39 mo_exe_dir = get_testdata_config(self.tc.td, 'DLDT_MO_EXE_DIR')
40 if not mo_exe_dir:
41 self.skipTest('Need to configure bitbake configuration (DLDT_MO_EXE_DIR="directory_to_mo.py").')
42 mo_files_dir = self.sqn_download.work_dir
43 (status, output) = self.dldt_mo.test_dldt_mo_can_create_ir(mo_exe_dir, mo_files_dir)
44 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
45
46 (status, output) = self.dldt_ie.test_can_download_input_file(proxy_port)
47 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
48
49 @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input'])
50 @OEHasPackage(['dldt-inference-engine'])
51 @OEHasPackage(['dldt-inference-engine-samples'])
52 def test_dldt_ie_classification_with_cpu(self):
53 (status, output) = self.dldt_ie.test_dldt_ie_classification_with_device('CPU', self.ir_files_dir)
54 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
55
56 @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input'])
57 @OEHasPackage(['dldt-inference-engine'])
58 @OEHasPackage(['dldt-inference-engine-samples'])
59 @OEHasPackage(['intel-compute-runtime'])
60 @OEHasPackage(['ocl-icd'])
61 def test_dldt_ie_classification_with_gpu(self):
62 (status, output) = self.dldt_ie.test_dldt_ie_classification_with_device('GPU', self.ir_files_dir)
63 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
64
65 @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input'])
66 @OEHasPackage(['dldt-inference-engine'])
67 @OEHasPackage(['dldt-inference-engine-samples'])
68 @OEHasPackage(['dldt-inference-engine-vpu-firmware'])
69 def test_dldt_ie_classification_with_myriad(self):
70 device = 'MYRIAD'
71 (status, output) = self.dldt_ie.test_check_if_openvino_device_available(device)
72 if not status:
73 self.skipTest('OpenVINO %s device not available on target machine(availalbe devices: %s)' % (device, output))
74 (status, output) = self.dldt_ie.test_dldt_ie_classification_with_device(device, self.ir_files_dir)
75 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
76
77 @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input'])
78 @OEHasPackage(['dldt-inference-engine'])
79 @OEHasPackage(['dldt-inference-engine-python3'])
80 @OEHasPackage(['python3-opencv'])
81 @OEHasPackage(['python3-numpy'])
82 def test_dldt_ie_classification_python_api_with_cpu(self):
83 (status, output) = self.dldt_ie.test_dldt_ie_classification_python_api_with_device('CPU', self.ir_files_dir)
84 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
85
86 @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input'])
87 @OEHasPackage(['dldt-inference-engine'])
88 @OEHasPackage(['dldt-inference-engine-python3'])
89 @OEHasPackage(['intel-compute-runtime'])
90 @OEHasPackage(['ocl-icd'])
91 @OEHasPackage(['python3-opencv'])
92 @OEHasPackage(['python3-numpy'])
93 def test_dldt_ie_classification_python_api_with_gpu(self):
94 (status, output) = self.dldt_ie.test_dldt_ie_classification_python_api_with_device('GPU', self.ir_files_dir)
95 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
96
97 @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input'])
98 @OEHasPackage(['dldt-inference-engine'])
99 @OEHasPackage(['dldt-inference-engine-python3'])
100 @OEHasPackage(['dldt-inference-engine-vpu-firmware'])
101 @OEHasPackage(['python3-opencv'])
102 @OEHasPackage(['python3-numpy'])
103 def test_dldt_ie_classification_python_api_with_myriad(self):
104 device = 'MYRIAD'
105 (status, output) = self.dldt_ie.test_check_if_openvino_device_available(device)
106 if not status:
107 self.skipTest('OpenVINO %s device not available on target machine(availalbe devices: %s)' % (device, output))
108 (status, output) = self.dldt_ie.test_dldt_ie_classification_python_api_with_device(device, self.ir_files_dir)
109 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
diff --git a/lib/oeqa/runtime/cases/dldt_model_optimizer.py b/lib/oeqa/runtime/cases/dldt_model_optimizer.py
new file mode 100644
index 00000000..736ea661
--- /dev/null
+++ b/lib/oeqa/runtime/cases/dldt_model_optimizer.py
@@ -0,0 +1,38 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.runtime.decorator.package import OEHasPackage
3from oeqa.runtime.miutils.targets.oeqatarget import OEQATarget
4from oeqa.runtime.miutils.tests.squeezenet_model_download_test import SqueezenetModelDownloadTest
5from oeqa.runtime.miutils.tests.dldt_model_optimizer_test import DldtModelOptimizerTest
6from oeqa.runtime.miutils.dldtutils import get_testdata_config
7
8class DldtModelOptimizer(OERuntimeTestCase):
9
10 @classmethod
11 def setUpClass(cls):
12 cls.sqn_download = SqueezenetModelDownloadTest(OEQATarget(cls.tc.target), '/tmp/mo/md')
13 cls.sqn_download.setup()
14 cls.dldt_mo = DldtModelOptimizerTest(OEQATarget(cls.tc.target), '/tmp/mo/ir')
15 cls.dldt_mo.setup()
16
17 @classmethod
18 def tearDownClass(cls):
19 cls.dldt_mo.tear_down()
20 cls.sqn_download.tear_down()
21
22 @OEHasPackage(['dldt-model-optimizer'])
23 @OEHasPackage(['wget'])
24 def test_dldt_mo_can_create_ir(self):
25 proxy_port = get_testdata_config(self.tc.td, 'DLDT_PIP_PROXY')
26 if not proxy_port:
27 self.skipTest('Need to configure bitbake configuration (DLDT_PIP_PROXY="proxy.server:port").')
28 (status, output) = self.sqn_download.test_can_download_squeezenet_model(proxy_port)
29 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
30 (status, output) = self.sqn_download.test_can_download_squeezenet_prototxt(proxy_port)
31 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
32
33 mo_exe_dir = get_testdata_config(self.tc.td, 'DLDT_MO_EXE_DIR')
34 if not mo_exe_dir:
35 self.skipTest('Need to configure bitbake configuration (DLDT_MO_EXE_DIR="directory_to_mo.py").')
36 mo_files_dir = self.sqn_download.work_dir
37 (status, output) = self.dldt_mo.test_dldt_mo_can_create_ir(mo_exe_dir, mo_files_dir)
38 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
diff --git a/lib/oeqa/runtime/cases/intel_mediasdk.py b/lib/oeqa/runtime/cases/intel_mediasdk.py
new file mode 100644
index 00000000..4ae7d580
--- /dev/null
+++ b/lib/oeqa/runtime/cases/intel_mediasdk.py
@@ -0,0 +1,34 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.runtime.decorator.package import OEHasPackage
3from oeqa.core.decorator.depends import OETestDepends
4
5class MsdkTest(OERuntimeTestCase):
6
7 @classmethod
8 def tearDownClass(cls):
9 cls.tc.target.run("rm /tmp/mtest_h264.mp4")
10
11 @OEHasPackage(['gstreamer1.0-plugins-base'])
12 @OEHasPackage(['gstreamer1.0-plugins-good'])
13 @OEHasPackage(['gstreamer1.0-plugins-bad'])
14 @OEHasPackage(['intel-mediasdk'])
15 @OEHasPackage(['intel-media-driver', 'libigfxcmrt7'])
16 def test_gstreamer_can_encode_with_msdk_and_intel_media_driver(self):
17 (status, output) = self.target.run('gst-inspect-1.0 msdk')
18 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
19
20 (status, output) = self.target.run('export LIBVA_DRIVER_NAME=iHD; '
21 'gst-launch-1.0 -ev videotestsrc num-buffers=120 ! timeoverlay ! '
22 'msdkh264enc ! video/x-h264,profile=main ! h264parse ! '
23 'filesink location=/tmp/mtest_h264.mp4')
24 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
25
26 @OETestDepends(['intel_mediasdk.MsdkTest.test_gstreamer_can_encode_with_msdk_and_intel_media_driver'])
27 def test_gstreamer_can_decode_with_msdk_and_intel_media_driver(self):
28 (status, output) = self.target.run('export LIBVA_DRIVER_NAME=iHD; '
29 'gst-launch-1.0 filesrc location=/tmp/mtest_h264.mp4 ! '
30 'h264parse ! msdkh264dec ! '
31 'msdkh265enc rate-control=cbr bitrate=5000 gop-size=30 b-frames=2 ! '
32 'video/x-h265,profile=main ! h265parse ! fakesink')
33 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
34
diff --git a/lib/oeqa/runtime/cases/intel_vaapi_driver.py b/lib/oeqa/runtime/cases/intel_vaapi_driver.py
new file mode 100644
index 00000000..31e11a81
--- /dev/null
+++ b/lib/oeqa/runtime/cases/intel_vaapi_driver.py
@@ -0,0 +1,27 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.runtime.decorator.package import OEHasPackage
3from oeqa.core.decorator.depends import OETestDepends
4
5class VaapiDriverTest(OERuntimeTestCase):
6
7 @classmethod
8 def tearDownClass(cls):
9 cls.tc.target.run("rm /tmp/vtest_h264.mp4")
10
11 @OEHasPackage(['gstreamer1.0-plugins-base'])
12 @OEHasPackage(['gstreamer1.0-plugins-good'])
13 @OEHasPackage(['gstreamer1.0-vaapi'])
14 @OEHasPackage(['intel-vaapi-driver'])
15 def test_gstreamer_can_encode_with_intel_vaapi_driver(self):
16 (status, output) = self.target.run('gst-inspect-1.0 vaapi')
17 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
18
19 (status, output) = self.target.run('gst-launch-1.0 -ev videotestsrc num-buffers=60 ! '
20 'timeoverlay ! vaapih264enc ! h264parse ! mp4mux ! filesink location=/tmp/vtest_h264.mp4')
21 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
22
23 @OETestDepends(['intel_vaapi_driver.VaapiDriverTest.test_gstreamer_can_encode_with_intel_vaapi_driver'])
24 def test_gstreamer_can_decode_with_intel_vaapi_driver(self):
25 (status, output) = self.target.run('gst-launch-1.0 filesrc location=/tmp/vtest_h264.mp4 ! '
26 'qtdemux ! h264parse ! vaapih264dec ! vaapisink')
27 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
diff --git a/lib/oeqa/runtime/cases/isal.py b/lib/oeqa/runtime/cases/isal.py
new file mode 100644
index 00000000..5025f986
--- /dev/null
+++ b/lib/oeqa/runtime/cases/isal.py
@@ -0,0 +1,24 @@
1import os
2from oeqa.runtime.decorator.package import OEHasPackage
3from oeqa.runtime.case import OERuntimeTestCase
4from oeqa.core.decorator.depends import OETestDepends
5
6class IsalTest(OERuntimeTestCase):
7
8 @OEHasPackage(['isa-l'])
9 def test_isal_igzip_version(self):
10 command = 'igzip -V'
11 (status, output) = self.target.run(command)
12 self.assertEqual(status, 0, msg="Error messages: %s" % output)
13
14 @OETestDepends(['isal.IsalTest.test_isal_igzip_version'])
15 def test_isal_igzip_can_compress(self):
16 command = 'echo "hello" > /tmp/igzip_sample'
17 (status, output) = self.target.run(command)
18 self.assertEqual(status, 0, msg="Error messages: %s" % output)
19 command = 'igzip -z /tmp/igzip_sample'
20 (status, output) = self.target.run(command)
21 self.assertEqual(status, 0, msg="Error messages: %s" % output)
22 command = 'rm /tmp/igzip_sample*'
23 (status, output) = self.target.run(command)
24 self.assertEqual(status, 0, msg="Error messages: %s" % output)
diff --git a/lib/oeqa/runtime/cases/libipt.py b/lib/oeqa/runtime/cases/libipt.py
new file mode 100644
index 00000000..4adb13f0
--- /dev/null
+++ b/lib/oeqa/runtime/cases/libipt.py
@@ -0,0 +1,23 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.runtime.decorator.package import OEHasPackage
3from oeqa.core.decorator.depends import OETestDepends
4
5class LibiptTest(OERuntimeTestCase):
6 libipt_bin_dir = '/usr/bin/libipt/'
7
8 @classmethod
9 def tearDownClass(cls):
10 cls.tc.target.run('rm /tmp/loop-tnt*')
11
12 @OEHasPackage(['libipt', 'libipt2'])
13 @OEHasPackage(['libipt-test'])
14 @OEHasPackage(['yasm'])
15 def test_libipt_can_generate_trace_packet(self):
16 (status, output) = self.target.run('cd /tmp; %spttc %s/tests/loop-tnt.ptt' %
17 (self.libipt_bin_dir, self.libipt_bin_dir))
18 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
19
20 @OETestDepends(['libipt.LibiptTest.test_libipt_can_generate_trace_packet'])
21 def test_libipt_can_perform_trace_packet_dump(self):
22 (status, output) = self.target.run('cd /tmp; %sptdump loop-tnt.pt' % self.libipt_bin_dir)
23 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
diff --git a/lib/oeqa/runtime/cases/libxcam.py b/lib/oeqa/runtime/cases/libxcam.py
new file mode 100644
index 00000000..57192f07
--- /dev/null
+++ b/lib/oeqa/runtime/cases/libxcam.py
@@ -0,0 +1,37 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.runtime.decorator.package import OEHasPackage
3from oeqa.core.decorator.depends import OETestDepends
4
5class LibxcamTest(OERuntimeTestCase):
6 yuv_file = 'vtest.yuv'
7 soft_test_app_file = 'test-soft-image'
8 libxcam_test_app_dir = '/usr/bin/libxcam/'
9 libxcam_file_dir = '/tmp/'
10
11 @classmethod
12 def tearDownClass(cls):
13 cls.tc.target.run("rm %s%s" % (cls.libxcam_file_dir, cls.yuv_file))
14
15 @OEHasPackage(['gstreamer1.0-plugins-base'])
16 @OEHasPackage(['gstreamer1.0-plugins-good'])
17 @OEHasPackage(['gstreamer1.0-vaapi'])
18 @OEHasPackage(['intel-vaapi-driver'])
19 def test_libxcam_can_generate_yuv_file_with_gstreamer(self):
20 (status, output) = self.target.run('gst-inspect-1.0 vaapi')
21 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
22
23 (status, output) = self.target.run('gst-launch-1.0 -ev videotestsrc num-buffers=60 ! '
24 'timeoverlay ! filesink location=%s%s' %
25 (self.libxcam_file_dir, self.yuv_file))
26 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
27
28 @OEHasPackage(['libxcam'])
29 @OEHasPackage(['libxcam-test'])
30 @OETestDepends(['libxcam.LibxcamTest.test_libxcam_can_generate_yuv_file_with_gstreamer'])
31 def test_libxcam_can_execute_soft_image_sample_app(self):
32 (status, output) = self.target.run('%s%s --type remap --input0 %s%s --output soft_out.nv12 --save false' %
33 (self.libxcam_test_app_dir,
34 self.soft_test_app_file,
35 self.libxcam_file_dir,
36 self.yuv_file))
37 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
diff --git a/lib/oeqa/runtime/cases/microcode.py b/lib/oeqa/runtime/cases/microcode.py
new file mode 100644
index 00000000..52c1cdb4
--- /dev/null
+++ b/lib/oeqa/runtime/cases/microcode.py
@@ -0,0 +1,31 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.runtime.decorator.package import OEHasPackage
3import re
4
5class MicrocodeTest(OERuntimeTestCase):
6
7 def get_revision_from_microcode_string_list(self, microcode_string_list, re_pattern):
8 re_compile = re.compile(re_pattern)
9 rev_list = []
10 for s in microcode_string_list:
11 matched_revs = re_compile.findall(s)
12 if matched_revs:
13 for mr in matched_revs:
14 rev_list.append(int(mr, 16))
15 return rev_list
16
17 @OEHasPackage(["iucode-tool"])
18 def test_microcode_update(self):
19 (status, output) = self.target.run('iucode_tool /lib/firmware/intel-ucode/ -tb -l --scan-system=2 | grep rev')
20
21 selected_microcodes = output.splitlines()
22 selected_rev_list = self.get_revision_from_microcode_string_list(selected_microcodes, "rev (\w*)")
23
24 (status, output) = self.target.run("dmesg | grep 'microcode updated early'")
25
26 updated_microcodes = output.splitlines()
27 updated_rev_list = self.get_revision_from_microcode_string_list(updated_microcodes, "revision (\w*)")
28
29 for ul in updated_rev_list:
30 self.assertTrue(ul in selected_rev_list, msg="Updated revision, %s, not in selected revision list (%s)" %
31 (ul, selected_rev_list))
diff --git a/lib/oeqa/runtime/cases/mkl_dnn.py b/lib/oeqa/runtime/cases/mkl_dnn.py
new file mode 100644
index 00000000..8d50df54
--- /dev/null
+++ b/lib/oeqa/runtime/cases/mkl_dnn.py
@@ -0,0 +1,67 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.runtime.decorator.package import OEHasPackage
3from oeqa.core.decorator.depends import OETestDepends
4from oeqa.runtime.miutils.targets.oeqatarget import OEQATarget
5from oeqa.runtime.miutils.tests.mkl_dnn_test import MkldnnTest
6
7class MklDnn(OERuntimeTestCase):
8
9 @classmethod
10 def setUpClass(cls):
11 cls.mkldnntest = MkldnnTest(OEQATarget(cls.tc.target))
12
13 @classmethod
14 def tearDownClass(cls):
15 cls.mkldnntest.tear_down()
16
17 @OEHasPackage(['onednn', 'libdnnl2'])
18 @OEHasPackage(['onednn-src', 'libdnnl-src'])
19 @OEHasPackage(['onednn-dev', 'libdnnl-dev'])
20 @OEHasPackage(['gcc'])
21 @OEHasPackage(['gcc-symlinks'])
22 @OEHasPackage(['libstdc++-dev'])
23 @OEHasPackage(['binutils'])
24 def test_mkldnn_can_compile_and_execute(self):
25 (status, output) = self.mkldnntest.test_mkldnn_can_compile_and_execute()
26 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
27
28 @OEHasPackage(['onednn', 'libdnnl2'])
29 @OEHasPackage(['onednn-test', 'libdnnl-test'])
30 def test_mkldnn_benchdnn_package_available(self):
31 (status, output) = self.mkldnntest.test_mkldnn_benchdnn_package_available()
32 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
33
34 @OETestDepends(['mkl_dnn.MklDnn.test_mkldnn_benchdnn_package_available'])
35 def test_mkldnn_conv_api(self):
36 (status, output) = self.mkldnntest.test_mkldnn_conv_api()
37 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
38
39 @OETestDepends(['mkl_dnn.MklDnn.test_mkldnn_benchdnn_package_available'])
40 def test_mkldnn_bnorm_api(self):
41 (status, output) = self.mkldnntest.test_mkldnn_bnorm_api()
42 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
43
44 @OETestDepends(['mkl_dnn.MklDnn.test_mkldnn_benchdnn_package_available'])
45 def test_mkldnn_deconv_api(self):
46 (status, output) = self.mkldnntest.test_mkldnn_deconv_api()
47 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
48
49 @OETestDepends(['mkl_dnn.MklDnn.test_mkldnn_benchdnn_package_available'])
50 def test_mkldnn_ip_api(self):
51 (status, output) = self.mkldnntest.test_mkldnn_ip_api()
52 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
53
54 @OETestDepends(['mkl_dnn.MklDnn.test_mkldnn_benchdnn_package_available'])
55 def test_mkldnn_reorder_api(self):
56 (status, output) = self.mkldnntest.test_mkldnn_reorder_api()
57 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
58
59 @OETestDepends(['mkl_dnn.MklDnn.test_mkldnn_benchdnn_package_available'])
60 def test_mkldnn_rnn_api(self):
61 (status, output) = self.mkldnntest.test_mkldnn_rnn_api()
62 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
63
64 @OETestDepends(['mkl_dnn.MklDnn.test_mkldnn_benchdnn_package_available'])
65 def test_mkldnn_shuffle_api(self):
66 (status, output) = self.mkldnntest.test_mkldnn_shuffle_api()
67 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
diff --git a/lib/oeqa/runtime/cases/parselogs-ignores-intel-core2-32.txt b/lib/oeqa/runtime/cases/parselogs-ignores-intel-core2-32.txt
new file mode 100644
index 00000000..84ce8168
--- /dev/null
+++ b/lib/oeqa/runtime/cases/parselogs-ignores-intel-core2-32.txt
@@ -0,0 +1,9 @@
1# These should be reviewed to see if they are still needed
2ACPI: No _BQC method, cannot determine initial brightness
3[Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness
4(EE) Failed to load module "psb"
5(EE) Failed to load module "psbdrv"
6(EE) open /dev/fb0: No such file or directory
7(EE) AIGLX: reverting to software rendering
8dmi: Firmware registration failed.
9ioremap error for 0x78
diff --git a/lib/oeqa/runtime/cases/parselogs-ignores-intel-corei7-64.txt b/lib/oeqa/runtime/cases/parselogs-ignores-intel-corei7-64.txt
new file mode 100644
index 00000000..5c9b4bc7
--- /dev/null
+++ b/lib/oeqa/runtime/cases/parselogs-ignores-intel-corei7-64.txt
@@ -0,0 +1,14 @@
1# These should be reviewed to see if they are still needed
2can't set Max Payload Size to 256
3intel_punit_ipc: can't request region for resource
4[drm] parse error at position 4 in video mode 'efifb'
5ACPI Error: Could not enable RealTimeClock event
6ACPI Warning: Could not enable fixed event - RealTimeClock
7hci_intel INT33E1:00: Unable to retrieve gpio
8hci_intel: probe of INT33E1:00 failed
9can't derive routing for PCI INT A
10failed to read out thermal zone
11Bluetooth: hci0: Setting Intel event mask failed
12ttyS2 - failed to request DMA
13Bluetooth: hci0: Failed to send firmware data (-38)
14atkbd serio0: Failed to enable keyboard on isa0060/serio0
diff --git a/lib/oeqa/runtime/cases/thermald.py b/lib/oeqa/runtime/cases/thermald.py
new file mode 100644
index 00000000..a0b6a92b
--- /dev/null
+++ b/lib/oeqa/runtime/cases/thermald.py
@@ -0,0 +1,47 @@
1from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.core.decorator.depends import OETestDepends
3from oeqa.runtime.decorator.package import OEHasPackage
4import threading
5import time
6import re
7
8class ThermaldTest(OERuntimeTestCase):
9 def get_thermal_zone_with_target_type(self, target_type):
10 i = 0
11 while True:
12 status, output = self.target.run('cat /sys/class/thermal/thermal_zone%s/type' % i)
13 if status:
14 return -1
15 if output == target_type:
16 return i
17 i = i + 1
18
19 def run_thermald_emulation_to_exceed_setpoint_then_end_thermald_process(self, run_args):
20 time.sleep(2)
21 self.target.run('echo 106000 > /sys/class/thermal/thermal_zone%s/emul_temp' % run_args)
22 time.sleep(5)
23 __, output = self.target.run('pidof thermald')
24 self.target.run('kill -9 %s' % output)
25
26 def test_thermald_emulation_mode(self):
27 # Thermald test depend on thermal emulation, where CONFIG_THERMAL_EMULATION=y was required
28 # To enable thermal emulation, refer to https://github.com/intel/thermal_daemon/blob/master/test/readme_test.txt
29 (status, output) = self.target.run('gzip -dc /proc/config.gz | grep CONFIG_THERMAL_EMULATION=y')
30 if status:
31 self.skipTest("CONFIG_THERMAL_EMULATION is not set")
32
33 @OEHasPackage(['thermald'])
34 @OETestDepends(['thermald.ThermaldTest.test_thermald_emulation_mode'])
35 def test_thermald_can_track_thermal_exceed_setpoint(self):
36 x86_thermal_zone_index = self.get_thermal_zone_with_target_type('x86_pkg_temp')
37 if x86_thermal_zone_index < 0:
38 self.skipTest('Could not get the thermal zone index for target type (%s)' % 'x86_pkg_temp')
39 td_thread = threading.Thread(target=self.run_thermald_emulation_to_exceed_setpoint_then_end_thermald_process,
40 args=(x86_thermal_zone_index,))
41 td_thread.start()
42 td_thread.join()
43 status, output = self.target.run('timeout 3s thermald --no-daemon --loglevel=info')
44 regex_search = ".*thd_cdev_set_state.*106000"
45 regex_comp = re.compile(regex_search)
46 m = regex_comp.search(output)
47 self.assertTrue(m, msg='status and output: %s and %s' % (status, output))