mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
reflink: fix style problems in existing tests
Fix style problems such as unnecessary use of quotes, add helper variables to reduce visual clutter, and other minor fixes to make the first batch of tests more closely resemble the second round tests. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
rm -f $tmp.* "$testdir"
|
||||
rm -f $tmp.* $testdir
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
rm -f $tmp.* "$testdir"
|
||||
rm -f $tmp.* $testdir
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
rm -f $tmp.* "$testdir"
|
||||
rm -f $tmp.* $testdir
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
|
||||
+22
-22
@@ -22,8 +22,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -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
|
||||
@@ -46,44 +46,44 @@ _cleanup()
|
||||
_supported_os Linux
|
||||
_require_test_reflink
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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"
|
||||
_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 do not match"
|
||||
|
||||
echo "Reflink the middle blocks together"
|
||||
free_before="$(stat -f -c '%a' "$testdir")"
|
||||
_reflink_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \
|
||||
$((blksz * 4)) $((blksz * 2)) >> "$seqres.full"
|
||||
free_before=$(stat -f -c '%a' $testdir)
|
||||
_reflink_range $testdir/file1 $((blksz * 4)) $testdir/file2 \
|
||||
$((blksz * 4)) $((blksz * 2)) >> $seqres.full
|
||||
_test_remount
|
||||
free_after="$(stat -f -c '%a' "$testdir")"
|
||||
echo "freesp changed by $free_before -> $free_after" >> "$seqres.full"
|
||||
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" \
|
||||
_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" \
|
||||
_compare_range $testdir/file1 $((blksz * 6)) $testdir/file2 \
|
||||
$((blksz * 6)) $((blksz * 2)) \
|
||||
|| echo "End sections do not match"
|
||||
|
||||
|
||||
+21
-21
@@ -23,7 +23,7 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
@@ -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
|
||||
@@ -47,44 +47,44 @@ _cleanup()
|
||||
_supported_os Linux
|
||||
_require_test_reflink
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 0x62 $((blksz * 2)) $((blksz * 6)) "$testdir/file2" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x62 $((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 do not match (intentional)"
|
||||
|
||||
echo "Reflink the middle blocks together"
|
||||
free_before="$(stat -f -c '%a' "$testdir")"
|
||||
_reflink_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \
|
||||
$((blksz * 4)) $((blksz * 2)) >> "$seqres.full"
|
||||
free_before=$(stat -f -c '%a' $testdir)
|
||||
_reflink_range $testdir/file1 $((blksz * 4)) $testdir/file2 \
|
||||
$((blksz * 4)) $((blksz * 2)) >> $seqres.full
|
||||
_test_remount
|
||||
free_after="$(stat -f -c '%a' "$testdir")"
|
||||
echo "freesp changed by $free_before -> $free_after" >> "$seqres.full"
|
||||
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 (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \
|
||||
_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" \
|
||||
_compare_range $testdir/file1 $((blksz * 6)) $testdir/file2 \
|
||||
$((blksz * 6)) $((blksz * 2)) \
|
||||
|| echo "End sections do not match (intentional)"
|
||||
|
||||
|
||||
+51
-51
@@ -24,8 +24,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -36,7 +36,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,7 +48,7 @@ _cleanup()
|
||||
_supported_os Linux
|
||||
_require_test_reflink
|
||||
|
||||
rm -f "$seqres.full"
|
||||
rm -f $seqres.full
|
||||
|
||||
testdir=$TEST_DIR/test-$seq
|
||||
rm -rf $testdir
|
||||
@@ -56,112 +56,112 @@ mkdir $testdir
|
||||
|
||||
echo "Create the original files"
|
||||
blksz=65536
|
||||
_pwrite_byte 0x61 0 $((blksz * 8)) "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 $((blksz * 8)) "$testdir/file2" >> "$seqres.full"
|
||||
_pwrite_byte 0x63 0 $((blksz * 8)) "$testdir/file3" >> "$seqres.full"
|
||||
_pwrite_byte 0x64 0 $((blksz * 8)) "$testdir/file4" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz * 8)) $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x62 0 $((blksz * 8)) $testdir/file2 >> $seqres.full
|
||||
_pwrite_byte 0x63 0 $((blksz * 8)) $testdir/file3 >> $seqres.full
|
||||
_pwrite_byte 0x64 0 $((blksz * 8)) $testdir/file4 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _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)"
|
||||
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file3" 0 $((blksz * 8)) \
|
||||
_compare_range $testdir/file1 0 $testdir/file3 0 $((blksz * 8)) \
|
||||
|| echo "Files 1-3 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file4" 0 $((blksz * 8)) \
|
||||
_compare_range $testdir/file1 0 $testdir/file4 0 $((blksz * 8)) \
|
||||
|| echo "Files 1-4 do not match (intentional)"
|
||||
|
||||
echo "Reflink the first four blocks together, 1-2 3-4"
|
||||
free_before="$(stat -f -c '%a' "$testdir")"
|
||||
_reflink_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 4)) >> "$seqres.full"
|
||||
_reflink_range "$testdir/file3" 0 "$testdir/file4" 0 $((blksz * 4)) >> "$seqres.full"
|
||||
free_before=$(stat -f -c '%a' $testdir)
|
||||
_reflink_range $testdir/file1 0 $testdir/file2 0 $((blksz * 4)) >> $seqres.full
|
||||
_reflink_range $testdir/file3 0 $testdir/file4 0 $((blksz * 4)) >> $seqres.full
|
||||
_test_remount
|
||||
free_after="$(stat -f -c '%a' "$testdir")"
|
||||
echo "freesp changed by $free_before -> $free_after" >> "$seqres.full"
|
||||
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/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 4)) \
|
||||
_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 4)) \
|
||||
|| echo "Sections of file 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file3" 0 $((blksz * 4)) \
|
||||
_compare_range $testdir/file1 0 $testdir/file3 0 $((blksz * 4)) \
|
||||
|| echo "Sections of file 1-3 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file4" 0 $((blksz * 4)) \
|
||||
_compare_range $testdir/file1 0 $testdir/file4 0 $((blksz * 4)) \
|
||||
|| echo "Sections of file 1-4 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file2" 0 "$testdir/file3" 0 $((blksz * 4)) \
|
||||
_compare_range $testdir/file2 0 $testdir/file3 0 $((blksz * 4)) \
|
||||
|| echo "Sections of file 2-3 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file2" 0 "$testdir/file4" 0 $((blksz * 4)) \
|
||||
_compare_range $testdir/file2 0 $testdir/file4 0 $((blksz * 4)) \
|
||||
|| echo "Sections of file 2-4 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file3" 0 "$testdir/file4" 0 $((blksz * 4)) \
|
||||
_compare_range $testdir/file3 0 $testdir/file4 0 $((blksz * 4)) \
|
||||
|| echo "Sections of file 3-4 do not match"
|
||||
|
||||
echo "Reflink the first two blocks together, 1-3 1-4"
|
||||
free_before="$(stat -f -c '%a' $testdir)"
|
||||
_reflink_range "$testdir/file1" 0 "$testdir/file3" 0 $((blksz * 2)) >> "$seqres.full"
|
||||
_reflink_range "$testdir/file1" 0 "$testdir/file4" 0 $((blksz * 2)) >> "$seqres.full"
|
||||
free_before=$(stat -f -c '%a' $testdir)
|
||||
_reflink_range $testdir/file1 0 $testdir/file3 0 $((blksz * 2)) >> $seqres.full
|
||||
_reflink_range $testdir/file1 0 $testdir/file4 0 $((blksz * 2)) >> $seqres.full
|
||||
_test_remount
|
||||
free_after="$(stat -f -c '%a' $testdir)"
|
||||
echo "freesp changed by $free_before -> $free_after" >> "$seqres.full"
|
||||
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/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $((blksz * 2)) \
|
||||
_compare_range $testdir/file1 0 $testdir/file2 0 $((blksz * 2)) \
|
||||
|| echo "Sections of files 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file3" 0 $((blksz * 2)) \
|
||||
_compare_range $testdir/file1 0 $testdir/file3 0 $((blksz * 2)) \
|
||||
|| echo "Sections of files 1-3 do not match"
|
||||
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file4" 0 $((blksz * 2)) \
|
||||
_compare_range $testdir/file1 0 $testdir/file4 0 $((blksz * 2)) \
|
||||
|| echo "Sections of files 1-4 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" 0 "$testdir/file3" 0 $((blksz * 2)) \
|
||||
_compare_range $testdir/file2 0 $testdir/file3 0 $((blksz * 2)) \
|
||||
|| echo "Sections of files 2-3 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" 0 "$testdir/file4" 0 $((blksz * 2)) \
|
||||
_compare_range $testdir/file2 0 $testdir/file4 0 $((blksz * 2)) \
|
||||
|| echo "Sections of files 2-4 do not match"
|
||||
|
||||
_compare_range "$testdir/file3" 0 "$testdir/file4" 0 $((blksz * 2)) \
|
||||
_compare_range $testdir/file3 0 $testdir/file4 0 $((blksz * 2)) \
|
||||
|| echo "Sections of files 3-4 do not match"
|
||||
|
||||
echo "Compare previously reflinked sections"
|
||||
_compare_range "$testdir/file1" $((blksz * 2)) "$testdir/file2" \
|
||||
_compare_range $testdir/file1 $((blksz * 2)) $testdir/file2 \
|
||||
$((blksz * 2)) $((blksz * 2)) \
|
||||
|| echo "Sections of file 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 2)) "$testdir/file3" \
|
||||
_compare_range $testdir/file1 $((blksz * 2)) $testdir/file3 \
|
||||
$((blksz * 2)) $((blksz * 2)) \
|
||||
|| echo "Sections of file 1-3 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 2)) "$testdir/file4" \
|
||||
_compare_range $testdir/file1 $((blksz * 2)) $testdir/file4 \
|
||||
$((blksz * 2)) $((blksz * 2)) \
|
||||
|| echo "Sections of file 1-4 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 2)) "$testdir/file3" \
|
||||
_compare_range $testdir/file2 $((blksz * 2)) $testdir/file3 \
|
||||
$((blksz * 2)) $((blksz * 2)) \
|
||||
|| echo "Sections of file 2-3 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 2)) "$testdir/file4" \
|
||||
_compare_range $testdir/file2 $((blksz * 2)) $testdir/file4 \
|
||||
$((blksz * 2)) $((blksz * 2)) \
|
||||
|| echo "Sections of file 2-4 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file3" $((blksz * 2)) "$testdir/file4" \
|
||||
_compare_range $testdir/file3 $((blksz * 2)) $testdir/file4 \
|
||||
$((blksz * 2)) $((blksz * 2)) \
|
||||
|| echo "Sections of file 3-4 do not match"
|
||||
|
||||
|
||||
+22
-22
@@ -22,8 +22,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -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
|
||||
@@ -46,44 +46,44 @@ _cleanup()
|
||||
_supported_os Linux
|
||||
_require_test_dedupe
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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"
|
||||
_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")"
|
||||
echo "freesp changed by $free_before -> $free_after" >> "$seqres.full"
|
||||
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" \
|
||||
_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" \
|
||||
_compare_range $testdir/file1 $((blksz * 6)) $testdir/file2 \
|
||||
$((blksz * 6)) $((blksz * 2)) \
|
||||
|| echo "End sections do not match"
|
||||
|
||||
|
||||
+22
-22
@@ -22,8 +22,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -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
|
||||
@@ -46,44 +46,44 @@ _cleanup()
|
||||
_supported_os Linux
|
||||
_require_test_dedupe
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 0x62 $((blksz * 2)) $((blksz * 6)) "$testdir/file2" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 6)) $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x62 $((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 "(Fail to) 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")"
|
||||
echo "freesp changed by $free_before -> $free_after" >> "$seqres.full"
|
||||
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 (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 4)) "$testdir/file2" \
|
||||
_compare_range $testdir/file1 $((blksz * 4)) $testdir/file2 \
|
||||
$((blksz * 4)) $((blksz * 2)) \
|
||||
|| echo "Middle sections do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 6)) "$testdir/file2" \
|
||||
_compare_range $testdir/file1 $((blksz * 6)) $testdir/file2 \
|
||||
$((blksz * 6)) $((blksz * 2)) \
|
||||
|| echo "End sections do not match (intentional)"
|
||||
|
||||
|
||||
+39
-39
@@ -26,8 +26,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -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
|
||||
@@ -50,46 +50,46 @@ _cleanup()
|
||||
_supported_os Linux
|
||||
_require_test_reflink
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 + 37)) "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz + 37)) "$testdir/file2" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 $((blksz + 37)) "$testdir/file3" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 $((blksz + 37)) "$testdir/file4" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file2 >> $seqres.full
|
||||
_pwrite_byte 0x62 0 $((blksz + 37)) $testdir/file3 >> $seqres.full
|
||||
_pwrite_byte 0x62 0 $((blksz + 37)) $testdir/file4 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
|
||||
c1="$(_md5_checksum $testdir/file1)"
|
||||
c2="$(_md5_checksum $testdir/file2)"
|
||||
c3="$(_md5_checksum $testdir/file3)"
|
||||
c4="$(_md5_checksum $testdir/file4)"
|
||||
|
||||
test "${c1}" = "${c2}" || echo "file1 and file2 should match"
|
||||
test "${c1}" != "${c3}" || echo "file1 and file3 should not match"
|
||||
test "${c1}" != "${c4}" || echo "file1 and file4 should not match"
|
||||
test "${c2}" != "${c3}" || echo "file2 and file3 should not match"
|
||||
test "${c2}" != "${c4}" || echo "file2 and file4 should not match"
|
||||
test "${c3}" = "${c4}" || echo "file3 and file4 should match"
|
||||
test ${c1} = ${c2} || echo "file1 and file2 should match"
|
||||
test ${c1} != ${c3} || echo "file1 and file3 should not match"
|
||||
test ${c1} != ${c4} || echo "file1 and file4 should not match"
|
||||
test ${c2} != ${c3} || echo "file2 and file3 should not match"
|
||||
test ${c2} != ${c4} || echo "file2 and file4 should not match"
|
||||
test ${c3} = ${c4} || echo "file3 and file4 should match"
|
||||
|
||||
echo "Reflink the last blocks together, 1-2 1-3"
|
||||
_reflink_range "$testdir/file1" $blksz "$testdir/file2" $blksz 37 >> "$seqres.full"
|
||||
_reflink_range "$testdir/file1" $blksz "$testdir/file3" $blksz 37 >> "$seqres.full"
|
||||
_reflink_range $testdir/file1 $blksz $testdir/file2 $blksz 37 >> $seqres.full
|
||||
_reflink_range $testdir/file1 $blksz $testdir/file3 $blksz 37 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
|
||||
c1="$(_md5_checksum $testdir/file1)"
|
||||
c2="$(_md5_checksum $testdir/file2)"
|
||||
@@ -97,30 +97,30 @@ c3="$(_md5_checksum $testdir/file3)"
|
||||
c4="$(_md5_checksum $testdir/file4)"
|
||||
|
||||
echo "Compare files"
|
||||
test "${c1}" = "${c2}" || echo "file1 and file2 should match"
|
||||
test "${c1}" != "${c3}" || echo "file1 and file3 should not match"
|
||||
test "${c1}" != "${c4}" || echo "file1 and file4 should not match"
|
||||
test "${c2}" != "${c3}" || echo "file2 and file3 should not match"
|
||||
test "${c2}" != "${c4}" || echo "file2 and file4 should not match"
|
||||
test "${c3}" != "${c4}" || echo "file3 and file4 should match"
|
||||
test ${c1} = ${c2} || echo "file1 and file2 should match"
|
||||
test ${c1} != ${c3} || echo "file1 and file3 should not match"
|
||||
test ${c1} != ${c4} || echo "file1 and file4 should not match"
|
||||
test ${c2} != ${c3} || echo "file2 and file3 should not match"
|
||||
test ${c2} != ${c4} || echo "file2 and file4 should not match"
|
||||
test ${c3} != ${c4} || echo "file3 and file4 should match"
|
||||
|
||||
echo "Compare sections"
|
||||
_compare_range "$testdir/file1" $blksz "$testdir/file2" $blksz 37 \
|
||||
_compare_range $testdir/file1 $blksz $testdir/file2 $blksz 37 \
|
||||
|| echo "End sections of files 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file1" $blksz "$testdir/file3" $blksz 37 \
|
||||
_compare_range $testdir/file1 $blksz $testdir/file3 $blksz 37 \
|
||||
|| echo "End sections of files 1-3 do not match"
|
||||
|
||||
_compare_range "$testdir/file1" $blksz "$testdir/file4" $blksz 37 \
|
||||
_compare_range $testdir/file1 $blksz $testdir/file4 $blksz 37 \
|
||||
|| echo "End sections of files 1-4 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file2" $blksz "$testdir/file3" $blksz 37 \
|
||||
_compare_range $testdir/file2 $blksz $testdir/file3 $blksz 37 \
|
||||
|| echo "End sections of files 2-3 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $blksz "$testdir/file4" $blksz 37 \
|
||||
_compare_range $testdir/file2 $blksz $testdir/file4 $blksz 37 \
|
||||
|| echo "End sections of files 2-4 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file3" $blksz "$testdir/file4" $blksz 37 \
|
||||
_compare_range $testdir/file3 $blksz $testdir/file4 $blksz 37 \
|
||||
|| echo "End sections of files 3-4 do not match (intentional)"
|
||||
|
||||
# success, all done
|
||||
|
||||
+39
-39
@@ -26,8 +26,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -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
|
||||
@@ -50,48 +50,48 @@ _cleanup()
|
||||
_supported_os Linux
|
||||
_require_test_dedupe
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 + 37)) "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz + 37)) "$testdir/file2" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 $((blksz + 37)) "$testdir/file3" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 $((blksz + 37)) "$testdir/file4" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x61 0 $((blksz + 37)) $testdir/file2 >> $seqres.full
|
||||
_pwrite_byte 0x62 0 $((blksz + 37)) $testdir/file3 >> $seqres.full
|
||||
_pwrite_byte 0x62 0 $((blksz + 37)) $testdir/file4 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
|
||||
c1="$(_md5_checksum $testdir/file1)"
|
||||
c2="$(_md5_checksum $testdir/file2)"
|
||||
c3="$(_md5_checksum $testdir/file3)"
|
||||
c4="$(_md5_checksum $testdir/file4)"
|
||||
|
||||
test "${c1}" = "${c2}" || echo "file1 and file2 should match"
|
||||
test "${c1}" != "${c3}" || echo "file1 and file3 should not match"
|
||||
test "${c1}" != "${c4}" || echo "file1 and file4 should not match"
|
||||
test "${c2}" != "${c3}" || echo "file2 and file3 should not match"
|
||||
test "${c2}" != "${c4}" || echo "file2 and file4 should not match"
|
||||
test "${c3}" = "${c4}" || echo "file3 and file4 should match"
|
||||
test ${c1} = ${c2} || echo "file1 and file2 should match"
|
||||
test ${c1} != ${c3} || echo "file1 and file3 should not match"
|
||||
test ${c1} != ${c4} || echo "file1 and file4 should not match"
|
||||
test ${c2} != ${c3} || echo "file2 and file3 should not match"
|
||||
test ${c2} != ${c4} || echo "file2 and file4 should not match"
|
||||
test ${c3} = ${c4} || echo "file3 and file4 should match"
|
||||
|
||||
echo "Dedupe the last blocks together"
|
||||
echo "1->2"
|
||||
_dedupe_range "$testdir/file1" $blksz "$testdir/file2" $blksz 37 >> "$seqres.full"
|
||||
_dedupe_range $testdir/file1 $blksz $testdir/file2 $blksz 37 >> $seqres.full
|
||||
echo "1->3"
|
||||
_dedupe_range "$testdir/file1" $blksz "$testdir/file3" $blksz 37 >> "$seqres.full"
|
||||
_dedupe_range $testdir/file1 $blksz $testdir/file3 $blksz 37 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
|
||||
c1="$(_md5_checksum $testdir/file1)"
|
||||
c2="$(_md5_checksum $testdir/file2)"
|
||||
@@ -99,30 +99,30 @@ c3="$(_md5_checksum $testdir/file3)"
|
||||
c4="$(_md5_checksum $testdir/file4)"
|
||||
|
||||
echo "Compare files"
|
||||
test "${c1}" = "${c2}" || echo "file1 and file2 should match"
|
||||
test "${c1}" != "${c3}" || echo "file1 and file3 should not match"
|
||||
test "${c1}" != "${c4}" || echo "file1 and file4 should not match"
|
||||
test "${c2}" != "${c3}" || echo "file2 and file3 should not match"
|
||||
test "${c2}" != "${c4}" || echo "file2 and file4 should not match"
|
||||
test "${c3}" = "${c4}" || echo "file3 and file4 should match"
|
||||
test ${c1} = ${c2} || echo "file1 and file2 should match"
|
||||
test ${c1} != ${c3} || echo "file1 and file3 should not match"
|
||||
test ${c1} != ${c4} || echo "file1 and file4 should not match"
|
||||
test ${c2} != ${c3} || echo "file2 and file3 should not match"
|
||||
test ${c2} != ${c4} || echo "file2 and file4 should not match"
|
||||
test ${c3} = ${c4} || echo "file3 and file4 should match"
|
||||
|
||||
echo "Compare sections"
|
||||
_compare_range "$testdir/file1" $blksz "$testdir/file2" $blksz 37 \
|
||||
_compare_range $testdir/file1 $blksz $testdir/file2 $blksz 37 \
|
||||
|| echo "End sections of files 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file1" $blksz "$testdir/file3" $blksz 37 \
|
||||
_compare_range $testdir/file1 $blksz $testdir/file3 $blksz 37 \
|
||||
|| echo "End sections of files 1-3 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" $blksz "$testdir/file4" $blksz 37 \
|
||||
_compare_range $testdir/file1 $blksz $testdir/file4 $blksz 37 \
|
||||
|| echo "End sections of files 1-4 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file2" $blksz "$testdir/file3" $blksz 37 \
|
||||
_compare_range $testdir/file2 $blksz $testdir/file3 $blksz 37 \
|
||||
|| echo "End sections of files 2-3 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file2" $blksz "$testdir/file4" $blksz 37 \
|
||||
_compare_range $testdir/file2 $blksz $testdir/file4 $blksz 37 \
|
||||
|| echo "End sections of files 2-4 do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file3" $blksz "$testdir/file4" $blksz 37 \
|
||||
_compare_range $testdir/file3 $blksz $testdir/file4 $blksz 37 \
|
||||
|| echo "End sections of files 3-4 do not match"
|
||||
|
||||
# success, all done
|
||||
|
||||
+22
-22
@@ -26,8 +26,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -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
|
||||
@@ -52,57 +52,57 @@ _require_test_reflink
|
||||
_require_test_dedupe
|
||||
_require_xfs_io_command "falloc"
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 file blocks"
|
||||
blksz=65536
|
||||
_pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $blksz $((blksz * 2)) "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x62 $blksz $((blksz * 2)) $testdir/file1 >> $seqres.full
|
||||
|
||||
nr_blks=1024
|
||||
|
||||
echo "fallocate half the file"
|
||||
"$XFS_IO_PROG" -f -c "falloc $((nr_blks * blksz / 2)) $((nr_blks * blksz / 2))" "$testdir/file1" >> "$seqres.full"
|
||||
$XFS_IO_PROG -f -c "falloc $((nr_blks * blksz / 2)) $((nr_blks * blksz / 2))" $testdir/file1 >> $seqres.full
|
||||
|
||||
echo "Reflink block zero to the threes"
|
||||
seq 1 $((nr_blks / 3)) | while read nr; do
|
||||
_reflink_range "$testdir/file1" 0 "$testdir/file1" $((nr * 3 * blksz)) \
|
||||
$blksz >> "$seqres.full"
|
||||
_reflink_range $testdir/file1 0 $testdir/file1 $((nr * 3 * blksz)) \
|
||||
$blksz >> $seqres.full
|
||||
done
|
||||
|
||||
echo "Reflink block one to the fives"
|
||||
seq 1 $((nr_blks / 5)) | while read nr; do
|
||||
_reflink_range "$testdir/file1" $blksz "$testdir/file1" \
|
||||
$((nr * 5 * blksz)) $blksz >> "$seqres.full"
|
||||
_reflink_range $testdir/file1 $blksz $testdir/file1 \
|
||||
$((nr * 5 * blksz)) $blksz >> $seqres.full
|
||||
done
|
||||
|
||||
echo "Dedupe block two to the sevens"
|
||||
seq 1 $((nr_blks / 7)) | while read nr; do
|
||||
_dedupe_range "$testdir/file1" $((blksz * 2)) "$testdir/file1" \
|
||||
$((nr * 7 * blksz)) $blksz >> "$seqres.full" 2>&1
|
||||
_dedupe_range $testdir/file1 $((blksz * 2)) $testdir/file1 \
|
||||
$((nr * 7 * blksz)) $blksz >> $seqres.full 2>&1
|
||||
done
|
||||
|
||||
_test_remount
|
||||
|
||||
echo "Check block mappings"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
|
||||
crcZ=$(_md5_range_checksum /dev/zero 0 $blksz)
|
||||
crc0=$(_md5_range_checksum "$testdir/file1" 0 $blksz)
|
||||
crc1=$(_md5_range_checksum "$testdir/file1" $blksz $blksz)
|
||||
crc2=$(_md5_range_checksum "$testdir/file1" $((blksz * 2)) $blksz)
|
||||
crc0=$(_md5_range_checksum $testdir/file1 0 $blksz)
|
||||
crc1=$(_md5_range_checksum $testdir/file1 $blksz $blksz)
|
||||
crc2=$(_md5_range_checksum $testdir/file1 $((blksz * 2)) $blksz)
|
||||
|
||||
check_block() {
|
||||
lblk="$1"
|
||||
lblk=$1
|
||||
rem7=$((lblk % 7))
|
||||
rem5=$((lblk % 5))
|
||||
rem3=$((lblk % 3))
|
||||
|
||||
crc=$(_md5_range_checksum "$testdir/file1" $((lblk * blksz)) $blksz)
|
||||
crc=$(_md5_range_checksum $testdir/file1 $((lblk * blksz)) $blksz)
|
||||
|
||||
if [ $rem7 -eq 0 ]; then
|
||||
if [ $rem5 -eq 0 ]; then
|
||||
|
||||
+52
-52
@@ -23,8 +23,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -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
|
||||
@@ -48,103 +48,103 @@ _supported_os Linux
|
||||
_require_test_reflink
|
||||
_require_cp_reflink
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 * 48 - 3)) "$testdir/file1" >> "$seqres.full"
|
||||
_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file1 >> $seqres.full
|
||||
_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
|
||||
_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
echo "Compare files"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
|
||||
cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 do not match"
|
||||
cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 do not match"
|
||||
cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 do not match"
|
||||
cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 do not match"
|
||||
cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 do not match"
|
||||
cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 do not match"
|
||||
|
||||
echo "pagecache CoW the second file"
|
||||
_pwrite_byte 0x62 0 17 "$testdir/file2" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 17 "$testdir/file3" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 17 $testdir/file2 >> $seqres.full
|
||||
_pwrite_byte 0x62 0 17 $testdir/file3 >> $seqres.full
|
||||
|
||||
_pwrite_byte 0x62 $((blksz * 16 - 34)) 17 "$testdir/file2" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $((blksz * 16 - 34)) 17 "$testdir/file3" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $((blksz * 16 - 34)) 17 $testdir/file2 >> $seqres.full
|
||||
_pwrite_byte 0x62 $((blksz * 16 - 34)) 17 $testdir/file3 >> $seqres.full
|
||||
|
||||
_pwrite_byte 0x62 $((blksz * 48 - 8)) 17 "$testdir/file2" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $((blksz * 48 - 8)) 17 "$testdir/file3" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $((blksz * 48 - 8)) 17 $testdir/file2 >> $seqres.full
|
||||
_pwrite_byte 0x62 $((blksz * 48 - 8)) 17 $testdir/file3 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
echo "Compare files"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
|
||||
cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 do not match (intentional)"
|
||||
cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 do not match (intentional)"
|
||||
cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 do not match"
|
||||
cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 do not match (intentional)"
|
||||
cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 do not match (intentional)"
|
||||
cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 do not match"
|
||||
|
||||
echo "Compare the CoW'd section to the before file"
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file2" 0 17 \
|
||||
_compare_range $testdir/file1 0 $testdir/file2 0 17 \
|
||||
|| echo "Start sections do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 16 - 34)) \
|
||||
"$testdir/file2" $((blksz * 16 - 34)) 17 \
|
||||
_compare_range $testdir/file1 $((blksz * 16 - 34)) \
|
||||
$testdir/file2 $((blksz * 16 - 34)) 17 \
|
||||
|| echo "Middle sections do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 48 - 8)) \
|
||||
"$testdir/file2" $((blksz * 48 - 8)) 17 \
|
||||
_compare_range $testdir/file1 $((blksz * 48 - 8)) \
|
||||
$testdir/file2 $((blksz * 48 - 8)) 17 \
|
||||
|| echo "End sections do not match (intentional)"
|
||||
|
||||
echo "Compare the CoW'd section to the after file"
|
||||
_compare_range "$testdir/file2" 0 "$testdir/file3" 0 17 \
|
||||
_compare_range $testdir/file2 0 $testdir/file3 0 17 \
|
||||
|| echo "Start sections do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 16 - 34)) \
|
||||
"$testdir/file3" $((blksz * 16 - 34)) 17 \
|
||||
_compare_range $testdir/file2 $((blksz * 16 - 34)) \
|
||||
$testdir/file3 $((blksz * 16 - 34)) 17 \
|
||||
|| echo "Middle sections do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 48 - 8)) \
|
||||
"$testdir/file3" $((blksz * 48 - 8)) 17 \
|
||||
_compare_range $testdir/file2 $((blksz * 48 - 8)) \
|
||||
$testdir/file3 $((blksz * 48 - 8)) 17 \
|
||||
|| echo "End sections do not match"
|
||||
|
||||
echo "Compare the not CoW'd sections"
|
||||
_compare_range "$testdir/file1" 18 "$testdir/file2" 18 17 \
|
||||
_compare_range $testdir/file1 18 $testdir/file2 18 17 \
|
||||
|| echo "Start sections of 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" 18 "$testdir/file3" 18 17 \
|
||||
_compare_range $testdir/file2 18 $testdir/file3 18 17 \
|
||||
|| echo "Start sections of 2-3 do not match"
|
||||
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 16 - 17)) \
|
||||
"$testdir/file2" $((blksz * 16 - 17)) 82 \
|
||||
_compare_range $testdir/file1 $((blksz * 16 - 17)) \
|
||||
$testdir/file2 $((blksz * 16 - 17)) 82 \
|
||||
|| echo "Middle sections of 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 16 - 17)) \
|
||||
"$testdir/file3" $((blksz * 16 - 17)) 82 \
|
||||
_compare_range $testdir/file2 $((blksz * 16 - 17)) \
|
||||
$testdir/file3 $((blksz * 16 - 17)) 82 \
|
||||
|| echo "Middle sections of 2-3 do not match"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 48 - 108)) \
|
||||
"$testdir/file2" $((blksz * 48 - 108)) 100 \
|
||||
_compare_range $testdir/file1 $((blksz * 48 - 108)) \
|
||||
$testdir/file2 $((blksz * 48 - 108)) 100 \
|
||||
|| echo "End sections of 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 48 - 108)) \
|
||||
"$testdir/file3" $((blksz * 48 - 108)) 100 \
|
||||
_compare_range $testdir/file2 $((blksz * 48 - 108)) \
|
||||
$testdir/file3 $((blksz * 48 - 108)) 100 \
|
||||
|| echo "End sections of 2-3 do not match"
|
||||
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 14)) \
|
||||
"$testdir/file2" $((blksz * 14)) $blksz \
|
||||
_compare_range $testdir/file1 $((blksz * 14)) \
|
||||
$testdir/file2 $((blksz * 14)) $blksz \
|
||||
|| echo "Untouched sections of 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 14)) \
|
||||
"$testdir/file3" $((blksz * 14)) $blksz \
|
||||
_compare_range $testdir/file2 $((blksz * 14)) \
|
||||
$testdir/file3 $((blksz * 14)) $blksz \
|
||||
|| echo "Untouched sections of 2-3 do not match"
|
||||
|
||||
# success, all done
|
||||
|
||||
+49
-49
@@ -23,8 +23,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -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
|
||||
@@ -48,7 +48,7 @@ _supported_os Linux
|
||||
_require_test_reflink
|
||||
_require_cp_reflink
|
||||
|
||||
rm -f "$seqres.full"
|
||||
rm -f $seqres.full
|
||||
|
||||
testdir=$TEST_DIR/test-$seq
|
||||
rm -rf $testdir
|
||||
@@ -56,94 +56,94 @@ mkdir $testdir
|
||||
|
||||
echo "Create the original files"
|
||||
blksz=65536
|
||||
_pwrite_byte 0x61 0 $((blksz * 48 - 3)) "$testdir/file1" >> "$seqres.full"
|
||||
_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file1 >> $seqres.full
|
||||
_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
|
||||
_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
echo "Compare files"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
|
||||
cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 should match"
|
||||
cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 should match"
|
||||
cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 should match"
|
||||
cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 should match"
|
||||
cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 should match"
|
||||
cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 should match"
|
||||
|
||||
echo "directio CoW the second file"
|
||||
_pwrite_byte 0x62 0 $blksz "$testdir/file2" -d >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 $blksz "$testdir/file3" -d >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 $blksz $testdir/file2 -d >> $seqres.full
|
||||
_pwrite_byte 0x62 0 $blksz $testdir/file3 -d >> $seqres.full
|
||||
|
||||
_pwrite_byte 0x62 $((blksz * 16 - 512)) 512 "$testdir/file2" -d >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $((blksz * 16 - 512)) 512 "$testdir/file3" -d >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $((blksz * 16 - 512)) 512 $testdir/file2 -d >> $seqres.full
|
||||
_pwrite_byte 0x62 $((blksz * 16 - 512)) 512 $testdir/file3 -d >> $seqres.full
|
||||
|
||||
_pwrite_byte 0x62 $((blksz * 48)) $blksz "$testdir/file2" -d >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $((blksz * 48)) $blksz "$testdir/file3" -d >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $((blksz * 48)) $blksz $testdir/file2 -d >> $seqres.full
|
||||
_pwrite_byte 0x62 $((blksz * 48)) $blksz $testdir/file3 -d >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
echo "Compare files"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
|
||||
cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 should not match (intentional)"
|
||||
cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 should not match (intentional)"
|
||||
cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 should match"
|
||||
cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 should not match (intentional)"
|
||||
cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 should not match (intentional)"
|
||||
cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 should match"
|
||||
|
||||
echo "Compare the CoW'd section to the before file"
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file2" 0 $blksz \
|
||||
_compare_range $testdir/file1 0 $testdir/file2 0 $blksz \
|
||||
|| echo "Start sections do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 16 - 512)) \
|
||||
"$testdir/file2" $((blksz * 16 - 512)) 512 \
|
||||
_compare_range $testdir/file1 $((blksz * 16 - 512)) \
|
||||
$testdir/file2 $((blksz * 16 - 512)) 512 \
|
||||
|| echo "Middle sections do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 48 - 512)) \
|
||||
"$testdir/file2" $((blksz * 48 - 512)) $blksz \
|
||||
_compare_range $testdir/file1 $((blksz * 48 - 512)) \
|
||||
$testdir/file2 $((blksz * 48 - 512)) $blksz \
|
||||
|| echo "End sections do not match (intentional)"
|
||||
|
||||
echo "Compare the CoW'd section to the after file"
|
||||
_compare_range "$testdir/file2" 0 "$testdir/file3" 0 $blksz \
|
||||
_compare_range $testdir/file2 0 $testdir/file3 0 $blksz \
|
||||
|| echo "Start sections do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 16 - 512)) \
|
||||
"$testdir/file3" $((blksz * 16 - 512)) 512 \
|
||||
_compare_range $testdir/file2 $((blksz * 16 - 512)) \
|
||||
$testdir/file3 $((blksz * 16 - 512)) 512 \
|
||||
|| echo "Middle sections do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 48 - 512)) \
|
||||
"$testdir/file3" $((blksz * 48 - 512)) $blksz \
|
||||
_compare_range $testdir/file2 $((blksz * 48 - 512)) \
|
||||
$testdir/file3 $((blksz * 48 - 512)) $blksz \
|
||||
|| echo "End sections do not match"
|
||||
|
||||
echo "Compare the not CoW'd sections"
|
||||
_compare_range "$testdir/file1" $blksz "$testdir/file2" $blksz 512 \
|
||||
_compare_range $testdir/file1 $blksz $testdir/file2 $blksz 512 \
|
||||
|| echo "Start sections of 1-2 do not match"
|
||||
_compare_range "$testdir/file2" $blksz "$testdir/file3" $blksz 512 \
|
||||
_compare_range $testdir/file2 $blksz $testdir/file3 $blksz 512 \
|
||||
|| echo "Start sections of 2-3 do not match"
|
||||
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 16 - 1024)) \
|
||||
"$testdir/file2" $((blksz * 16 - 1024)) 512 \
|
||||
_compare_range $testdir/file1 $((blksz * 16 - 1024)) \
|
||||
$testdir/file2 $((blksz * 16 - 1024)) 512 \
|
||||
|| echo "Middle sections of 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 16 - 1024)) \
|
||||
"$testdir/file3" $((blksz * 16 - 1024)) 512 \
|
||||
_compare_range $testdir/file2 $((blksz * 16 - 1024)) \
|
||||
$testdir/file3 $((blksz * 16 - 1024)) 512 \
|
||||
|| echo "Middle sections of 2-3 do not match"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 48 - 1024)) \
|
||||
"$testdir/file2" $((blksz * 48 - 1024)) 512 \
|
||||
_compare_range $testdir/file1 $((blksz * 48 - 1024)) \
|
||||
$testdir/file2 $((blksz * 48 - 1024)) 512 \
|
||||
|| echo "End sections of 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 48 - 1024)) \
|
||||
"$testdir/file3" $((blksz * 48 - 1024)) 512 \
|
||||
_compare_range $testdir/file2 $((blksz * 48 - 1024)) \
|
||||
$testdir/file3 $((blksz * 48 - 1024)) 512 \
|
||||
|| echo "End sections of 2-3 do not match"
|
||||
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 16)) \
|
||||
"$testdir/file2" $((blksz * 16)) 512 \
|
||||
_compare_range $testdir/file1 $((blksz * 16)) \
|
||||
$testdir/file2 $((blksz * 16)) 512 \
|
||||
|| echo "Untouched sections of 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 16)) \
|
||||
"$testdir/file3" $((blksz * 16)) 512 \
|
||||
_compare_range $testdir/file2 $((blksz * 16)) \
|
||||
$testdir/file3 $((blksz * 16)) 512 \
|
||||
|| echo "Untouched sections of 2-3 do not match"
|
||||
|
||||
# success, all done
|
||||
|
||||
+52
-52
@@ -23,8 +23,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -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
|
||||
@@ -48,103 +48,103 @@ _supported_os Linux
|
||||
_require_test_reflink
|
||||
_require_cp_reflink
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 * 48 - 3)) "$testdir/file1" >> "$seqres.full"
|
||||
_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file1 >> $seqres.full
|
||||
_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
|
||||
_pwrite_byte 0x61 0 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
echo "Compare files"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
|
||||
cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 do not match"
|
||||
cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 do not match"
|
||||
cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 do not match"
|
||||
cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 do not match"
|
||||
cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 do not match"
|
||||
cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 do not match"
|
||||
|
||||
echo "mmap CoW the second file"
|
||||
_mwrite_byte 0x62 0 17 $((blksz * 48 - 3)) "$testdir/file2" >> "$seqres.full"
|
||||
_mwrite_byte 0x62 0 17 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full"
|
||||
_mwrite_byte 0x62 0 17 $((blksz * 48 - 3)) $testdir/file2 >> $seqres.full
|
||||
_mwrite_byte 0x62 0 17 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full
|
||||
|
||||
_mwrite_byte 0x62 $((blksz * 16 - 34)) 17 $((blksz * 48 - 3)) "$testdir/file2" >> "$seqres.full"
|
||||
_mwrite_byte 0x62 $((blksz * 16 - 34)) 17 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full"
|
||||
_mwrite_byte 0x62 $((blksz * 16 - 34)) 17 $((blksz * 48 - 3)) $testdir/file2 >> $seqres.full
|
||||
_mwrite_byte 0x62 $((blksz * 16 - 34)) 17 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full
|
||||
|
||||
_mwrite_byte 0x62 $((blksz * 48 - 20)) 17 $((blksz * 48 - 3)) "$testdir/file2" >> "$seqres.full"
|
||||
_mwrite_byte 0x62 $((blksz * 48 - 20)) 17 $((blksz * 48 - 3)) "$testdir/file3" >> "$seqres.full"
|
||||
_mwrite_byte 0x62 $((blksz * 48 - 20)) 17 $((blksz * 48 - 3)) $testdir/file2 >> $seqres.full
|
||||
_mwrite_byte 0x62 $((blksz * 48 - 20)) 17 $((blksz * 48 - 3)) $testdir/file3 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
echo "Compare files"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
|
||||
cmp -s "$testdir/file1" "$testdir/file2" || echo "Files 1-2 do not match (intentional)"
|
||||
cmp -s "$testdir/file1" "$testdir/file3" || echo "Files 1-3 do not match (intentional)"
|
||||
cmp -s "$testdir/file2" "$testdir/file3" || echo "Files 2-3 do not match"
|
||||
cmp -s $testdir/file1 $testdir/file2 || echo "Files 1-2 do not match (intentional)"
|
||||
cmp -s $testdir/file1 $testdir/file3 || echo "Files 1-3 do not match (intentional)"
|
||||
cmp -s $testdir/file2 $testdir/file3 || echo "Files 2-3 do not match"
|
||||
|
||||
echo "Compare the CoW'd section to the before file"
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file2" 0 17 \
|
||||
_compare_range $testdir/file1 0 $testdir/file2 0 17 \
|
||||
|| echo "Start sections do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 16 - 34)) \
|
||||
"$testdir/file2" $((blksz * 16 - 34)) 17 \
|
||||
_compare_range $testdir/file1 $((blksz * 16 - 34)) \
|
||||
$testdir/file2 $((blksz * 16 - 34)) 17 \
|
||||
|| echo "Middle sections do not match (intentional)"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 48 - 20)) \
|
||||
"$testdir/file2" $((blksz * 48 - 20)) 17 \
|
||||
_compare_range $testdir/file1 $((blksz * 48 - 20)) \
|
||||
$testdir/file2 $((blksz * 48 - 20)) 17 \
|
||||
|| echo "End sections do not match (intentional)"
|
||||
|
||||
echo "Compare the CoW'd section to the after file"
|
||||
_compare_range "$testdir/file2" 0 "$testdir/file3" 0 17 \
|
||||
_compare_range $testdir/file2 0 $testdir/file3 0 17 \
|
||||
|| echo "Start sections do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 16 - 34)) \
|
||||
"$testdir/file3" $((blksz * 16 - 34)) 17 \
|
||||
_compare_range $testdir/file2 $((blksz * 16 - 34)) \
|
||||
$testdir/file3 $((blksz * 16 - 34)) 17 \
|
||||
|| echo "Middle sections do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 48 - 20)) \
|
||||
"$testdir/file3" $((blksz * 48 - 20)) 17 \
|
||||
_compare_range $testdir/file2 $((blksz * 48 - 20)) \
|
||||
$testdir/file3 $((blksz * 48 - 20)) 17 \
|
||||
|| echo "End sections do not match"
|
||||
|
||||
echo "Compare the not CoW'd sections"
|
||||
_compare_range "$testdir/file1" 18 "$testdir/file2" 18 17 \
|
||||
_compare_range $testdir/file1 18 $testdir/file2 18 17 \
|
||||
|| echo "Start sections of 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" 18 "$testdir/file3" 18 17 \
|
||||
_compare_range $testdir/file2 18 $testdir/file3 18 17 \
|
||||
|| echo "Start sections of 2-3 do not match"
|
||||
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 16 - 17)) \
|
||||
"$testdir/file2" $((blksz * 16 - 17)) 82 \
|
||||
_compare_range $testdir/file1 $((blksz * 16 - 17)) \
|
||||
$testdir/file2 $((blksz * 16 - 17)) 82 \
|
||||
|| echo "Middle sections of 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 16 - 17)) \
|
||||
"$testdir/file3" $((blksz * 16 - 17)) 82 \
|
||||
_compare_range $testdir/file2 $((blksz * 16 - 17)) \
|
||||
$testdir/file3 $((blksz * 16 - 17)) 82 \
|
||||
|| echo "Middle sections of 2-3 do not match"
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 48 - 120)) \
|
||||
"$testdir/file2" $((blksz * 48 - 120)) 100 \
|
||||
_compare_range $testdir/file1 $((blksz * 48 - 120)) \
|
||||
$testdir/file2 $((blksz * 48 - 120)) 100 \
|
||||
|| echo "End sections of 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 48 - 120)) \
|
||||
"$testdir/file3" $((blksz * 48 - 120)) 100 \
|
||||
_compare_range $testdir/file2 $((blksz * 48 - 120)) \
|
||||
$testdir/file3 $((blksz * 48 - 120)) 100 \
|
||||
|| echo "End sections of 2-3 do not match"
|
||||
|
||||
|
||||
_compare_range "$testdir/file1" $((blksz * 14)) \
|
||||
"$testdir/file2" $((blksz * 14)) $blksz \
|
||||
_compare_range $testdir/file1 $((blksz * 14)) \
|
||||
$testdir/file2 $((blksz * 14)) $blksz \
|
||||
|| echo "Untouched sections of 1-2 do not match"
|
||||
|
||||
_compare_range "$testdir/file2" $((blksz * 14)) \
|
||||
"$testdir/file3" $((blksz * 14)) $blksz \
|
||||
_compare_range $testdir/file2 $((blksz * 14)) \
|
||||
$testdir/file3 $((blksz * 14)) $blksz \
|
||||
|| echo "Untouched sections of 2-3 do not match"
|
||||
|
||||
# success, all done
|
||||
|
||||
+19
-18
@@ -25,8 +25,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -37,7 +37,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
|
||||
@@ -50,41 +50,42 @@ _supported_os Linux
|
||||
_require_test_reflink
|
||||
_require_cp_reflink
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 file blocks"
|
||||
blksz=65536
|
||||
nr=9
|
||||
_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full"
|
||||
filesize=$((blksz * nr))
|
||||
_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
csum="$(_md5_checksum "$testdir/file1")"
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
csum=$(_md5_checksum $testdir/file1)
|
||||
|
||||
echo "Create the reflink copies"
|
||||
seq 2 $nr | while read i; do
|
||||
_cp_reflink "$testdir/file1" "$testdir/file$i"
|
||||
_cp_reflink $testdir/file1 $testdir/file$i
|
||||
done
|
||||
_test_remount
|
||||
|
||||
echo "Rewrite the copies"
|
||||
seq 2 $nr | while read i; do
|
||||
_pwrite_byte 0x62 0 $((blksz * 256)) "$testdir/file$i" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 $((blksz * 256)) $testdir/file$i >> $seqres.full
|
||||
done
|
||||
_test_remount
|
||||
|
||||
echo "Examine original file"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
|
||||
mod_csum="$(_md5_checksum "$testdir/file2")"
|
||||
new_csum="$(_md5_checksum "$testdir/file1")"
|
||||
test "${csum}" != "${mod_csum}" || echo "checksums do not match"
|
||||
test "${csum}" = "${new_csum}" || echo "checksums do not match"
|
||||
mod_csum=$(_md5_checksum $testdir/file2)
|
||||
new_csum=$(_md5_checksum $testdir/file1)
|
||||
test ${csum} != ${mod_csum} || echo "checksums do not match"
|
||||
test ${csum} = ${new_csum} || echo "checksums do not match"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
|
||||
+19
-18
@@ -25,8 +25,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -37,7 +37,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
|
||||
@@ -50,41 +50,42 @@ _supported_os Linux
|
||||
_require_test_reflink
|
||||
_require_cp_reflink
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 file blocks"
|
||||
blksz=65536
|
||||
nr=9
|
||||
_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full"
|
||||
filesize=$((blksz * nr))
|
||||
_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
csum="$(_md5_checksum "$testdir/file1")"
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
csum=$(_md5_checksum $testdir/file1)
|
||||
|
||||
echo "Create the reflink copies"
|
||||
seq 2 $nr | while read i; do
|
||||
_cp_reflink "$testdir/file1" "$testdir/file$i"
|
||||
_cp_reflink $testdir/file1 $testdir/file$i
|
||||
done
|
||||
_test_remount
|
||||
|
||||
echo "Rewrite the copies"
|
||||
seq 2 $nr | while read i; do
|
||||
_pwrite_byte 0x62 0 $((blksz * 256)) "$testdir/file$i" -d >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 $((blksz * 256)) $testdir/file$i -d >> $seqres.full
|
||||
done
|
||||
_test_remount
|
||||
|
||||
echo "Examine original file"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
|
||||
mod_csum="$(_md5_checksum "$testdir/file2")"
|
||||
new_csum="$(_md5_checksum "$testdir/file1")"
|
||||
test "${csum}" != "${mod_csum}" || echo "checksums do not match"
|
||||
test "${csum}" = "${new_csum}" || echo "checksums do not match"
|
||||
mod_csum=$(_md5_checksum $testdir/file2)
|
||||
new_csum=$(_md5_checksum $testdir/file1)
|
||||
test ${csum} != ${mod_csum} || echo "checksums do not match"
|
||||
test ${csum} = ${new_csum} || echo "checksums do not match"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
|
||||
+59
-59
@@ -23,8 +23,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -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
|
||||
@@ -50,92 +50,92 @@ _require_cp_reflink
|
||||
_require_xfs_io_command "falloc"
|
||||
_require_xfs_io_command "truncate"
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 * 5 + 37)) "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $((blksz * 5 + 37)) $testdir/file1 >> $seqres.full
|
||||
|
||||
_reflink_range "$testdir/file1" $blksz "$testdir/file2" $blksz \
|
||||
$((blksz * 4 + 37)) >> "$seqres.full"
|
||||
_reflink_range $testdir/file1 $blksz $testdir/file2 $blksz \
|
||||
$((blksz * 4 + 37)) >> $seqres.full
|
||||
|
||||
"$XFS_IO_PROG" -f -c "truncate $((blksz * 5 + 37))" "$testdir/file3" >> "$seqres.full"
|
||||
_reflink_range "$testdir/file1" 0 "$testdir/file3" 0 $blksz >> "$seqres.full"
|
||||
$XFS_IO_PROG -f -c "truncate $((blksz * 5 + 37))" $testdir/file3 >> $seqres.full
|
||||
_reflink_range $testdir/file1 0 $testdir/file3 0 $blksz >> $seqres.full
|
||||
|
||||
"$XFS_IO_PROG" -f -c "truncate $((blksz * 5 + 37))" "$testdir/file4" >> "$seqres.full"
|
||||
_reflink_range "$testdir/file1" $blksz "$testdir/file4" $blksz $blksz >> "$seqres.full"
|
||||
_reflink_range "$testdir/file1" $((blksz * 3)) "$testdir/file4" $((blksz * 3)) \
|
||||
$blksz >> "$seqres.full"
|
||||
$XFS_IO_PROG -f -c "truncate $((blksz * 5 + 37))" $testdir/file4 >> $seqres.full
|
||||
_reflink_range $testdir/file1 $blksz $testdir/file4 $blksz $blksz >> $seqres.full
|
||||
_reflink_range $testdir/file1 $((blksz * 3)) $testdir/file4 $((blksz * 3)) \
|
||||
$blksz >> $seqres.full
|
||||
|
||||
_cp_reflink "$testdir/file1" "$testdir/file5"
|
||||
_cp_reflink $testdir/file1 $testdir/file5
|
||||
_test_remount
|
||||
|
||||
echo "Compare sections"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum "$testdir/file5" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
md5sum $testdir/file5 | _filter_test_dir
|
||||
|
||||
_compare_range "$testdir/file1" $blksz "$testdir/file2" $blksz \
|
||||
_compare_range $testdir/file1 $blksz $testdir/file2 $blksz \
|
||||
$((blksz * 4 + 37)) \
|
||||
|| echo "shared parts of files 1-2 changed"
|
||||
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file3" 0 $blksz \
|
||||
_compare_range $testdir/file1 0 $testdir/file3 0 $blksz \
|
||||
|| echo "shared parts of files 1-3 changed"
|
||||
|
||||
_compare_range "$testdir/file1" $blksz "$testdir/file4" $blksz $blksz \
|
||||
_compare_range $testdir/file1 $blksz $testdir/file4 $blksz $blksz \
|
||||
|| echo "shared parts of files 1-4 changed"
|
||||
|
||||
_compare_range "$testdir/file1" 0 "$testdir/file5" 0 $((blksz * 5 + 37)) \
|
||||
_compare_range $testdir/file1 0 $testdir/file5 0 $((blksz * 5 + 37)) \
|
||||
|| echo "shared parts of files 1-5 changed"
|
||||
|
||||
echo "Compare files"
|
||||
c1="$(_md5_checksum "$testdir/file1")"
|
||||
c2="$(_md5_checksum "$testdir/file2")"
|
||||
c3="$(_md5_checksum "$testdir/file3")"
|
||||
c4="$(_md5_checksum "$testdir/file4")"
|
||||
c5="$(_md5_checksum "$testdir/file5")"
|
||||
c1=$(_md5_checksum $testdir/file1)
|
||||
c2=$(_md5_checksum $testdir/file2)
|
||||
c3=$(_md5_checksum $testdir/file3)
|
||||
c4=$(_md5_checksum $testdir/file4)
|
||||
c5=$(_md5_checksum $testdir/file5)
|
||||
|
||||
test "${c1}" != "${c2}" || echo "file1 and file2 should not match"
|
||||
test "${c1}" != "${c3}" || echo "file1 and file3 should not match"
|
||||
test "${c1}" != "${c4}" || echo "file1 and file4 should not match"
|
||||
test "${c1}" = "${c5}" || echo "file1 and file5 should match"
|
||||
test "${c2}" != "${c3}" || echo "file2 and file3 should not match"
|
||||
test "${c2}" != "${c4}" || echo "file2 and file4 should not match"
|
||||
test "${c2}" != "${c5}" || echo "file2 and file5 should not match"
|
||||
test "${c3}" != "${c4}" || echo "file3 and file4 should not match"
|
||||
test "${c3}" != "${c5}" || echo "file3 and file5 should not match"
|
||||
test "${c4}" != "${c5}" || echo "file4 and file5 should not match"
|
||||
test ${c1} != ${c2} || echo "file1 and file2 should not match"
|
||||
test ${c1} != ${c3} || echo "file1 and file3 should not match"
|
||||
test ${c1} != ${c4} || echo "file1 and file4 should not match"
|
||||
test ${c1} = ${c5} || echo "file1 and file5 should match"
|
||||
test ${c2} != ${c3} || echo "file2 and file3 should not match"
|
||||
test ${c2} != ${c4} || echo "file2 and file4 should not match"
|
||||
test ${c2} != ${c5} || echo "file2 and file5 should not match"
|
||||
test ${c3} != ${c4} || echo "file3 and file4 should not match"
|
||||
test ${c3} != ${c5} || echo "file3 and file5 should not match"
|
||||
test ${c4} != ${c5} || echo "file4 and file5 should not match"
|
||||
|
||||
echo "falloc everything"
|
||||
"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 5))" "$testdir/file2" >> "$seqres.full"
|
||||
"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 5))" "$testdir/file3" >> "$seqres.full"
|
||||
"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 5))" "$testdir/file4" >> "$seqres.full"
|
||||
$XFS_IO_PROG -f -c "falloc 0 $((blksz * 5))" $testdir/file2 >> $seqres.full
|
||||
$XFS_IO_PROG -f -c "falloc 0 $((blksz * 5))" $testdir/file3 >> $seqres.full
|
||||
$XFS_IO_PROG -f -c "falloc 0 $((blksz * 5))" $testdir/file4 >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
echo "Compare files"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum "$testdir/file5" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
md5sum $testdir/file5 | _filter_test_dir
|
||||
|
||||
d1="$(_md5_checksum "$testdir/file1")"
|
||||
d2="$(_md5_checksum "$testdir/file2")"
|
||||
d3="$(_md5_checksum "$testdir/file3")"
|
||||
d4="$(_md5_checksum "$testdir/file4")"
|
||||
d5="$(_md5_checksum "$testdir/file5")"
|
||||
d1=$(_md5_checksum $testdir/file1)
|
||||
d2=$(_md5_checksum $testdir/file2)
|
||||
d3=$(_md5_checksum $testdir/file3)
|
||||
d4=$(_md5_checksum $testdir/file4)
|
||||
d5=$(_md5_checksum $testdir/file5)
|
||||
|
||||
test "${c1}" = "${d1}" || echo "file1 should not change"
|
||||
test "${c2}" = "${d2}" || echo "file2 should not change"
|
||||
test "${c3}" = "${d3}" || echo "file3 should not change"
|
||||
test "${c4}" = "${d4}" || echo "file4 should not change"
|
||||
test "${c5}" = "${d5}" || echo "file2 should not change"
|
||||
test ${c1} = ${d1} || echo "file1 should not change"
|
||||
test ${c2} = ${d2} || echo "file2 should not change"
|
||||
test ${c3} = ${d3} || echo "file3 should not change"
|
||||
test ${c4} = ${d4} || echo "file4 should not change"
|
||||
test ${c5} = ${d5} || echo "file2 should not change"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
|
||||
+66
-66
@@ -24,8 +24,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -36,7 +36,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,91 +51,91 @@ _require_cp_reflink
|
||||
_require_xfs_io_command "falloc"
|
||||
_require_xfs_io_command "fcollapse"
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $blksz $blksz "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x62 $blksz $blksz $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file1 >> $seqres.full
|
||||
|
||||
_cp_reflink "$testdir/file1" "$testdir/file2"
|
||||
_cp_reflink "$testdir/file1" "$testdir/file3"
|
||||
_cp_reflink "$testdir/file1" "$testdir/file4"
|
||||
_cp_reflink $testdir/file1 $testdir/file2
|
||||
_cp_reflink $testdir/file1 $testdir/file3
|
||||
_cp_reflink $testdir/file1 $testdir/file4
|
||||
|
||||
"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 4))" "$testdir/file1"
|
||||
"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 4))" "$testdir/file2"
|
||||
"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 4))" "$testdir/file3"
|
||||
"$XFS_IO_PROG" -f -c "falloc 0 $((blksz * 4))" "$testdir/file4"
|
||||
$XFS_IO_PROG -f -c "falloc 0 $((blksz * 4))" $testdir/file1
|
||||
$XFS_IO_PROG -f -c "falloc 0 $((blksz * 4))" $testdir/file2
|
||||
$XFS_IO_PROG -f -c "falloc 0 $((blksz * 4))" $testdir/file3
|
||||
$XFS_IO_PROG -f -c "falloc 0 $((blksz * 4))" $testdir/file4
|
||||
|
||||
_pwrite_byte 0x62 0 $blksz "$testdir/file2.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x63 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 0 $blksz $testdir/file2.chk >> $seqres.full
|
||||
_pwrite_byte 0x63 $blksz $blksz $testdir/file2.chk >> $seqres.full
|
||||
_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full
|
||||
|
||||
_pwrite_byte 0x61 0 $blksz "$testdir/file3.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x63 $blksz $blksz "$testdir/file3.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file3.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $blksz $testdir/file3.chk >> $seqres.full
|
||||
_pwrite_byte 0x63 $blksz $blksz $testdir/file3.chk >> $seqres.full
|
||||
_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file3.chk >> $seqres.full
|
||||
|
||||
_pwrite_byte 0x61 0 $blksz "$testdir/file4.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $blksz $blksz "$testdir/file4.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file4.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $blksz $testdir/file4.chk >> $seqres.full
|
||||
_pwrite_byte 0x62 $blksz $blksz $testdir/file4.chk >> $seqres.full
|
||||
_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file4.chk >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum "$testdir/file2.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file3.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file4.chk" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
md5sum $testdir/file2.chk | _filter_test_dir
|
||||
md5sum $testdir/file3.chk | _filter_test_dir
|
||||
md5sum $testdir/file4.chk | _filter_test_dir
|
||||
|
||||
c1="$(_md5_checksum "$testdir/file1")"
|
||||
c2="$(_md5_checksum "$testdir/file2")"
|
||||
c3="$(_md5_checksum "$testdir/file3")"
|
||||
c4="$(_md5_checksum "$testdir/file4")"
|
||||
c1=$(_md5_checksum $testdir/file1)
|
||||
c2=$(_md5_checksum $testdir/file2)
|
||||
c3=$(_md5_checksum $testdir/file3)
|
||||
c4=$(_md5_checksum $testdir/file4)
|
||||
|
||||
test "${c1}" = "${c2}" || echo "file1 and file2 should match"
|
||||
test "${c1}" = "${c3}" || echo "file1 and file3 should match"
|
||||
test "${c1}" = "${c4}" || echo "file1 and file4 should match"
|
||||
test "${c2}" = "${c3}" || echo "file2 and file3 should match"
|
||||
test "${c2}" = "${c4}" || echo "file2 and file4 should match"
|
||||
test "${c3}" = "${c4}" || echo "file3 and file4 should match"
|
||||
test ${c1} = ${c2} || echo "file1 and file2 should match"
|
||||
test ${c1} = ${c3} || echo "file1 and file3 should match"
|
||||
test ${c1} = ${c4} || echo "file1 and file4 should match"
|
||||
test ${c2} = ${c3} || echo "file2 and file3 should match"
|
||||
test ${c2} = ${c4} || echo "file2 and file4 should match"
|
||||
test ${c3} = ${c4} || echo "file3 and file4 should match"
|
||||
|
||||
echo "fcollapse files"
|
||||
"$XFS_IO_PROG" -f -c "fcollapse 0 $blksz" "$testdir/file2"
|
||||
"$XFS_IO_PROG" -f -c "fcollapse $blksz $blksz" "$testdir/file3"
|
||||
"$XFS_IO_PROG" -f -c "fcollapse $((blksz * 2)) $blksz" "$testdir/file4"
|
||||
$XFS_IO_PROG -f -c "fcollapse 0 $blksz" $testdir/file2
|
||||
$XFS_IO_PROG -f -c "fcollapse $blksz $blksz" $testdir/file3
|
||||
$XFS_IO_PROG -f -c "fcollapse $((blksz * 2)) $blksz" $testdir/file4
|
||||
_test_remount
|
||||
|
||||
echo "Compare files"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum "$testdir/file2.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file3.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file4.chk" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
md5sum $testdir/file2.chk | _filter_test_dir
|
||||
md5sum $testdir/file3.chk | _filter_test_dir
|
||||
md5sum $testdir/file4.chk | _filter_test_dir
|
||||
|
||||
c1="$(_md5_checksum "$testdir/file1")"
|
||||
c2="$(_md5_checksum "$testdir/file2")"
|
||||
c3="$(_md5_checksum "$testdir/file3")"
|
||||
c4="$(_md5_checksum "$testdir/file4")"
|
||||
c1=$(_md5_checksum $testdir/file1)
|
||||
c2=$(_md5_checksum $testdir/file2)
|
||||
c3=$(_md5_checksum $testdir/file3)
|
||||
c4=$(_md5_checksum $testdir/file4)
|
||||
|
||||
test "${c1}" != "${c2}" || echo "file1 and file2 should not match"
|
||||
test "${c1}" != "${c3}" || echo "file1 and file3 should not match"
|
||||
test "${c1}" != "${c4}" || echo "file1 and file4 should not match"
|
||||
test "${c2}" != "${c3}" || echo "file2 and file3 should not match"
|
||||
test "${c2}" != "${c4}" || echo "file2 and file4 should not match"
|
||||
test "${c3}" != "${c4}" || echo "file3 and file4 should not match"
|
||||
test ${c1} != ${c2} || echo "file1 and file2 should not match"
|
||||
test ${c1} != ${c3} || echo "file1 and file3 should not match"
|
||||
test ${c1} != ${c4} || echo "file1 and file4 should not match"
|
||||
test ${c2} != ${c3} || echo "file2 and file3 should not match"
|
||||
test ${c2} != ${c4} || echo "file2 and file4 should not match"
|
||||
test ${c3} != ${c4} || echo "file3 and file4 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/file3" "$testdir/file3.chk" || echo "file3 and file3.chk do not match"
|
||||
cmp -s "$testdir/file4" "$testdir/file4.chk" || echo "file4 and file4.chk do not match"
|
||||
cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match"
|
||||
cmp -s $testdir/file3 $testdir/file3.chk || echo "file3 and file3.chk do not match"
|
||||
cmp -s $testdir/file4 $testdir/file4.chk || echo "file4 and file4.chk do not match"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
|
||||
+62
-62
@@ -24,8 +24,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -36,7 +36,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
|
||||
@@ -50,86 +50,86 @@ _require_test_reflink
|
||||
_require_cp_reflink
|
||||
_require_xfs_io_command "fpunch"
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $blksz $blksz "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x62 $blksz $blksz $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file1 >> $seqres.full
|
||||
|
||||
_cp_reflink "$testdir/file1" "$testdir/file2"
|
||||
_cp_reflink "$testdir/file1" "$testdir/file3"
|
||||
_cp_reflink "$testdir/file1" "$testdir/file4"
|
||||
_cp_reflink $testdir/file1 $testdir/file2
|
||||
_cp_reflink $testdir/file1 $testdir/file3
|
||||
_cp_reflink $testdir/file1 $testdir/file4
|
||||
|
||||
_pwrite_byte 0x00 0 $blksz "$testdir/file2.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x00 0 $blksz $testdir/file2.chk >> $seqres.full
|
||||
_pwrite_byte 0x62 $blksz $blksz $testdir/file2.chk >> $seqres.full
|
||||
_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full
|
||||
|
||||
_pwrite_byte 0x61 0 $blksz "$testdir/file3.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x00 $blksz $blksz "$testdir/file3.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file3.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $blksz $testdir/file3.chk >> $seqres.full
|
||||
_pwrite_byte 0x00 $blksz $blksz $testdir/file3.chk >> $seqres.full
|
||||
_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file3.chk >> $seqres.full
|
||||
|
||||
_pwrite_byte 0x61 0 $blksz "$testdir/file4.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $blksz $blksz "$testdir/file4.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file4.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $blksz $testdir/file4.chk >> $seqres.full
|
||||
_pwrite_byte 0x62 $blksz $blksz $testdir/file4.chk >> $seqres.full
|
||||
_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file4.chk >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum "$testdir/file2.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file3.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file4.chk" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
md5sum $testdir/file2.chk | _filter_test_dir
|
||||
md5sum $testdir/file3.chk | _filter_test_dir
|
||||
md5sum $testdir/file4.chk | _filter_test_dir
|
||||
|
||||
c1="$(_md5_checksum "$testdir/file1")"
|
||||
c2="$(_md5_checksum "$testdir/file2")"
|
||||
c3="$(_md5_checksum "$testdir/file3")"
|
||||
c4="$(_md5_checksum "$testdir/file4")"
|
||||
c1=$(_md5_checksum $testdir/file1)
|
||||
c2=$(_md5_checksum $testdir/file2)
|
||||
c3=$(_md5_checksum $testdir/file3)
|
||||
c4=$(_md5_checksum $testdir/file4)
|
||||
|
||||
test "${c1}" = "${c2}" || echo "file1 and file2 should match"
|
||||
test "${c1}" = "${c3}" || echo "file1 and file3 should match"
|
||||
test "${c1}" = "${c4}" || echo "file1 and file4 should match"
|
||||
test "${c2}" = "${c3}" || echo "file2 and file3 should match"
|
||||
test "${c2}" = "${c4}" || echo "file2 and file4 should match"
|
||||
test "${c3}" = "${c4}" || echo "file3 and file4 should match"
|
||||
test ${c1} = ${c2} || echo "file1 and file2 should match"
|
||||
test ${c1} = ${c3} || echo "file1 and file3 should match"
|
||||
test ${c1} = ${c4} || echo "file1 and file4 should match"
|
||||
test ${c2} = ${c3} || echo "file2 and file3 should match"
|
||||
test ${c2} = ${c4} || echo "file2 and file4 should match"
|
||||
test ${c3} = ${c4} || echo "file3 and file4 should match"
|
||||
|
||||
echo "fpunch files"
|
||||
"$XFS_IO_PROG" -f -c "fpunch 0 $blksz" "$testdir/file2"
|
||||
"$XFS_IO_PROG" -f -c "fpunch $blksz $blksz" "$testdir/file3"
|
||||
"$XFS_IO_PROG" -f -c "fpunch $((blksz * 2)) $blksz" "$testdir/file4"
|
||||
$XFS_IO_PROG -f -c "fpunch 0 $blksz" $testdir/file2
|
||||
$XFS_IO_PROG -f -c "fpunch $blksz $blksz" $testdir/file3
|
||||
$XFS_IO_PROG -f -c "fpunch $((blksz * 2)) $blksz" $testdir/file4
|
||||
_test_remount
|
||||
|
||||
echo "Compare files"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum "$testdir/file2.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file3.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file4.chk" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
md5sum $testdir/file2.chk | _filter_test_dir
|
||||
md5sum $testdir/file3.chk | _filter_test_dir
|
||||
md5sum $testdir/file4.chk | _filter_test_dir
|
||||
|
||||
c1="$(_md5_checksum "$testdir/file1")"
|
||||
c2="$(_md5_checksum "$testdir/file2")"
|
||||
c3="$(_md5_checksum "$testdir/file3")"
|
||||
c4="$(_md5_checksum "$testdir/file4")"
|
||||
c1=$(_md5_checksum $testdir/file1)
|
||||
c2=$(_md5_checksum $testdir/file2)
|
||||
c3=$(_md5_checksum $testdir/file3)
|
||||
c4=$(_md5_checksum $testdir/file4)
|
||||
|
||||
test "${c1}" != "${c2}" || echo "file1 and file2 should not match"
|
||||
test "${c1}" != "${c3}" || echo "file1 and file3 should not match"
|
||||
test "${c1}" != "${c4}" || echo "file1 and file4 should not match"
|
||||
test "${c2}" != "${c3}" || echo "file2 and file3 should not match"
|
||||
test "${c2}" != "${c4}" || echo "file2 and file4 should not match"
|
||||
test "${c3}" != "${c4}" || echo "file3 and file4 should not match"
|
||||
test ${c1} != ${c2} || echo "file1 and file2 should not match"
|
||||
test ${c1} != ${c3} || echo "file1 and file3 should not match"
|
||||
test ${c1} != ${c4} || echo "file1 and file4 should not match"
|
||||
test ${c2} != ${c3} || echo "file2 and file3 should not match"
|
||||
test ${c2} != ${c4} || echo "file2 and file4 should not match"
|
||||
test ${c3} != ${c4} || echo "file3 and file4 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/file3" "$testdir/file3.chk" || echo "file3 and file3.chk do not match"
|
||||
cmp -s "$testdir/file4" "$testdir/file4.chk" || echo "file4 and file4.chk do not match"
|
||||
cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match"
|
||||
cmp -s $testdir/file3 $testdir/file3.chk || echo "file3 and file3.chk do not match"
|
||||
cmp -s $testdir/file4 $testdir/file4.chk || echo "file4 and file4.chk do not match"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
|
||||
+65
-65
@@ -24,8 +24,8 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename "$0"`
|
||||
seqres="$RESULT_DIR/$seq"
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
@@ -36,7 +36,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
|
||||
@@ -50,89 +50,89 @@ _require_test_reflink
|
||||
_require_cp_reflink
|
||||
_require_xfs_io_command "finsert"
|
||||
|
||||
rm -f "$seqres.full"
|
||||
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 "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $blksz $blksz "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x63 $((blksz * 2)) $blksz "$testdir/file1" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x62 $blksz $blksz $testdir/file1 >> $seqres.full
|
||||
_pwrite_byte 0x63 $((blksz * 2)) $blksz $testdir/file1 >> $seqres.full
|
||||
|
||||
_cp_reflink "$testdir/file1" "$testdir/file2"
|
||||
_cp_reflink "$testdir/file1" "$testdir/file3"
|
||||
_cp_reflink "$testdir/file1" "$testdir/file4"
|
||||
_cp_reflink $testdir/file1 $testdir/file2
|
||||
_cp_reflink $testdir/file1 $testdir/file3
|
||||
_cp_reflink $testdir/file1 $testdir/file4
|
||||
|
||||
_pwrite_byte 0x00 0 $blksz "$testdir/file2.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x63 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x00 0 $blksz $testdir/file2.chk >> $seqres.full
|
||||
_pwrite_byte 0x61 $blksz $blksz $testdir/file2.chk >> $seqres.full
|
||||
_pwrite_byte 0x62 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full
|
||||
_pwrite_byte 0x63 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full
|
||||
|
||||
_pwrite_byte 0x61 0 $blksz "$testdir/file3.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x00 $blksz $blksz "$testdir/file3.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $((blksz * 2)) $blksz "$testdir/file3.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x63 $((blksz * 3)) $blksz "$testdir/file3.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $blksz $testdir/file3.chk >> $seqres.full
|
||||
_pwrite_byte 0x00 $blksz $blksz $testdir/file3.chk >> $seqres.full
|
||||
_pwrite_byte 0x62 $((blksz * 2)) $blksz $testdir/file3.chk >> $seqres.full
|
||||
_pwrite_byte 0x63 $((blksz * 3)) $blksz $testdir/file3.chk >> $seqres.full
|
||||
|
||||
_pwrite_byte 0x61 0 $blksz "$testdir/file4.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x62 $blksz $blksz "$testdir/file4.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x00 $((blksz * 2)) $blksz "$testdir/file4.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x63 $((blksz * 3)) $blksz "$testdir/file4.chk" >> "$seqres.full"
|
||||
_pwrite_byte 0x61 0 $blksz $testdir/file4.chk >> $seqres.full
|
||||
_pwrite_byte 0x62 $blksz $blksz $testdir/file4.chk >> $seqres.full
|
||||
_pwrite_byte 0x00 $((blksz * 2)) $blksz $testdir/file4.chk >> $seqres.full
|
||||
_pwrite_byte 0x63 $((blksz * 3)) $blksz $testdir/file4.chk >> $seqres.full
|
||||
_test_remount
|
||||
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum "$testdir/file2.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file3.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file4.chk" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
md5sum $testdir/file2.chk | _filter_test_dir
|
||||
md5sum $testdir/file3.chk | _filter_test_dir
|
||||
md5sum $testdir/file4.chk | _filter_test_dir
|
||||
|
||||
c1="$(_md5_checksum "$testdir/file1")"
|
||||
c2="$(_md5_checksum "$testdir/file2")"
|
||||
c3="$(_md5_checksum "$testdir/file3")"
|
||||
c4="$(_md5_checksum "$testdir/file4")"
|
||||
c1=$(_md5_checksum $testdir/file1)
|
||||
c2=$(_md5_checksum $testdir/file2)
|
||||
c3=$(_md5_checksum $testdir/file3)
|
||||
c4=$(_md5_checksum $testdir/file4)
|
||||
|
||||
test "${c1}" = "${c2}" || echo "file1 and file2 should match"
|
||||
test "${c1}" = "${c3}" || echo "file1 and file3 should match"
|
||||
test "${c1}" = "${c4}" || echo "file1 and file4 should match"
|
||||
test "${c2}" = "${c3}" || echo "file2 and file3 should match"
|
||||
test "${c2}" = "${c4}" || echo "file2 and file4 should match"
|
||||
test "${c3}" = "${c4}" || echo "file3 and file4 should match"
|
||||
test ${c1} = ${c2} || echo "file1 and file2 should match"
|
||||
test ${c1} = ${c3} || echo "file1 and file3 should match"
|
||||
test ${c1} = ${c4} || echo "file1 and file4 should match"
|
||||
test ${c2} = ${c3} || echo "file2 and file3 should match"
|
||||
test ${c2} = ${c4} || echo "file2 and file4 should match"
|
||||
test ${c3} = ${c4} || echo "file3 and file4 should match"
|
||||
|
||||
echo "finsert files"
|
||||
"$XFS_IO_PROG" -f -c "finsert 0 $blksz" "$testdir/file2"
|
||||
"$XFS_IO_PROG" -f -c "finsert $blksz $blksz" "$testdir/file3"
|
||||
"$XFS_IO_PROG" -f -c "finsert $((blksz * 2)) $blksz" "$testdir/file4"
|
||||
$XFS_IO_PROG -f -c "finsert 0 $blksz" $testdir/file2
|
||||
$XFS_IO_PROG -f -c "finsert $blksz $blksz" $testdir/file3
|
||||
$XFS_IO_PROG -f -c "finsert $((blksz * 2)) $blksz" $testdir/file4
|
||||
_test_remount
|
||||
|
||||
echo "Compare files"
|
||||
md5sum "$testdir/file1" | _filter_test_dir
|
||||
md5sum "$testdir/file2" | _filter_test_dir
|
||||
md5sum "$testdir/file3" | _filter_test_dir
|
||||
md5sum "$testdir/file4" | _filter_test_dir
|
||||
md5sum "$testdir/file2.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file3.chk" | _filter_test_dir
|
||||
md5sum "$testdir/file4.chk" | _filter_test_dir
|
||||
md5sum $testdir/file1 | _filter_test_dir
|
||||
md5sum $testdir/file2 | _filter_test_dir
|
||||
md5sum $testdir/file3 | _filter_test_dir
|
||||
md5sum $testdir/file4 | _filter_test_dir
|
||||
md5sum $testdir/file2.chk | _filter_test_dir
|
||||
md5sum $testdir/file3.chk | _filter_test_dir
|
||||
md5sum $testdir/file4.chk | _filter_test_dir
|
||||
|
||||
c1="$(_md5_checksum "$testdir/file1")"
|
||||
c2="$(_md5_checksum "$testdir/file2")"
|
||||
c3="$(_md5_checksum "$testdir/file3")"
|
||||
c4="$(_md5_checksum "$testdir/file4")"
|
||||
c1=$(_md5_checksum $testdir/file1)
|
||||
c2=$(_md5_checksum $testdir/file2)
|
||||
c3=$(_md5_checksum $testdir/file3)
|
||||
c4=$(_md5_checksum $testdir/file4)
|
||||
|
||||
test "${c1}" != "${c2}" || echo "file1 and file2 should not match"
|
||||
test "${c1}" != "${c3}" || echo "file1 and file3 should not match"
|
||||
test "${c1}" != "${c4}" || echo "file1 and file4 should not match"
|
||||
test "${c2}" != "${c3}" || echo "file2 and file3 should not match"
|
||||
test "${c2}" != "${c4}" || echo "file2 and file4 should not match"
|
||||
test "${c3}" != "${c4}" || echo "file3 and file4 should not match"
|
||||
test ${c1} != ${c2} || echo "file1 and file2 should not match"
|
||||
test ${c1} != ${c3} || echo "file1 and file3 should not match"
|
||||
test ${c1} != ${c4} || echo "file1 and file4 should not match"
|
||||
test ${c2} != ${c3} || echo "file2 and file3 should not match"
|
||||
test ${c2} != ${c4} || echo "file2 and file4 should not match"
|
||||
test ${c3} != ${c4} || echo "file3 and file4 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/file3" "$testdir/file3.chk" || echo "file3 and file3.chk do not match"
|
||||
cmp -s "$testdir/file4" "$testdir/file4.chk" || echo "file4 and file4.chk do not match"
|
||||
cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match"
|
||||
cmp -s $testdir/file3 $testdir/file3.chk || echo "file3 and file3.chk do not match"
|
||||
cmp -s $testdir/file4 $testdir/file4.chk || echo "file4 and file4.chk do not match"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user