]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Add a test for templating in a FIT
authorSimon Glass <sjg@chromium.org>
Tue, 18 Jul 2023 13:24:06 +0000 (07:24 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 20 Jul 2023 20:10:58 +0000 (14:10 -0600)
Add this as a separate test case.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/ftest.py
tools/binman/test/288_template_fit.dts [new file with mode: 0644]

index dd6075b871d4eb657384ba1f0799dee586d97b6a..dfca6316624caed5ce22aabbaf9b77539740a8f8 100644 (file)
@@ -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 (file)
index 0000000..d84dca4
--- /dev/null
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+       binman: binman {
+               multiple-images;
+
+               my_template: template {
+                       fit@0 {
+                               images {
+                                       kernel-1 {
+                                       };
+                                       kernel-2 {
+                                       };
+                               };
+                       };
+               };
+
+               image {
+                       filename = "image.bin";
+                       insert-template = <&my_template>;
+
+                       fit@0 {
+                               description = "desc";
+                               configurations {
+                               };
+                               images {
+                                       kernel-3 {
+                                       };
+                                       kernel-4 {
+                                       };
+                               };
+                       };
+               };
+       };
+};