]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/core/decorators/data: improve has_* logic
authorRoss Burton <ross@burtonini.com>
Thu, 31 Mar 2022 18:29:07 +0000 (19:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 1 Apr 2022 22:05:31 +0000 (23:05 +0100)
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 <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/lib/oeqa/core/decorator/data.py

index bc4939e87c5ec2083a88c41109c8ff47a375f48f..12197be246e61349d7744d3d2bcc741dff5d6492 100644 (file)
@@ -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