1*4882a593Smuzhiyun# 2*4882a593Smuzhiyun# SPDX-License-Identifier: MIT 3*4882a593Smuzhiyun# 4*4882a593Smuzhiyun 5*4882a593Smuzhiyunimport os, tempfile 6*4882a593Smuzhiyunimport time 7*4882a593Smuzhiyunfrom oeqa.sdk.case import OESDKTestCase 8*4882a593Smuzhiyunfrom oeqa.utils.subprocesstweak import errors_have_output 9*4882a593Smuzhiyunerrors_have_output() 10*4882a593Smuzhiyun 11*4882a593Smuzhiyunclass BuildTests(OESDKTestCase): 12*4882a593Smuzhiyun """ 13*4882a593Smuzhiyun Verify that bitbake can build virtual/libc inside the buildtools. 14*4882a593Smuzhiyun """ 15*4882a593Smuzhiyun def test_libc(self): 16*4882a593Smuzhiyun with tempfile.TemporaryDirectory(prefix='bitbake-build-', dir=self.tc.sdk_dir) as testdir: 17*4882a593Smuzhiyun corebase = self.td['COREBASE'] 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun self._run('. %s/oe-init-build-env %s' % (corebase, testdir)) 20*4882a593Smuzhiyun with open(os.path.join(testdir, 'conf', 'local.conf'), 'ta') as conf: 21*4882a593Smuzhiyun conf.write('\n') 22*4882a593Smuzhiyun conf.write('DL_DIR = "%s"\n' % self.td['DL_DIR']) 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun try: 25*4882a593Smuzhiyun self._run('. %s/oe-init-build-env %s && bitbake virtual/libc' % (corebase, testdir)) 26*4882a593Smuzhiyun finally: 27*4882a593Smuzhiyun delay = 10 28*4882a593Smuzhiyun while delay and (os.path.exists(testdir + "/bitbake.lock") or os.path.exists(testdir + "/cache/hashserv.db-wal")): 29*4882a593Smuzhiyun time.sleep(1) 30*4882a593Smuzhiyun delay = delay - 1 31