summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk/cases
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-08-29 10:56:31 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-04 11:03:55 +0100
commit227cc78b3f461164310de33194cc9e0d006fbfef (patch)
tree7c18c789958811bc5f3e57b03f0363c890bbfecf /meta/lib/oeqa/sdk/cases
parent20cba32f2d9caab1202295424bd85c26b8c4192a (diff)
downloadpoky-227cc78b3f461164310de33194cc9e0d006fbfef.tar.gz
oeqa/sdk: fixes related to hasPackage semantics
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. (From OE-Core rev: 595e9922cdbacf84cf35cc83f0d03cace042e302) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/sdk/cases')
-rw-r--r--meta/lib/oeqa/sdk/cases/buildgalculator.py4
-rw-r--r--meta/lib/oeqa/sdk/cases/buildlzip.py4
-rw-r--r--meta/lib/oeqa/sdk/cases/gcc.py4
3 files changed, 6 insertions, 6 deletions
diff --git a/meta/lib/oeqa/sdk/cases/buildgalculator.py b/meta/lib/oeqa/sdk/cases/buildgalculator.py
index 3714825b06..050d1b3b52 100644
--- a/meta/lib/oeqa/sdk/cases/buildgalculator.py
+++ b/meta/lib/oeqa/sdk/cases/buildgalculator.py
@@ -8,8 +8,8 @@ class GalculatorTest(OESDKTestCase):
8 8
9 @classmethod 9 @classmethod
10 def setUpClass(self): 10 def setUpClass(self):
11 if not (self.tc.hasTargetPackage(r"gtk\+3", multilib=True) or\ 11 if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \
12 self.tc.hasTargetPackage(r"libgtk-3.0", multilib=True)): 12 self.tc.hasTargetPackage("libgtk-3.0", multilib=True)):
13 raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3") 13 raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3")
14 if not (self.tc.hasHostPackage("nativesdk-gettext-dev")): 14 if not (self.tc.hasHostPackage("nativesdk-gettext-dev")):
15 raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain gettext") 15 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 3a89ce8627..b28cc3a595 100644
--- a/meta/lib/oeqa/sdk/cases/buildlzip.py
+++ b/meta/lib/oeqa/sdk/cases/buildlzip.py
@@ -17,8 +17,8 @@ class BuildLzipTest(OESDKTestCase):
17 17
18 machine = self.td.get("MACHINE") 18 machine = self.td.get("MACHINE")
19 19
20 if not (self.tc.hasTargetPackage("packagegroup-cross-canadian-%s" % machine) or 20 if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or
21 self.tc.hasTargetPackage("gcc")): 21 self.tc.hasHostPackage("^gcc-", regex=True)):
22 raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain") 22 raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain")
23 23
24 def test_lzip(self): 24 def test_lzip(self):
diff --git a/meta/lib/oeqa/sdk/cases/gcc.py b/meta/lib/oeqa/sdk/cases/gcc.py
index d11f4b63fb..b32b01fc24 100644
--- a/meta/lib/oeqa/sdk/cases/gcc.py
+++ b/meta/lib/oeqa/sdk/cases/gcc.py
@@ -18,8 +18,8 @@ class GccCompileTest(OESDKTestCase):
18 18
19 def setUp(self): 19 def setUp(self):
20 machine = self.td.get("MACHINE") 20 machine = self.td.get("MACHINE")
21 if not (self.tc.hasTargetPackage("packagegroup-cross-canadian-%s" % machine) or 21 if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or
22 self.tc.hasTargetPackage("gcc")): 22 self.tc.hasHostPackage("^gcc-", regex=True)):
23 raise unittest.SkipTest("GccCompileTest class: SDK doesn't contain a cross-canadian toolchain") 23 raise unittest.SkipTest("GccCompileTest class: SDK doesn't contain a cross-canadian toolchain")
24 24
25 def test_gcc_compile(self): 25 def test_gcc_compile(self):