summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/binman/etype/section.py3
-rw-r--r--tools/binman/ftest.py9
-rw-r--r--tools/binman/test/234_replace_section_simple.dts23
3 files changed, 35 insertions, 0 deletions
diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py
index ccac658c18..bd67238b91 100644
--- a/tools/binman/etype/section.py
+++ b/tools/binman/etype/section.py
@@ -788,6 +788,9 @@ class Entry_section(Entry):
data = new_data
return data
+ def WriteData(self, data, decomp=True):
+ self.Raise("Replacing sections is not implemented yet")
+
def WriteChildData(self, child):
return True
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 421754b1d0..b5cf549703 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -5693,6 +5693,15 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
self.assertIsNotNone(path)
self.assertEqual(expected_fdtmap, fdtmap)
+ @unittest.expectedFailure
+ def testReplaceSectionSimple(self):
+ """Test replacing a simple section with arbitrary data"""
+ new_data = b'w' * len(COMPRESS_DATA + U_BOOT_DATA)
+ data, expected_fdtmap, _ = self._RunReplaceCmd(
+ 'section', new_data,
+ dts='234_replace_section_simple.dts')
+ self.assertEqual(new_data, data)
+
if __name__ == "__main__":
unittest.main()
diff --git a/tools/binman/test/234_replace_section_simple.dts b/tools/binman/test/234_replace_section_simple.dts
new file mode 100644
index 0000000000..c9d5c32856
--- /dev/null
+++ b/tools/binman/test/234_replace_section_simple.dts
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0+
+/dts-v1/;
+
+/ {
+ binman {
+ allow-repack;
+
+ u-boot-dtb {
+ };
+
+ section {
+ blob {
+ filename = "compress";
+ };
+
+ u-boot {
+ };
+ };
+
+ fdtmap {
+ };
+ };
+};