[OE-core] [PATCH 1/2] oeqa: make OEHasPackage() check multilib package

Robert Yang liezhi.yang at windriver.com
Tue Nov 14 07:57:47 UTC 2017


Make OEHasPackage() check multilib package when test multilib image, for
example, OEHasPackage(['dnf']) should check lib32-dnf when test
lib32-core-image-sato, this can make
"bitbake lib32-core-image-sato -ctestimage" work, otherwise the testcases
would be skipped.

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
 meta/lib/oeqa/runtime/decorator/package.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/runtime/decorator/package.py b/meta/lib/oeqa/runtime/decorator/package.py
index aa6ecb6..1a8bc00 100644
--- a/meta/lib/oeqa/runtime/decorator/package.py
+++ b/meta/lib/oeqa/runtime/decorator/package.py
@@ -32,11 +32,20 @@ class OEHasPackage(OETestDecorator):
         need_pkgs = set()
         unneed_pkgs = set()
         pkgs = strToSet(self.need_pkgs)
+        # Conver to multilib
+        mlprefix = self.case.tc.td['MLPREFIX']
         for pkg in pkgs:
             if pkg.startswith('!'):
-                unneed_pkgs.add(pkg[1:])
+                pkg_name = pkg[1:]
+                if mlprefix and not pkg_name.startswith(mlprefix):
+                    unneed_pkgs.add('%s%s' % (mlprefix, pkg_name))
+                else:
+                    unneed_pkgs.add(pkg_name)
             else:
-                need_pkgs.add(pkg)
+                if mlprefix and not pkg.startswith(mlprefix):
+                    need_pkgs.add('%s%s' % (mlprefix, pkg))
+                else:
+                    need_pkgs.add(pkg)
 
         if unneed_pkgs:
             msg = 'Checking if %s is not installed' % ', '.join(unneed_pkgs)
-- 
2.7.4




More information about the Openembedded-core mailing list