Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 1 | # |
| 2 | # SPDX-License-Identifier: MIT |
| 3 | # |
| 4 | |
| 5 | import os, tempfile |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 6 | import time |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 7 | from oeqa.sdk.case import OESDKTestCase |
| 8 | from oeqa.utils.subprocesstweak import errors_have_output |
| 9 | errors_have_output() |
| 10 | |
| 11 | class 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 Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 24 | try: |
| 25 | self._run('. %s/oe-init-build-env %s && bitbake virtual/libc' % (corebase, testdir)) |
| 26 | finally: |
| 27 | delay = 10 |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 28 | while delay and (os.path.exists(testdir + "/bitbake.lock") or os.path.exists(testdir + "/cache/hashserv.db-wal")): |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 29 | time.sleep(1) |
| 30 | delay = delay - 1 |