diff options
author | Simon Glass <sjg@chromium.org> | 2022-02-08 21:49:51 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-02-22 20:05:44 +0300 |
commit | a30c39f2f77f4fb57a22a50c6d6b477d5d2f4342 (patch) | |
tree | b7d074377566fa5fc30fd853a85ba2c13a7aee13 /tools/dtoc/test_fdt.py | |
parent | bc116029c0ad25b2631629062a70a4d36157d43c (diff) | |
download | u-boot-a30c39f2f77f4fb57a22a50c6d6b477d5d2f4342.tar.xz |
dtoc: Support deleting a node
Add a function to delete a node. This is synced to the tree when
requested.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/test_fdt.py')
-rwxr-xr-x | tools/dtoc/test_fdt.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index 5a5333b134..ee603cc152 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -539,6 +539,15 @@ class TestProp(unittest.TestCase): data = self.fdt.getprop(self.node.Offset(), 'stringlist') self.assertEqual(b'123\x00456\0', data) + def test_delete_node(self): + """Test deleting a node""" + old_offset = self.fdt.path_offset('/spl-test') + self.assertGreater(old_offset, 0) + self.node.Delete() + self.dtb.Sync() + new_offset = self.fdt.path_offset('/spl-test', libfdt.QUIET_NOTFOUND) + self.assertEqual(-libfdt.NOTFOUND, new_offset) + def testFromData(self): dtb2 = fdt.Fdt.FromData(self.dtb.GetContents()) self.assertEqual(dtb2.GetContents(), self.dtb.GetContents()) |