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
+21 -21
View File
@@ -34,7 +34,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
@@ -48,43 +48,43 @@ _require_test_dedupe
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 $((BLKSZ * 2)) $((BLKSZ * 6)) "$TESTDIR/file1" >> "$seqres.full"
_pwrite_byte 0x61 $((BLKSZ * 2)) $((BLKSZ * 6)) "$TESTDIR/file2" >> "$seqres.full"
blksz=65536
_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) "$testdir/file1" >> "$seqres.full"
_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) "$testdir/file2" >> "$seqres.full"
_test_remount
md5sum "$TESTDIR/file1" | _filter_test_dir
md5sum "$TESTDIR/file2" | _filter_test_dir
md5sum "$testdir/file1" | _filter_test_dir
md5sum "$testdir/file2" | _filter_test_dir
_compare_range "$TESTDIR/file1" 0 "$TESTDIR/file2" 0 $((BLKSZ * 8)) \
_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 8)) \
|| echo "Files 1-2 do not match (intentional)"
echo "Dedupe the middle blocks together"
free_before="$(stat -f -c '%a' "$TESTDIR")"
_dedupe_range "$TESTDIR/file1" $((BLKSZ * 4)) "$TESTDIR/file2" \
$((BLKSZ * 4)) $((BLKSZ * 2)) >> "$seqres.full"
free_before="$(stat -f -c '%a' "$testdir")"
_dedupe_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \
$((blksz * 4)) $((blksz * 2)) >> "$seqres.full"
_test_remount
free_after="$(stat -f -c '%a' "$TESTDIR")"
free_after="$(stat -f -c '%a' "$testdir")"
echo "freesp changed by $free_before -> $free_after" >> "$seqres.full"
echo "Compare sections"
md5sum "$TESTDIR/file1" | _filter_test_dir
md5sum "$TESTDIR/file2" | _filter_test_dir
md5sum "$testdir/file1" | _filter_test_dir
md5sum "$testdir/file2" | _filter_test_dir
_compare_range "$TESTDIR/file1" 0 "$TESTDIR/file2" 0 $((BLKSZ * 4)) \
_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 4)) \
|| echo "Start sections do not match"
_compare_range "$TESTDIR/file1" $((BLKSZ * 4)) "$TESTDIR/file2" \
$((BLKSZ * 4)) $((BLKSZ * 2)) \
_compare_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \
$((blksz * 4)) $((blksz * 2)) \
|| echo "Middle sections do not match"
_compare_range "$TESTDIR/file1" $((BLKSZ * 6)) "$TESTDIR/file2" \
$((BLKSZ * 6)) $((BLKSZ * 2)) \
_compare_range "$testdir/file1" $((blksz * 6)) "$testdir/file2" \
$((blksz * 6)) $((blksz * 2)) \
|| echo "End sections do not match"
# success, all done