From: Ahmad Fatoum <ah...@a3f.at>

When backend points at a device that couldn't be resolved, barebox-state
should fail instead of taking another device.

This is meant to address issues like the one fixed by commit
e7d71f099659 ("libdt: fix of_get_devicepath looking up sibling if
device unavailable"), but the error case there can't be reproduced
exactly, because loop devices have no common parent. Still one test
is better than no test until we start testing in Qemu.

Signed-off-by: Ahmad Fatoum <a.fat...@pengutronix.de>
---
 test/09-no-disk-fail.dts | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 test/09-no-disk-fail.dts

diff --git a/test/09-no-disk-fail.dts b/test/09-no-disk-fail.dts
new file mode 100644
index 000000000000..49cfa852525d
--- /dev/null
+++ b/test/09-no-disk-fail.dts
@@ -0,0 +1,26 @@
+/dts-v1/;
+
+#include "barebox-state.dtsi"
+
+/ {
+       expected-dev = "";
+
+       disk: loopfile0 {
+               compatible = "barebox,hostfile";
+               barebox,filename = "/dev/barebox-state-dev-does-not-exist";
+               barebox,blockdev;
+       };
+
+       otherdisk: loopfile1 {
+               compatible = "barebox,hostfile";
+               barebox,filename = __GPT_LOOPDEV__;
+               barebox,blockdev;
+       };
+};
+
+&state {
+       backend = <&disk>;
+       backend-type = "raw";
+       backend-stridesize = <0x40>;
+       backend-storage-type = "direct";
+};
-- 
2.39.2


Reply via email to