summaryrefslogtreecommitdiffstats
path: root/lib/oeqa/runtime/cases/dldt_model_optimizer.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oeqa/runtime/cases/dldt_model_optimizer.py')
-rw-r--r--lib/oeqa/runtime/cases/dldt_model_optimizer.py38
1 files changed, 38 insertions, 0 deletions
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))