binman: Enhance the map and fdt-update output
[oweals/u-boot.git] / tools / binman / etype / _testing.py
index 04bdc6c532b213b98259ffe0a58564137e10037b..31f625c026cf4cd41f85cab0caa9e47d6503f6b3 100644 (file)
@@ -14,7 +14,7 @@ class Entry__testing(Entry):
     """A fake entry used for testing
 
     Properties:
-        return_invalid_entry: Return an invalid entry from GetPositions()
+        return_invalid_entry: Return an invalid entry from GetOffsets()
     """
     def __init__(self, section, etype, node):
         Entry.__init__(self, section, etype, node)
@@ -24,6 +24,9 @@ class Entry__testing(Entry):
                                                      'return-unknown-contents')
         self.bad_update_contents = fdt_util.GetBool(self._node,
                                                     'bad-update-contents')
+        self.process_fdt_ready = False
+        self.never_complete_process_fdt = fdt_util.GetBool(self._node,
+                                                'never-complete-process-fdt')
 
     def ObtainContents(self):
         if self.return_unknown_contents:
@@ -32,7 +35,7 @@ class Entry__testing(Entry):
         self.contents_size = len(self.data)
         return True
 
-    def GetPositions(self):
+    def GetOffsets(self):
         if self.return_invalid_entry :
             return {'invalid-entry': [1, 2]}
         return {}
@@ -42,3 +45,10 @@ class Entry__testing(Entry):
             # Request to update the conents with something larger, to cause a
             # failure.
             self.ProcessContentsUpdate('aa')
+
+    def ProcessFdt(self, fdt):
+        """Force reprocessing the first time"""
+        ready = self.process_fdt_ready
+        if not self.never_complete_process_fdt:
+            self.process_fdt_ready = True
+        return ready