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