diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2017-05-26 15:37:42 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-02 13:36:14 +0100 |
commit | f9102ab1ede53c9c2e4b296566a58a398322d28c (patch) | |
tree | 113a4c03def9076e3ea44c9a510197360c452e4b /meta/lib/oeqa | |
parent | d3d4ba902dee8b19fa1054330cffdf73f9b81fe7 (diff) | |
download | poky-f9102ab1ede53c9c2e4b296566a58a398322d28c.tar.gz |
oeqa/sdkext/cases: Move sdk_update test into devtool module
With the new OEQA thread support there are problems running
devtool twice at the same time because only one instance of
bitbake/devtool is allowed.
[YOCTO #11450]
(From OE-Core rev: 44254caaef131402629d01f01cdee6722718adba)
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')
-rw-r--r-- | meta/lib/oeqa/sdkext/cases/devtool.py | 32 | ||||
-rw-r--r-- | meta/lib/oeqa/sdkext/cases/sdk_update.py | 39 |
2 files changed, 32 insertions, 39 deletions
diff --git a/meta/lib/oeqa/sdkext/cases/devtool.py b/meta/lib/oeqa/sdkext/cases/devtool.py index a01bc0bfe2..ea9051710a 100644 --- a/meta/lib/oeqa/sdkext/cases/devtool.py +++ b/meta/lib/oeqa/sdkext/cases/devtool.py | |||
@@ -1,12 +1,14 @@ | |||
1 | # Copyright (C) 2016 Intel Corporation | 1 | # Copyright (C) 2016 Intel Corporation |
2 | # Released under the MIT license (see COPYING.MIT) | 2 | # Released under the MIT license (see COPYING.MIT) |
3 | 3 | ||
4 | import os | ||
4 | import shutil | 5 | import shutil |
5 | import subprocess | 6 | import subprocess |
6 | 7 | ||
7 | from oeqa.sdkext.case import OESDKExtTestCase | 8 | from oeqa.sdkext.case import OESDKExtTestCase |
8 | from oeqa.core.decorator.depends import OETestDepends | 9 | from oeqa.core.decorator.depends import OETestDepends |
9 | from oeqa.core.decorator.oeid import OETestID | 10 | from oeqa.core.decorator.oeid import OETestID |
11 | from oeqa.utils.httpserver import HTTPService | ||
10 | 12 | ||
11 | class DevtoolTest(OESDKExtTestCase): | 13 | class DevtoolTest(OESDKExtTestCase): |
12 | @classmethod | 14 | @classmethod |
@@ -95,3 +97,33 @@ class DevtoolTest(OESDKExtTestCase): | |||
95 | self._run('devtool build %s ' % package_nodejs) | 97 | self._run('devtool build %s ' % package_nodejs) |
96 | finally: | 98 | finally: |
97 | self._run('devtool reset %s '% package_nodejs) | 99 | self._run('devtool reset %s '% package_nodejs) |
100 | |||
101 | class SdkUpdateTest(OESDKExtTestCase): | ||
102 | @classmethod | ||
103 | def setUpClass(self): | ||
104 | self.publish_dir = os.path.join(self.tc.sdk_dir, 'esdk_publish') | ||
105 | if os.path.exists(self.publish_dir): | ||
106 | shutil.rmtree(self.publish_dir) | ||
107 | os.mkdir(self.publish_dir) | ||
108 | |||
109 | base_tcname = "%s/%s" % (self.td.get("SDK_DEPLOY", ''), | ||
110 | self.td.get("TOOLCHAINEXT_OUTPUTNAME", '')) | ||
111 | tcname_new = "%s-new.sh" % base_tcname | ||
112 | if not os.path.exists(tcname_new): | ||
113 | tcname_new = "%s.sh" % base_tcname | ||
114 | |||
115 | cmd = 'oe-publish-sdk %s %s' % (tcname_new, self.publish_dir) | ||
116 | subprocess.check_output(cmd, shell=True) | ||
117 | |||
118 | self.http_service = HTTPService(self.publish_dir) | ||
119 | self.http_service.start() | ||
120 | |||
121 | self.http_url = "http://127.0.0.1:%d" % self.http_service.port | ||
122 | |||
123 | def test_sdk_update_http(self): | ||
124 | output = self._run("devtool sdk-update \"%s\"" % self.http_url) | ||
125 | |||
126 | @classmethod | ||
127 | def tearDownClass(self): | ||
128 | self.http_service.stop() | ||
129 | shutil.rmtree(self.publish_dir) | ||
diff --git a/meta/lib/oeqa/sdkext/cases/sdk_update.py b/meta/lib/oeqa/sdkext/cases/sdk_update.py deleted file mode 100644 index 2f8598bbe5..0000000000 --- a/meta/lib/oeqa/sdkext/cases/sdk_update.py +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | # Copyright (C) 2016 Intel Corporation | ||
2 | # Released under the MIT license (see COPYING.MIT) | ||
3 | |||
4 | import os | ||
5 | import shutil | ||
6 | import subprocess | ||
7 | |||
8 | from oeqa.sdkext.case import OESDKExtTestCase | ||
9 | from oeqa.utils.httpserver import HTTPService | ||
10 | |||
11 | class SdkUpdateTest(OESDKExtTestCase): | ||
12 | @classmethod | ||
13 | def setUpClass(self): | ||
14 | self.publish_dir = os.path.join(self.tc.sdk_dir, 'esdk_publish') | ||
15 | if os.path.exists(self.publish_dir): | ||
16 | shutil.rmtree(self.publish_dir) | ||
17 | os.mkdir(self.publish_dir) | ||
18 | |||
19 | base_tcname = "%s/%s" % (self.td.get("SDK_DEPLOY", ''), | ||
20 | self.td.get("TOOLCHAINEXT_OUTPUTNAME", '')) | ||
21 | tcname_new = "%s-new.sh" % base_tcname | ||
22 | if not os.path.exists(tcname_new): | ||
23 | tcname_new = "%s.sh" % base_tcname | ||
24 | |||
25 | cmd = 'oe-publish-sdk %s %s' % (tcname_new, self.publish_dir) | ||
26 | subprocess.check_output(cmd, shell=True) | ||
27 | |||
28 | self.http_service = HTTPService(self.publish_dir) | ||
29 | self.http_service.start() | ||
30 | |||
31 | self.http_url = "http://127.0.0.1:%d" % self.http_service.port | ||
32 | |||
33 | def test_sdk_update_http(self): | ||
34 | output = self._run("devtool sdk-update \"%s\"" % self.http_url) | ||
35 | |||
36 | @classmethod | ||
37 | def tearDownClass(self): | ||
38 | self.http_service.stop() | ||
39 | shutil.rmtree(self.publish_dir) | ||