tests: use lowercase variables for all the new reflink tests

Since $TESTDIR is a local variable, make it lowercase to avoid
confusion with $TEST_DIR.  While we're at it, make all the local
variables lowercase.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Darrick J. Wong
2016-02-08 09:27:15 +11:00
committed by Dave Chinner
parent aa69397ed1
commit 813524b566
89 changed files with 2290 additions and 2290 deletions
+24 -24
View File
@@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
rm -rf "$tmp".* "$TESTDIR"
rm -rf "$tmp".* "$testdir"
}
# get standard environment, filters and checks
@@ -56,41 +56,41 @@ echo "Format and mount"
_scratch_mkfs > "$seqres.full" 2>&1
_scratch_mount >> "$seqres.full" 2>&1
TESTDIR="$SCRATCH_MNT/test-$seq"
rm -rf $TESTDIR
mkdir $TESTDIR
testdir="$SCRATCH_MNT/test-$seq"
rm -rf $testdir
mkdir $testdir
echo "Create the original files"
BLKSZ=65536
NR=64
_pwrite_byte 0x61 0 $((BLKSZ * NR)) "$TESTDIR/file1" >> "$seqres.full"
_pwrite_byte 0x62 0 $((BLKSZ * NR)) "$TESTDIR/file2" >> "$seqres.full"
seq 0 2 $((NR-1)) | while read f; do
_reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
_pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
blksz=65536
nr=64
_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full"
_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file2" >> "$seqres.full"
seq 0 2 $((nr-1)) | while read f; do
_reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full"
_pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full"
done
seq 1 2 $((NR-1)) | while read f; do
_reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
_pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
seq 1 2 $((nr-1)) | while read f; do
_reflink_range "$testdir/file2" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full"
_pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full"
done
_scratch_remount
echo "Compare files"
md5sum "$TESTDIR/file1" | _filter_scratch
md5sum "$TESTDIR/file2" | _filter_scratch
md5sum "$TESTDIR/file3" | _filter_scratch
md5sum "$TESTDIR/file3.chk" | _filter_scratch
md5sum "$testdir/file1" | _filter_scratch
md5sum "$testdir/file2" | _filter_scratch
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
echo "CoW across the transition"
_pwrite_byte 0x63 $((BLKSZ * NR / 4)) $((BLKSZ * NR / 2)) "$TESTDIR/file3" >> "$seqres.full"
_pwrite_byte 0x63 $((BLKSZ * NR / 4)) $((BLKSZ * NR / 2)) "$TESTDIR/file3.chk" >> "$seqres.full"
_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3" >> "$seqres.full"
_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
_scratch_remount
echo "Compare files"
md5sum "$TESTDIR/file1" | _filter_scratch
md5sum "$TESTDIR/file2" | _filter_scratch
md5sum "$TESTDIR/file3" | _filter_scratch
md5sum "$TESTDIR/file3.chk" | _filter_scratch
md5sum "$testdir/file1" | _filter_scratch
md5sum "$testdir/file2" | _filter_scratch
md5sum "$testdir/file3" | _filter_scratch
md5sum "$testdir/file3.chk" | _filter_scratch
echo "Check for damage"
umount "$SCRATCH_MNT"