diff options
-rw-r--r-- | meta/lib/oeqa/sdk/buildtools-cases/README | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/sdk/buildtools-cases/build.py | 23 | ||||
-rw-r--r-- | meta/lib/oeqa/sdk/buildtools-cases/sanity.py | 22 |
3 files changed, 47 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdk/buildtools-cases/README b/meta/lib/oeqa/sdk/buildtools-cases/README new file mode 100644 index 0000000000..d4f20faa9f --- /dev/null +++ b/meta/lib/oeqa/sdk/buildtools-cases/README | |||
@@ -0,0 +1,2 @@ | |||
1 | These test cases are used by buildtools-tarball, and are not used by the testsdk | ||
2 | class. | ||
diff --git a/meta/lib/oeqa/sdk/buildtools-cases/build.py b/meta/lib/oeqa/sdk/buildtools-cases/build.py new file mode 100644 index 0000000000..5a17ab98c6 --- /dev/null +++ b/meta/lib/oeqa/sdk/buildtools-cases/build.py | |||
@@ -0,0 +1,23 @@ | |||
1 | # | ||
2 | # SPDX-License-Identifier: MIT | ||
3 | # | ||
4 | |||
5 | import os, tempfile | ||
6 | from oeqa.sdk.case import OESDKTestCase | ||
7 | from oeqa.utils.subprocesstweak import errors_have_output | ||
8 | errors_have_output() | ||
9 | |||
10 | class BuildTests(OESDKTestCase): | ||
11 | """ | ||
12 | Verify that bitbake can build virtual/libc inside the buildtools. | ||
13 | """ | ||
14 | def test_libc(self): | ||
15 | with tempfile.TemporaryDirectory(prefix='bitbake-build-', dir=self.tc.sdk_dir) as testdir: | ||
16 | corebase = self.td['COREBASE'] | ||
17 | |||
18 | self._run('. %s/oe-init-build-env %s' % (corebase, testdir)) | ||
19 | with open(os.path.join(testdir, 'conf', 'local.conf'), 'ta') as conf: | ||
20 | conf.write('\n') | ||
21 | conf.write('DL_DIR = "%s"\n' % self.td['DL_DIR']) | ||
22 | |||
23 | self._run('. %s/oe-init-build-env %s && bitbake virtual/libc' % (corebase, testdir)) | ||
diff --git a/meta/lib/oeqa/sdk/buildtools-cases/sanity.py b/meta/lib/oeqa/sdk/buildtools-cases/sanity.py new file mode 100644 index 0000000000..64baaa8f84 --- /dev/null +++ b/meta/lib/oeqa/sdk/buildtools-cases/sanity.py | |||
@@ -0,0 +1,22 @@ | |||
1 | # | ||
2 | # SPDX-License-Identifier: MIT | ||
3 | # | ||
4 | |||
5 | import shutil | ||
6 | import os.path | ||
7 | from oeqa.sdk.case import OESDKTestCase | ||
8 | |||
9 | class SanityTests(OESDKTestCase): | ||
10 | def test_tools(self): | ||
11 | """ | ||
12 | Test that wget and tar come from the buildtools, not the host. This | ||
13 | verifies that the buildtools have installed correctly. We can't check | ||
14 | for gcc as that is only installed by buildtools-extended. | ||
15 | """ | ||
16 | for command in ("tar", "wget"): | ||
17 | # Canonicalise the SDK root | ||
18 | sdk_base = os.path.realpath(self.tc.sdk_dir) | ||
19 | # Canonicalise the location of this command | ||
20 | tool_path = os.path.realpath(self._run("command -v %s" % command).strip()) | ||
21 | # Assert that the tool was found inside the SDK root | ||
22 | self.assertEquals(os.path.commonprefix((sdk_base, tool_path)), sdk_base) | ||