blob: aee2e5a8c06dfa4456a14a6fa506062eb1d91f82 [file] [log] [blame]
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001#
2# SPDX-License-Identifier: MIT
3#
4
5import os, tempfile
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05006import time
Patrick Williams0ca19cc2021-08-16 14:03:13 -05007from oeqa.sdk.case import OESDKTestCase
8from oeqa.utils.subprocesstweak import errors_have_output
9errors_have_output()
10
11class BuildTests(OESDKTestCase):
12 """
13 Verify that bitbake can build virtual/libc inside the buildtools.
14 """
15 def test_libc(self):
16 with tempfile.TemporaryDirectory(prefix='bitbake-build-', dir=self.tc.sdk_dir) as testdir:
17 corebase = self.td['COREBASE']
18
19 self._run('. %s/oe-init-build-env %s' % (corebase, testdir))
20 with open(os.path.join(testdir, 'conf', 'local.conf'), 'ta') as conf:
21 conf.write('\n')
22 conf.write('DL_DIR = "%s"\n' % self.td['DL_DIR'])
23
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050024 try:
25 self._run('. %s/oe-init-build-env %s && bitbake virtual/libc' % (corebase, testdir))
26 finally:
27 delay = 10
Andrew Geisslereff27472021-10-29 15:35:00 -050028 while delay and (os.path.exists(testdir + "/bitbake.lock") or os.path.exists(testdir + "/cache/hashserv.db-wal")):
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050029 time.sleep(1)
30 delay = delay - 1