summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorFrancisco Pedraza <francisco.j.pedraza.gonzalez@intel.com>2017-01-17 20:09:02 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:22 +0000
commit51b6df76f2640a3de085e75fe14f96668d6af94a (patch)
treea439933035ba43b2867d028b7b6ab8636078943c /meta
parent44ac2995b88410aa1456e91c0ec913e3b5335010 (diff)
downloadpoky-51b6df76f2640a3de085e75fe14f96668d6af94a.tar.gz
oeqa/selftest: Adds test case for sdk-update eSDK
1. Test case adds perl recipe before build eSDK. 2. After this added recipe, the script verifies the update: ${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh oe-publish-sdk [esdk] [path-to-http] CORE_IMAGE_EXTRA_INSTALL = "perl" bitbake -c populate-sdk-ext [some-image] devtool sdk-update This should fix [YOCTO #9369] (From OE-Core rev: 21bd406bf89e9ceafe1a807877406be817cacca6) Signed-off-by: Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/eSDK.py42
1 files changed, 36 insertions, 6 deletions
diff --git a/meta/lib/oeqa/selftest/eSDK.py b/meta/lib/oeqa/selftest/eSDK.py
index b43a452ac1..c95ca6deb2 100644
--- a/meta/lib/oeqa/selftest/eSDK.py
+++ b/meta/lib/oeqa/selftest/eSDK.py
@@ -51,6 +51,29 @@ class oeSDKExtSelfTest(oeSelfTest):
51 toolchain_name = get_bb_var('TOOLCHAINEXT_OUTPUTNAME', pn_task) 51 toolchain_name = get_bb_var('TOOLCHAINEXT_OUTPUTNAME', pn_task)
52 return os.path.join(sdk_deploy, toolchain_name + '.sh') 52 return os.path.join(sdk_deploy, toolchain_name + '.sh')
53 53
54 @staticmethod
55 def update_configuration(cls, image, tmpdir_eSDKQA, env_eSDK, ext_sdk_path):
56 sstate_dir = os.path.join(os.environ['BUILDDIR'], 'sstate-cache')
57 cls.http_service = HTTPService(sstate_dir)
58 cls.http_service.start()
59 cls.http_url = "http://127.0.0.1:%d" % cls.http_service.port
60
61 oeSDKExtSelfTest.generate_eSDK(cls.image)
62
63 cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image)
64 runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA))
65
66 cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA)
67
68 sstate_config="""
69SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
70SSTATE_MIRRORS = "file://.* http://%s/PATH"
71CORE_IMAGE_EXTRA_INSTALL = "perl"
72 """ % cls.http_url
73
74 with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
75 f.write(sstate_config)
76
54 77
55 @classmethod 78 @classmethod
56 def setUpClass(cls): 79 def setUpClass(cls):
@@ -59,16 +82,16 @@ class oeSDKExtSelfTest(oeSelfTest):
59 cls.http_service = HTTPService(sstate_dir) 82 cls.http_service = HTTPService(sstate_dir)
60 cls.http_service.start() 83 cls.http_service.start()
61 84
62 http_url = "127.0.0.1:%d" % cls.http_service.port 85 cls.http_url = "http://127.0.0.1:%d" % cls.http_service.port
63 86
64 image = 'core-image-minimal' 87 cls.image = 'core-image-minimal'
65 88
66 cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA') 89 cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
67 oeSDKExtSelfTest.generate_eSDK(image) 90 oeSDKExtSelfTest.generate_eSDK(cls.image)
68 91
69 # Install eSDK 92 # Install eSDK
70 ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(image) 93 cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image)
71 runCmd("%s -y -d \"%s\"" % (ext_sdk_path, cls.tmpdir_eSDKQA)) 94 runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA))
72 95
73 cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA) 96 cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA)
74 97
@@ -76,7 +99,7 @@ class oeSDKExtSelfTest(oeSelfTest):
76 sstate_config=""" 99 sstate_config="""
77SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" 100SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
78SSTATE_MIRRORS = "file://.* http://%s/PATH" 101SSTATE_MIRRORS = "file://.* http://%s/PATH"
79 """ % http_url 102 """ % cls.http_url
80 with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f: 103 with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
81 f.write(sstate_config) 104 f.write(sstate_config)
82 105
@@ -99,5 +122,12 @@ SSTATE_MIRRORS = "file://.* http://%s/PATH"
99 cmd = "devtool build-image %s" % image 122 cmd = "devtool build-image %s" % image
100 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd) 123 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
101 124
125 @testcase(1567)
126 def test_sdk_update_http(self):
127 cmd = "devtool sdk-update %s" % self.http_url
128 oeSDKExtSelfTest.update_configuration(self, self.image, self.tmpdir_eSDKQA, self.env_eSDK, self.ext_sdk_path)
129 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
130 self.http_service.stop()
131
102if __name__ == '__main__': 132if __name__ == '__main__':
103 unittest.main() 133 unittest.main()