aboutsummaryrefslogtreecommitdiff
path: root/test/dm/ofnode.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/dm/ofnode.c')
-rw-r--r--test/dm/ofnode.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c
index 64baaf68db..6fbebc7da0 100644
--- a/test/dm/ofnode.c
+++ b/test/dm/ofnode.c
@@ -1266,3 +1266,22 @@ static int dm_test_livetree_align(struct unit_test_state *uts)
return 0;
}
DM_TEST(dm_test_livetree_align, UT_TESTF_LIVE_TREE);
+
+/* check that it is possible to load an arbitrary livetree */
+static int dm_test_livetree_ensure(struct unit_test_state *uts)
+{
+ oftree tree;
+ ofnode node;
+
+ /* read from other.dtb */
+ ut_assertok(test_load_other_fdt(uts));
+ tree = oftree_from_fdt(uts->other_fdt);
+ ut_assert(oftree_valid(tree));
+ node = oftree_path(tree, "/node/subnode");
+ ut_assert(ofnode_valid(node));
+ ut_asserteq_str("sandbox-other2",
+ ofnode_read_string(node, "compatible"));
+
+ return 0;
+}
+DM_TEST(dm_test_livetree_ensure, 0);