diff options
author | Simon Glass <sjg@chromium.org> | 2019-07-20 21:23:31 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2019-07-29 18:38:05 +0300 |
commit | 4bdd30055ca3a9096f462177758b97e55c15f1e7 (patch) | |
tree | 82a457491e4be44ee87e32ff890b681f4a7a600f /tools/binman/entry_test.py | |
parent | 726e2961291dec2c46d773866c5923210c3bac0f (diff) | |
download | u-boot-4bdd30055ca3a9096f462177758b97e55c15f1e7.tar.xz |
binman: Adjust GetFdt() to be keyed by etype
At present the FDTs are keyed by their default filename (not their actual
filename). It seems easier to key by the entry type, since this is always
the same for each FDT type.
To do this, add a new Entry method called GetFdtEtype(). This is necessary
since some entry types contain a device tree which are not the simple
three entry types 'u-boot-dtb', 'u-boot-spl' or 'u-boot-tpl'.
The code already returns a dict for GetFdt(). Update the value of that
dict to include the filename so that existing code can work.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/entry_test.py')
-rw-r--r-- | tools/binman/entry_test.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py index b6ad3edb8d..460171ba89 100644 --- a/tools/binman/entry_test.py +++ b/tools/binman/entry_test.py @@ -84,5 +84,14 @@ class TestEntry(unittest.TestCase): base_entry = entry.Entry(None, None, None, read_node=False) self.assertIsNone(base_entry.GetDefaultFilename()) + def testBlobFdt(self): + """Test the GetFdtEtype() method of the blob-dtb entries""" + base = entry.Entry.Create(None, self.GetNode(), 'blob-dtb') + self.assertIsNone(base.GetFdtEtype()) + + dtb = entry.Entry.Create(None, self.GetNode(), 'u-boot-dtb') + self.assertEqual('u-boot-dtb', dtb.GetFdtEtype()) + + if __name__ == "__main__": unittest.main() |