Add the ability to test for the existence of a property in a FIT image node without enforcing a specific value. This allows to ensure that properties for which a value cannot be determined (e.g.: because they are arch- or machine-dependent) are anyhow present.
Signed-off-by: Francesco Valla <[email protected]> --- meta/lib/oeqa/selftest/cases/fitimage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 0f2d9d17dbe6a452261566a1421cc41d10809399..2aff5c84c8fa10c43ccf008859fdb7c4958bfbe7 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py @@ -209,6 +209,7 @@ class FitImageTestCase(OESelftestTestCase): This function recursively checks if the required dictionary (`req_dict`) is a subset of the found dictionary (`found_dict`). It supports nested dictionaries, strings, lists, and sets as values. + If the value of one element in the required dictionary is None, only the presence of the key is checked. Args: found_dict (dict): The dictionary to search within. @@ -224,7 +225,7 @@ class FitImageTestCase(OESelftestTestCase): self.assertLessEqual(set(value), set(found_dict[key])) elif isinstance(value, set): self.assertLessEqual(value, found_dict[key]) - else: + elif value is not None: self.assertEqual(value, found_dict[key]) def _check_its_file(self, bb_vars, its_file_path): -- 2.53.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#232120): https://lists.openembedded.org/g/openembedded-core/message/232120 Mute This Topic: https://lists.openembedded.org/mt/118051540/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
