mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
pylibfdt: Add support for fdt_get_alias()
Add this into the class to simplify use of this function. Signed-off-by: Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com> Message-Id: <1562130487-27028-1-git-send-email-appana.durga.rao@xilinx.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
1c17714dbb
commit
d6de81b81b
2 changed files with 19 additions and 0 deletions
|
@ -77,6 +77,7 @@ class PyLibfdtBasicTests(unittest.TestCase):
|
|||
"""Read in the device tree we use for testing"""
|
||||
self.fdt = _ReadFdt('test_tree1.dtb')
|
||||
self.fdt2 = _ReadFdt('test_props.dtb')
|
||||
self.fdt3 = _ReadFdt('aliases.dtb')
|
||||
|
||||
def GetPropList(self, node_path):
|
||||
"""Read a list of properties from a node
|
||||
|
@ -340,6 +341,12 @@ class PyLibfdtBasicTests(unittest.TestCase):
|
|||
node2 = self.fdt.path_offset('/subnode@2')
|
||||
self.assertEquals(0x2000, self.fdt.get_phandle(node2))
|
||||
|
||||
def testGetAlias(self):
|
||||
"""Test for the get_alias() method"""
|
||||
self.assertEquals("/subnode@1", self.fdt3.get_alias('s1'))
|
||||
self.assertEquals("/subnode@1/subsubnode", self.fdt3.get_alias('ss1'))
|
||||
self.assertEquals("/subnode@1/subsubnode/subsubsubnode", self.fdt3.get_alias('sss1'))
|
||||
|
||||
def testParentOffset(self):
|
||||
"""Test for the parent_offset() method"""
|
||||
self.assertEquals(-libfdt.NOTFOUND,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue