summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdkext/case.py
blob: 668faec9b9a23e8ad5e4a23b8e6ca97a63ca17b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
# Copyright (C) 2016 Intel Corporation
#
# SPDX-License-Identifier: MIT
#

import os
import subprocess

from oeqa.utils import avoid_paths_in_environ
from oeqa.sdk.case import OESDKTestCase

class OESDKExtTestCase(OESDKTestCase):
    def _run(self, cmd):
        # extensible sdk shows a warning if found bitbake in the path
        # because can cause contamination, i.e. use devtool from
        # poky/scripts instead of eSDK one.
        env = os.environ.copy()
        paths_to_avoid = ['bitbake/bin', 'poky/scripts']
        env['PATH'] = avoid_paths_in_environ(paths_to_avoid)

        return subprocess.check_output(". %s > /dev/null;"\
            " %s;" % (self.tc.sdk_env, cmd), stderr=subprocess.STDOUT,
            shell=True, env=env, universal_newlines=True)