diff options
author | Aníbal Limón <limon.anibal@gmail.com> | 2016-02-21 14:40:20 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-28 11:33:06 +0000 |
commit | c7e5a38d232b97da81eb87aa1ef520c65c4692b4 (patch) | |
tree | 9a5e3aa6d2ae547f6d7acc90ef08dfdfd38f38f6 | |
parent | 738bd1a6407d87573edcc61c1eb2d276fbffd0f3 (diff) | |
download | poky-c7e5a38d232b97da81eb87aa1ef520c65c4692b4.tar.gz |
oeqa/sdkext: Add sdk_update.SDKUpdateTest class.
The SDKUpdateTest class test devtool sdk-update mechanism inside
eSDK.
The SDKUpdateTest class search for new sdk if not found uses
the main one then it publish the eSDK into known folder
inside work and it starts a web server for serve the eSDK.
Finally it executes sdk-update over http, the local test is
commented due to bug [1].
[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=9043
[YOCTO #9089]
(From OE-Core rev: be7f5036a7c86fe70d43526df529bc467a9cf7d9)
Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/sdkext/sdk_update.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdkext/sdk_update.py b/meta/lib/oeqa/sdkext/sdk_update.py new file mode 100644 index 0000000000..16f5b10d59 --- /dev/null +++ b/meta/lib/oeqa/sdkext/sdk_update.py | |||
@@ -0,0 +1,39 @@ | |||
1 | import os | ||
2 | import shutil | ||
3 | import subprocess | ||
4 | |||
5 | from oeqa.oetest import oeSDKExtTest | ||
6 | from oeqa.utils.httpserver import HTTPService | ||
7 | |||
8 | class SdkUpdateTest(oeSDKExtTest): | ||
9 | |||
10 | @classmethod | ||
11 | def setUpClass(self): | ||
12 | self.publish_dir = os.path.join(self.tc.sdktestdir, 'esdk_publish') | ||
13 | if os.path.exists(self.publish_dir): | ||
14 | shutil.rmtree(self.publish_dir) | ||
15 | os.mkdir(self.publish_dir) | ||
16 | |||
17 | tcname_new = self.tc.d.expand( | ||
18 | "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}-new.sh") | ||
19 | if not os.path.exists(tcname_new): | ||
20 | tcname_new = self.tc.tcname | ||
21 | |||
22 | cmd = 'oe-publish-sdk %s %s' % (tcname_new, self.publish_dir) | ||
23 | subprocess.check_output(cmd, shell=True) | ||
24 | |||
25 | self.http_service = HTTPService(self.publish_dir) | ||
26 | self.http_service.start() | ||
27 | |||
28 | self.http_url = "http://127.0.0.1:%d" % self.http_service.port | ||
29 | |||
30 | def test_sdk_update_http(self): | ||
31 | output = self._run("devtool sdk-update \"%s\"" % self.http_url) | ||
32 | |||
33 | # def test_sdk_update_local(self): | ||
34 | # output = self._run("devtool sdk-update \"%s\"" % self.publish_dir) | ||
35 | |||
36 | @classmethod | ||
37 | def tearDownClass(self): | ||
38 | self.http_service.stop() | ||
39 | shutil.rmtree(self.publish_dir) | ||