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 shutil |
| 8 | import os.path |
| 9 | from oeqa.sdk.case import OESDKTestCase |
| 10 | |
| 11 | class SanityTests(OESDKTestCase): |
| 12 | def test_tools(self): |
| 13 | """ |
| 14 | Test that wget and tar come from the buildtools, not the host. This |
| 15 | verifies that the buildtools have installed correctly. We can't check |
| 16 | for gcc as that is only installed by buildtools-extended. |
| 17 | """ |
| 18 | for command in ("tar", "wget"): |
| 19 | # Canonicalise the SDK root |
| 20 | sdk_base = os.path.realpath(self.tc.sdk_dir) |
| 21 | # Canonicalise the location of this command |
| 22 | tool_path = os.path.realpath(self._run("command -v %s" % command).strip()) |
| 23 | # Assert that the tool was found inside the SDK root |
| 24 | self.assertEquals(os.path.commonprefix((sdk_base, tool_path)), sdk_base) |