_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
-do_snapshot=/tmp/snapshot
+finished_file=$tmp.finished
+do_snapshot=$tmp.snapshot
rm -rf $finished_file
mkdir $testdir
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
+ [ -n "$write_pid" ] && kill -9 $write_pid > /dev/null 2>&1
wait
}
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
echo "Reflink and write the target"
overwrite &
+write_pid=$!
seq 1 10 | while read j; do
seq 0 $nr_loops | while read i; do
_reflink_range $testdir/file1 $((i * blksz)) \
done
touch $finished_file
wait
+unset write_pid
# success, all done
status=0
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
+ [ -n "$write_pid" ] && kill -9 $write_pid > /dev/null 2>&1
wait
}
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
echo "Reflink and dio write the target"
overwrite &
+write_pid=$!
seq 1 10 | while read j; do
seq 0 $nr_loops | while read i; do
_reflink_range $testdir/file1 $((i * blksz)) \
done
touch $finished_file
wait
+unset write_pid
# success, all done
status=0
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file $abort_file
+ rm -rf $tmp.*
wait
}
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
-abort_file=/tmp/abort
+abort_file=$tmp.abort
rm -rf $abort_file
mkdir $testdir
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file $abort_file
+ rm -rf $tmp.*
wait
}
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
-abort_file=/tmp/abort
+abort_file=$tmp.abort
rm -rf $abort_file
mkdir $testdir
testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
-otherdir=/tmp/m.$seq
+otherdir=$tmp.m.$seq
othertestdir=$otherdir/test-$seq
rm -rf $otherdir
mkdir $otherdir
testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
-otherdir=/tmp/m.$seq
+otherdir=$tmp.m.$seq
othertestdir=$otherdir/test-$seq
rm -rf $otherdir
mkdir $otherdir
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
. ./common/preamble
_begin_fstest auto quick fiexchange
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- rm -r -f $tmp.* $dir
-}
-
# Import common functions.
. ./common/filter
. ./common/reflink
old_b=$(md5sum $SCRATCH_MNT/b | awk '{print $1}')
echo "md5 a: $old_a md5 b: $old_b" >> $seqres.full
-od -tx1 -Ad -c $SCRATCH_MNT/a > /tmp/a0
-od -tx1 -Ad -c $SCRATCH_MNT/b > /tmp/b0
+od -tx1 -Ad -c $SCRATCH_MNT/a > $tmp.a0
+od -tx1 -Ad -c $SCRATCH_MNT/b > $tmp.b0
echo swap >> $seqres.full
$XFS_IO_PROG -c "exchangerange -f $SCRATCH_MNT/a" $SCRATCH_MNT/b
test $old_a = $new_b || echo "scratch file B doesn't match old file A"
test $old_b = $new_a || echo "scratch file A doesn't match old file B"
-od -tx1 -Ad -c $SCRATCH_MNT/a > /tmp/a1
-od -tx1 -Ad -c $SCRATCH_MNT/b > /tmp/b1
+od -tx1 -Ad -c $SCRATCH_MNT/a > $tmp.a1
+od -tx1 -Ad -c $SCRATCH_MNT/b > $tmp.b1
# success, all done
echo Silence is golden
_cleanup()
{
cd /
- rm -rf $tmp.* $testdir
+ rm -rf $tmp.*
}
# Import common functions.