aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2019-07-04 14:39:02 +1000
committerDavid Gibson <david@gibson.dropbear.id.au>2019-07-04 14:39:02 +1000
commitb99353474850969a1f856d344d273325ddb069c7 (patch)
tree3acfbf1226303aa6580e5ddbda23ef5e02eb46ab /tests
parentd6de81b81b68f9e559adf42366574233be338fd8 (diff)
downloaddtc-b99353474850969a1f856d344d273325ddb069c7.zip
dtc-b99353474850969a1f856d344d273325ddb069c7.tar.gz
dtc-b99353474850969a1f856d344d273325ddb069c7.tar.bz2
fdtoverlay: Allow adding labels to __overlay__ nodes in overlays
When applying overlays, we merge symbols from the overlay into the target tree. At the moment the logic for this assumes all symbols in the overlay are attached to a node of the form: /fragment@XXX/__overlay__/relative/path And will end up applied to the relative/path node under the fragment's target. However, this disallows the case of a symbol in the form just: /fragment@XXX/__overlay__ This does have a pretty obvious sensible meaning: attach the new symbol directly to the fragment's target, but we don't currently do that. It's pretty easy to workaround this limitation in one's overlays, but it's also easy to handle in the overlay applying code, so we might as well extend it to cover this case. Reported-by: Christophe Braillon Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run_tests.sh12
-rw-r--r--tests/stacked_overlay_addlabel.dts13
-rw-r--r--tests/stacked_overlay_base_nolabel.dts6
3 files changed, 31 insertions, 0 deletions
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index d368ad5..2620332 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -949,6 +949,18 @@ fdtoverlay_tests() {
# test that fdtoverlay manages to apply overlays with long target path
run_fdtoverlay_test lpath "/test-node/sub-test-node/sub-test-node-with-very-long-target-path/test-0" "prop" "-ts" ${basedtb} ${target_long_pathdtb} ${overlay_long_pathdtb}
+
+ # test adding a label to the root of a fragment
+ stacked_base_nolabel=stacked_overlay_base_nolabel.dts
+ stacked_base_nolabeldtb=stacked_overlay_base_nolabel.test.dtb
+ stacked_addlabel=stacked_overlay_addlabel.dts
+ stacked_addlabeldtb=stacked_overlay_addlabel.test.dtb
+ stacked_addlabel_targetdtb=stacked_overlay_target_nolabel.fdtoverlay.test.dtb
+
+ run_dtc_test -@ -I dts -O dtb -o $stacked_base_nolabeldtb $stacked_base_nolabel
+ run_dtc_test -@ -I dts -O dtb -o $stacked_addlabeldtb $stacked_addlabel
+
+ run_fdtoverlay_test baz "/foonode/barnode/baznode" "baz-property" "-ts" ${stacked_base_nolabeldtb} ${stacked_addlabel_targetdtb} ${stacked_addlabeldtb} ${stacked_bardtb} ${stacked_bazdtb}
}
pylibfdt_tests () {
diff --git a/tests/stacked_overlay_addlabel.dts b/tests/stacked_overlay_addlabel.dts
new file mode 100644
index 0000000..e5c158f
--- /dev/null
+++ b/tests/stacked_overlay_addlabel.dts
@@ -0,0 +1,13 @@
+/dts-v1/;
+/plugin/;
+/ {
+ fragment@1 {
+ target-path = "/foonode";
+ foo: __overlay__ {
+ overlay-1-property;
+ bar: barnode {
+ bar-property = "bar";
+ };
+ };
+ };
+};
diff --git a/tests/stacked_overlay_base_nolabel.dts b/tests/stacked_overlay_base_nolabel.dts
new file mode 100644
index 0000000..0c47f0d
--- /dev/null
+++ b/tests/stacked_overlay_base_nolabel.dts
@@ -0,0 +1,6 @@
+/dts-v1/;
+/ {
+ foonode {
+ foo-property = "foo";
+ };
+};