[oe-commits] [openembedded-core] 02/05: oeqa/selftest: Adds test case for sdk-update eSDK

git at git.openembedded.org git at git.openembedded.org
Mon Sep 11 09:48:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch morty-next
in repository openembedded-core.

commit 7824ca273e7e4b25d4efe5461c0402833f535d06
Author: Francisco Pedraza <francisco.j.pedraza.gonzalez at intel.com>
AuthorDate: Tue Jan 17 20:09:02 2017 -0600

    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 at intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/selftest/eSDK.py | 42 ++++++++++++++++++++++++++++++++++++------
 1 file changed, 36 insertions(+), 6 deletions(-)

diff --git a/meta/lib/oeqa/selftest/eSDK.py b/meta/lib/oeqa/selftest/eSDK.py
index b43a452..c95ca6d 100644
--- a/meta/lib/oeqa/selftest/eSDK.py
+++ b/meta/lib/oeqa/selftest/eSDK.py
@@ -51,6 +51,29 @@ class oeSDKExtSelfTest(oeSelfTest):
         toolchain_name = get_bb_var('TOOLCHAINEXT_OUTPUTNAME', pn_task)
         return os.path.join(sdk_deploy, toolchain_name + '.sh')
     
+    @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()
+        cls.http_url = "http://127.0.0.1:%d" % cls.http_service.port
+
+        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://.* http://%s/PATH"
+CORE_IMAGE_EXTRA_INSTALL = "perl"
+        """ % cls.http_url
+
+        with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
+            f.write(sstate_config)
+    
 
     @classmethod
     def setUpClass(cls):
@@ -59,16 +82,16 @@ class oeSDKExtSelfTest(oeSelfTest):
         cls.http_service = HTTPService(sstate_dir)
         cls.http_service.start()
 
-        http_url = "127.0.0.1:%d" % cls.http_service.port
+        cls.http_url = "http://127.0.0.1:%d" % cls.http_service.port
  
-        image = 'core-image-minimal'
+        cls.image = 'core-image-minimal'
 
         cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
-        oeSDKExtSelfTest.generate_eSDK(image)
+        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)
 
@@ -76,7 +99,7 @@ class oeSDKExtSelfTest(oeSelfTest):
         sstate_config="""
 SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
 SSTATE_MIRRORS =  "file://.* http://%s/PATH"
-        """ % http_url
+        """ % cls.http_url
         with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
             f.write(sstate_config)
 
@@ -99,5 +122,12 @@ SSTATE_MIRRORS =  "file://.* http://%s/PATH"
         cmd = "devtool build-image %s" % image
         oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
 
+    @testcase(1567)
+    def test_sdk_update_http(self):
+        cmd = "devtool sdk-update %s" % self.http_url
+        oeSDKExtSelfTest.update_configuration(self, self.image, self.tmpdir_eSDKQA, self.env_eSDK, self.ext_sdk_path)
+        oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
+        self.http_service.stop()
+
 if __name__ == '__main__':
     unittest.main()

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list