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.

(From OE-Core rev: 34e872ab23067231fb93c3b31ad5a439e9c17cb8)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Adrian Freihofer
2025-10-19 18:44:11 +02:00
committed by Richard Purdie
parent d950cfad31
commit 49e2a19a4b

View File

@@ -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]))