mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
da8ac46681
This test was using the "mktemp -d" command to create a temporary directory for storing send streams and computations from fssum, without ever deleting them when it finishes. Therefore after running it for many times it filled up all space from /tmp. Fix this by using a temporary directory in TEST_DEV instead, as all the more recent send/receive tests do, to store these files, and making sure they get deleted when the test finishes. On average the sum of the size of those files is between 5.5Mb to 6Mb, but changing the number of operations for fsstress makes it even bigger. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
103 lines
2.7 KiB
Bash
Executable File
103 lines
2.7 KiB
Bash
Executable File
#! /bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2013 STRATO. All rights reserved.
|
|
#
|
|
# FSQA Test No. 007
|
|
#
|
|
# Run fsstress to create a reasonably strange file system, make a
|
|
# snapshot (base) and run more fsstress. Then take another snapshot
|
|
# (incr) and send both snapshots to a temp file. Remake the file
|
|
# system and receive from the files. Check both states with fssum.
|
|
#
|
|
# creator
|
|
owner=list.btrfs@jan-o-sch.net
|
|
|
|
seq=`basename $0`
|
|
seqres=$RESULT_DIR/$seq
|
|
echo "QA output created by $seq"
|
|
|
|
tmp=/tmp/$$
|
|
status=1
|
|
|
|
_cleanup()
|
|
{
|
|
cd /
|
|
rm -f $tmp.*
|
|
rm -fr $send_files_dir
|
|
}
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
# get standard environment, filters and checks
|
|
. ./common/rc
|
|
. ./common/filter
|
|
|
|
# real QA test starts here
|
|
_supported_fs btrfs
|
|
_supported_os Linux
|
|
_require_scratch
|
|
_require_fssum
|
|
_require_seek_data_hole
|
|
|
|
send_files_dir=$TEST_DIR/btrfs-test-$seq
|
|
|
|
rm -f $seqres.full
|
|
rm -fr $send_files_dir
|
|
mkdir $send_files_dir
|
|
|
|
workout()
|
|
{
|
|
fsz=$1
|
|
ops=$2
|
|
|
|
_scratch_unmount >/dev/null 2>&1
|
|
echo "*** mkfs -dsize=$fsz" >>$seqres.full
|
|
echo "" >>$seqres.full
|
|
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
|
|
|| _fail "size=$fsz mkfs failed"
|
|
_scratch_mount "-o noatime"
|
|
|
|
run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n $ops $FSSTRESS_AVOID -x \
|
|
"$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base"
|
|
|
|
_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr
|
|
|
|
echo "# $BTRFS_UTIL_PROG send $SCRATCH_MNT/base > ${send_files_dir}/base.snap" \
|
|
>> $seqres.full
|
|
$BTRFS_UTIL_PROG send $SCRATCH_MNT/base > $send_files_dir/base.snap 2>> $seqres.full \
|
|
|| _fail "failed: '$@'"
|
|
echo "# $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base\
|
|
$SCRATCH_MNT/incr > ${send_files_dir}/incr.snap" >> $seqres.full
|
|
$BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base \
|
|
$SCRATCH_MNT/incr > $send_files_dir/incr.snap 2>> $seqres.full \
|
|
|| _fail "failed: '$@'"
|
|
|
|
run_check $FSSUM_PROG -A -f -w $send_files_dir/base.fssum \
|
|
$SCRATCH_MNT/base
|
|
run_check $FSSUM_PROG -A -f -w $send_files_dir/incr.fssum \
|
|
-x $SCRATCH_MNT/incr/base $SCRATCH_MNT/incr
|
|
|
|
_scratch_unmount >/dev/null 2>&1
|
|
echo "*** mkfs -dsize=$fsz" >>$seqres.full
|
|
echo "" >>$seqres.full
|
|
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
|
|
|| _fail "size=$fsz mkfs failed"
|
|
_scratch_mount "-o noatime"
|
|
|
|
_run_btrfs_util_prog receive $SCRATCH_MNT < $send_files_dir/base.snap
|
|
run_check $FSSUM_PROG -r $send_files_dir/base.fssum $SCRATCH_MNT/base
|
|
|
|
_run_btrfs_util_prog receive $SCRATCH_MNT < $send_files_dir/incr.snap
|
|
run_check $FSSUM_PROG -r $send_files_dir/incr.fssum $SCRATCH_MNT/incr
|
|
}
|
|
|
|
echo "*** test send / receive"
|
|
|
|
fssize=`expr 2000 \* 1024 \* 1024`
|
|
ops=200
|
|
|
|
workout $fssize $ops
|
|
|
|
echo "*** done"
|
|
status=0
|
|
exit
|