xref: /OK3568_Linux_fs/yocto/poky/meta/lib/oeqa/sdk/buildtools-cases/sanity.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#
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)
23