[PATCH v4 17/20] binman: Add a test for templating in a FIT

Simon Glass sjg at chromium.org
Tue Jul 11 16:59:19 CEST 2023


Add this as a separate test case.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v3)

Changes in v3:
- Add new test case for templating in a FIT

 tools/binman/ftest.py                  |  7 +++++
 tools/binman/test/288_template_fit.dts | 37 ++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 tools/binman/test/288_template_fit.dts

diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index dd6075b871d4..dfca6316624c 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -6805,6 +6805,13 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
         data = tools.read_file(image_fname)
         self.assertEqual(b'blob@@@@other', data)
 
+    def testTemplateFit(self):
+        """Test using a template in a FIT"""
+        fit_data = self._DoReadFile('288_template_fit.dts')
+        fname = os.path.join(self._indir, 'fit_data.fit')
+        tools.write_file(fname, fit_data)
+        out = tools.run('dumpimage', '-l', fname)
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/test/288_template_fit.dts b/tools/binman/test/288_template_fit.dts
new file mode 100644
index 000000000000..d84dca4ea41e
--- /dev/null
+++ b/tools/binman/test/288_template_fit.dts
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	binman: binman {
+		multiple-images;
+
+		my_template: template {
+			fit at 0 {
+				images {
+					kernel-1 {
+					};
+					kernel-2 {
+					};
+				};
+			};
+		};
+
+		image {
+			filename = "image.bin";
+			insert-template = <&my_template>;
+
+			fit at 0 {
+				description = "desc";
+				configurations {
+				};
+				images {
+					kernel-3 {
+					};
+					kernel-4 {
+					};
+				};
+			};
+		};
+	};
+};
-- 
2.41.0.390.g38632f3daf-goog



More information about the U-Boot mailing list