summaryrefslogtreecommitdiff
path: root/tools/binman/entry_test.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-18 10:25:04 +0300
committerSimon Glass <sjg@chromium.org>2021-03-26 07:03:09 +0300
commitb35fb179364decef1f564b5667b99af65dd0402a (patch)
tree62c0911fae771458b1b75bf6d9a648321dc5c3d3 /tools/binman/entry_test.py
parent5187b806175a357b9e3dca247a1cb8f62a927c03 (diff)
downloadu-boot-b35fb179364decef1f564b5667b99af65dd0402a.tar.xz
binman: Allow using an an 'expanded' entry type
As the first step in supporting expanded entries, add a way for binman to automatically select an 'expanded' version of an entry type, if requested. This is controlled by a class method. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/entry_test.py')
-rw-r--r--tools/binman/entry_test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py
index 80802f33de..c3d5f3eef4 100644
--- a/tools/binman/entry_test.py
+++ b/tools/binman/entry_test.py
@@ -87,6 +87,18 @@ class TestEntry(unittest.TestCase):
base = entry.Entry.Create(None, self.GetNode(), 'blob-dtb')
self.assertIsNone(base.ReadChildData(base))
+ def testExpandedEntry(self):
+ """Test use of an expanded entry when available"""
+ base = entry.Entry.Create(None, self.GetNode())
+ self.assertEqual('u-boot', base.etype)
+
+ expanded = entry.Entry.Create(None, self.GetNode(), expanded=True)
+ self.assertEqual('u-boot-expanded', expanded.etype)
+
+ with self.assertRaises(ValueError) as e:
+ entry.Entry.Create(None, self.GetNode(), 'missing', expanded=True)
+ self.assertIn("Unknown entry type 'missing' in node '/binman/u-boot'",
+ str(e.exception))
if __name__ == "__main__":
unittest.main()