mailarchive of the pengutronix oss-tools mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: oss-tools@pengutronix.de
Subject: [OSS-Tools] [PATCH 2/3] test: add test case with non-existent /dev/file
Date: Mon, 12 Jun 2023 14:07:53 +0200	[thread overview]
Message-ID: <20230612120754.896995-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230612120754.896995-1-a.fatoum@pengutronix.de>

From: Ahmad Fatoum <ahmad@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.fatoum@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	other threads:[~2023-06-12 12:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 12:07 [OSS-Tools] [PATCH 1/3] meson: options: use defaults of type boolean for boolean options Ahmad Fatoum
2023-06-12 12:07 ` Ahmad Fatoum [this message]
2023-07-27  8:23   ` [OSS-Tools] [PATCH 2/3] test: add test case with non-existent /dev/file Roland Hieber
2023-06-12 12:07 ` [OSS-Tools] [PATCH 3/3] meson: set optimization level to -O2 by default Ahmad Fatoum
2023-07-27  8:23   ` Roland Hieber
2023-07-27  8:23 ` [OSS-Tools] [PATCH 1/3] meson: options: use defaults of type boolean for boolean options Roland Hieber
2023-08-01 10:10 ` Roland Hieber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230612120754.896995-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=oss-tools@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox