diff options
Diffstat (limited to 'import-layers/yocto-poky/meta/lib/oeqa/selftest/eSDK.py')
-rw-r--r-- | import-layers/yocto-poky/meta/lib/oeqa/selftest/eSDK.py | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/import-layers/yocto-poky/meta/lib/oeqa/selftest/eSDK.py b/import-layers/yocto-poky/meta/lib/oeqa/selftest/eSDK.py index 9d5c68094..1596c6e9d 100644 --- a/import-layers/yocto-poky/meta/lib/oeqa/selftest/eSDK.py +++ b/import-layers/yocto-poky/meta/lib/oeqa/selftest/eSDK.py @@ -6,16 +6,15 @@ import glob import logging import subprocess import oeqa.utils.ftools as ftools -from oeqa.utils.decorators import testcase +from oeqa.utils.decorators import testcase from oeqa.selftest.base import oeSelfTest -from oeqa.utils.commands import runCmd, bitbake, get_bb_var -from oeqa.utils.httpserver import HTTPService +from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars class oeSDKExtSelfTest(oeSelfTest): """ # Bugzilla Test Plan: 6033 # This code is planned to be part of the automation for eSDK containig - # Install libraries and headers, image generation binary feeds. + # Install libraries and headers, image generation binary feeds, sdk-update. """ @staticmethod @@ -24,7 +23,7 @@ class oeSDKExtSelfTest(oeSelfTest): # what environment load oe-selftest, i586, x86_64 pattern = os.path.join(tmpdir_eSDKQA, 'environment-setup-*') return glob.glob(pattern)[0] - + @staticmethod def run_esdk_cmd(env_eSDK, tmpdir_eSDKQA, cmd, postconfig=None, **options): if postconfig: @@ -47,53 +46,66 @@ class oeSDKExtSelfTest(oeSelfTest): def get_eSDK_toolchain(image): pn_task = '%s -c populate_sdk_ext' % image - sdk_deploy = get_bb_var('SDK_DEPLOY', pn_task) - toolchain_name = get_bb_var('TOOLCHAINEXT_OUTPUTNAME', pn_task) + bb_vars = get_bb_vars(['SDK_DEPLOY', 'TOOLCHAINEXT_OUTPUTNAME'], pn_task) + sdk_deploy = bb_vars['SDK_DEPLOY'] + toolchain_name = bb_vars['TOOLCHAINEXT_OUTPUTNAME'] return os.path.join(sdk_deploy, toolchain_name + '.sh') - - @classmethod - def setUpClass(cls): - # Start to serve sstate dir + @staticmethod + def update_configuration(cls, image, tmpdir_eSDKQA, env_eSDK, ext_sdk_path): sstate_dir = os.path.join(os.environ['BUILDDIR'], 'sstate-cache') - cls.http_service = HTTPService(sstate_dir) - cls.http_service.start() - http_url = "127.0.0.1:%d" % cls.http_service.port - - image = 'core-image-minimal' + oeSDKExtSelfTest.generate_eSDK(cls.image) + cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image) + runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA)) + + cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA) + + sstate_config=""" +SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" +SSTATE_MIRRORS = "file://.* file://%s/PATH" +CORE_IMAGE_EXTRA_INSTALL = "perl" + """ % sstate_dir + + with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f: + f.write(sstate_config) + + @classmethod + def setUpClass(cls): cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA') - oeSDKExtSelfTest.generate_eSDK(image) + + sstate_dir = get_bb_var('SSTATE_DIR') + + cls.image = 'core-image-minimal' + oeSDKExtSelfTest.generate_eSDK(cls.image) # Install eSDK - ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(image) - runCmd("%s -y -d \"%s\"" % (ext_sdk_path, cls.tmpdir_eSDKQA)) + cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image) + runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA)) cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA) # Configure eSDK to use sstate mirror from poky sstate_config=""" SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" -SSTATE_MIRRORS = "file://.* http://%s/PATH" - """ % http_url +SSTATE_MIRRORS = "file://.* file://%s/PATH" + """ % sstate_dir with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f: f.write(sstate_config) - @classmethod def tearDownClass(cls): shutil.rmtree(cls.tmpdir_eSDKQA) - cls.http_service.stop() - @testcase (1471) + @testcase (1602) def test_install_libraries_headers(self): pn_sstate = 'bc' bitbake(pn_sstate) cmd = "devtool sdk-install %s " % pn_sstate oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd) - - @testcase(1472) + + @testcase(1603) def test_image_generation_binary_feeds(self): image = 'core-image-minimal' cmd = "devtool build-image %s" % image |