Skip to contentSkip to conversation

generic/805: skip this test if we can't mount the filesystem

PATCH In review Darrick J. Wong 3 participants 5 messages Sep 24 – Oct 15

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/805: skip this test if we can't mount the filesystem

From: Darrick J. Wong <[email protected]>

This test doesn't work on filesystems with external devices (e.g. xfs realtime) because the SCRATCH_DEV gets formatted with regular scratch fs options but the filesystem is mounted with a bare _mount call, not _scratch_mount. Since SCRATCH_DEV is not the dm-linear device created earlier in the test, we can't really use that either.

In any case, if we can't mount the filesystem immediately after formatting it, then we're not satisfying a test precondition. Change the _fail to _notrun.

While we're at it, fix the cleanup function so that unmount failures don't pollute the output.

---
 tests/generic/805 |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/805 +2 -2
index ae498f5c669808..403d36d383a973 100755
@@ -25,7 +25,7 @@ _cleanup()
 {
 	xfs_freeze -u $SCRATCH_MNT 2>/dev/null
 	$DMSETUP_PROG resume $lvdev >> $seqres.full 2>&1
-	_unmount -q $SCRATCH_MNT
+	_unmount -q $SCRATCH_MNT &>> $seqres.full
 	_dmsetup_remove $node
 	cd /
 	rm -f $tmp.*
@@ -47,7 +47,7 @@ table="0 $size_in_sector linear $SCRATCH_DEV 0"
 _dmsetup_create $node --table "$table" || \
 	_fail "failed to create dm device"
 
-_mount $lvdev $SCRATCH_MNT || _fail "failed to mount dm device"
+_mount $lvdev $SCRATCH_MNT || _notrun "failed to mount dm device"
 
 # Freeze the filesystem from userspace first, then nest a block device
 # initiated freeze/thaw cycle inside it via dm suspend/resume.
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

This test doesn't work on filesystems with external devices (e.g. xfs realtime) because the SCRATCH_DEV gets formatted with regular scratch fs options but the filesystem is mounted with a bare _mount call, not _scratch_mount. Since SCRATCH_DEV is not the dm-linear device created earlier in the test, we can't really use that either.

Quoted 8 lines

In any case, if we can't mount the filesystem immediately after formatting it, then we're not satisfying a test precondition. Change the _fail to _notrun.

While we're at it, fix the cleanup function so that unmount failures don't pollute the output.

Looks good to me

Signature · 1 line
- Andrey
#3 lore raw
Quoted 2 lines · Christoph Hellwig

I think my version of this is better - we really should never use the scratch helpers unless using a real scratch fs.

<nod> I think your patch works too, though if we can't _mkfs the synthesized device then there's no point in continuing the test.

--D

#4 lore raw
In reply to Darrick J. Wong
Quoted 25 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

This test doesn't work on filesystems with external devices (e.g. xfs realtime) because the SCRATCH_DEV gets formatted with regular scratch fs options but the filesystem is mounted with a bare _mount call, not _scratch_mount. Since SCRATCH_DEV is not the dm-linear device created earlier in the test, we can't really use that either.

In any case, if we can't mount the filesystem immediately after formatting it, then we're not satisfying a test precondition. Change the _fail to _notrun.

While we're at it, fix the cleanup function so that unmount failures don't pollute the output.

---
 tests/generic/805 |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/805 +0 -0
index ae498f5c669808..403d36d383a973 100755

tests/generic/805 _cleanup() · line 28

Quoted 5 lines
tests/generic/805 +1 -1
@@ -25,7 +25,7 @@ _cleanup()
 {
 	xfs_freeze -u $SCRATCH_MNT 2>/dev/null
 	$DMSETUP_PROG resume $lvdev >> $seqres.full 2>&1
-	_unmount -q $SCRATCH_MNT
+	_unmount -q $SCRATCH_MNT &>> $seqres.full

Still seeing the false failures as a result of the lack of redirection here, so I'll send just this chunk as a separate patch.

--D

Quoted 13 lines
tests/generic/805 +1 -1
 	_dmsetup_remove $node
 	cd /
 	rm -f $tmp.*
@@ -47,7 +47,7 @@ table="0 $size_in_sector linear $SCRATCH_DEV 0"
 _dmsetup_create $node --table "$table" || \
 	_fail "failed to create dm device"
 
-_mount $lvdev $SCRATCH_MNT || _fail "failed to mount dm device"
+_mount $lvdev $SCRATCH_MNT || _notrun "failed to mount dm device"
 
 # Freeze the filesystem from userspace first, then nest a block device
 # initiated freeze/thaw cycle inside it via dm suspend/resume.