Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 1 | # |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
| 6 | |
| 7 | import os, tempfile |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 8 | import time |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 9 | from oeqa.sdk.case import OESDKTestCase |
| 10 | from oeqa.utils.subprocesstweak import errors_have_output |
| 11 | errors_have_output() |
| 12 | |
| 13 | class BuildTests(OESDKTestCase): |
| 14 | """ |
| 15 | Verify that bitbake can build virtual/libc inside the buildtools. |
| 16 | """ |
| 17 | def test_libc(self): |
| 18 | with tempfile.TemporaryDirectory(prefix='bitbake-build-', dir=self.tc.sdk_dir) as testdir: |
| 19 | corebase = self.td['COREBASE'] |
| 20 | |
| 21 | self._run('. %s/oe-init-build-env %s' % (corebase, testdir)) |
| 22 | with open(os.path.join(testdir, 'conf', 'local.conf'), 'ta') as conf: |
| 23 | conf.write('\n') |
| 24 | conf.write('DL_DIR = "%s"\n' % self.td['DL_DIR']) |
| 25 | |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 26 | try: |
| 27 | self._run('. %s/oe-init-build-env %s && bitbake virtual/libc' % (corebase, testdir)) |
| 28 | finally: |
| 29 | delay = 10 |
Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame] | 30 | 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] | 31 | time.sleep(1) |
| 32 | delay = delay - 1 |