[OE-core] [PATCH v3 18/22] oeqa/oetest: Fix compatibility SDK tests using eSDK.

Aníbal Limón anibal.limon at linux.intel.com
Thu Feb 4 22:29:35 UTC 2016


When run SDK tests over eSDK we need to use SDKExtTestContext
instead of SDKTestContext because if we use SDKTestContext search
for SDK manifest and depends on the SDK manifest generation so
populate_sdk needs to be executed.

Adds a compatibility mode flag to SDKExtTestContext for search tests
over sdk module instead of sdkext module and change testsdk calls
to comply with this new param.

Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
---
 meta/classes/testsdk.bbclass |  6 +++---
 meta/lib/oeqa/oetest.py      | 13 ++++++++++---
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass
index 417510c..453ce40 100644
--- a/meta/classes/testsdk.bbclass
+++ b/meta/classes/testsdk.bbclass
@@ -5,14 +5,14 @@
 TEST_LOG_DIR ?= "${WORKDIR}/testimage"
 TESTSDKLOCK = "${TMPDIR}/testsdk.lock"
 
-def run_test_context(CTestContext, d, testdir, tcname, pn):
+def run_test_context(CTestContext, d, testdir, tcname, pn, *args):
     import glob
     import time
 
     targets = glob.glob(d.expand(testdir + "/tc/environment-setup-*"))
     for sdkenv in targets:
         bb.plain("Testing %s" % sdkenv)
-        tc = CTestContext(d, testdir, sdkenv)
+        tc = CTestContext(d, testdir, sdkenv, args)
 
         # this is a dummy load of tests
         # we are doing that to find compile errors in the tests themselves
@@ -112,7 +112,7 @@ def testsdkext_main(d):
 
     try:
         bb.plain("Running SDK Compatibility tests ...")
-        run_test_context(SDKTestContext, d, testdir, tcname, pn)
+        run_test_context(SDKExtTestContext, d, testdir, tcname, pn, True)
     finally:
         pass
 
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 80b40b6..3e2ea0f 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -376,7 +376,7 @@ class ImageTestContext(TestContext):
         setattr(oeRuntimeTest, "pscmd", "ps -ef" if oeTest.hasPackage("procps") else "ps")
 
 class SDKTestContext(TestContext):
-    def __init__(self, d, sdktestdir, sdkenv):
+    def __init__(self, d, sdktestdir, sdkenv, *args):
         super(SDKTestContext, self).__init__(d)
 
         self.sdktestdir = sdktestdir
@@ -409,9 +409,13 @@ class SDKTestContext(TestContext):
                 "auto").split() if t != "auto"]
 
 class SDKExtTestContext(SDKTestContext):
-    def __init__(self, d, sdktestdir, sdkenv):
+    def __init__(self, d, sdktestdir, sdkenv, *args):
         self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST", True)
         self.host_manifest = d.getVar("SDK_EXT_HOST_MANIFEST", True)
+        if args:
+            self.cm = args[0] # Compatibility mode for run SDK tests
+        else:
+            self.cm = False
 
         super(SDKExtTestContext, self).__init__(d, sdktestdir, sdkenv)
 
@@ -419,7 +423,10 @@ class SDKExtTestContext(SDKTestContext):
             oeqa.sdkext.__file__)), "files")
 
     def _get_test_namespace(self):
-        return "sdkext"
+        if self.cm:
+            return "sdk"
+        else:
+            return "sdkext"
 
     def _get_test_suites(self):
         return (self.d.getVar("TEST_SUITES_SDK_EXT", True) or "auto").split()
-- 
2.1.4




More information about the Openembedded-core mailing list