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>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
}
trap "_cleanup; exit \$status" 0 1 2 3 15
+filter_enospc() {
+ sed -e '/^.*No space left on device.*/d'
+}
+
_create()
{
dir=$1
mkdir -p $dir
for i in $(seq 0 $count)
do
- touch $dir/$i
+ touch $dir/$i 2>&1 | filter_enospc
done
}
do
file=$((RANDOM % count))
rm -f $dir/$file
- touch $dir/$file
+ touch $dir/$file 2>&1 | filter_enospc
done
}
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