binman: Add a test for an inner section with a size
authorSimon Glass <sjg@chromium.org>
Wed, 11 Jan 2023 23:10:12 +0000 (16:10 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 18 Jan 2023 21:55:40 +0000 (14:55 -0700)
This is a slightly different scenario from the existing testSections
tests. Add a new test for it.

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

index 330e8e1..a4f78ae 100644 (file)
@@ -6188,6 +6188,12 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
             err,
             "Image '.*' is missing external blobs but is still functional: missing")
 
+    def testSectionInner(self):
+        """Test an inner section with a size"""
+        data = self._DoReadFile('267_section_inner.dts')
+        expected = U_BOOT_DATA + tools.get_bytes(0, 12)
+        self.assertEqual(expected, data)
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/test/267_section_inner.dts b/tools/binman/test/267_section_inner.dts
new file mode 100644 (file)
index 0000000..f6faab3
--- /dev/null
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       binman {
+               section {
+                       size = <0x10>;
+                       u-boot {
+                       };
+               };
+       };
+};