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
+23 -23
View File
@@ -35,7 +35,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
@@ -51,45 +51,45 @@ _require_xfs_io_command "fpunch"
rm -f "$seqres.full"
TESTDIR="$TEST_DIR/test-$seq"
rm -rf "$TESTDIR"
mkdir "$TESTDIR"
testdir="$TEST_DIR/test-$seq"
rm -rf "$testdir"
mkdir "$testdir"
echo "Create the original files"
BLKSZ=65536
_pwrite_byte 0x61 0 $((BLKSZ * 3)) "$TESTDIR/file1" >> "$seqres.full"
blksz=65536
_pwrite_byte 0x61 0 $((blksz * 3)) "$testdir/file1" >> "$seqres.full"
_cp_reflink "$TESTDIR/file1" "$TESTDIR/file2"
_cp_reflink "$testdir/file1" "$testdir/file2"
_pwrite_byte 0x61 0 $((BLKSZ * 3)) "$TESTDIR/file2.chk" >> "$seqres.full"
_pwrite_byte 0x00 $((BLKSZ - 17)) $((BLKSZ + 17)) "$TESTDIR/file2.chk" >> "$seqres.full"
_pwrite_byte 0x61 0 $((blksz * 3)) "$testdir/file2.chk" >> "$seqres.full"
_pwrite_byte 0x00 $((blksz - 17)) $((blksz + 17)) "$testdir/file2.chk" >> "$seqres.full"
_test_remount
md5sum "$TESTDIR/file1" | _filter_test_dir
md5sum "$TESTDIR/file2" | _filter_test_dir
md5sum "$TESTDIR/file2.chk" | _filter_test_dir
md5sum "$testdir/file1" | _filter_test_dir
md5sum "$testdir/file2" | _filter_test_dir
md5sum "$testdir/file2.chk" | _filter_test_dir
C1="$(_md5_checksum "$TESTDIR/file1")"
C2="$(_md5_checksum "$TESTDIR/file2")"
c1="$(_md5_checksum "$testdir/file1")"
c2="$(_md5_checksum "$testdir/file2")"
test "${C1}" = "${C2}" || echo "file1 and file2 should match"
test "${c1}" = "${c2}" || echo "file1 and file2 should match"
echo "fpunch files"
"$XFS_IO_PROG" -f -c "fpunch $((BLKSZ - 17)) $((BLKSZ + 17))" "$TESTDIR/file2"
"$XFS_IO_PROG" -f -c "fpunch $((blksz - 17)) $((blksz + 17))" "$testdir/file2"
_test_remount
echo "Compare files"
md5sum "$TESTDIR/file1" | _filter_test_dir
md5sum "$TESTDIR/file2" | _filter_test_dir
md5sum "$TESTDIR/file2.chk" | _filter_test_dir
md5sum "$testdir/file1" | _filter_test_dir
md5sum "$testdir/file2" | _filter_test_dir
md5sum "$testdir/file2.chk" | _filter_test_dir
C1="$(_md5_checksum "$TESTDIR/file1")"
C2="$(_md5_checksum "$TESTDIR/file2")"
c1="$(_md5_checksum "$testdir/file1")"
c2="$(_md5_checksum "$testdir/file2")"
test "${C1}" != "${C2}" || echo "file1 and file2 should not match"
test "${c1}" != "${c2}" || echo "file1 and file2 should not match"
echo "Compare against check files"
cmp -s "$TESTDIR/file2" "$TESTDIR/file2.chk" || echo "file2 and file2.chk do not match"
cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match"
# success, all done
status=0