From: "Darrick J. Wong" <djwong@kernel.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH RESEND] tests: skip u_direct_io if losetup fails
Date: Thu, 5 Aug 2021 08:43:28 -0700 [thread overview]
Message-ID: <20210805154328.GB3601392@magnolia> (raw)
From: Darrick J. Wong <djwong@kernel.org>
This new test requires a loop device to run testing. While it checks
for some "obvious" parameters that might cause the test to fail such as
not being root and no losetup executable, it doesn't actually check that
the losetup -a call succeeds. This causes a test regression in my
package building container (where there is only a minimal /dev with no
loop devices available) so I can't build debian packages.
Fix the test to skip out if we can't create a loop device.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
tests/u_direct_io/script | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/u_direct_io/script b/tests/u_direct_io/script
index 0b5d7083..b4f07752 100644
--- a/tests/u_direct_io/script
+++ b/tests/u_direct_io/script
@@ -9,6 +9,11 @@ elif test ! -x $DEBUGFS_EXE; then
else
dd if=/dev/zero of=$TMPFILE bs=1M count=128 > /dev/null 2>&1
LOOP=$(losetup --show --sector-size 4096 -f $TMPFILE)
+ if [ ! -b "$LOOP" ]; then
+ echo "$test_name: $DESCRIPTION: skipped (no loop devices)"
+ rm -f $TMPFILE
+ exit 0
+ fi
echo mke2fs -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D \$LOOP > $OUT
$MKE2FS -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP 2>&1 | \
sed -f $cmd_dir/filter.sed >> $OUT
next reply other threads:[~2021-08-05 15:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-05 15:43 Darrick J. Wong [this message]
2021-08-06 15:23 ` [PATCH RESEND] tests: skip u_direct_io if losetup fails Theodore Ts'o
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=20210805154328.GB3601392@magnolia \
--to=djwong@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).