* [PATCH 0/3] Fixes regarding oeqa/sdk
@ 2018-08-29 2:56 Chen Qi
2018-08-29 2:56 ` [PATCH 1/3] sdk/context.py: add ability to check for multilib version of target package Chen Qi
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Chen Qi @ 2018-08-29 2:56 UTC (permalink / raw)
To: openembedded-core
The following changes since commit a8368651ffed1bd6c4715a37dfe9f40c48ca23c4:
bitbake: fetcher: Fixed remote removal not throwing exception. (2018-08-28 10:32:08 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/oeqa-sdk
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/oeqa-sdk
Chen Qi (3):
sdk/context.py: add ability to check for multilib version of target
package
sdk/buldgalculator.py: check against multilib for gtk+3
oeqa/sdk: fixes related to hasPackage semantics
meta/lib/oeqa/sdk/cases/buildgalculator.py | 4 ++--
meta/lib/oeqa/sdk/cases/buildlzip.py | 4 ++--
meta/lib/oeqa/sdk/cases/gcc.py | 4 ++--
meta/lib/oeqa/sdk/context.py | 29 +++++++++++++++++++++--------
4 files changed, 27 insertions(+), 14 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] sdk/context.py: add ability to check for multilib version of target package
2018-08-29 2:56 [PATCH 0/3] Fixes regarding oeqa/sdk Chen Qi
@ 2018-08-29 2:56 ` Chen Qi
2018-08-29 2:56 ` [PATCH 2/3] sdk/buldgalculator.py: check against multilib for gtk+3 Chen Qi
2018-08-29 2:56 ` [PATCH 3/3] oeqa/sdk: fixes related to hasPackage semantics Chen Qi
2 siblings, 0 replies; 4+ messages in thread
From: Chen Qi @ 2018-08-29 2:56 UTC (permalink / raw)
To: openembedded-core
Add a named argument 'multilib' for the hasTargetPackage function. Its default
value is False. When setting to True, it will try to get the correct multilib
prefix from the sdk_env, the environment setup script.
We need this because we don't want unexpected run of some sdk test cases.
The following steps will generate error.
1. Enable multilib for qemux86-64
require conf/multilib.conf
MULTILIBS ?= "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 ?= "core2-32"
2. bitbake core-image-sato -c populate_sdk
3. bitbake core-image-sato -c testsdk
The error message is like below.
No package 'gtk+-3.0' found
RESULTS - buildgalculator.GalculatorTest.test_galculator - Testcase -1: FAILED
As we don't have lib32-gtk+3 installed, the test case should be skipped when
testing against the lib32 environment setup script.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/lib/oeqa/sdk/context.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/sdk/context.py b/meta/lib/oeqa/sdk/context.py
index 7c091c0..ec8972d 100644
--- a/meta/lib/oeqa/sdk/context.py
+++ b/meta/lib/oeqa/sdk/context.py
@@ -29,7 +29,13 @@ class OESDKTestContext(OETestContext):
def hasHostPackage(self, pkg):
return self._hasPackage(self.host_pkg_manifest, pkg)
- def hasTargetPackage(self, pkg):
+ def hasTargetPackage(self, pkg, multilib=False):
+ if multilib:
+ # match multilib according to sdk_env
+ mls = self.td.get('MULTILIB_VARIANTS', '').split()
+ for ml in mls:
+ if ('ml'+ml) in self.sdk_env:
+ pkg = ml + '-' + pkg
return self._hasPackage(self.target_pkg_manifest, pkg)
class OESDKTestContextExecutor(OETestContextExecutor):
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] sdk/buldgalculator.py: check against multilib for gtk+3
2018-08-29 2:56 [PATCH 0/3] Fixes regarding oeqa/sdk Chen Qi
2018-08-29 2:56 ` [PATCH 1/3] sdk/context.py: add ability to check for multilib version of target package Chen Qi
@ 2018-08-29 2:56 ` Chen Qi
2018-08-29 2:56 ` [PATCH 3/3] oeqa/sdk: fixes related to hasPackage semantics Chen Qi
2 siblings, 0 replies; 4+ messages in thread
From: Chen Qi @ 2018-08-29 2:56 UTC (permalink / raw)
To: openembedded-core
When determining whether to skip the test case, the check should be
done with consideration of multilib. Otherwise, we will meet the
following error when testing against lib32 environment.
No package 'gtk+-3.0' found
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/lib/oeqa/sdk/cases/buildgalculator.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/lib/oeqa/sdk/cases/buildgalculator.py b/meta/lib/oeqa/sdk/cases/buildgalculator.py
index 4c02ea4..3714825 100644
--- a/meta/lib/oeqa/sdk/cases/buildgalculator.py
+++ b/meta/lib/oeqa/sdk/cases/buildgalculator.py
@@ -8,8 +8,8 @@ class GalculatorTest(OESDKTestCase):
@classmethod
def setUpClass(self):
- if not (self.tc.hasTargetPackage(r"gtk\+3") or\
- self.tc.hasTargetPackage(r"libgtk-3.0")):
+ if not (self.tc.hasTargetPackage(r"gtk\+3", multilib=True) or\
+ self.tc.hasTargetPackage(r"libgtk-3.0", multilib=True)):
raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3")
if not (self.tc.hasHostPackage("nativesdk-gettext-dev")):
raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain gettext")
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] oeqa/sdk: fixes related to hasPackage semantics
2018-08-29 2:56 [PATCH 0/3] Fixes regarding oeqa/sdk Chen Qi
2018-08-29 2:56 ` [PATCH 1/3] sdk/context.py: add ability to check for multilib version of target package Chen Qi
2018-08-29 2:56 ` [PATCH 2/3] sdk/buldgalculator.py: check against multilib for gtk+3 Chen Qi
@ 2018-08-29 2:56 ` Chen Qi
2 siblings, 0 replies; 4+ messages in thread
From: Chen Qi @ 2018-08-29 2:56 UTC (permalink / raw)
To: openembedded-core
The current _hasPackage does a regex match when checking for the
existence of packages. This will sometimes result in unexpected
result. For example, the condition hasTargetPackage('gcc') is likely
to be always true as it matches libgcc1.
For most of the time, we should do exact match instead of regex match.
So change _hasPackage function to do that. For the current sdk test
cases, the only place that needs regex match is '^gcc-'. This is because
there's no easy way to get multilib tune arch (e.g. i686) from testdata.json
file.
Besides, packagegroup-cross-canadian-xxx and gcc-xxx should be check in
host manifest instead of the target one. So fix to use hasHostPackage.
Also, as we are doing exact match, there's no need to use r'gtk\+3',
just 'gtk+3' is enough.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/lib/oeqa/sdk/cases/buildgalculator.py | 4 ++--
meta/lib/oeqa/sdk/cases/buildlzip.py | 4 ++--
meta/lib/oeqa/sdk/cases/gcc.py | 4 ++--
meta/lib/oeqa/sdk/context.py | 21 ++++++++++++++-------
4 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/meta/lib/oeqa/sdk/cases/buildgalculator.py b/meta/lib/oeqa/sdk/cases/buildgalculator.py
index 3714825..050d1b3 100644
--- a/meta/lib/oeqa/sdk/cases/buildgalculator.py
+++ b/meta/lib/oeqa/sdk/cases/buildgalculator.py
@@ -8,8 +8,8 @@ class GalculatorTest(OESDKTestCase):
@classmethod
def setUpClass(self):
- if not (self.tc.hasTargetPackage(r"gtk\+3", multilib=True) or\
- self.tc.hasTargetPackage(r"libgtk-3.0", multilib=True)):
+ if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \
+ self.tc.hasTargetPackage("libgtk-3.0", multilib=True)):
raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3")
if not (self.tc.hasHostPackage("nativesdk-gettext-dev")):
raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain gettext")
diff --git a/meta/lib/oeqa/sdk/cases/buildlzip.py b/meta/lib/oeqa/sdk/cases/buildlzip.py
index 3a89ce8..b28cc3a 100644
--- a/meta/lib/oeqa/sdk/cases/buildlzip.py
+++ b/meta/lib/oeqa/sdk/cases/buildlzip.py
@@ -17,8 +17,8 @@ class BuildLzipTest(OESDKTestCase):
machine = self.td.get("MACHINE")
- if not (self.tc.hasTargetPackage("packagegroup-cross-canadian-%s" % machine) or
- self.tc.hasTargetPackage("gcc")):
+ if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or
+ self.tc.hasHostPackage("^gcc-", regex=True)):
raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain")
def test_lzip(self):
diff --git a/meta/lib/oeqa/sdk/cases/gcc.py b/meta/lib/oeqa/sdk/cases/gcc.py
index d11f4b6..b32b01f 100644
--- a/meta/lib/oeqa/sdk/cases/gcc.py
+++ b/meta/lib/oeqa/sdk/cases/gcc.py
@@ -18,8 +18,8 @@ class GccCompileTest(OESDKTestCase):
def setUp(self):
machine = self.td.get("MACHINE")
- if not (self.tc.hasTargetPackage("packagegroup-cross-canadian-%s" % machine) or
- self.tc.hasTargetPackage("gcc")):
+ if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or
+ self.tc.hasHostPackage("^gcc-", regex=True)):
raise unittest.SkipTest("GccCompileTest class: SDK doesn't contain a cross-canadian toolchain")
def test_gcc_compile(self):
diff --git a/meta/lib/oeqa/sdk/context.py b/meta/lib/oeqa/sdk/context.py
index ec8972d..adc4166 100644
--- a/meta/lib/oeqa/sdk/context.py
+++ b/meta/lib/oeqa/sdk/context.py
@@ -20,23 +20,30 @@ class OESDKTestContext(OETestContext):
self.target_pkg_manifest = target_pkg_manifest
self.host_pkg_manifest = host_pkg_manifest
- def _hasPackage(self, manifest, pkg):
- for host_pkg in manifest.keys():
- if re.search(pkg, host_pkg):
+ def _hasPackage(self, manifest, pkg, regex=False):
+ if regex:
+ # do regex match
+ pat = re.compile(pkg)
+ for p in manifest.keys():
+ if pat.search(p):
+ return True
+ else:
+ # do exact match
+ if pkg in manifest.keys():
return True
return False
- def hasHostPackage(self, pkg):
- return self._hasPackage(self.host_pkg_manifest, pkg)
+ def hasHostPackage(self, pkg, regex=False):
+ return self._hasPackage(self.host_pkg_manifest, pkg, regex=regex)
- def hasTargetPackage(self, pkg, multilib=False):
+ def hasTargetPackage(self, pkg, multilib=False, regex=False):
if multilib:
# match multilib according to sdk_env
mls = self.td.get('MULTILIB_VARIANTS', '').split()
for ml in mls:
if ('ml'+ml) in self.sdk_env:
pkg = ml + '-' + pkg
- return self._hasPackage(self.target_pkg_manifest, pkg)
+ return self._hasPackage(self.target_pkg_manifest, pkg, regex=regex)
class OESDKTestContextExecutor(OETestContextExecutor):
_context_class = OESDKTestContext
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-29 2:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-29 2:56 [PATCH 0/3] Fixes regarding oeqa/sdk Chen Qi
2018-08-29 2:56 ` [PATCH 1/3] sdk/context.py: add ability to check for multilib version of target package Chen Qi
2018-08-29 2:56 ` [PATCH 2/3] sdk/buldgalculator.py: check against multilib for gtk+3 Chen Qi
2018-08-29 2:56 ` [PATCH 3/3] oeqa/sdk: fixes related to hasPackage semantics Chen Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox