From 09705a4af0b2cbbf1de925159d4a25c24432b546 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Wed, 23 Dec 2015 13:45:23 +0000 Subject: 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 Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/devtool.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'meta/lib/oeqa/selftest/devtool.py') 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): needvalue = checkvars.pop(var) if needvalue is None: self.fail('Variable %s should not appear in recipe') + if isinstance(needvalue, set): + value = set(value.split()) self.assertEqual(value, needvalue, 'values for %s do not match' % var) -- cgit v1.2.3-54-g00ecf