From: Ross Burton Date: Thu, 31 Mar 2022 18:29:07 +0000 (+0100) Subject: oeqa/core/decorators/data: improve has_* logic X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~4552 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4c63819234e252c58e040af8bbdbfb96b6feccf;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git oeqa/core/decorators/data: improve has_* logic has_feature() should be splitting the feature string into substrings and then looking for membership instead of looking for simple substrings. has_machine() should be using equality instead of substrings. Signed-off-by: Ross Burton Signed-off-by: Alexandre Belloni --- diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py index bc4939e87c5..12197be246e 100644 --- a/meta/lib/oeqa/core/decorator/data.py +++ b/meta/lib/oeqa/core/decorator/data.py @@ -13,8 +13,8 @@ def has_feature(td, feature): Checks for feature in DISTRO_FEATURES or IMAGE_FEATURES. """ - if (feature in td.get('DISTRO_FEATURES', '') or - feature in td.get('IMAGE_FEATURES', '')): + if (feature in td.get('DISTRO_FEATURES', '').split() or + feature in td.get('IMAGE_FEATURES', '').split()): return True return False @@ -23,7 +23,7 @@ def has_machine(td, machine): Checks for MACHINE. """ - if (machine in td.get('MACHINE', '')): + if (machine == td.get('MACHINE', '')): return True return False