1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-22 10:31:56 +02:00

dtoc: Support adding new nodes

Add a way to add new nodes and sync them back to the blob.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2018-09-14 04:57:15 -06:00
parent af53f5aafc
commit e21c27af47
2 changed files with 28 additions and 0 deletions

View File

@@ -355,6 +355,14 @@ class TestProp(unittest.TestCase):
def testAddNode(self):
self.fdt.pack()
self.node.AddSubnode('subnode')
with self.assertRaises(libfdt.FdtException) as e:
self.dtb.Sync(auto_resize=False)
self.assertIn('FDT_ERR_NOSPACE', str(e.exception))
self.dtb.Sync(auto_resize=True)
offset = self.fdt.path_offset('/spl-test/subnode')
self.assertTrue(offset > 0)
class TestFdtUtil(unittest.TestCase):