summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
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-09-11 17:15:55 +0100
commita17d574f092287267e08ae9548d4444673ddf610 (patch)
tree291b4c6d619b3ec7b2557f1050baaabd269a6169 /meta/lib/oeqa
parentce4016c070ffc81267b0d071bbc738fb688fb902 (diff)
downloadpoky-a17d574f092287267e08ae9548d4444673ddf610.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) (From OE-Core rev: 840a317e8a5518dbd1a025381441e13e906519ff) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-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 4c58d2b410..d3041426ed 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 11from oeqa.utils.commands import runCmd, bitbake, get_bb_var
12from oeqa.utils.httpserver import HTTPService
13 12
14class oeSDKExtSelfTest(oeSelfTest): 13class oeSDKExtSelfTest(oeSelfTest):
15 """ 14 """
@@ -54,9 +53,6 @@ class oeSDKExtSelfTest(oeSelfTest):
54 @staticmethod 53 @staticmethod
55 def update_configuration(cls, image, tmpdir_eSDKQA, env_eSDK, ext_sdk_path): 54 def update_configuration(cls, image, tmpdir_eSDKQA, env_eSDK, ext_sdk_path):
56 sstate_dir = os.path.join(os.environ['BUILDDIR'], 'sstate-cache') 55 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 56
61 oeSDKExtSelfTest.generate_eSDK(cls.image) 57 oeSDKExtSelfTest.generate_eSDK(cls.image)
62 58
@@ -67,51 +63,39 @@ class oeSDKExtSelfTest(oeSelfTest):
67 63
68 sstate_config=""" 64 sstate_config="""
69SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" 65SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
70SSTATE_MIRRORS = "file://.* http://%s/PATH" 66SSTATE_MIRRORS = "file://.* file://%s/PATH"
71CORE_IMAGE_EXTRA_INSTALL = "perl" 67CORE_IMAGE_EXTRA_INSTALL = "perl"
72 """ % cls.http_url 68 """ % sstate_dir
73 69
74 with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f: 70 with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
75 f.write(sstate_config) 71 f.write(sstate_config)
76 72
77 @classmethod 73 @classmethod
78 def setUpClass(cls): 74 def setUpClass(cls):
79 # If there is an exception in setUpClass it will not run tearDownClass 75 cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
80 # method and it leaves HTTP server running forever, so we need to be
81 # sure tearDownClass is run.
82 try:
83 cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
84 76
85 # Start to serve sstate dir 77 sstate_dir = get_bb_var('SSTATE_DIR')
86 sstate_dir = get_bb_var('SSTATE_DIR')
87 cls.http_service = HTTPService(sstate_dir)
88 cls.http_url = "http://127.0.0.1:%d" % cls.http_service.port
89 cls.http_service.start()
90 78
91 cls.image = 'core-image-minimal' 79 cls.image = 'core-image-minimal'
92 oeSDKExtSelfTest.generate_eSDK(cls.image) 80 oeSDKExtSelfTest.generate_eSDK(cls.image)
93 81
94 # Install eSDK 82 # Install eSDK
95 cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image) 83 cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image)
96 runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA)) 84 runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA))
97 85
98 cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA) 86 cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA)
99 87
100 # Configure eSDK to use sstate mirror from poky 88 # Configure eSDK to use sstate mirror from poky
101 sstate_config=""" 89 sstate_config="""
102SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" 90SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
103SSTATE_MIRRORS = "file://.* http://%s/PATH" 91SSTATE_MIRRORS = "file://.* file://%s/PATH"
104 """ % cls.http_url 92 """ % sstate_dir
105 with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f: 93 with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
106 f.write(sstate_config) 94 f.write(sstate_config)
107 except:
108 cls.tearDownClass()
109 raise
110 95
111 @classmethod 96 @classmethod
112 def tearDownClass(cls): 97 def tearDownClass(cls):
113 shutil.rmtree(cls.tmpdir_eSDKQA) 98 shutil.rmtree(cls.tmpdir_eSDKQA)
114 cls.http_service.stop()
115 99
116 @testcase (1471) 100 @testcase (1471)
117 def test_install_libraries_headers(self): 101 def test_install_libraries_headers(self):
@@ -126,12 +110,5 @@ SSTATE_MIRRORS = "file://.* http://%s/PATH"
126 cmd = "devtool build-image %s" % image 110 cmd = "devtool build-image %s" % image
127 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd) 111 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
128 112
129 @testcase(1567)
130 def test_sdk_update_http(self):
131 cmd = "devtool sdk-update %s" % self.http_url
132 oeSDKExtSelfTest.update_configuration(self, self.image, self.tmpdir_eSDKQA, self.env_eSDK, self.ext_sdk_path)
133 oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
134 self.http_service.stop()
135
136if __name__ == '__main__': 113if __name__ == '__main__':
137 unittest.main() 114 unittest.main()