summaryrefslogtreecommitdiffstats
path: root/lib/oeqa
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oeqa')
-rw-r--r--lib/oeqa/runtime/cases/dldt_inference_engine.py18
-rw-r--r--lib/oeqa/runtime/cases/intel_vaapi_driver.py2
-rw-r--r--lib/oeqa/runtime/cases/microcode.py11
-rw-r--r--lib/oeqa/runtime/cases/mkl_dnn.py10
-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
-rw-r--r--lib/oeqa/runtime/miutils/tests/dldt_inference_engine_test.py8
-rw-r--r--lib/oeqa/runtime/miutils/tests/mkl_dnn_test.py12
9 files changed, 105 insertions, 26 deletions
diff --git a/lib/oeqa/runtime/cases/dldt_inference_engine.py b/lib/oeqa/runtime/cases/dldt_inference_engine.py
index 2e969975..fb35d52f 100644
--- a/lib/oeqa/runtime/cases/dldt_inference_engine.py
+++ b/lib/oeqa/runtime/cases/dldt_inference_engine.py
@@ -57,7 +57,7 @@ class DldtInferenceEngine(OERuntimeTestCase):
57 @OEHasPackage(['dldt-inference-engine']) 57 @OEHasPackage(['dldt-inference-engine'])
58 @OEHasPackage(['dldt-inference-engine-samples']) 58 @OEHasPackage(['dldt-inference-engine-samples'])
59 @OEHasPackage(['intel-compute-runtime']) 59 @OEHasPackage(['intel-compute-runtime'])
60 @OEHasPackage(['opencl-icd-loader']) 60 @OEHasPackage(['ocl-icd'])
61 def test_dldt_ie_classification_with_gpu(self): 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) 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)) 63 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
@@ -67,7 +67,11 @@ class DldtInferenceEngine(OERuntimeTestCase):
67 @OEHasPackage(['dldt-inference-engine-samples']) 67 @OEHasPackage(['dldt-inference-engine-samples'])
68 @OEHasPackage(['dldt-inference-engine-vpu-firmware']) 68 @OEHasPackage(['dldt-inference-engine-vpu-firmware'])
69 def test_dldt_ie_classification_with_myriad(self): 69 def test_dldt_ie_classification_with_myriad(self):
70 (status, output) = self.dldt_ie.test_dldt_ie_classification_with_device('MYRIAD', self.ir_files_dir) 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)
71 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) 75 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
72 76
73 @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input']) 77 @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input'])
@@ -76,14 +80,14 @@ class DldtInferenceEngine(OERuntimeTestCase):
76 @OEHasPackage(['python3-opencv']) 80 @OEHasPackage(['python3-opencv'])
77 @OEHasPackage(['python3-numpy']) 81 @OEHasPackage(['python3-numpy'])
78 def test_dldt_ie_classification_python_api_with_cpu(self): 82 def test_dldt_ie_classification_python_api_with_cpu(self):
79 (status, output) = self.dldt_ie.test_dldt_ie_classification_python_api_with_device('CPU', self.ir_files_dir, 'libcpu_extension.so') 83 (status, output) = self.dldt_ie.test_dldt_ie_classification_python_api_with_device('CPU', self.ir_files_dir)
80 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) 84 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
81 85
82 @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input']) 86 @OETestDepends(['dldt_inference_engine.DldtInferenceEngine.test_dldt_ie_can_create_ir_and_download_input'])
83 @OEHasPackage(['dldt-inference-engine']) 87 @OEHasPackage(['dldt-inference-engine'])
84 @OEHasPackage(['dldt-inference-engine-python3']) 88 @OEHasPackage(['dldt-inference-engine-python3'])
85 @OEHasPackage(['intel-compute-runtime']) 89 @OEHasPackage(['intel-compute-runtime'])
86 @OEHasPackage(['opencl-icd-loader']) 90 @OEHasPackage(['ocl-icd'])
87 @OEHasPackage(['python3-opencv']) 91 @OEHasPackage(['python3-opencv'])
88 @OEHasPackage(['python3-numpy']) 92 @OEHasPackage(['python3-numpy'])
89 def test_dldt_ie_classification_python_api_with_gpu(self): 93 def test_dldt_ie_classification_python_api_with_gpu(self):
@@ -97,5 +101,9 @@ class DldtInferenceEngine(OERuntimeTestCase):
97 @OEHasPackage(['python3-opencv']) 101 @OEHasPackage(['python3-opencv'])
98 @OEHasPackage(['python3-numpy']) 102 @OEHasPackage(['python3-numpy'])
99 def test_dldt_ie_classification_python_api_with_myriad(self): 103 def test_dldt_ie_classification_python_api_with_myriad(self):
100 (status, output) = self.dldt_ie.test_dldt_ie_classification_python_api_with_device('MYRIAD', self.ir_files_dir) 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)
101 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) 109 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
diff --git a/lib/oeqa/runtime/cases/intel_vaapi_driver.py b/lib/oeqa/runtime/cases/intel_vaapi_driver.py
index d5989044..31e11a81 100644
--- a/lib/oeqa/runtime/cases/intel_vaapi_driver.py
+++ b/lib/oeqa/runtime/cases/intel_vaapi_driver.py
@@ -17,7 +17,7 @@ class VaapiDriverTest(OERuntimeTestCase):
17 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) 17 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
18 18
19 (status, output) = self.target.run('gst-launch-1.0 -ev videotestsrc num-buffers=60 ! ' 19 (status, output) = self.target.run('gst-launch-1.0 -ev videotestsrc num-buffers=60 ! '
20 'timeoverlay ! vaapih264enc ! mp4mux ! filesink location=/tmp/vtest_h264.mp4') 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)) 21 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
22 22
23 @OETestDepends(['intel_vaapi_driver.VaapiDriverTest.test_gstreamer_can_encode_with_intel_vaapi_driver']) 23 @OETestDepends(['intel_vaapi_driver.VaapiDriverTest.test_gstreamer_can_encode_with_intel_vaapi_driver'])
diff --git a/lib/oeqa/runtime/cases/microcode.py b/lib/oeqa/runtime/cases/microcode.py
index 6ce36a6f..52c1cdb4 100644
--- a/lib/oeqa/runtime/cases/microcode.py
+++ b/lib/oeqa/runtime/cases/microcode.py
@@ -16,20 +16,15 @@ class MicrocodeTest(OERuntimeTestCase):
16 16
17 @OEHasPackage(["iucode-tool"]) 17 @OEHasPackage(["iucode-tool"])
18 def test_microcode_update(self): 18 def test_microcode_update(self):
19 (status, output) = self.target.run('iucode_tool /lib/firmware/intel-ucode/ -tb -lS | grep rev') 19 (status, output) = self.target.run('iucode_tool /lib/firmware/intel-ucode/ -tb -l --scan-system=2 | grep rev')
20 if status:
21 self.skipTest("The iucode_tool detected no microcode for update.")
22 20
23 selected_microcodes = output.splitlines() 21 selected_microcodes = output.splitlines()
24 selected_rev_list = self.get_revision_from_microcode_string_list(selected_microcodes, "rev (\w*)") 22 selected_rev_list = self.get_revision_from_microcode_string_list(selected_microcodes, "rev (\w*)")
25 self.assertTrue(selected_rev_list, msg="Could not find any rev from iucode_tool selected microcode.")
26 23
27 (status, output) = self.target.run('dmesg | grep microcode') 24 (status, output) = self.target.run("dmesg | grep 'microcode updated early'")
28 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
29 25
30 updated_microcodes = output.splitlines() 26 updated_microcodes = output.splitlines()
31 updated_rev_list = self.get_revision_from_microcode_string_list(updated_microcodes, "revision=(\w*)") 27 updated_rev_list = self.get_revision_from_microcode_string_list(updated_microcodes, "revision (\w*)")
32 self.assertTrue(updated_rev_list, msg="Could not find any updated revision from microcode dmesg.")
33 28
34 for ul in updated_rev_list: 29 for ul in updated_rev_list:
35 self.assertTrue(ul in selected_rev_list, msg="Updated revision, %s, not in selected revision list (%s)" % 30 self.assertTrue(ul in selected_rev_list, msg="Updated revision, %s, not in selected revision list (%s)" %
diff --git a/lib/oeqa/runtime/cases/mkl_dnn.py b/lib/oeqa/runtime/cases/mkl_dnn.py
index c7994b13..8d50df54 100644
--- a/lib/oeqa/runtime/cases/mkl_dnn.py
+++ b/lib/oeqa/runtime/cases/mkl_dnn.py
@@ -14,9 +14,9 @@ class MklDnn(OERuntimeTestCase):
14 def tearDownClass(cls): 14 def tearDownClass(cls):
15 cls.mkldnntest.tear_down() 15 cls.mkldnntest.tear_down()
16 16
17 @OEHasPackage(['libdnnl', 'libdnnl1']) 17 @OEHasPackage(['onednn', 'libdnnl2'])
18 @OEHasPackage(['libdnnl-src']) 18 @OEHasPackage(['onednn-src', 'libdnnl-src'])
19 @OEHasPackage(['libdnnl-dev']) 19 @OEHasPackage(['onednn-dev', 'libdnnl-dev'])
20 @OEHasPackage(['gcc']) 20 @OEHasPackage(['gcc'])
21 @OEHasPackage(['gcc-symlinks']) 21 @OEHasPackage(['gcc-symlinks'])
22 @OEHasPackage(['libstdc++-dev']) 22 @OEHasPackage(['libstdc++-dev'])
@@ -25,8 +25,8 @@ class MklDnn(OERuntimeTestCase):
25 (status, output) = self.mkldnntest.test_mkldnn_can_compile_and_execute() 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)) 26 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))
27 27
28 @OEHasPackage(['mkl-dnn', 'libdnnl1']) 28 @OEHasPackage(['onednn', 'libdnnl2'])
29 @OEHasPackage(['mkl-dnn-test', 'libdnnl-test']) 29 @OEHasPackage(['onednn-test', 'libdnnl-test'])
30 def test_mkldnn_benchdnn_package_available(self): 30 def test_mkldnn_benchdnn_package_available(self):
31 (status, output) = self.mkldnntest.test_mkldnn_benchdnn_package_available() 31 (status, output) = self.mkldnntest.test_mkldnn_benchdnn_package_available()
32 self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) 32 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))
diff --git a/lib/oeqa/runtime/miutils/tests/dldt_inference_engine_test.py b/lib/oeqa/runtime/miutils/tests/dldt_inference_engine_test.py
index a44f9027..31bfb539 100644
--- a/lib/oeqa/runtime/miutils/tests/dldt_inference_engine_test.py
+++ b/lib/oeqa/runtime/miutils/tests/dldt_inference_engine_test.py
@@ -16,10 +16,18 @@ class DldtInferenceEngineTest(object):
16 self.target.run('mkdir -p %s' % self.work_dir) 16 self.target.run('mkdir -p %s' % self.work_dir)
17 self.target.copy_to(os.path.join(files_path, 'dldt-inference-engine', self.ie_input_files['ie_python_sample']), 17 self.target.copy_to(os.path.join(files_path, 'dldt-inference-engine', self.ie_input_files['ie_python_sample']),
18 self.work_dir) 18 self.work_dir)
19 python_cmd = 'from openvino.inference_engine import IENetwork, IECore; ie = IECore(); print(ie.available_devices)'
20 __, output = self.target.run('python3 -c "%s"' % python_cmd)
21 self.available_devices = output
19 22
20 def tear_down(self): 23 def tear_down(self):
21 self.target.run('rm -rf %s' % self.work_dir) 24 self.target.run('rm -rf %s' % self.work_dir)
22 25
26 def test_check_if_openvino_device_available(self, device):
27 if device not in self.available_devices:
28 return False, self.available_devices
29 return True, self.available_devices
30
23 def test_can_download_input_file(self, proxy_port): 31 def test_can_download_input_file(self, proxy_port):
24 return self.target.run('cd %s; wget %s -e https_proxy=%s' % 32 return self.target.run('cd %s; wget %s -e https_proxy=%s' %
25 (self.work_dir, 33 (self.work_dir,
diff --git a/lib/oeqa/runtime/miutils/tests/mkl_dnn_test.py b/lib/oeqa/runtime/miutils/tests/mkl_dnn_test.py
index 13afd1a4..869a4cbe 100644
--- a/lib/oeqa/runtime/miutils/tests/mkl_dnn_test.py
+++ b/lib/oeqa/runtime/miutils/tests/mkl_dnn_test.py
@@ -9,13 +9,13 @@ class MkldnnTest(object):
9 self.target.run('rm /tmp/%s' % self.mkldnn_target_test_filename) 9 self.target.run('rm /tmp/%s' % self.mkldnn_target_test_filename)
10 10
11 def test_mkldnn_can_compile_and_execute(self): 11 def test_mkldnn_can_compile_and_execute(self):
12 mkldnn_src_dir = '/usr/src/debug/mkl-dnn/' 12 mkldnn_src_dir = '/usr/src/debug/onednn/'
13 mkldnn_src_test_filename = 'api.c' 13 mkldnn_src_test_filename = 'api.c'
14 mkldnn_src_test_file = '' 14 mkldnn_src_test_file = ''
15 15
16 (status, output) = self.target.run('cd %s; find -name %s' % (mkldnn_src_dir, mkldnn_src_test_filename)) 16 (__, output) = self.target.run('cd %s; find -name %s' % (mkldnn_src_dir, mkldnn_src_test_filename))
17 if status: 17 if 'No such file or directory' in output:
18 return status, output 18 return -1, output
19 19
20 mkldnn_src_test_file = os.path.join(mkldnn_src_dir, output) 20 mkldnn_src_test_file = os.path.join(mkldnn_src_dir, output)
21 (status, output) = self.target.run('gcc %s -o /tmp/%s -ldnnl' % (mkldnn_src_test_file, self.mkldnn_target_test_filename)) 21 (status, output) = self.target.run('gcc %s -o /tmp/%s -ldnnl' % (mkldnn_src_test_file, self.mkldnn_target_test_filename))
@@ -49,9 +49,7 @@ class MkldnnTest(object):
49 return self._run_mkldnn_benchdnn_test('./benchdnn --reorder --batch=inputs/reorder/test_reorder_bfloat16') 49 return self._run_mkldnn_benchdnn_test('./benchdnn --reorder --batch=inputs/reorder/test_reorder_bfloat16')
50 50
51 def test_mkldnn_rnn_api(self): 51 def test_mkldnn_rnn_api(self):
52 # test_rnn_inference was not yet ready and was expected to fail 52 return self._run_mkldnn_benchdnn_test('./benchdnn --rnn --batch=inputs/rnn/test_rnn_all')
53 # while waiting it to be ready, use test_rnn_small for now
54 return self._run_mkldnn_benchdnn_test('./benchdnn --rnn --batch=inputs/rnn/test_rnn_small')
55 53
56 def test_mkldnn_shuffle_api(self): 54 def test_mkldnn_shuffle_api(self):
57 return self._run_mkldnn_benchdnn_test('./benchdnn --shuffle --batch=inputs/shuffle/test_shuffle_bfloat16') \ No newline at end of file 55 return self._run_mkldnn_benchdnn_test('./benchdnn --shuffle --batch=inputs/shuffle/test_shuffle_bfloat16') \ No newline at end of file