summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdkext/cases/devtool.py
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2016-11-30 10:35:52 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:19 +0000
commit55f05fab2b2b72b3e254ff02c1e294d53691a1fc (patch)
treebc8499111780cf799e2baa4b2b7e95c334d5fd7a /meta/lib/oeqa/sdkext/cases/devtool.py
parent3fac2417ddfffb8b32a821ae4b53fabfbb48a8fa (diff)
downloadpoky-55f05fab2b2b72b3e254ff02c1e294d53691a1fc.tar.gz
oeqa/sdkext: Move test cases inside cases directory
For match with the new structure of the OEQA framework. In the new framework Test component base directory in this case sdk module will contain case and context implementations. [YOCTO #10599] (From OE-Core rev: bdb92fa4d9bd2e4a0a14e3adc62a6b9e9bf639d3) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/sdkext/cases/devtool.py')
-rw-r--r--meta/lib/oeqa/sdkext/cases/devtool.py108
1 files changed, 108 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdkext/cases/devtool.py b/meta/lib/oeqa/sdkext/cases/devtool.py
new file mode 100644
index 0000000000..65f41f6875
--- /dev/null
+++ b/meta/lib/oeqa/sdkext/cases/devtool.py
@@ -0,0 +1,108 @@
1import shutil
2import subprocess
3import urllib.request
4from oeqa.oetest import oeSDKExtTest
5from oeqa.utils.decorators import *
6
7class DevtoolTest(oeSDKExtTest):
8 @classmethod
9 def setUpClass(self):
10 self.myapp_src = os.path.join(self.tc.sdkextfilesdir, "myapp")
11 self.myapp_dst = os.path.join(self.tc.sdktestdir, "myapp")
12 shutil.copytree(self.myapp_src, self.myapp_dst)
13
14 self.myapp_cmake_src = os.path.join(self.tc.sdkextfilesdir, "myapp_cmake")
15 self.myapp_cmake_dst = os.path.join(self.tc.sdktestdir, "myapp_cmake")
16 shutil.copytree(self.myapp_cmake_src, self.myapp_cmake_dst)
17
18 def _test_devtool_build(self, directory):
19 self._run('devtool add myapp %s' % directory)
20 try:
21 self._run('devtool build myapp')
22 except Exception as e:
23 print(e.output)
24 self._run('devtool reset myapp')
25 raise e
26 self._run('devtool reset myapp')
27
28 def _test_devtool_build_package(self, directory):
29 self._run('devtool add myapp %s' % directory)
30 try:
31 self._run('devtool package myapp')
32 except Exception as e:
33 print(e.output)
34 self._run('devtool reset myapp')
35 raise e
36 self._run('devtool reset myapp')
37
38 def test_devtool_location(self):
39 output = self._run('which devtool')
40 self.assertEqual(output.startswith(self.tc.sdktestdir), True, \
41 msg="Seems that devtool isn't the eSDK one: %s" % output)
42
43 @skipUnlessPassed('test_devtool_location')
44 def test_devtool_add_reset(self):
45 self._run('devtool add myapp %s' % self.myapp_dst)
46 self._run('devtool reset myapp')
47
48 @testcase(1473)
49 @skipUnlessPassed('test_devtool_location')
50 def test_devtool_build_make(self):
51 self._test_devtool_build(self.myapp_dst)
52
53 @testcase(1474)
54 @skipUnlessPassed('test_devtool_location')
55 def test_devtool_build_esdk_package(self):
56 self._test_devtool_build_package(self.myapp_dst)
57
58 @testcase(1479)
59 @skipUnlessPassed('test_devtool_location')
60 def test_devtool_build_cmake(self):
61 self._test_devtool_build(self.myapp_cmake_dst)
62
63 @testcase(1482)
64 @skipUnlessPassed('test_devtool_location')
65 def test_extend_autotools_recipe_creation(self):
66 req = 'https://github.com/rdfa/librdfa'
67 recipe = "bbexample"
68 self._run('devtool add %s %s' % (recipe, req) )
69 try:
70 self._run('devtool build %s' % recipe)
71 except Exception as e:
72 print(e.output)
73 self._run('devtool reset %s' % recipe)
74 raise e
75 self._run('devtool reset %s' % recipe)
76
77 @testcase(1484)
78 @skipUnlessPassed('test_devtool_location')
79 def test_devtool_kernelmodule(self):
80 docfile = 'https://github.com/umlaeute/v4l2loopback.git'
81 recipe = 'v4l2loopback-driver'
82 self._run('devtool add %s %s' % (recipe, docfile) )
83 try:
84 self._run('devtool build %s' % recipe)
85 except Exception as e:
86 print(e.output)
87 self._run('devtool reset %s' % recipe)
88 raise e
89 self._run('devtool reset %s' % recipe)
90
91 @testcase(1478)
92 @skipUnlessPassed('test_devtool_location')
93 def test_recipes_for_nodejs(self):
94 package_nodejs = "npm://registry.npmjs.org;name=winston;version=2.2.0"
95 self._run('devtool add %s ' % package_nodejs)
96 try:
97 self._run('devtool build %s ' % package_nodejs)
98 except Exception as e:
99 print(e.output)
100 self._run('devtool reset %s' % package_nodejs)
101 raise e
102 self._run('devtool reset %s '% package_nodejs)
103
104
105 @classmethod
106 def tearDownClass(self):
107 shutil.rmtree(self.myapp_dst)
108 shutil.rmtree(self.myapp_cmake_dst)