Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | # |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 2 | # Copyright (C) 2016 Intel Corporation |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 6 | |
| 7 | import os |
| 8 | import subprocess |
| 9 | |
| 10 | from oeqa.utils import avoid_paths_in_environ |
| 11 | from oeqa.sdk.case import OESDKTestCase |
| 12 | |
| 13 | class OESDKExtTestCase(OESDKTestCase): |
| 14 | def _run(self, cmd): |
| 15 | # extensible sdk shows a warning if found bitbake in the path |
| 16 | # because can cause contamination, i.e. use devtool from |
| 17 | # poky/scripts instead of eSDK one. |
| 18 | env = os.environ.copy() |
| 19 | paths_to_avoid = ['bitbake/bin', 'poky/scripts'] |
| 20 | env['PATH'] = avoid_paths_in_environ(paths_to_avoid) |
| 21 | |
| 22 | return subprocess.check_output(". %s > /dev/null;"\ |
| 23 | " %s;" % (self.tc.sdk_env, cmd), stderr=subprocess.STDOUT, |
| 24 | shell=True, env=env, universal_newlines=True) |