All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] tests: skip u_direct_io if losetup fails
@ 2021-08-05 15:43 Darrick J. Wong
  2021-08-06 15:23 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Darrick J. Wong @ 2021-08-05 15:43 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-ext4

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] tests: skip u_direct_io if losetup fails
  2021-08-05 15:43 [PATCH RESEND] tests: skip u_direct_io if losetup fails Darrick J. Wong
@ 2021-08-06 15:23 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2021-08-06 15:23 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-ext4

On Thu, Aug 05, 2021 at 08:43:28AM -0700, Darrick J. Wong wrote:
> 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>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-06 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 15:43 [PATCH RESEND] tests: skip u_direct_io if losetup fails Darrick J. Wong
2021-08-06 15:23 ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.