From 42ce9ed7ffef726640fa234966e8c36d39252422 Mon Sep 17 00:00:00 2001 From: Neha Malcom Francis Date: Mon, 17 Mar 2025 10:24:20 +0530 Subject: tools: binman: control.py: Delete template nodes after parsing Dynamically going through the subnode array and deleting leads to templates being skipped from deletion when templates are consecutive in the subnode list. Prevent this from happening by first parsing the DT and then deleting the nodes. Add a testcase as well for this cornercase. Signed-off-by: Neha Malcom Francis --- tools/binman/ftest.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools/binman/ftest.py') diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 1a92a99b511..948fcc02259 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -7990,5 +7990,12 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test an image with an FIT with multiple FDT images using NAME""" self.CheckFitFdt('345_fit_fdt_name.dts', use_seq_num=False) + def testRemoveTemplate(self): + """Test whether template is removed""" + TestFunctional._MakeInputFile('my-blob.bin', b'blob') + TestFunctional._MakeInputFile('my-blob2.bin', b'other') + self._DoTestFile('346_remove_template.dts', + force_missing_bintools='openssl',) + if __name__ == "__main__": unittest.main() -- cgit v1.2.3