]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oe-selftest: fitimage: fix req_its_fields last field_index
authorAdrian Freihofer <adrian.freihofer@siemens.com>
Sun, 19 Oct 2025 16:44:11 +0000 (18:44 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Oct 2025 11:37:38 +0000 (11:37 +0000)
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 <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>
meta/lib/oeqa/selftest/cases/fitimage.py

index 195b9ee8b597f3eb15c3b2d9745a245d4a25a286..9c2e10dd2bfa4a3d2b6fefbec52c4752e68ca130 100644 (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]))