blob: 64baaa8f84f3ba5e69beb4c47c5e1748bb1dc3cb [file] [log] [blame]
Patrick Williams0ca19cc2021-08-16 14:03:13 -05001#
2# SPDX-License-Identifier: MIT
3#
4
5import shutil
6import os.path
7from oeqa.sdk.case import OESDKTestCase
8
9class 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)