From: Adrian Freihofer Date: Sun, 19 Oct 2025 16:44:11 +0000 (+0200) Subject: oe-selftest: fitimage: fix req_its_fields last field_index X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34e872ab23067231fb93c3b31ad5a439e9c17cb8;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git oe-selftest: fitimage: fix req_its_fields last field_index The last enrty of req_its_fields was not taken into account and the test passed even if the last entry was not found in the its file. Signed-off-by: Adrian Freihofer Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 195b9ee8b5..9c2e10dd2b 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py @@ -297,14 +297,16 @@ class FitImageTestCase(OESelftestTestCase): if req_its_fields: field_index = 0 field_index_last = len(req_its_fields) - 1 + found_all = False with open(its_file_path) as its_file: for line in its_file: if req_its_fields[field_index] in line: if field_index < field_index_last: - field_index +=1 + field_index += 1 else: + found_all = True break - self.assertEqual(field_index, field_index_last, + self.assertTrue(found_all, "Fields in Image Tree Source File %s did not match, error in finding %s" % (its_file_path, req_its_fields[field_index]))