1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7import shutil
8import os.path
9from oeqa.sdk.case import OESDKTestCase
10
11class 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.assertEqual(os.path.commonprefix((sdk_base, tool_path)), sdk_base)
25