poky/meta/lib/oeqa/sdkext/case.py
Richard Purdie 23137a9897 oeqs/sdk*/case: Use universal_newlines for subprocess calls
This removes the need for some of the ugly decode calls with hardcoded
locales.

(From OE-Core rev: a14dddc77e553d2fa90d12576503dd3fc2e52bbc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:11 +00:00

22 lines
790 B
Python

# Copyright (C) 2016 Intel Corporation
# Released under the MIT license (see COPYING.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)