[oe-commits] [openembedded-core] 20/26: oeqa/selftest: Drop http sstate sharing

git at git.openembedded.org git at git.openembedded.org
Wed Mar 1 15:51:29 UTC 2017


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

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

commit 75be84b01aab1f5505e8c4d5c6ee0a141fe8f78b
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Mar 1 15:16:44 2017 +0000

    oeqa/selftest: Drop http sstate sharing
    
    Using httpServer from python for sharing sstate is known to be buggy, it can't
    cope with the number/type of requests coming from bitbake and quietly fails
    to share files.
    
    This causes intermittent build failures which are hard to debug. We can
    use a file:// url for the sstate mirror instead, removing the need for
    the http server.
    
    The sdk-update test is simply dropped since the SDK is never published
    to this location and hence it would never have any update. Its equiavalent
    to pointing at an empty web server. There is a better eSDK update test in
    testsdk so rather than improve this one, lets drop it and concentrate on
    the one there.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/selftest/eSDK.py | 55 ++++++++++++------------------------------
 1 file changed, 16 insertions(+), 39 deletions(-)

diff --git a/meta/lib/oeqa/selftest/eSDK.py b/meta/lib/oeqa/selftest/eSDK.py
index a66ff92..1596c6e 100644
--- a/meta/lib/oeqa/selftest/eSDK.py
+++ b/meta/lib/oeqa/selftest/eSDK.py
@@ -9,7 +9,6 @@ import oeqa.utils.ftools as ftools
 from oeqa.utils.decorators import testcase
 from oeqa.selftest.base import oeSelfTest
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
-from oeqa.utils.httpserver import HTTPService
 
 class oeSDKExtSelfTest(oeSelfTest):
     """
@@ -55,9 +54,6 @@ class oeSDKExtSelfTest(oeSelfTest):
     @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)
 
@@ -68,51 +64,39 @@ class oeSDKExtSelfTest(oeSelfTest):
 
         sstate_config="""
 SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
-SSTATE_MIRRORS =  "file://.* http://%s/PATH"
+SSTATE_MIRRORS =  "file://.* file://%s/PATH"
 CORE_IMAGE_EXTRA_INSTALL = "perl"
-        """ % cls.http_url
+        """ % sstate_dir
 
         with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
             f.write(sstate_config)
 
     @classmethod
     def setUpClass(cls):
-        # If there is an exception in setUpClass it will not run tearDownClass
-        # method and it leaves HTTP server running forever, so we need to be
-        # sure tearDownClass is run.
-        try:
-            cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
+        cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
 
-            # Start to serve sstate dir
-            sstate_dir = get_bb_var('SSTATE_DIR')
-            cls.http_service = HTTPService(sstate_dir)
-            cls.http_url = "http://127.0.0.1:%d" % cls.http_service.port
-            cls.http_service.start()
+        sstate_dir = get_bb_var('SSTATE_DIR')
 
-            cls.image = 'core-image-minimal'
-            oeSDKExtSelfTest.generate_eSDK(cls.image)
+        cls.image = 'core-image-minimal'
+        oeSDKExtSelfTest.generate_eSDK(cls.image)
 
-            # Install eSDK
-            cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image)
-            runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA))
+        # Install eSDK
+        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)
+        cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA)
 
-            # Configure eSDK to use sstate mirror from poky
-            sstate_config="""
+        # Configure eSDK to use sstate mirror from poky
+        sstate_config="""
 SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
-SSTATE_MIRRORS =  "file://.* http://%s/PATH"
-            """ % cls.http_url
-            with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
-                f.write(sstate_config)
-        except:
-            cls.tearDownClass()
-            raise
+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 (1602)
     def test_install_libraries_headers(self):
@@ -127,12 +111,5 @@ 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