binman: Allow listing an image created by a newer version
If an older version of binman is used to list images created by a newer one, it is possible that it will contain entry types that are not supported. At present this produces an error. Adjust binman to use a plain 'blob' entry type to cope with this, so the image can at least be listed. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -10,6 +10,7 @@ import sys
|
||||
import unittest
|
||||
|
||||
from binman import entry
|
||||
from binman.etype.blob import Entry_blob
|
||||
from dtoc import fdt
|
||||
from dtoc import fdt_util
|
||||
from patman import tools
|
||||
@@ -100,5 +101,13 @@ class TestEntry(unittest.TestCase):
|
||||
self.assertIn("Unknown entry type 'missing' in node '/binman/u-boot'",
|
||||
str(e.exception))
|
||||
|
||||
def testMissingEtype(self):
|
||||
"""Test use of a blob etype when the requested one is not available"""
|
||||
ent = entry.Entry.Create(None, self.GetNode(), 'missing',
|
||||
missing_etype=True)
|
||||
self.assertTrue(isinstance(ent, Entry_blob))
|
||||
self.assertEquals('missing', ent.etype)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Reference in New Issue
Block a user