diff options
author | Simon Glass <sjg@chromium.org> | 2018-09-14 04:57:15 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-09-28 11:09:01 -0600 |
commit | e21c27af47183619c7ec7097abb1dec34410e775 (patch) | |
tree | 3ce664c775d41266a3cad56335c3c52c4c9e5587 /tools/dtoc/test_fdt.py | |
parent | af53f5aafcbbe1ba97264a0262067657f3dc8c34 (diff) | |
download | u-boot-e21c27af47183619c7ec7097abb1dec34410e775.tar.gz |
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>
Diffstat (limited to 'tools/dtoc/test_fdt.py')
-rwxr-xr-x | tools/dtoc/test_fdt.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index 4a67f8949d..c94e455d12 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -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): |