summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-01 15:16:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-01 23:27:11 +0000
commit842bc0ff5ae1b2d85ed1c1c40b46bbd559adcb4b (patch)
tree2867ea15d9a9d2236ea77990ea8543aaca3ecd02 /meta/lib
parent28430385ad085be87738c42a997d9e100f0b3baa (diff)
downloadpoky-842bc0ff5ae1b2d85ed1c1c40b46bbd559adcb4b.tar.gz
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. (From OE-Core rev: 7606f05e48ad2e31650e3a56bfcd04b4fbfad1e3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/eSDK.py55
1 files changed, 16 insertions, 39 deletions
diff --git a/meta/lib/oeqa/selftest/eSDK.py b/meta/lib/oeqa/selftest/eSDK.py
index a66ff92140..1596c6e9d6 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
9from oeqa.utils.decorators import testcase 9from oeqa.utils.decorators import testcase
10from oeqa.selftest.base import oeSelfTest 10from oeqa.selftest.base import oeSelfTest
11from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars 11from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
12from oeqa.utils.httpserver import HTTPService
13 12
14class oeSDKExtSelfTest(oeSelfTest): 13class oeSDKExtSelfTest(oeSelfTest):
15 """ 14 """
@@ -55,9 +54,6 @@ class oeSDKExtSelfTest(oeSelfTest):
55 @staticmethod 54 @staticmethod
56 def update_configuration(cls, image, tmpdir_eSDKQA, env_eSDK, ext_sdk_path): 55 def update_configuration(cls, image, tmpdir_eSDKQA, env_eSDK, ext_sdk_path):
57 sstate_dir = os.path.join(os.environ['BUILDDIR'], 'sstate-cache') 56 sstate_dir = os.path.join(os.environ['BUILDDIR'], 'sstate-cache')
58 cls.http_service = HTTPService(sstate_dir)
59 cls.http_service.start()
60 cls.http_url = "http://127.0.0.1:%d" % cls.http_service.port
61 57
62 oeSDKExtSelfTest.generate_eSDK(cls.image) 58 oeSDKExtSelfTest.generate_eSDK(cls.image)
63 59
@@ -68,51 +64,39 @@ class oeSDKExtSelfTest(oeSelfTest):
68 64
69 sstate_config=""" 65 sstate_config="""
70SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" 66SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
71SSTATE_MIRRORS = "file://.* http://%s/PATH" 67SSTATE_MIRRORS = "file://.* file://%s/PATH"
72CORE_IMAGE_EXTRA_INSTALL = "perl" 68CORE_IMAGE_EXTRA_INSTALL = "perl"
73 """ % cls.http_url 69 """ % sstate_dir
74 70
75 with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f: 71 with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
76 f.write(sstate_config) 72 f.write(sstate_config)
77 73
78 @classmethod 74 @classmethod
79 def setUpClass(cls): 75 def setUpClass(cls):
80 # If there is an exception in setUpClass it will not run tearDownClass 76 cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
81 # method and it leaves HTTP server running forever, so we need to be
82 # sure tearDownClass is run.
83 try:
84 cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
85 77
86 # Start to serve sstate dir 78 sstate_dir = get_bb_var('SSTATE_DIR')
87 sstate_dir = get_bb_var('SSTATE_DIR')
88 cls.http_service = HTTPService(sstate_dir)
89 cls.http_url = "http://127.0.0.1:%d" % cls.http_service.port
90 cls.http_service.start()
91 79
92 cls.image = 'core-image-minimal' 80 cls.image = 'core-image-minimal'
93 oeSDKExtSelfTest.generate_eSDK(cls.image) 81 oeSDKExtSelfTest.generate_eSDK(cls.image)
94 82
95 # Install eSDK 83 # Install eSDK
96 cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image) 84 cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image)
97 runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA)) 85 runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA))
98 86
99 cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA) 87 cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA)
100 88
101 # Configure eSDK to use sstate mirror from poky 89 # Configure eSDK to use sstate mirror from poky
102 sstate_config=""" 90 sstate_config="""
103SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" 91SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
104SSTATE_MIRRORS = "file://.* http://%s/PATH" 92SSTATE_MIRRORS = "file://.* file://%s/PATH"
105 """ % cls.http_url 93 """ % sstate_dir
106 with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f: 94 with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
107 f.write(sstate_config) 95 f.write(sstate_config)
108 except:
109 cls.tearDownClass()
110 raise
111 96
112 @classmethod 97 @classmethod
113 def tearDownClass(cls): 98 def tearDownClass(cls):
114 shutil.rmtree(cls.tmpdir_eSDKQA) 99 shutil.rmtree(cls.tmpdir_eSDKQA)
115 cls.http_service.stop()
116 100
117 @testcase (1602) 101 @testcase (1602)
118 def test_install_libraries_headers(self): 102 def test_install_libraries_headers(self):
@@ -127,12 +111,5 @@ SSTATE_MIRRORS = "file://.* http://%s/PATH"
127 cmd = "devtool build-image %s" % image 111 cmd = "devtool build-image %s" % image
128 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd) 112 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
129 113
130 @testcase(1567)
131 def test_sdk_update_http(self):
132 cmd = "devtool sdk-update %s" % self.http_url
133 oeSDKExtSelfTest.update_configuration(self, self.image, self.tmpdir_eSDKQA, self.env_eSDK, self.ext_sdk_path)
134 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
135 self.http_service.stop()
136
137if __name__ == '__main__': 114if __name__ == '__main__':
138 unittest.main() 115 unittest.main()