diff mbox

[13/14] xfs/013: don't fail because cp ran out of space

Message ID 150957286832.18388.13139420646783539250.stgit@magnolia (mailing list archive)
State New, archived
Headers show

Commit Message

Darrick J. Wong Nov. 1, 2017, 9:47 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Don't fail xfs/013 just because cp -Rl runs out of space to allocate
inodes and sprays the ENOSPC messages into the golden output.  We want
to stress the finobt by using cp to push us near ENOSPC conditions,
so it's fine to let cp run out of space.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/013 |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/xfs/013 b/tests/xfs/013
index 4e49e4b..80298ca 100755
--- a/tests/xfs/013
+++ b/tests/xfs/013
@@ -48,6 +48,10 @@  _cleanup()
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
+filter_enospc() {
+	sed -e '/^.*No space left on device.*/d'
+}
+
 _create()
 {
 	dir=$1
@@ -56,7 +60,7 @@  _create()
 	mkdir -p $dir
 	for i in $(seq 0 $count)
 	do
-		touch $dir/$i
+		touch $dir/$i 2>&1 | filter_enospc
 	done
 }
 
@@ -70,7 +74,7 @@  _rand_replace()
 	do
 		file=$((RANDOM % count))
 		rm -f $dir/$file
-		touch $dir/$file
+		touch $dir/$file 2>&1 | filter_enospc
 	done
 }
 
@@ -141,7 +145,8 @@  $FSSTRESS_PROG -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t \
 for i in $(seq 1 $LOOPS)
 do
 	# hard link the content of the current directory to the next
-	cp -Rl $SCRATCH_MNT/dir$i $SCRATCH_MNT/dir$((i+1))
+	cp -Rl $SCRATCH_MNT/dir$i $SCRATCH_MNT/dir$((i+1)) 2>&1 | \
+		filter_enospc
 
 	# do a random replacement of files in the new directory
 	_rand_replace $SCRATCH_MNT/dir$((i+1)) $COUNT