Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame^] | 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) |