summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/devtool.py
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2015-12-23 13:45:23 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-28 09:25:20 +0000
commit09705a4af0b2cbbf1de925159d4a25c24432b546 (patch)
tree32f924237af2a6611937dc6d051fe70fb75fed57 /meta/lib/oeqa/selftest/devtool.py
parent4b543f7405430a2ab452dbd334b4b0a430e1091c (diff)
downloadpoky-09705a4af0b2cbbf1de925159d4a25c24432b546.tar.gz
oeqa/selftest: support sets in devtool comparisons
The devtool and recipetool tests do literal string comparisons, but for some fields the ordering could be irrelevant and potentially non-deterministic. For example, the recipetool_create_simple test started failing with: AssertionError: 'GPLv2 Unknown' != 'Unknown GPLv2' : values for LICENSE do not match The ordering of the LICENSE field isn't relevant. So, if the expected value is a set(), split the string into a set too and compare those. (From OE-Core rev: dab1b0ad42f08eb547732e854ba28a4cf0a23107) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/devtool.py')
-rw-r--r--meta/lib/oeqa/selftest/devtool.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 6f76ce7b84..1eadd6b371 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -44,6 +44,8 @@ class DevtoolBase(oeSelfTest):
44 needvalue = checkvars.pop(var) 44 needvalue = checkvars.pop(var)
45 if needvalue is None: 45 if needvalue is None:
46 self.fail('Variable %s should not appear in recipe') 46 self.fail('Variable %s should not appear in recipe')
47 if isinstance(needvalue, set):
48 value = set(value.split())
47 self.assertEqual(value, needvalue, 'values for %s do not match' % var) 49 self.assertEqual(value, needvalue, 'values for %s do not match' % var)
48 50
49 51