summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-21 08:24:31 +0300
committerSimon Glass <sjg@chromium.org>2021-03-27 06:26:48 +0300
commit189f291914cb867f8782d7224a1073d6e17fc800 (patch)
treef848d1a376d44180ce736afba75c34bc0f2b4b67 /tools/binman/ftest.py
parent3d4333829388db834e6f0945bbefc837da590d78 (diff)
downloadu-boot-189f291914cb867f8782d7224a1073d6e17fc800.tar.xz
binman: Add support for a collection of entries
The vblock entry type includes code to collect the data from a number of other entries (not necessarily subentries) and concatenating it. This is a useful feature for other entry types. Make it a base class, so that vblock can use it, along with other entry types. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index cd93dc153a..fdd4f4d2fa 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -1718,7 +1718,7 @@ class TestFunctional(unittest.TestCase):
"""Test we detect a vblock which has no content to sign"""
with self.assertRaises(ValueError) as e:
self._DoReadFile('075_vblock_no_content.dts')
- self.assertIn("Node '/binman/vblock': Vblock must have a 'content' "
+ self.assertIn("Node '/binman/vblock': Collection must have a 'content' "
'property', str(e.exception))
def testVblockBadPhandle(self):
@@ -4476,5 +4476,13 @@ class TestFunctional(unittest.TestCase):
U_BOOT_SPL_DTB_DATA, 0x38,
entry_args=entry_args, use_expanded=True)
+ def testCollection(self):
+ """Test a collection"""
+ data = self._DoReadFile('198_collection.dts')
+ self.assertEqual(U_BOOT_NODTB_DATA + U_BOOT_DTB_DATA +
+ tools.GetBytes(0xff, 2) + U_BOOT_NODTB_DATA +
+ tools.GetBytes(0xfe, 3) + U_BOOT_DTB_DATA,
+ data)
+
if __name__ == "__main__":
unittest.main()