[oe-commits] [openembedded-core] 92/103: classes/testsdk: Move the removal of bitbake PATH to eSDK context only

git at git.openembedded.org git at git.openembedded.org
Sun Feb 28 11:36:32 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 4ae0c84568f39661722cbceba8ddab22cffe5003
Author: Aníbal Limón <limon.anibal at gmail.com>
AuthorDate: Sun Feb 21 12:31:50 2016 -0600

    classes/testsdk: Move the removal of bitbake PATH to eSDK context only
    
    The removal of bitbake and scripts PATH is only needed by eSDK tests
    so move to eSDK context only.
    
    This also it's a support for eSDK update test because it needs to
    execute oe-publish-sdk from scripts.
    
    Signed-off-by: Aníbal Limón <limon.anibal at gmail.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/testsdk.bbclass |  9 ++++-----
 meta/lib/oeqa/oetest.py      | 12 +++++++++++-
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass
index 41e03d6..157077e 100644
--- a/meta/classes/testsdk.bbclass
+++ b/meta/classes/testsdk.bbclass
@@ -96,11 +96,10 @@ def testsdkext_main(d):
     # extensible sdk use network
     export_proxies(d)
 
-    # extensible sdk shows a warning if found bitbake in the path
-    # because can cause problems so clean it
-    paths_to_avoid = ['bitbake/bin', 'poky/scripts',
-                       d.getVar('STAGING_DIR', True),
-                       d.getVar('BASE_WORKDIR', True)]
+    # extensible sdk can be contaminated if native programs are
+    # in PATH, i.e. use perl-native instead of eSDK one.
+    paths_to_avoid = [d.getVar('STAGING_DIR', True),
+                      d.getVar('BASE_WORKDIR', True)]
     os.environ['PATH'] = avoid_paths_in_environ(paths_to_avoid)
 
     pn = d.getVar("PN", True)
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 3e2ea0f..3809ed7 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -21,6 +21,7 @@ import logging
 import oeqa.runtime
 import oeqa.sdkext
 from oeqa.utils.decorators import LogResults, gettag, getResults
+from oeqa.utils import avoid_paths_in_environ
 
 logger = logging.getLogger("BitBake")
 
@@ -128,7 +129,16 @@ class oeSDKTest(oeTest):
         return subprocess.check_output(". %s > /dev/null; %s;" % (self.tc.sdkenv, cmd), shell=True)
 
 class oeSDKExtTest(oeSDKTest):
-    pass
+    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.sdkenv, cmd), shell=True, env=env)
 
 def getmodule(pos=2):
     # stack returns a list of tuples containg frame information

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list