_cleanup()
{
cd /
- rm -f $tmp.* "$testdir"
+ rm -f $tmp.* $testdir
}
# get standard environment, filters and checks
_cleanup()
{
cd /
- rm -f $tmp.* "$testdir"
+ rm -f $tmp.* $testdir
}
# get standard environment, filters and checks
_cleanup()
{
cd /
- rm -f $tmp.* "$testdir"
+ rm -f $tmp.* $testdir
}
# get standard environment, filters and checks
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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"
# 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"
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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)"
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_supported_os Linux
_require_test_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
testdir=$TEST_DIR/test-$seq
rm -rf $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"
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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"
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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)"
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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)"
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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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)"
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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_test_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
testdir=$TEST_DIR/test-$seq
rm -rf $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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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")"
-
-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"
+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"
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
-
-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"
+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)
+
+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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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"
-
-_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"
-
-_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/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/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
+
+$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 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
_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
-
-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"
+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)
+
+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
-
-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"
+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)
+
+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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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
-
-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"
+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)
+
+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
-
-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"
+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)
+
+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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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"
-
-_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 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/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
+
+_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/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
-
-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"
+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)
+
+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
-
-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"
+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)
+
+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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_cp_reflink
_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 "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 $blksz 37 "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 $blksz 37 $testdir/file1 >> $seqres.full
-_cp_reflink "$testdir/file1" "$testdir/file2"
-_cp_reflink "$testdir/file1" "$testdir/file3"
+_cp_reflink $testdir/file1 $testdir/file2
+_cp_reflink $testdir/file1 $testdir/file3
-_pwrite_byte 0x61 0 $blksz "$testdir/file2.chk" >> "$seqres.full"
-_pwrite_byte 0x62 $blksz 34 "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 0 $blksz $testdir/file2.chk >> $seqres.full
+_pwrite_byte 0x62 $blksz 34 $testdir/file2.chk >> $seqres.full
-_pwrite_byte 0x61 0 $blksz "$testdir/file3.chk" >> "$seqres.full"
-_pwrite_byte 0x62 $blksz 37 "$testdir/file3.chk" >> "$seqres.full"
-_pwrite_byte 0x00 $((blksz + 37)) 3 "$testdir/file3.chk" >> "$seqres.full"
+_pwrite_byte 0x61 0 $blksz $testdir/file3.chk >> $seqres.full
+_pwrite_byte 0x62 $blksz 37 $testdir/file3.chk >> $seqres.full
+_pwrite_byte 0x00 $((blksz + 37)) 3 $testdir/file3.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/file2.chk" | _filter_test_dir
-md5sum "$testdir/file3.chk" | _filter_test_dir
+md5sum $testdir/file1 | _filter_test_dir
+md5sum $testdir/file2 | _filter_test_dir
+md5sum $testdir/file3 | _filter_test_dir
+md5sum $testdir/file2.chk | _filter_test_dir
+md5sum $testdir/file3.chk | _filter_test_dir
-c1="$(_md5_checksum "$testdir/file1")"
-c2="$(_md5_checksum "$testdir/file2")"
-c3="$(_md5_checksum "$testdir/file3")"
+c1=$(_md5_checksum $testdir/file1)
+c2=$(_md5_checksum $testdir/file2)
+c3=$(_md5_checksum $testdir/file3)
-test "${c1}" = "${c2}" || echo "file1 and file2 should match"
-test "${c1}" = "${c3}" || echo "file1 and file3 should match"
-test "${c2}" = "${c3}" || echo "file2 and file3 should match"
+test ${c1} = ${c2} || echo "file1 and file2 should match"
+test ${c1} = ${c3} || echo "file1 and file3 should match"
+test ${c2} = ${c3} || echo "file2 and file3 should match"
echo "truncate files"
-"$XFS_IO_PROG" -f -c "truncate $((blksz + 34))" "$testdir/file2"
-"$XFS_IO_PROG" -f -c "truncate $((blksz + 40))" "$testdir/file3"
+$XFS_IO_PROG -f -c "truncate $((blksz + 34))" $testdir/file2
+$XFS_IO_PROG -f -c "truncate $((blksz + 40))" $testdir/file3
_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/file2.chk" | _filter_test_dir
-md5sum "$testdir/file3.chk" | _filter_test_dir
+md5sum $testdir/file1 | _filter_test_dir
+md5sum $testdir/file2 | _filter_test_dir
+md5sum $testdir/file3 | _filter_test_dir
+md5sum $testdir/file2.chk | _filter_test_dir
+md5sum $testdir/file3.chk | _filter_test_dir
-c1="$(_md5_checksum "$testdir/file1")"
-c2="$(_md5_checksum "$testdir/file2")"
-c3="$(_md5_checksum "$testdir/file3")"
+c1=$(_md5_checksum $testdir/file1)
+c2=$(_md5_checksum $testdir/file2)
+c3=$(_md5_checksum $testdir/file3)
-test "${c1}" != "${c2}" || echo "file1 and file2 should not match"
-test "${c1}" != "${c3}" || echo "file1 and file3 should not match"
-test "${c2}" != "${c3}" || echo "file2 and file3 should not match"
+test ${c1} != ${c2} || echo "file1 and file2 should not match"
+test ${c1} != ${c3} || echo "file1 and file3 should not match"
+test ${c2} != ${c3} || echo "file2 and file3 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/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"
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_cp_reflink
_require_xfs_io_command "fzero"
-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
-
-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"
+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)
+
+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 "fzero files"
-"$XFS_IO_PROG" -f -c "fzero 0 $blksz" "$testdir/file2"
-"$XFS_IO_PROG" -f -c "fzero $blksz $blksz" "$testdir/file3"
-"$XFS_IO_PROG" -f -c "fzero $((blksz * 2)) $blksz" "$testdir/file4"
+$XFS_IO_PROG -f -c "fzero 0 $blksz" $testdir/file2
+$XFS_IO_PROG -f -c "fzero $blksz $blksz" $testdir/file3
+$XFS_IO_PROG -f -c "fzero $((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
-
-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"
+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)
+
+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
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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="$(stat -f $testdir -c '%S')"
margin='15%'
sz=$((blksz * blks))
nr=7
-_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
sync
-free_blocks0=$(stat -f "$testdir" -c '%f')
+free_blocks0=$(stat -f $testdir -c '%f')
echo "Create the reflink copies"
for i in `seq 2 $nr`; do
- _cp_reflink "$testdir/file1" "$testdir/file.$i"
+ _cp_reflink $testdir/file1 $testdir/file.$i
done
_test_remount
-free_blocks1=$(stat -f "$testdir" -c '%f')
+free_blocks1=$(stat -f $testdir -c '%f')
_within_tolerance "free blocks after reflink" $free_blocks1 $free_blocks0 $margin -v
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
blks=2000
margin='15%'
sz=$((blksz * blks))
-free_blocks0=$(stat -f "$testdir" -c '%f')
+free_blocks0=$(stat -f $testdir -c '%f')
nr=7
-_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
sync
echo "Create the reflink copies"
for i in `seq 2 $nr`; do
- _cp_reflink "$testdir/file1" "$testdir/file.$i"
+ _cp_reflink $testdir/file1 $testdir/file.$i
done
-_cp_reflink "$testdir/file1" "$testdir/survivor"
+_cp_reflink $testdir/file1 $testdir/survivor
_test_remount
-free_blocks1=$(stat -f "$testdir" -c '%f')
+free_blocks1=$(stat -f $testdir -c '%f')
echo "Delete most of the files"
-rm -rf "$testdir"/file*
+rm -rf $testdir/file*
_test_remount
-free_blocks2=$(stat -f "$testdir" -c '%f')
+free_blocks2=$(stat -f $testdir -c '%f')
echo "Delete all the files"
-rm -rf "$testdir"/*
+rm -rf $testdir/*
_test_remount
-free_blocks3=$(stat -f "$testdir" -c '%f')
+free_blocks3=$(stat -f $testdir -c '%f')
#echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3
_within_tolerance "free blocks after reflink" $free_blocks1 $((free_blocks0 - blks)) $margin -v
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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 file blocks"
-blksz="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
blks=2000
margin='15%'
sz=$((blksz * blks))
-free_blocks0=$(stat -f "$testdir" -c '%f')
+free_blocks0=$(stat -f $testdir -c '%f')
nr=4
-_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
sync
echo "Create the reflink copies"
for i in `seq 2 $nr`; do
- _cp_reflink "$testdir/file1" "$testdir/file$i"
+ _cp_reflink $testdir/file1 $testdir/file$i
done
_test_remount
-free_blocks1=$(stat -f "$testdir" -c '%f')
+free_blocks1=$(stat -f $testdir -c '%f')
echo "Punch most of the blocks"
-"$XFS_IO_PROG" -f -c "fpunch 0 $sz" "$testdir/file2"
-"$XFS_IO_PROG" -f -c "fpunch 0 $((sz / 2))" "$testdir/file3"
-"$XFS_IO_PROG" -f -c "fpunch $((sz / 2)) $((sz / 2))" "$testdir/file4"
+$XFS_IO_PROG -f -c "fpunch 0 $sz" $testdir/file2
+$XFS_IO_PROG -f -c "fpunch 0 $((sz / 2))" $testdir/file3
+$XFS_IO_PROG -f -c "fpunch $((sz / 2)) $((sz / 2))" $testdir/file4
_test_remount
-free_blocks2=$(stat -f "$testdir" -c '%f')
+free_blocks2=$(stat -f $testdir -c '%f')
echo "Punch all the files"
for i in `seq 2 $nr`; do
- "$XFS_IO_PROG" -f -c "fpunch 0 $sz" "$testdir/file$i"
+ $XFS_IO_PROG -f -c "fpunch 0 $sz" $testdir/file$i
done
-"$XFS_IO_PROG" -f -c "fpunch 0 $sz" "$testdir/file1"
+$XFS_IO_PROG -f -c "fpunch 0 $sz" $testdir/file1
_test_remount
-free_blocks3=$(stat -f "$testdir" -c '%f')
+free_blocks3=$(stat -f $testdir -c '%f')
#echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3
_within_tolerance "free blocks after reflink" $free_blocks1 $((free_blocks0 - blks)) $margin -v
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_cp_reflink
_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 file blocks"
-blksz="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
blks=2000
margin='15%'
sz=$((blksz * blks))
-free_blocks0=$(stat -f "$testdir" -c '%f')
+free_blocks0=$(stat -f $testdir -c '%f')
nr=4
-_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
_test_remount
echo "Create the reflink copies"
for i in `seq 2 $nr`; do
- _cp_reflink "$testdir/file1" "$testdir/file$i"
+ _cp_reflink $testdir/file1 $testdir/file$i
done
_test_remount
-free_blocks1=$(stat -f "$testdir" -c '%f')
+free_blocks1=$(stat -f $testdir -c '%f')
echo "Collapse most of the blocks"
-"$XFS_IO_PROG" -f -c "fcollapse 0 $(((blks - 1) * blksz))" $testdir/file2
-"$XFS_IO_PROG" -f -c "fcollapse 0 $((sz / 2))" $testdir/file3
-"$XFS_IO_PROG" -f -c "fcollapse $((sz / 2)) $(( ((blks / 2) - 1) * blksz))" $testdir/file4
+$XFS_IO_PROG -f -c "fcollapse 0 $(((blks - 1) * blksz))" $testdir/file2
+$XFS_IO_PROG -f -c "fcollapse 0 $((sz / 2))" $testdir/file3
+$XFS_IO_PROG -f -c "fcollapse $((sz / 2)) $(( ((blks / 2) - 1) * blksz))" $testdir/file4
_test_remount
-free_blocks2=$(stat -f "$testdir" -c '%f')
+free_blocks2=$(stat -f $testdir -c '%f')
echo "Collpase nearly all the files"
-"$XFS_IO_PROG" -f -c "fcollapse 0 $(( ((blks / 2) - 1) * blksz))" $testdir/file3
-"$XFS_IO_PROG" -f -c "fcollapse 0 $((sz / 2))" $testdir/file4
-"$XFS_IO_PROG" -f -c "fcollapse 0 $(( (blks - 1) * blksz))" $testdir/file1
+$XFS_IO_PROG -f -c "fcollapse 0 $(( ((blks / 2) - 1) * blksz))" $testdir/file3
+$XFS_IO_PROG -f -c "fcollapse 0 $((sz / 2))" $testdir/file4
+$XFS_IO_PROG -f -c "fcollapse 0 $(( (blks - 1) * blksz))" $testdir/file1
_test_remount
-free_blocks3=$(stat -f "$testdir" -c '%f')
+free_blocks3=$(stat -f $testdir -c '%f')
#echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3
_within_tolerance "free blocks after reflink" $free_blocks1 $((free_blocks0 - blks)) $margin -v
#-----------------------------------------------------------------------
seq=`basename $0`
-seqres="$RESULT_DIR/$seq"
+seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
blks=2000
margin='15%'
-free_blocks0=$(stat -f "$testdir" -c '%f')
+free_blocks0=$(stat -f $testdir -c '%f')
nr=4
+filesize=$((blksz * nr))
sz=$((blks * blksz))
-_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
_test_remount
echo "Create the reflink copies"
for i in `seq 2 $nr`; do
- _cp_reflink "$testdir/file1" "$testdir/file$i"
+ _cp_reflink $testdir/file1 $testdir/file$i
done
_test_remount
-free_blocks1=$(stat -f "$testdir" -c '%f')
+free_blocks1=$(stat -f $testdir -c '%f')
echo "Rewrite some of the blocks"
-_pwrite_byte 0x62 0 $sz "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x63 0 $((sz / 2)) "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x64 $((sz / 2)) $((sz / 2)) "$testdir/file4" >> "$seqres.full"
+_pwrite_byte 0x62 0 $sz $testdir/file2 >> $seqres.full
+_pwrite_byte 0x63 0 $((sz / 2)) $testdir/file3 >> $seqres.full
+_pwrite_byte 0x64 $((sz / 2)) $((sz / 2)) $testdir/file4 >> $seqres.full
_test_remount
-free_blocks2=$(stat -f "$testdir" -c '%f')
+free_blocks2=$(stat -f $testdir -c '%f')
echo "Rewrite all the files"
-_pwrite_byte 0x62 0 $sz "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x63 0 $sz "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x64 0 $sz "$testdir/file4" >> "$seqres.full"
+_pwrite_byte 0x62 0 $sz $testdir/file2 >> $seqres.full
+_pwrite_byte 0x63 0 $sz $testdir/file3 >> $seqres.full
+_pwrite_byte 0x64 0 $sz $testdir/file4 >> $seqres.full
_test_remount
-free_blocks3=$(stat -f "$testdir" -c '%f')
+free_blocks3=$(stat -f $testdir -c '%f')
echo "Rewrite the original file"
-_pwrite_byte 0x65 0 $sz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x65 0 $sz $testdir/file1 >> $seqres.full
_test_remount
-free_blocks4=$(stat -f "$testdir" -c '%f')
+free_blocks4=$(stat -f $testdir -c '%f')
#echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4
_within_tolerance "free blocks after reflinking" $free_blocks1 $((free_blocks0 - blks)) $margin -v
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_cp_reflink
_require_xfs_io_command "fzero"
-rm -f "$seqres.full"
+rm -f $seqres.full
testdir=$TEST_DIR/test-$seq
rm -rf $testdir
mkdir $testdir
echo "Create the original file blocks"
-blksz="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
blks=2000
margin='15%'
sz=$((blksz * blks))
-free_blocks0=$(stat -f "$testdir" -c '%f')
+free_blocks0=$(stat -f $testdir -c '%f')
nr=4
-_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
_test_remount
echo "Create the reflink copies"
for i in `seq 2 $nr`; do
- _cp_reflink "$testdir/file1" "$testdir/file$i"
+ _cp_reflink $testdir/file1 $testdir/file$i
done
_test_remount
-free_blocks1=$(stat -f "$testdir" -c '%f')
+free_blocks1=$(stat -f $testdir -c '%f')
echo "Rewrite some of the blocks"
-"$XFS_IO_PROG" -f -c "fzero 0 $sz" "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x63 0 $((sz / 2)) "$testdir/file3" -d >> "$seqres.full"
-_mwrite_byte 0x64 $((sz / 2)) $((sz / 2)) $sz "$testdir/file4" >> "$seqres.full"
+$XFS_IO_PROG -f -c "fzero 0 $sz" $testdir/file2 >> $seqres.full
+_pwrite_byte 0x63 0 $((sz / 2)) $testdir/file3 -d >> $seqres.full
+_mwrite_byte 0x64 $((sz / 2)) $((sz / 2)) $sz $testdir/file4 >> $seqres.full
_test_remount
-free_blocks2=$(stat -f "$testdir" -c '%f')
+free_blocks2=$(stat -f $testdir -c '%f')
echo "Rewrite all the files"
-_pwrite_byte 0x62 0 $sz "$testdir/file2" -d >> "$seqres.full"
-_mwrite_byte 0x63 0 $sz $sz "$testdir/file3" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "fzero 0 $sz" $testdir/file4 >> "$seqres.full"
+_pwrite_byte 0x62 0 $sz $testdir/file2 -d >> $seqres.full
+_mwrite_byte 0x63 0 $sz $sz $testdir/file3 >> $seqres.full
+$XFS_IO_PROG -f -c "fzero 0 $sz" $testdir/file4 >> $seqres.full
_test_remount
-free_blocks3=$(stat -f "$testdir" -c '%f')
+free_blocks3=$(stat -f $testdir -c '%f')
echo "Rewrite the original file"
-_pwrite_byte 0x65 0 $sz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x65 0 $sz $testdir/file1 >> $seqres.full
_test_remount
-free_blocks4=$(stat -f "$testdir" -c '%f')
+free_blocks4=$(stat -f $testdir -c '%f')
#echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4
_within_tolerance "free blocks after reflinking" $free_blocks1 $((free_blocks0 - blks)) $margin -v
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_cp_reflink
_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="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
blks=2000
margin='15%'
sz=$((blksz * blks))
-free_blocks0=$(stat -f "$testdir" -c '%f')
+free_blocks0=$(stat -f $testdir -c '%f')
nr=4
-_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
_test_remount
echo "Create the reflink copies"
for i in `seq 2 $nr`; do
- _cp_reflink "$testdir/file1" "$testdir/file$i"
+ _cp_reflink $testdir/file1 $testdir/file$i
done
_test_remount
-free_blocks1=$(stat -f "$testdir" -c '%f')
+free_blocks1=$(stat -f $testdir -c '%f')
echo "funshare part of a file"
-"$XFS_IO_PROG" -f -c "falloc 0 $((sz / 2))" "$testdir/file2"
+$XFS_IO_PROG -f -c "falloc 0 $((sz / 2))" $testdir/file2
_test_remount
echo "funshare some of the copies"
-"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file2"
-"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file3"
+$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file2
+$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file3
_test_remount
-free_blocks2=$(stat -f "$testdir" -c '%f')
+free_blocks2=$(stat -f $testdir -c '%f')
echo "funshare the rest of the files"
-"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file4"
-"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file1"
+$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file4
+$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file1
_test_remount
-free_blocks3=$(stat -f "$testdir" -c '%f')
+free_blocks3=$(stat -f $testdir -c '%f')
echo "Rewrite the original file"
-_pwrite_byte 0x65 0 $sz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x65 0 $sz $testdir/file1 >> $seqres.full
_test_remount
-free_blocks4=$(stat -f "$testdir" -c '%f')
+free_blocks4=$(stat -f $testdir -c '%f')
#echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4
_within_tolerance "free blocks after reflinking" $free_blocks1 $((free_blocks0 - blks)) $margin -v
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir1"
+ rm -rf $tmp.* $testdir1
}
# get standard environment, filters and checks
_require_test_reflink
_require_scratch_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
testdir1="$TEST_DIR/test-$seq"
-rm -rf "$testdir1"
-mkdir "$testdir1"
+rm -rf $testdir1
+mkdir $testdir1
testdir2=$SCRATCH_MNT/test-$seq
-rm -rf "$testdir2"
-mkdir "$testdir2"
+mkdir $testdir2
echo "Create the original files"
blksz="$(stat -f $testdir1 -c '%S')"
sz=$((blksz * blks))
free_blocks0=$(stat -f $testdir1 -c '%f')
nr=4
-_pwrite_byte 0x61 0 $sz "$testdir1/file1" >> "$seqres.full"
-_pwrite_byte 0x61 0 $sz "$testdir1/file2" >> "$seqres.full"
-_pwrite_byte 0x61 0 $sz "$testdir2/file1" >> "$seqres.full"
-_pwrite_byte 0x61 0 $sz "$testdir2/file2" >> "$seqres.full"
-mkdir "$testdir1/dir1"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full
+_pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full
+_pwrite_byte 0x61 0 $sz $testdir2/file1 >> $seqres.full
+_pwrite_byte 0x61 0 $sz $testdir2/file2 >> $seqres.full
+mkdir $testdir1/dir1
seq 1 $((2 * blksz / 250)) | while read f; do
- touch "$testdir1/dir1/$f"
+ touch $testdir1/dir1/$f
done
-mknod "$testdir1/dev1" c 1 3
-mkfifo "$testdir1/fifo1"
+mknod $testdir1/dev1 c 1 3
+mkfifo $testdir1/fifo1
sync
_filter_enotty() {
}
echo "Try cross-device reflink"
-_reflink_range "$testdir1/file1" 0 "$testdir2/file1" 0 $blksz
+_reflink_range $testdir1/file1 0 $testdir2/file1 0 $blksz
echo "Try unaligned reflink"
-_reflink_range "$testdir1/file1" 37 "$testdir1/file1" 59 23
+_reflink_range $testdir1/file1 37 $testdir1/file1 59 23
echo "Try overlapping reflink"
-_reflink_range "$testdir1/file1" 0 "$testdir1/file1" 1 $((blksz * 2))
+_reflink_range $testdir1/file1 0 $testdir1/file1 1 $((blksz * 2))
echo "Try reflink past EOF"
-_reflink_range "$testdir1/file1" $(( (blks + 10) * blksz)) "$testdir1/file1" 0 $blksz
+_reflink_range $testdir1/file1 $(( (blks + 10) * blksz)) $testdir1/file1 0 $blksz
echo "Try to reflink a dir"
-_reflink_range "$testdir1/dir1" 0 "$testdir1/file2" 0 $blksz
+_reflink_range $testdir1/dir1 0 $testdir1/file2 0 $blksz
echo "Try to reflink a device"
-_reflink_range "$testdir1/dev1" 0 "$testdir1/file2" 0 $blksz
+_reflink_range $testdir1/dev1 0 $testdir1/file2 0 $blksz
echo "Try to reflink to a dir"
-_reflink_range "$testdir1/file1" 0 "$testdir1/dir1" 0 $blksz 2>&1 | _filter_test_dir
+_reflink_range $testdir1/file1 0 $testdir1/dir1 0 $blksz 2>&1 | _filter_test_dir
echo "Try to reflink to a device"
-_reflink_range "$testdir1/file1" 0 "$testdir1/dev1" 0 $blksz 2>&1 | _filter_enotty
+_reflink_range $testdir1/file1 0 $testdir1/dev1 0 $blksz 2>&1 | _filter_enotty
echo "Try to reflink to a fifo"
-_reflink_range "$testdir1/file1" 0 "$testdir1/fifo1" 0 $blksz -n 2>&1 | _filter_enotty
+_reflink_range $testdir1/file1 0 $testdir1/fifo1 0 $blksz -n 2>&1 | _filter_enotty
echo "Try to reflink an append-only file"
-_reflink_range "$testdir1/file1" 0 "$testdir1/file3" 0 $blksz -a 2>&1 | _filter_einval
+_reflink_range $testdir1/file1 0 $testdir1/file3 0 $blksz -a 2>&1 | _filter_einval
echo "Reflink two files"
-_reflink_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz >> "$seqres.full"
-_reflink_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full"
+_reflink_range $testdir1/file1 0 $testdir1/file2 0 $blksz >> $seqres.full
+_reflink_range $testdir2/file1 0 $testdir2/file2 0 $blksz >> $seqres.full
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir1"
+ rm -rf $tmp.* $testdir1
}
# get standard environment, filters and checks
_require_test_dedupe
_require_scratch_dedupe
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
testdir1="$TEST_DIR/test-$seq"
-rm -rf "$testdir1"
-mkdir "$testdir1"
+rm -rf $testdir1
+mkdir $testdir1
testdir2=$SCRATCH_MNT/test-$seq
-rm -rf "$testdir2"
-mkdir "$testdir2"
+mkdir $testdir2
echo "Create the original files"
blksz="$(stat -f $testdir1 -c '%S')"
sz=$((blksz * blks))
free_blocks0=$(stat -f $testdir1 -c '%f')
nr=4
-_pwrite_byte 0x61 0 $sz "$testdir1/file1" >> "$seqres.full"
-_pwrite_byte 0x61 0 $sz "$testdir1/file2" >> "$seqres.full"
-_pwrite_byte 0x61 0 $sz "$testdir1/file3" >> "$seqres.full"
-_pwrite_byte 0x61 0 $sz "$testdir2/file1" >> "$seqres.full"
-_pwrite_byte 0x61 0 $sz "$testdir2/file2" >> "$seqres.full"
-mkdir "$testdir1/dir1"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full
+_pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full
+_pwrite_byte 0x61 0 $sz $testdir1/file3 >> $seqres.full
+_pwrite_byte 0x61 0 $sz $testdir2/file1 >> $seqres.full
+_pwrite_byte 0x61 0 $sz $testdir2/file2 >> $seqres.full
+mkdir $testdir1/dir1
seq 1 $((2 * blksz / 250)) | while read f; do
- touch "$testdir1/dir1/$f"
+ touch $testdir1/dir1/$f
done
-mknod "$testdir1/dev1" c 1 3
-mkfifo "$testdir1/fifo1"
+mknod $testdir1/dev1 c 1 3
+mkfifo $testdir1/fifo1
sync
_filter_enotty() {
}
echo "Try cross-device dedupe"
-_dedupe_range "$testdir1/file1" 0 "$testdir2/file1" 0 $blksz
+_dedupe_range $testdir1/file1 0 $testdir2/file1 0 $blksz
echo "Try unaligned dedupe"
-_dedupe_range "$testdir1/file1" 37 "$testdir1/file1" 59 23
+_dedupe_range $testdir1/file1 37 $testdir1/file1 59 23
echo "Try overlapping dedupe"
-_dedupe_range "$testdir1/file1" 0 "$testdir1/file1" 1 $((blksz * 2))
+_dedupe_range $testdir1/file1 0 $testdir1/file1 1 $((blksz * 2))
echo "Try dedupe past EOF"
-_dedupe_range "$testdir1/file1" $(( (blks + 10) * blksz)) "$testdir1/file1" 0 $blksz
+_dedupe_range $testdir1/file1 $(( (blks + 10) * blksz)) $testdir1/file1 0 $blksz
echo "Try to dedupe a dir"
-_dedupe_range "$testdir1/dir1" 0 "$testdir1/file2" 0 $blksz
+_dedupe_range $testdir1/dir1 0 $testdir1/file2 0 $blksz
echo "Try to dedupe a device"
-_dedupe_range "$testdir1/dev1" 0 "$testdir1/file2" 0 $blksz 2>&1 | _filter_enotty
+_dedupe_range $testdir1/dev1 0 $testdir1/file2 0 $blksz 2>&1 | _filter_enotty
echo "Try to dedupe to a dir"
-_dedupe_range "$testdir1/file1" 0 "$testdir1/dir1" 0 $blksz 2>&1 | _filter_test_dir
+_dedupe_range $testdir1/file1 0 $testdir1/dir1 0 $blksz 2>&1 | _filter_test_dir
echo "Try to dedupe to a device"
-_dedupe_range "$testdir1/file1" 0 "$testdir1/dev1" 0 $blksz 2>&1 | _filter_eperm
+_dedupe_range $testdir1/file1 0 $testdir1/dev1 0 $blksz 2>&1 | _filter_eperm
echo "Try to dedupe to a fifo"
-_dedupe_range "$testdir1/file1" 0 "$testdir1/fifo1" 0 $blksz -n 2>&1 | _filter_eperm
+_dedupe_range $testdir1/file1 0 $testdir1/fifo1 0 $blksz -n 2>&1 | _filter_eperm
echo "Try to dedupe an append-only file"
-_dedupe_range "$testdir1/file1" 0 "$testdir1/file3" 0 $blksz -a >> "$seqres.full"
+_dedupe_range $testdir1/file1 0 $testdir1/file3 0 $blksz -a >> $seqres.full
echo "Dedupe two files"
-_dedupe_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz >> "$seqres.full"
-_dedupe_range "$testdir2/file1" 0 "$testdir2/file2" 0 $blksz >> "$seqres.full"
+_dedupe_range $testdir1/file1 0 $testdir1/file2 0 $blksz >> $seqres.full
+_dedupe_range $testdir2/file1 0 $testdir2/file2 0 $blksz >> $seqres.full
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir1"
+ rm -rf $tmp.* $testdir1
}
# get standard environment, filters and checks
_require_test_lsattr
_require_test_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
testdir1="$TEST_DIR/test-$seq"
-rm -rf "$testdir1"
-mkdir "$testdir1"
+rm -rf $testdir1
+mkdir $testdir1
echo "Create the original files"
blksz="$(stat -f $testdir1 -c '%S')"
sz=$((blksz * blks))
free_blocks0=$(stat -f $testdir1 -c '%f')
nr=4
-_pwrite_byte 0x61 0 $sz "$testdir1/file1" >> "$seqres.full"
-_pwrite_byte 0x61 0 $sz "$testdir1/file2" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full
+_pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full
sync
echo "Try reflink on immutable files"
$CHATTR_PROG +i $testdir1/file1 $testdir1/file2
-_reflink_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz 2>&1 | _filter_test_dir
+_reflink_range $testdir1/file1 0 $testdir1/file2 0 $blksz 2>&1 | _filter_test_dir
$CHATTR_PROG -i $testdir1/file1 $testdir1/file2
# success, all done
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir1"
+ rm -rf $tmp.* $testdir1
}
# get standard environment, filters and checks
_require_test_lsattr
_require_test_dedupe
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
testdir1="$TEST_DIR/test-$seq"
-rm -rf "$testdir1"
-mkdir "$testdir1"
+rm -rf $testdir1
+mkdir $testdir1
echo "Create the original files"
blksz="$(stat -f $testdir1 -c '%S')"
sz=$((blksz * blks))
free_blocks0=$(stat -f $testdir1 -c '%f')
nr=4
-_pwrite_byte 0x61 0 $sz "$testdir1/file1" >> "$seqres.full"
-_pwrite_byte 0x61 0 $sz "$testdir1/file2" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full
+_pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full
sync
echo "Try dedupe on immutable files"
$CHATTR_PROG +i $testdir1/file1 $testdir1/file2
-_dedupe_range "$testdir1/file1" 0 "$testdir1/file2" 0 $blksz 2>&1 | _filter_test_dir
+_dedupe_range $testdir1/file1 0 $testdir1/file2 0 $blksz 2>&1 | _filter_test_dir
$CHATTR_PROG -i $testdir1/file1 $testdir1/file2
# success, all done
#-----------------------------------------------------------------------
#
-seq=`basename "$0"`
-seqres="$RESULT_DIR/$seq"
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
_cleanup()
{
cd /
- rm -rf "$tmp".*
+ rm -rf $tmp.*
wait
}
_require_cp_reflink
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
loops=4096
blksz=65536
echo "Initialize files"
-echo > "$seqres.full"
-_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full"
-_cp_reflink "$testdir/file1" "$testdir/file2"
+echo > $seqres.full
+_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full
+_cp_reflink $testdir/file1 $testdir/file2
_scratch_remount
echo "Delete while rewriting"
-rm -rf "$testdir/file1" &
-_pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full"
+rm -rf $testdir/file1 &
+_pwrite_byte 0x62 0 $((loops * blksz)) $testdir/file1 >> $seqres.full
wait
# success, all done
#-----------------------------------------------------------------------
#
-seq=`basename "$0"`
-seqres="$RESULT_DIR/$seq"
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
_cleanup()
{
cd /
- rm -rf "$tmp".*
+ rm -rf $tmp.*
wait
}
_require_scratch_dedupe
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
loops=512
nr_loops=$((loops - 1))
blksz=65536
echo "Initialize files"
-echo > "$seqres.full"
-_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full"
+echo > $seqres.full
+_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full
+_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file2 >> $seqres.full
_scratch_remount
overwrite() {
- while [ ! -e "$testdir/finished" ]; do
+ while [ ! -e $testdir/finished ]; do
seq $nr_loops -1 0 | while read i; do
- _pwrite_byte 0x61 $((i * blksz)) $blksz "$testdir/file2" >> "$seqres.full"
+ _pwrite_byte 0x61 $((i * blksz)) $blksz $testdir/file2 >> $seqres.full
done
done
}
overwrite &
for i in `seq 1 2`; do
seq $nr_loops -1 0 | while read i; do
- _dedupe_range "$testdir/file1" $((i * blksz)) \
- "$testdir/file2" $((i * blksz)) $blksz >> "$seqres.full"
+ _dedupe_range $testdir/file1 $((i * blksz)) \
+ $testdir/file2 $((i * blksz)) $blksz >> $seqres.full
[ $? -ne 0 ] && break
done
done
echo "Finished dedupeing"
-touch "$testdir/finished"
+touch $testdir/finished
wait
# success, all done
#-----------------------------------------------------------------------
#
-seq=`basename "$0"`
-seqres="$RESULT_DIR/$seq"
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
_cleanup()
{
cd /
- rm -rf "$tmp".*
+ rm -rf $tmp.*
wait
}
_require_scratch_dedupe
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
loops=512
nr_loops=$((loops - 1))
blksz=65536
echo "Initialize files"
-echo > "$seqres.full"
-_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full"
+echo > $seqres.full
+_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full
+_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file2 >> $seqres.full
_scratch_remount
overwrite() {
- while [ ! -e "$testdir/finished" ]; do
+ while [ ! -e $testdir/finished ]; do
seq $nr_loops -1 0 | while read i; do
- _pwrite_byte 0x61 $((i * blksz)) $blksz "$testdir/file1" >> "$seqres.full"
+ _pwrite_byte 0x61 $((i * blksz)) $blksz $testdir/file1 >> $seqres.full
done
done
}
overwrite &
for i in `seq 1 2`; do
seq $nr_loops -1 0 | while read i; do
- _dedupe_range "$testdir/file1" $((i * blksz)) \
- "$testdir/file2" $((i * blksz)) $blksz >> "$seqres.full"
+ _dedupe_range $testdir/file1 $((i * blksz)) \
+ $testdir/file2 $((i * blksz)) $blksz >> $seqres.full
[ $? -ne 0 ] && break
done
done
echo "Finished dedupeing"
-touch "$testdir/finished"
+touch $testdir/finished
wait
# success, all done
#-----------------------------------------------------------------------
#
-seq=`basename "$0"`
+seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
_cleanup()
{
cd /
- rm -rf "$tmp".*
+ rm -rf $tmp.*
wait
}
_require_cp_reflink
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
loops=512
nr_loops=$((loops - 1))
blksz=65536
echo "Initialize files"
-echo > "$seqres.full"
-_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full"
-_cp_reflink "$testdir/file1" "$testdir/file3"
+echo > $seqres.full
+_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 0 $((loops * blksz)) $testdir/file2 >> $seqres.full
+_cp_reflink $testdir/file1 $testdir/file3
_scratch_remount
fbytes() {
}
reader() {
- while [ ! -e "$testdir/finished" ]; do
- _read_range "$testdir/file3" 0 $((loops * blksz)) | fbytes
+ while [ ! -e $testdir/finished ]; do
+ _read_range $testdir/file3 0 $((loops * blksz)) | fbytes
done
}
reader &
for i in `seq 1 2`; do
seq $nr_loops -1 0 | while read i; do
- _reflink_range "$testdir/file1" $((i * blksz)) \
- "$testdir/file3" $((i * blksz)) $blksz >> "$seqres.full"
+ _reflink_range $testdir/file1 $((i * blksz)) \
+ $testdir/file3 $((i * blksz)) $blksz >> $seqres.full
[ $? -ne 0 ] && break
done
seq $nr_loops -1 0 | while read i; do
- _reflink_range "$testdir/file2" $((i * blksz)) \
- "$testdir/file3" $((i * blksz)) $blksz >> "$seqres.full"
+ _reflink_range $testdir/file2 $((i * blksz)) \
+ $testdir/file3 $((i * blksz)) $blksz >> $seqres.full
[ $? -ne 0 ] && break
done
done
echo "Finished reflinking"
-touch "$testdir/finished"
+touch $testdir/finished
wait
# success, all done
#-----------------------------------------------------------------------
#
-seq=`basename "$0"`
+seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
_cleanup()
{
cd /
- rm -rf "$tmp".*
+ rm -rf $tmp.*
wait
}
_require_cp_reflink
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
loops=512
nr_loops=$((loops - 1))
blksz=65536
echo "Initialize files"
-echo > "$seqres.full"
-_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full"
+echo > $seqres.full
+_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 0 $((loops * blksz)) $testdir/file2 >> $seqres.full
_cp_reflink $testdir/file1 $testdir/file3
_scratch_remount
}
reader() {
- while [ ! -e "$testdir/finished" ]; do
- _read_range "$testdir/file3" 0 $((loops * blksz)) -d | fbytes
+ while [ ! -e $testdir/finished ]; do
+ _read_range $testdir/file3 0 $((loops * blksz)) -d | fbytes
done
}
reader &
for i in `seq 1 2`; do
seq $nr_loops -1 0 | while read i; do
- _reflink_range "$testdir/file1" $((i * blksz)) \
- "$testdir/file3" $((i * blksz)) $blksz >> "$seqres.full"
+ _reflink_range $testdir/file1 $((i * blksz)) \
+ $testdir/file3 $((i * blksz)) $blksz >> $seqres.full
[ $? -ne 0 ] && break
done
seq $nr_loops -1 0 | while read i; do
- _reflink_range "$testdir/file2" $((i * blksz)) \
- "$testdir/file3" $((i * blksz)) $blksz >> "$seqres.full"
+ _reflink_range $testdir/file2 $((i * blksz)) \
+ $testdir/file3 $((i * blksz)) $blksz >> $seqres.full
[ $? -ne 0 ] && break
done
done
echo "Finished reflinking"
-touch "$testdir/finished"
+touch $testdir/finished
wait
# success, all done
#-----------------------------------------------------------------------
#
-seq=`basename "$0"`
-seqres="$RESULT_DIR/$seq"
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
_cleanup()
{
cd /
- rm -rf "$tmp".*
+ rm -rf $tmp.*
wait
}
_require_cp_reflink
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
loops=1024
nr_loops=$((loops - 1))
blksz=65536
echo "Initialize file"
-echo > "$seqres.full"
-_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full"
+echo > $seqres.full
+_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full
_scratch_remount
# Snapshot creator...
snappy() {
n=0
- while [ ! -e "$testdir/finished" ]; do
- _cp_reflink "$testdir/file1" "$testdir/snap_$n" || break
+ while [ ! -e $testdir/finished ]; do
+ _cp_reflink $testdir/file1 $testdir/snap_$n || break
n=$((n + 1))
done
}
echo "Snapshot a file undergoing directio rewrite"
snappy &
seq $nr_loops -1 0 | while read i; do
- _pwrite_byte 0x63 $((i * blksz)) $blksz -d "$testdir/file1" >> "$seqres.full"
+ _pwrite_byte 0x63 $((i * blksz)) $blksz -d $testdir/file1 >> $seqres.full
done
touch $testdir/finished
wait
#-----------------------------------------------------------------------
#
-seq=`basename "$0"`
-seqres="$RESULT_DIR/$seq"
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
_cleanup()
{
cd /
- rm -rf "$tmp".*
+ rm -rf $tmp.*
wait
}
_require_cp_reflink
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
loops=1024
nr_loops=$((loops - 1))
blksz=65536
echo "Initialize file"
-echo > "$seqres.full"
-_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full"
+echo > $seqres.full
+_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full
_scratch_remount
# Snapshot creator...
snappy() {
n=0
- while [ ! -e "$testdir/finished" ]; do
- _cp_reflink "$testdir/file1" "$testdir/snap_$n" || break
+ while [ ! -e $testdir/finished ]; do
+ _cp_reflink $testdir/file1 $testdir/snap_$n || break
n=$((n + 1))
done
}
echo "Snapshot a file undergoing buffered rewrite"
snappy &
seq $nr_loops -1 0 | while read i; do
- _pwrite_byte 0x63 $((i * blksz)) $blksz "$testdir/file1" >> "$seqres.full"
+ _pwrite_byte 0x63 $((i * blksz)) $blksz $testdir/file1 >> $seqres.full
done
touch $testdir/finished
wait
#-----------------------------------------------------------------------
#
-seq=`basename "$0"`
-seqres="$RESULT_DIR/$seq"
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
_cleanup()
{
cd /
- rm -rf "$tmp".*
+ rm -rf $tmp.*
wait
}
_require_scratch_reflink
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
loops=1024
nr_loops=$((loops - 1))
blksz=65536
echo "Initialize files"
-echo > "$seqres.full"
-_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full"
+echo > $seqres.full
+_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 0 $((loops * blksz)) $testdir/file2 >> $seqres.full
_scratch_remount
# Direct I/O overwriter...
overwrite() {
- while [ ! -e "$testdir/finished" ]; do
+ while [ ! -e $testdir/finished ]; do
seq $nr_loops -1 0 | while read i; do
- _pwrite_byte 0x63 $((i * blksz)) $blksz "$testdir/file2" >> "$seqres.full"
+ _pwrite_byte 0x63 $((i * blksz)) $blksz $testdir/file2 >> $seqres.full
done
done
}
overwrite &
seq 1 10 | while read j; do
seq 0 $nr_loops | while read i; do
- _reflink_range "$testdir/file1" $((i * blksz)) \
- "$testdir/file2" $((i * blksz)) $blksz >> "$seqres.full"
+ _reflink_range $testdir/file1 $((i * blksz)) \
+ $testdir/file2 $((i * blksz)) $blksz >> $seqres.full
[ $? -ne 0 ] && exit
done
done
-touch "$testdir/finished"
+touch $testdir/finished
wait
# success, all done
#-----------------------------------------------------------------------
#
-seq=`basename "$0"`
-seqres="$RESULT_DIR/$seq"
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
_cleanup()
{
cd /
- rm -rf "$tmp".*
+ rm -rf $tmp.*
wait
}
_require_scratch_reflink
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
loops=1024
nr_loops=$((loops - 1))
blksz=65536
echo "Initialize files"
-echo > "$seqres.full"
-_pwrite_byte 0x61 0 $((loops * blksz)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((loops * blksz)) "$testdir/file2" >> "$seqres.full"
+echo > $seqres.full
+_pwrite_byte 0x61 0 $((loops * blksz)) $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 0 $((loops * blksz)) $testdir/file2 >> $seqres.full
_scratch_remount
# Direct I/O overwriter...
overwrite() {
- while [ ! -e "$testdir/finished" ]; do
+ while [ ! -e $testdir/finished ]; do
seq $nr_loops -1 0 | while read i; do
- _pwrite_byte 0x63 $((i * blksz)) $blksz -d "$testdir/file2" >> "$seqres.full"
+ _pwrite_byte 0x63 $((i * blksz)) $blksz -d $testdir/file2 >> $seqres.full
done
done
}
overwrite &
seq 1 10 | while read j; do
seq 0 $nr_loops | while read i; do
- _reflink_range "$testdir/file1" $((i * blksz)) \
- "$testdir/file2" $((i * blksz)) $blksz >> "$seqres.full"
+ _reflink_range $testdir/file1 $((i * blksz)) \
+ $testdir/file2 $((i * blksz)) $blksz >> $seqres.full
[ $? -ne 0 ] && exit
done
done
-touch "$testdir/finished"
+touch $testdir/finished
wait
# success, all done
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir1"
+ rm -rf $tmp.* $testdir1
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
echo "Reformat with appropriate size"
-blksz="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
nr_blks=10240
-umount "$SCRATCH_MNT"
+umount $SCRATCH_MNT
sz_bytes=$((nr_blks * 8 * blksz))
if [ $sz_bytes -lt $((32 * 1048576)) ]; then
sz_bytes=$((32 * 1048576))
fi
-_scratch_mkfs_sized $sz_bytes >> "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
-rm -rf "$testdir"
-mkdir "$testdir"
+_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
+rm -rf $testdir
+mkdir $testdir
echo "Create a big file and reflink it"
-_pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/bigfile" >> "$seqres.full" 2>&1
-_cp_reflink "$testdir/bigfile" "$testdir/clonefile"
+_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1
+_cp_reflink $testdir/bigfile $testdir/clonefile
sync
echo "Allocate the rest of the space"
-nr_free="$(stat -f -c '%f' "$testdir")"
-touch "$testdir/file0" "$testdir/file1"
-_pwrite_byte 0x61 0 $((blksz * nr_free)) "$testdir/eat_my_space" >> "$seqres.full" 2>&1
+nr_free=$(stat -f -c '%f' $testdir)
+touch $testdir/file0 $testdir/file1
+_pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2>&1
sync
echo "CoW the big file"
-out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)"
-echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
-echo "${out}" >> "$seqres.full" 2>&1
-echo "${out}"
+out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)"
+echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
+echo ${out} >> $seqres.full 2>&1
+echo ${out}
echo "Remount and try CoW again"
_scratch_remount
-out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)"
-echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
-echo "${out}" >> "$seqres.full" 2>&1
-echo "${out}"
+out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)"
+echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
+echo ${out} >> $seqres.full 2>&1
+echo ${out}
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir1"
+ rm -rf $tmp.* $testdir1
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
echo "Reformat with appropriate size"
-blksz="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
nr_blks=10240
-umount "$SCRATCH_MNT"
+umount $SCRATCH_MNT
sz_bytes=$((nr_blks * 3 / 2 * blksz))
if [ $sz_bytes -lt $((32 * 1048576)) ]; then
sz_bytes=$((32 * 1048576))
fi
-_scratch_mkfs_sized $sz_bytes >> "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
-rm -rf "$testdir"
-mkdir "$testdir"
+_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
+rm -rf $testdir
+mkdir $testdir
echo "Create a big file and reflink it"
-_pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/bigfile" >> "$seqres.full" 2>&1
-_cp_reflink "$testdir/bigfile" "$testdir/clonefile"
+_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1
+_cp_reflink $testdir/bigfile $testdir/clonefile
sync
echo "Allocate the rest of the space"
-nr_free="$(stat -f -c '%f' "$testdir")"
-touch "$testdir/file0" "$testdir/file1"
-_pwrite_byte 0x61 0 $((blksz * nr_free)) "$testdir/eat_my_space" >> "$seqres.full" 2>&1
+nr_free=$(stat -f -c '%f' $testdir)
+touch $testdir/file0 $testdir/file1
+_pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2>&1
sync
echo "CoW the big file"
-out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)"
-echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
-echo "${out}" >> "$seqres.full" 2>&1
-echo "${out}"
+out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)"
+echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
+echo ${out} >> $seqres.full 2>&1
+echo ${out}
echo "Remount and try CoW again"
_scratch_remount
-out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)"
-echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
-echo "${out}" >> "$seqres.full" 2>&1
-echo "${out}"
+out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1)"
+echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
+echo ${out} >> $seqres.full 2>&1
+echo ${out}
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir1"
+ rm -rf $tmp.* $testdir1
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
echo "Reformat with appropriate size"
-blksz="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
nr_blks=10240
-umount "$SCRATCH_MNT"
+umount $SCRATCH_MNT
sz_bytes=$((nr_blks * 8 * blksz))
if [ $sz_bytes -lt $((32 * 1048576)) ]; then
sz_bytes=$((32 * 1048576))
fi
-_scratch_mkfs_sized $sz_bytes >> "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
-rm -rf "$testdir"
-mkdir "$testdir"
+_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
+rm -rf $testdir
+mkdir $testdir
echo "Create a big file and reflink it"
-_pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/bigfile" >> "$seqres.full" 2>&1
-_cp_reflink "$testdir/bigfile" "$testdir/clonefile"
+_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1
+_cp_reflink $testdir/bigfile $testdir/clonefile
sync
echo "Allocate the rest of the space"
-nr_free="$(stat -f -c '%f' "$testdir")"
-touch "$testdir/file0" "$testdir/file1"
-_pwrite_byte 0x61 0 $((blksz * nr_free)) "$testdir/eat_my_space" >> "$seqres.full" 2>&1
+nr_free=$(stat -f -c '%f' $testdir)
+touch $testdir/file0 $testdir/file1
+_pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2>&1
sync
echo "mmap CoW the big file"
-out="$(_mwrite_byte 0x62 0 $((blksz * nr_blks)) $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)"
+out="$(_mwrite_byte 0x62 0 $((blksz * nr_blks)) $((blksz * nr_blks)) $testdir/bigfile 2>&1)"
err="$?"
-if [ "$err" -lt 128 ]; then
+if [ $err -lt 128 ]; then
echo "mmap CoW should have failed with SIGBUS, got SIG$(kill -l $err)"
fi
echo "Remount and try CoW again"
_scratch_remount
-out="$(_mwrite_byte 0x62 0 $((blksz * nr_blks)) $((blksz * nr_blks)) "$testdir/bigfile" 2>&1)"
+out="$(_mwrite_byte 0x62 0 $((blksz * nr_blks)) $((blksz * nr_blks)) $testdir/bigfile 2>&1)"
err="$?"
-if [ "$err" -lt 128 ]; then
+if [ $err -lt 128 ]; then
echo "mmap CoW should have failed with SIGBUS, got SIG$(kill -l $err)"
fi
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir1"
+ rm -rf $tmp.* $testdir1
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
echo "Reformat with appropriate size"
-blksz="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
nr_blks=10240
-umount "$SCRATCH_MNT"
+umount $SCRATCH_MNT
sz_bytes=$((nr_blks * 8 * blksz))
if [ $sz_bytes -lt $((32 * 1048576)) ]; then
sz_bytes=$((32 * 1048576))
fi
-_scratch_mkfs_sized $sz_bytes >> "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
-rm -rf "$testdir"
-mkdir "$testdir"
+_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
+rm -rf $testdir
+mkdir $testdir
echo "Create a big file and reflink it"
-_pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/bigfile" >> "$seqres.full" 2>&1
-_cp_reflink "$testdir/bigfile" "$testdir/clonefile"
+_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1
+_cp_reflink $testdir/bigfile $testdir/clonefile
sync
echo "Allocate the rest of the space"
-nr_free="$(stat -f -c '%f' "$testdir")"
-touch "$testdir/file0" "$testdir/file1"
-_pwrite_byte 0x61 0 $((blksz * nr_free)) "$testdir/eat_my_space" >> "$seqres.full" 2>&1
+nr_free=$(stat -f -c '%f' $testdir)
+touch $testdir/file0 $testdir/file1
+_pwrite_byte 0x61 0 $((blksz * nr_free)) $testdir/eat_my_space >> $seqres.full 2>&1
sync
echo "CoW the big file"
-out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" -d 2>&1)"
-echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
-echo "${out}" >> "$seqres.full" 2>&1
-echo "${out}"
+out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1)"
+echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
+echo ${out} >> $seqres.full 2>&1
+echo ${out}
echo "Remount and try CoW again"
_scratch_remount
-out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) "$testdir/bigfile" -d 2>&1)"
-echo "${out}" | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
-echo "${out}" >> "$seqres.full" 2>&1
-echo "${out}"
+out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1)"
+echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
+echo ${out} >> $seqres.full 2>&1
+echo ${out}
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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
nr=512
-_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full
-_cp_reflink "$testdir/file1" "$testdir/file2"
+_cp_reflink $testdir/file1 $testdir/file2
_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
echo "Write and punch"
-_pwrite_byte 0x62 0 $((blksz * 256)) "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "fpunch $blksz $((blksz * 254))" "$testdir/file2"
+_pwrite_byte 0x62 0 $((blksz * 256)) $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "fpunch $blksz $((blksz * 254))" $testdir/file2
_test_remount
echo "Compare results"
-md5sum "$testdir/file1" | _filter_test_dir
-md5sum "$testdir/file2" | _filter_test_dir
+md5sum $testdir/file1 | _filter_test_dir
+md5sum $testdir/file2 | _filter_test_dir
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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 * 3)) "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $((blksz * 3)) $testdir/file1 >> $seqres.full
-_cp_reflink "$testdir/file1" "$testdir/file2"
+_cp_reflink $testdir/file1 $testdir/file2
-_pwrite_byte 0x61 0 $((blksz * 3)) "$testdir/file2.chk" >> "$seqres.full"
-_pwrite_byte 0x00 $((blksz - 17)) $((blksz + 17)) "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 0 $((blksz * 3)) $testdir/file2.chk >> $seqres.full
+_pwrite_byte 0x00 $((blksz - 17)) $((blksz + 17)) $testdir/file2.chk >> $seqres.full
_test_remount
-md5sum "$testdir/file1" | _filter_test_dir
-md5sum "$testdir/file2" | _filter_test_dir
-md5sum "$testdir/file2.chk" | _filter_test_dir
+md5sum $testdir/file1 | _filter_test_dir
+md5sum $testdir/file2 | _filter_test_dir
+md5sum $testdir/file2.chk | _filter_test_dir
-c1="$(_md5_checksum "$testdir/file1")"
-c2="$(_md5_checksum "$testdir/file2")"
+c1=$(_md5_checksum $testdir/file1)
+c2=$(_md5_checksum $testdir/file2)
-test "${c1}" = "${c2}" || echo "file1 and file2 should match"
+test ${c1} = ${c2} || echo "file1 and file2 should match"
echo "fpunch files"
-"$XFS_IO_PROG" -f -c "fpunch $((blksz - 17)) $((blksz + 17))" "$testdir/file2"
+$XFS_IO_PROG -f -c "fpunch $((blksz - 17)) $((blksz + 17))" $testdir/file2
_test_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_test_dir
-md5sum "$testdir/file2" | _filter_test_dir
-md5sum "$testdir/file2.chk" | _filter_test_dir
+md5sum $testdir/file1 | _filter_test_dir
+md5sum $testdir/file2 | _filter_test_dir
+md5sum $testdir/file2.chk | _filter_test_dir
-c1="$(_md5_checksum "$testdir/file1")"
-c2="$(_md5_checksum "$testdir/file2")"
+c1=$(_md5_checksum $testdir/file1)
+c2=$(_md5_checksum $testdir/file2)
-test "${c1}" != "${c2}" || echo "file1 and file2 should not match"
+test ${c1} != ${c2} || echo "file1 and file2 should not match"
echo "Compare against check files"
-cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match"
+cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match"
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_cp_reflink
_require_xfs_io_command "fzero"
-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 * 3)) "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $((blksz * 3)) $testdir/file1 >> $seqres.full
-_cp_reflink "$testdir/file1" "$testdir/file2"
+_cp_reflink $testdir/file1 $testdir/file2
-_pwrite_byte 0x61 0 $((blksz * 3)) "$testdir/file2.chk" >> "$seqres.full"
-_pwrite_byte 0x00 $((blksz - 17)) $((blksz + 17)) "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 0 $((blksz * 3)) $testdir/file2.chk >> $seqres.full
+_pwrite_byte 0x00 $((blksz - 17)) $((blksz + 17)) $testdir/file2.chk >> $seqres.full
_test_remount
-md5sum "$testdir/file1" | _filter_test_dir
-md5sum "$testdir/file2" | _filter_test_dir
-md5sum "$testdir/file2.chk" | _filter_test_dir
+md5sum $testdir/file1 | _filter_test_dir
+md5sum $testdir/file2 | _filter_test_dir
+md5sum $testdir/file2.chk | _filter_test_dir
-c1="$(_md5_checksum "$testdir/file1")"
-c2="$(_md5_checksum "$testdir/file2")"
+c1=$(_md5_checksum $testdir/file1)
+c2=$(_md5_checksum $testdir/file2)
-test "${c1}" = "${c2}" || echo "file1 and file2 should match"
+test ${c1} = ${c2} || echo "file1 and file2 should match"
echo "fzero files"
-"$XFS_IO_PROG" -f -c "fzero $((blksz - 17)) $((blksz + 17))" "$testdir/file2"
+$XFS_IO_PROG -f -c "fzero $((blksz - 17)) $((blksz + 17))" $testdir/file2
_test_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_test_dir
-md5sum "$testdir/file2" | _filter_test_dir
-md5sum "$testdir/file2.chk" | _filter_test_dir
+md5sum $testdir/file1 | _filter_test_dir
+md5sum $testdir/file2 | _filter_test_dir
+md5sum $testdir/file2.chk | _filter_test_dir
-c1="$(_md5_checksum "$testdir/file1")"
-c2="$(_md5_checksum "$testdir/file2")"
+c1=$(_md5_checksum $testdir/file1)
+c2=$(_md5_checksum $testdir/file2)
-test "${c1}" != "${c2}" || echo "file1 and file2 should not match"
+test ${c1} != ${c2} || echo "file1 and file2 should not match"
echo "Compare against check files"
-cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match"
+cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match"
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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 * 256)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((blksz * 256)) "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((blksz * 2)) "$testdir/file2.chk" >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 255)) "$testdir/file2.chk" >> "$seqres.full"
-_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) 0 >> "$seqres.full"
+_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 0 $((blksz * 256)) $testdir/file2 >> $seqres.full
+_pwrite_byte 0x62 0 $((blksz * 2)) $testdir/file2.chk >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 2)) $((blksz * 255)) $testdir/file2.chk >> $seqres.full
+_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) 0 >> $seqres.full
_test_remount
-md5sum "$testdir/file1" | _filter_test_dir
-md5sum "$testdir/file2" | _filter_test_dir
-md5sum "$testdir/file2.chk" | _filter_test_dir
+md5sum $testdir/file1 | _filter_test_dir
+md5sum $testdir/file2 | _filter_test_dir
+md5sum $testdir/file2.chk | _filter_test_dir
-c1="$(_md5_checksum "$testdir/file1")"
-c2="$(_md5_checksum "$testdir/file2")"
+c1=$(_md5_checksum $testdir/file1)
+c2=$(_md5_checksum $testdir/file2)
-test "${c1}" != "${c2}" || echo "file1 and file2 should not match"
+test ${c1} != ${c2} || echo "file1 and file2 should not match"
echo "Compare against check files"
-cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match"
+cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match"
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_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 * 256)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((blksz * 257)) "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((blksz * 257)) "$testdir/file2.chk" >> "$seqres.full"
-_dedupe_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) 0 >> "$seqres.full"
+_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 0 $((blksz * 257)) $testdir/file2 >> $seqres.full
+_pwrite_byte 0x62 0 $((blksz * 257)) $testdir/file2.chk >> $seqres.full
+_dedupe_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) 0 >> $seqres.full
_test_remount
-md5sum "$testdir/file1" | _filter_test_dir
-md5sum "$testdir/file2" | _filter_test_dir
-md5sum "$testdir/file2.chk" | _filter_test_dir
+md5sum $testdir/file1 | _filter_test_dir
+md5sum $testdir/file2 | _filter_test_dir
+md5sum $testdir/file2.chk | _filter_test_dir
-c1="$(_md5_checksum "$testdir/file1")"
-c2="$(_md5_checksum "$testdir/file2")"
+c1=$(_md5_checksum $testdir/file1)
+c2=$(_md5_checksum $testdir/file2)
-test "${c1}" != "${c2}" || echo "file1 and file2 should not match"
+test ${c1} != ${c2} || echo "file1 and file2 should not match"
echo "Compare against check files"
-cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match"
+cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match"
echo "Make the original file almost dedup-able"
-_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file2.chk" >> "$seqres.full"
-_dedupe_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) 0 >> "$seqres.full"
+_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full
+_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file2 >> $seqres.full
+_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file2.chk >> $seqres.full
+_dedupe_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) 0 >> $seqres.full
_test_remount
-md5sum "$testdir/file1" | _filter_test_dir
-md5sum "$testdir/file2" | _filter_test_dir
-md5sum "$testdir/file2.chk" | _filter_test_dir
+md5sum $testdir/file1 | _filter_test_dir
+md5sum $testdir/file2 | _filter_test_dir
+md5sum $testdir/file2.chk | _filter_test_dir
-c1="$(_md5_checksum "$testdir/file1")"
-c2="$(_md5_checksum "$testdir/file2")"
+c1=$(_md5_checksum $testdir/file1)
+c2=$(_md5_checksum $testdir/file2)
-test "${c1}" != "${c2}" || echo "file1 and file2 should not match"
+test ${c1} != ${c2} || echo "file1 and file2 should not match"
echo "Compare against check files"
-cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match"
+cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match"
echo "Make the original file dedup-able"
-_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x61 0 $((blksz * 257)) "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x61 0 $((blksz * 257)) "$testdir/file2.chk" >> "$seqres.full"
-_dedupe_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) 0 >> "$seqres.full"
+_pwrite_byte 0x61 0 $((blksz * 256)) $testdir/file1 >> $seqres.full
+_pwrite_byte 0x61 0 $((blksz * 257)) $testdir/file2 >> $seqres.full
+_pwrite_byte 0x61 0 $((blksz * 257)) $testdir/file2.chk >> $seqres.full
+_dedupe_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) 0 >> $seqres.full
_test_remount
-md5sum "$testdir/file1" | _filter_test_dir
-md5sum "$testdir/file2" | _filter_test_dir
-md5sum "$testdir/file2.chk" | _filter_test_dir
+md5sum $testdir/file1 | _filter_test_dir
+md5sum $testdir/file2 | _filter_test_dir
+md5sum $testdir/file2.chk | _filter_test_dir
-c1="$(_md5_checksum "$testdir/file1")"
-c2="$(_md5_checksum "$testdir/file2")"
+c1=$(_md5_checksum $testdir/file1)
+c2=$(_md5_checksum $testdir/file2)
-test "${c1}" = "${c2}" || echo "file1 and file2 should match"
+test ${c1} = ${c2} || echo "file1 and file2 should match"
echo "Compare against check files"
-cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match"
+cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match"
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_supported_os Linux
_require_scratch_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
-_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file2" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 0 $filesize $testdir/file2 >> $seqres.full
seq 0 2 $((nr-1)) | while read f; do
- _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full"
- _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full"
+ _reflink_range $testdir/file1 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full
+ _pwrite_byte 0x61 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full
done
seq 1 2 $((nr-1)) | while read f; do
- _reflink_range "$testdir/file2" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full"
- _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full"
+ _reflink_range $testdir/file2 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full
+ _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full
done
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "directio CoW across the transition"
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_supported_os Linux
_require_scratch_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
-_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file2" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 0 $filesize $testdir/file2 >> $seqres.full
seq 0 2 $((nr-1)) | while read f; do
- _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full"
- _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full"
+ _reflink_range $testdir/file1 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full
+ _pwrite_byte 0x61 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full
done
seq 1 2 $((nr-1)) | while read f; do
- _reflink_range "$testdir/file2" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full"
- _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full"
+ _reflink_range $testdir/file2 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full
+ _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full
done
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "CoW across the transition"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
-# rm -rf "$tmp".* "$testdir"
+# rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_cp_reflink
_require_xfs_io_command "falloc"
_require_xfs_io_command "fpunch"
-test "$FSTYP" = "btrfs" && _notrun "Can't fragment free space on btrfs."
+test $FSTYP = "btrfs" && _notrun "Can't fragment free space on btrfs."
-rm -f "$seqres.full"
+rm -f $seqres.full
_fragment_freesp()
{
- file="$1"
+ file=$1
# consume nearly all available space (leave ~1MB)
avail=`_get_available_space $SCRATCH_MNT`
echo "$avail bytes left"
filesize=$((avail - 1048576))
- $XFS_IO_PROG -fc "truncate $filesize" "$file"
+ $XFS_IO_PROG -fc "truncate $filesize" $file
chunks=20
chunksizemb=$((filesize / chunks / 1048576))
seq 1 $chunks | while read f; do
echo "$((f * chunksizemb)) file size $f / 20"
- $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" "$file"
+ $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" $file
done
chunks=100
chunksizemb=$((filesize / chunks / 1048576))
seq 80 $chunks | while read f; do
echo "$((f * chunksizemb)) file size $f / $chunks"
- $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" "$file"
+ $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" $file
done
filesizemb=$((filesize / 1048576))
- $XFS_IO_PROG -fc "falloc -k 0 ${filesizemb}m" "$file"
+ $XFS_IO_PROG -fc "falloc -k 0 ${filesizemb}m" $file
# Try again anyway
avail=`_get_available_space $SCRATCH_MNT`
- $XFS_IO_PROG -fc "pwrite -S 0x65 0 $avail" "${file}.${i}"
+ $XFS_IO_PROG -fc "pwrite -S 0x65 0 $avail" ${file}.${i}
# Punch out whatever we need
seq 1 $((nr * 4)) | while read f; do
- $XFS_IO_PROG -f -c "fpunch $((f * 2 * blksz)) $blksz" "$file"
+ $XFS_IO_PROG -f -c "fpunch $((f * 2 * blksz)) $blksz" $file
done
}
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=1024
-_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file2" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 0 $filesize $testdir/file2 >> $seqres.full
seq 0 2 $((nr-1)) | while read f; do
- _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full"
- _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full"
+ _reflink_range $testdir/file1 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full
+ _pwrite_byte 0x61 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full
done
seq 1 2 $((nr-1)) | while read f; do
- _reflink_range "$testdir/file2" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full"
- _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full"
+ _reflink_range $testdir/file2 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full
+ _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full
done
_scratch_remount
-_fragment_freesp "$testdir/bigfile" >> "$seqres.full" 2>&1
+_fragment_freesp $testdir/bigfile >> $seqres.full 2>&1
+filesize=$((blksz * nr))
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "CoW with multiple extents?"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
+$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
-# rm -rf "$tmp".* "$testdir"
+# rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_cp_reflink
_require_xfs_io_command "falloc"
_require_xfs_io_command "fpunch"
-test "$FSTYP" = "btrfs" && _notrun "Can't fragment free space on btrfs."
+test $FSTYP = "btrfs" && _notrun "Can't fragment free space on btrfs."
-rm -f "$seqres.full"
+rm -f $seqres.full
_fragment_freesp()
{
- file="$1"
+ file=$1
# consume nearly all available space (leave ~1MB)
avail=`_get_available_space $SCRATCH_MNT`
echo "$avail bytes left"
filesize=$((avail - 1048576))
- $XFS_IO_PROG -fc "truncate $filesize" "$file"
+ $XFS_IO_PROG -fc "truncate $filesize" $file
chunks=20
chunksizemb=$((filesize / chunks / 1048576))
seq 1 $chunks | while read f; do
echo "$((f * chunksizemb)) file size $f / 20"
- $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" "$file"
+ $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" $file
done
chunks=100
chunksizemb=$((filesize / chunks / 1048576))
seq 80 $chunks | while read f; do
echo "$((f * chunksizemb)) file size $f / $chunks"
- $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" "$file"
+ $XFS_IO_PROG -fc "falloc -k $(( (f - 1) * chunksizemb))m ${chunksizemb}m" $file
done
filesizemb=$((filesize / 1048576))
- $XFS_IO_PROG -fc "falloc -k 0 ${filesizemb}m" "$file"
+ $XFS_IO_PROG -fc "falloc -k 0 ${filesizemb}m" $file
# Try again anyway
avail=`_get_available_space $SCRATCH_MNT`
- $XFS_IO_PROG -fc "pwrite -S 0x65 0 $avail" "${file}.${i}"
+ $XFS_IO_PROG -fc "pwrite -S 0x65 0 $avail" ${file}.${i}
# Punch out whatever we need
seq 1 $((nr * 4)) | while read f; do
- $XFS_IO_PROG -f -c "fpunch $((f * 2 * blksz)) $blksz" "$file"
+ $XFS_IO_PROG -f -c "fpunch $((f * 2 * blksz)) $blksz" $file
done
}
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=1024
-_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file2" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 0 $filesize $testdir/file2 >> $seqres.full
seq 0 2 $((nr-1)) | while read f; do
- _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full"
- _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full"
+ _reflink_range $testdir/file1 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full
+ _pwrite_byte 0x61 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full
done
seq 1 2 $((nr-1)) | while read f; do
- _reflink_range "$testdir/file2" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full"
- _pwrite_byte 0x62 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full"
+ _reflink_range $testdir/file2 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full
+ _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full
done
_scratch_remount
-_fragment_freesp "$testdir/bigfile" >> "$seqres.full" 2>&1
+_fragment_freesp $testdir/bigfile >> $seqres.full 2>&1
+filesize=$((blksz * nr))
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "CoW with multiple extents?"
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
+filesize=$((blksz * nr))
_weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "directio CoW across the transition"
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
+filesize=$((blksz * nr))
_weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "CoW across the transition"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
+$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
+filesize=$((blksz * nr))
_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "directio CoW across the transition"
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
+filesize=$((blksz * nr))
_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "CoW across the transition"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
+$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
+filesize=$((blksz * nr))
_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "directio CoW across the transition"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
_weave_reflink_holes_delalloc $blksz $nr $testdir/file3 >> $seqres.full
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
+filesize=$((blksz * nr))
_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "CoW across the transition"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
_weave_reflink_holes_delalloc $blksz $nr $testdir/file3 >> $seqres.full
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
+filesize=$((blksz * nr))
_weave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "directio CoW across the transition"
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
+filesize=$((blksz * nr))
_weave_reflink_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "CoW across the transition"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
+$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_xfs_io_command "fpunch"
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
+filesize=$((blksz * nr))
_weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "directio CoW across the transition"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
_weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full
# now cow
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_xfs_io_command "fpunch"
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
+filesize=$((blksz * nr))
_weave_reflink_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "directio CoW across the transition"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
_weave_reflink_rainbow_delalloc $blksz $nr $testdir/file3 >> $seqres.full
# now cow
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x63 $((blksz * nr / 4)) $((blksz * nr / 2)) "$testdir/file3.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+_pwrite_byte 0x63 $cowoff $cowsz $testdir/file3.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
nr=64
-_pwrite_byte 0x61 0 $((blksz * nr)) "$testdir/file1" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3" >> "$seqres.full"
-_pwrite_byte 0x62 0 $((blksz * nr)) "$testdir/file3.chk" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $filesize $testdir/file1 >> $seqres.full
+_pwrite_byte 0x62 0 $filesize $testdir/file3 >> $seqres.full
+_pwrite_byte 0x62 0 $filesize $testdir/file3.chk >> $seqres.full
seq 0 2 $((nr-1)) | while read f; do
- _reflink_range "$testdir/file1" $((blksz * f)) "$testdir/file3" $((blksz * f)) $blksz >> "$seqres.full"
- _pwrite_byte 0x61 $((blksz * f)) $blksz "$testdir/file3.chk" >> "$seqres.full"
+ _reflink_range $testdir/file1 $((blksz * f)) $testdir/file3 $((blksz * f)) $blksz >> $seqres.full
+ _pwrite_byte 0x61 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full
done
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file3.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file3.chk | _filter_scratch
echo "CoW and unmount"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * nr / 2)) $((blksz * nr / 4)) $((blksz * nr / 2))" "$testdir/file3" >> "$seqres.full"
-rm "$testdir/file3"
+cowoff=$((filesize / 4))
+cowsz=$((filesize / 2))
+$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $cowsz $cowoff $cowsz" $testdir/file3 >> $seqres.full
+rm $testdir/file3
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
-_pwrite_byte 0x61 0 $((blksz + 17)) "$testdir/file1" >> "$seqres.full"
-_cp_reflink "$testdir/file1" "$testdir/file2"
-_pwrite_byte 0x61 0 $((blksz + 17)) "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file1 >> $seqres.full
+_cp_reflink $testdir/file1 $testdir/file2
+_pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file2.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file2.chk | _filter_scratch
echo "CoW and unmount"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) 17" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) 17" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) 17" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) 17" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file2.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file2.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original files"
blksz=65536
-_pwrite_byte 0x61 0 $((blksz + 17)) "$testdir/file1" >> "$seqres.full"
-_cp_reflink "$testdir/file1" "$testdir/file2"
-_pwrite_byte 0x61 0 $((blksz + 17)) "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file1 >> $seqres.full
+_cp_reflink $testdir/file1 $testdir/file2
+_pwrite_byte 0x61 0 $((blksz + 17)) $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file2.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file2.chk | _filter_scratch
echo "CoW and unmount"
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $blksz" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $blksz" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $blksz" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $blksz" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file2.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file2.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_supported_os Linux
_require_scratch_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
pagesz=$(getconf PAGE_SIZE)
blksz=$((pagesz / 4))
echo "Format and mount"
-_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
real_blksz=$(stat -f -c '%S' $testdir)
-test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize."
+test $real_blksz != $blksz && _notrun "Failed to format with small blocksize."
echo "Create the original files"
-_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full
-_pwrite_byte 0x61 $blksz $blksz "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x61 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 $blksz $blksz $testdir/file2 >> $seqres.full
+_pwrite_byte 0x61 $blksz $blksz $testdir/file2.chk >> $seqres.full
-_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2 >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full
-_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
echo "CoW and unmount"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_supported_os Linux
_require_scratch_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
pagesz=$(getconf PAGE_SIZE)
blksz=$((pagesz / 4))
echo "Format and mount"
-_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
real_blksz=$(stat -f -c '%S' $testdir)
-test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize."
+test $real_blksz != $blksz && _notrun "Failed to format with small blocksize."
echo "Create the original files"
-_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full
-_pwrite_byte 0x61 $blksz $blksz "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x61 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 $blksz $blksz $testdir/file2 >> $seqres.full
+_pwrite_byte 0x61 $blksz $blksz $testdir/file2.chk >> $seqres.full
-_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2 >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full
-_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
echo "CoW and unmount"
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
pagesz=$(getconf PAGE_SIZE)
blksz=$((pagesz / 4))
echo "Format and mount"
-_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
real_blksz=$(stat -f -c '%S' $testdir)
-test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize."
+test $real_blksz != $blksz && _notrun "Failed to format with small blocksize."
echo "Create the original files"
-_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full
-"$XFS_IO_PROG" -f -c "falloc -k $blksz $blksz" "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x00 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "falloc -k $blksz $blksz" $testdir/file2 >> $seqres.full
+_pwrite_byte 0x00 $blksz $blksz $testdir/file2.chk >> $seqres.full
-"$XFS_IO_PROG" -f -c "falloc -k $((blksz * 3)) $blksz" "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x00 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "falloc -k $((blksz * 3)) $blksz" $testdir/file2 >> $seqres.full
+_pwrite_byte 0x00 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full
-_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
echo "CoW and unmount"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
pagesz=$(getconf PAGE_SIZE)
blksz=$((pagesz / 4))
echo "Format and mount"
-_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
real_blksz=$(stat -f -c '%S' $testdir)
-test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize."
+test $real_blksz != $blksz && _notrun "Failed to format with small blocksize."
echo "Create the original files"
-_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full
-"$XFS_IO_PROG" -f -c "falloc -k $blksz $blksz" "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x00 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "falloc -k $blksz $blksz" $testdir/file2 >> $seqres.full
+_pwrite_byte 0x00 $blksz $blksz $testdir/file2.chk >> $seqres.full
-"$XFS_IO_PROG" -f -c "falloc -k $((blksz * 3)) $blksz" "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x00 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "falloc -k $((blksz * 3)) $blksz" $testdir/file2 >> $seqres.full
+_pwrite_byte 0x00 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full
-_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
echo "CoW and unmount"
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
pagesz=$(getconf PAGE_SIZE)
blksz=$((pagesz / 4))
echo "Format and mount"
-_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
real_blksz=$(stat -f -c '%S' $testdir)
-test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize."
+test $real_blksz != $blksz && _notrun "Failed to format with small blocksize."
echo "Create the original files"
-_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full
-_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
echo "CoW and unmount"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
pagesz=$(getconf PAGE_SIZE)
blksz=$((pagesz / 4))
echo "Format and mount"
-_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
real_blksz=$(stat -f -c '%S' $testdir)
-test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize."
+test $real_blksz != $blksz && _notrun "Failed to format with small blocksize."
echo "Create the original files"
-_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full
-_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
echo "CoW and unmount"
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
pagesz=$(getconf PAGE_SIZE)
blksz=$((pagesz / 4))
echo "Format and mount"
-_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
real_blksz=$(stat -f -c '%S' $testdir)
-test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize."
+test $real_blksz != $blksz && _notrun "Failed to format with small blocksize."
echo "Create the original files"
-_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full
-_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
echo "CoW and unmount"
-_pwrite_byte 0x61 $blksz $blksz "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x61 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 $blksz $blksz $testdir/file2 >> $seqres.full
+_pwrite_byte 0x61 $blksz $blksz $testdir/file2.chk >> $seqres.full
-_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2 >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
pagesz=$(getconf PAGE_SIZE)
blksz=$((pagesz / 4))
echo "Format and mount"
-_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
real_blksz=$(stat -f -c '%S' $testdir)
-test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize."
+test $real_blksz != $blksz && _notrun "Failed to format with small blocksize."
echo "Create the original files"
-_pwrite_byte 0x61 0 $pagesz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $pagesz $testdir/file1 >> $seqres.full
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "truncate $pagesz" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "truncate $pagesz" $testdir/file2.chk >> $seqres.full
-_reflink_range "$testdir/file1" $blksz "$testdir/file2" $((blksz * 2)) $blksz >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 2)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_reflink_range $testdir/file1 $blksz $testdir/file2 $((blksz * 2)) $blksz >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 2)) $blksz $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
echo "CoW and unmount"
-_pwrite_byte 0x61 $blksz $blksz "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x61 $blksz $blksz "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 $blksz $blksz $testdir/file2 >> $seqres.full
+_pwrite_byte 0x61 $blksz $blksz $testdir/file2.chk >> $seqres.full
-_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x61 $((blksz * 3)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2 >> $seqres.full
+_pwrite_byte 0x61 $((blksz * 3)) $blksz $testdir/file2.chk >> $seqres.full
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || _fail "file1 and file2 don't match."
-cmp -s "$testdir/file2" "$testdir/file2.chk" || _fail "file2 and file2.chk don't match."
+! cmp -s $testdir/file1 $testdir/file2 || _fail "file1 and file2 don't match."
+cmp -s $testdir/file2 $testdir/file2.chk || _fail "file2 and file2.chk don't match."
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
pagesz=$(getconf PAGE_SIZE)
blksz=$((pagesz / 4))
echo "Format and mount"
-_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
real_blksz=$(stat -f -c '%S' $testdir)
-test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize."
+test $real_blksz != $blksz && _notrun "Failed to format with small blocksize."
runtest() {
echo "runtest $1 $2"
dir=$3
echo "Create the original files"
- mkdir -p "$dir"
- _pwrite_byte 0x61 0 $pagesz "$dir/file1" >> "$seqres.full"
+ mkdir -p $dir
+ _pwrite_byte 0x61 0 $pagesz $dir/file1 >> $seqres.full
- "$XFS_IO_PROG" -f -c "truncate $pagesz" "$dir/file2" >> "$seqres.full"
- "$XFS_IO_PROG" -f -c "truncate $pagesz" "$dir/file2.chk" >> "$seqres.full"
+ $XFS_IO_PROG -f -c "truncate $pagesz" $dir/file2 >> $seqres.full
+ $XFS_IO_PROG -f -c "truncate $pagesz" $dir/file2.chk >> $seqres.full
- case "$b2" in
+ case $b2 in
"regular")
- _pwrite_byte 0x61 $blksz $blksz "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x61 $blksz $blksz "$dir/file2.chk" >> "$seqres.full"
+ _pwrite_byte 0x61 $blksz $blksz $dir/file2 >> $seqres.full
+ _pwrite_byte 0x61 $blksz $blksz $dir/file2.chk >> $seqres.full
;;
"unwritten")
- "$XFS_IO_PROG" -f -c "falloc -k $blksz $blksz" "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x00 $blksz $blksz "$dir/file2.chk" >> "$seqres.full"
+ $XFS_IO_PROG -f -c "falloc -k $blksz $blksz" $dir/file2 >> $seqres.full
+ _pwrite_byte 0x00 $blksz $blksz $dir/file2.chk >> $seqres.full
;;
"hole")
;;
- case "$b4" in
+ case $b4 in
"regular")
- _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full"
+ _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2 >> $seqres.full
+ _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full
;;
"unwritten")
- "$XFS_IO_PROG" -f -c "falloc -k $((blksz * 3)) $blksz" "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x00 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full"
+ $XFS_IO_PROG -f -c "falloc -k $((blksz * 3)) $blksz" $dir/file2 >> $seqres.full
+ _pwrite_byte 0x00 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full
;;
"hole")
;;
esac
- _reflink_range "$dir/file1" $blksz "$dir/file2" $((blksz * 2)) $blksz >> "$seqres.full"
- _pwrite_byte 0x61 $((blksz * 2)) $blksz "$dir/file2.chk" >> "$seqres.full"
+ _reflink_range $dir/file1 $blksz $dir/file2 $((blksz * 2)) $blksz >> $seqres.full
+ _pwrite_byte 0x61 $((blksz * 2)) $blksz $dir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
- ! cmp -s "$dir/file1" "$dir/file2" || _fail "file1 and file2 don't match."
- cmp -s "$dir/file2" "$dir/file2.chk" || _fail "file2 and file2.chk don't match."
+ ! cmp -s $dir/file1 $dir/file2 || _fail "file1 and file2 don't match."
+ cmp -s $dir/file2 $dir/file2.chk || _fail "file2 and file2.chk don't match."
echo "CoW and unmount"
- if [ "$b2" = "delalloc" ]; then
- _pwrite_byte 0x61 $blksz $blksz "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x61 $blksz $blksz "$dir/file2.chk" >> "$seqres.full"
+ if [ $b2 = "delalloc" ]; then
+ _pwrite_byte 0x61 $blksz $blksz $dir/file2 >> $seqres.full
+ _pwrite_byte 0x61 $blksz $blksz $dir/file2.chk >> $seqres.full
fi
- if [ "$b4" = "delalloc" ]; then
- _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full"
+ if [ $b4 = "delalloc" ]; then
+ _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2 >> $seqres.full
+ _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full
fi
- "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$dir/file2" >> "$seqres.full"
- "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" "$dir/file2.chk" >> "$seqres.full"
+ $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $dir/file2 >> $seqres.full
+ $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz + 17)) $((blksz * 3 - 34))" $dir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
- ! cmp -s "$dir/file1" "$dir/file2" || _fail "file1 and file2 don't match."
- cmp -s "$dir/file2" "$dir/file2.chk" || _fail "file2 and file2.chk don't match."
+ ! cmp -s $dir/file1 $dir/file2 || _fail "file1 and file2 don't match."
+ cmp -s $dir/file2 $dir/file2.chk || _fail "file2 and file2.chk don't match."
}
runtest regular delalloc "$testdir/r-d"
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_xfs_io_command "falloc"
-rm -f "$seqres.full"
+rm -f $seqres.full
pagesz=$(getconf PAGE_SIZE)
blksz=$((pagesz / 4))
echo "Format and mount"
-_scratch_mkfs_blocksized $blksz > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs_blocksized $blksz > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
real_blksz=$(stat -f -c '%S' $testdir)
-test "$real_blksz" != "$blksz" && _notrun "Failed to format with small blocksize."
+test $real_blksz != $blksz && _notrun "Failed to format with small blocksize."
runtest() {
echo "runtest $1 $2"
dir=$3
echo "Create the original files"
- mkdir -p "$dir"
- _pwrite_byte 0x61 0 $pagesz "$dir/file1" >> "$seqres.full"
+ mkdir -p $dir
+ _pwrite_byte 0x61 0 $pagesz $dir/file1 >> $seqres.full
- "$XFS_IO_PROG" -f -c "truncate $pagesz" "$dir/file2" >> "$seqres.full"
- "$XFS_IO_PROG" -f -c "truncate $pagesz" "$dir/file2.chk" >> "$seqres.full"
+ $XFS_IO_PROG -f -c "truncate $pagesz" $dir/file2 >> $seqres.full
+ $XFS_IO_PROG -f -c "truncate $pagesz" $dir/file2.chk >> $seqres.full
- case "$b2" in
+ case $b2 in
"regular")
- _pwrite_byte 0x61 $blksz $blksz "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x61 $blksz $blksz "$dir/file2.chk" >> "$seqres.full"
+ _pwrite_byte 0x61 $blksz $blksz $dir/file2 >> $seqres.full
+ _pwrite_byte 0x61 $blksz $blksz $dir/file2.chk >> $seqres.full
;;
"unwritten")
- "$XFS_IO_PROG" -f -c "falloc -k $blksz $blksz" "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x00 $blksz $blksz "$dir/file2.chk" >> "$seqres.full"
+ $XFS_IO_PROG -f -c "falloc -k $blksz $blksz" $dir/file2 >> $seqres.full
+ _pwrite_byte 0x00 $blksz $blksz $dir/file2.chk >> $seqres.full
;;
"hole")
;;
- case "$b4" in
+ case $b4 in
"regular")
- _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full"
+ _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2 >> $seqres.full
+ _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full
;;
"unwritten")
- "$XFS_IO_PROG" -f -c "falloc -k $((blksz * 3)) $blksz" "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x00 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full"
+ $XFS_IO_PROG -f -c "falloc -k $((blksz * 3)) $blksz" $dir/file2 >> $seqres.full
+ _pwrite_byte 0x00 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full
;;
"hole")
;;
esac
- _reflink_range "$dir/file1" $blksz "$dir/file2" $((blksz * 2)) $blksz >> "$seqres.full"
- _pwrite_byte 0x61 $((blksz * 2)) $blksz "$dir/file2.chk" >> "$seqres.full"
+ _reflink_range $dir/file1 $blksz $dir/file2 $((blksz * 2)) $blksz >> $seqres.full
+ _pwrite_byte 0x61 $((blksz * 2)) $blksz $dir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
- ! cmp -s "$dir/file1" "$dir/file2" || _fail "file1 and file2 don't match."
- cmp -s "$dir/file2" "$dir/file2.chk" || _fail "file2 and file2.chk don't match."
+ ! cmp -s $dir/file1 $dir/file2 || _fail "file1 and file2 don't match."
+ cmp -s $dir/file2 $dir/file2.chk || _fail "file2 and file2.chk don't match."
echo "CoW and unmount"
- if [ "$b2" = "delalloc" ]; then
- _pwrite_byte 0x61 $blksz $blksz "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x61 $blksz $blksz "$dir/file2.chk" >> "$seqres.full"
+ if [ $b2 = "delalloc" ]; then
+ _pwrite_byte 0x61 $blksz $blksz $dir/file2 >> $seqres.full
+ _pwrite_byte 0x61 $blksz $blksz $dir/file2.chk >> $seqres.full
fi
- if [ "$b4" = "delalloc" ]; then
- _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2" >> "$seqres.full"
- _pwrite_byte 0x61 $((blksz * 3)) $blksz "$dir/file2.chk" >> "$seqres.full"
+ if [ $b4 = "delalloc" ]; then
+ _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2 >> $seqres.full
+ _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2.chk >> $seqres.full
fi
- "$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$dir/file2" >> "$seqres.full"
- "$XFS_IO_PROG" -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" "$dir/file2.chk" >> "$seqres.full"
+ $XFS_IO_PROG -d -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $dir/file2 >> $seqres.full
+ $XFS_IO_PROG -f -c "pwrite -S 0x63 $blksz $((blksz * 3))" $dir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
- ! cmp -s "$dir/file1" "$dir/file2" || _fail "file1 and file2 don't match."
- cmp -s "$dir/file2" "$dir/file2.chk" || _fail "file2 and file2.chk don't match."
+ ! cmp -s $dir/file1 $dir/file2 || _fail "file1 and file2 don't match."
+ cmp -s $dir/file2 $dir/file2.chk || _fail "file2 and file2.chk don't match."
}
runtest regular delalloc "$testdir/r-d"
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
blksz=65536
nr=6400
-bsz=1280
+filesize=$((blksz * nr))
+bufnr=1280
+bufsize=$((blksz * bufnr))
-free_blocks=$(stat -f -c '%a' "$testdir")
-real_blksz=$(stat -f -c '%S' "$testdir")
-space_needed=$(((blksz * nr * 3) * 5 / 4))
+free_blocks=$(stat -f -c '%a' $testdir)
+real_blksz=$(stat -f -c '%S' $testdir)
+space_needed=$(((filesize * 3) * 5 / 4))
space_avail=$((free_blocks * real_blksz))
test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed"
echo "Create the original files"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full"
-_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full
+_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file2.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file2.chk | _filter_scratch
echo "CoW and unmount"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file2.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file2.chk | _filter_scratch
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf $testdir
+testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
blksz=65536
nr=6400
-bsz=1280
+filesize=$((blksz * nr))
+bufnr=1280
+bufsize=$((blksz * bufnr))
-free_blocks=$(stat -f -c '%a' "$testdir")
-real_blksz=$(stat -f -c '%S' "$testdir")
-space_needed=$(((blksz * nr * 3) * 5 / 4))
+free_blocks=$(stat -f -c '%a' $testdir)
+real_blksz=$(stat -f -c '%S' $testdir)
+space_needed=$(((filesize * 3) * 5 / 4))
space_avail=$((free_blocks * real_blksz))
test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed"
echo "Create the original files"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file1" >> "$seqres.full"
-_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x61 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file1 >> $seqres.full
+_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x61 -b $bufsize 0 $filesize" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file2.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file2.chk | _filter_scratch
echo "CoW and unmount"
-"$XFS_IO_PROG" -d -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2" >> "$seqres.full"
-"$XFS_IO_PROG" -f -c "pwrite -S 0x63 -b $((blksz * bsz)) 0 $((blksz * nr))" "$testdir/file2.chk" >> "$seqres.full"
+$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full
+$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file2.chk" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file2.chk | _filter_scratch
# success, all done
status=0
#-----------------------------------------------------------------------
#
-seq=`basename "$0"`
-seqres="$RESULT_DIR/$seq"
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
_cleanup()
{
cd /
- rm -f "$tmp".*
+ rm -f $tmp.*
}
# get standard environment, filters and checks
_require_cp_reflink
echo "Format and mount"
-_scratch_mkfs -d size=$((2 * 4096 * 4096)) -l size=4194304 > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs -d size=$((2 * 4096 * 4096)) -l size=4194304 > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
echo "Create the original file and reflink to copy1, copy2"
-blksz="$(stat -f "$testdir" -c '%S')"
-_pwrite_byte 0x61 0 $((blksz * 14 + 71)) "$testdir/original" >> "$seqres.full"
-_cp_reflink "$testdir/original" "$testdir/copy1"
-_cp_reflink "$testdir/copy1" "$testdir/copy2"
+blksz="$(stat -f $testdir -c '%S')"
+_pwrite_byte 0x61 0 $((blksz * 14 + 71)) $testdir/original >> $seqres.full
+_cp_reflink $testdir/original $testdir/copy1
+_cp_reflink $testdir/copy1 $testdir/copy2
echo "Grow fs"
-"$XFS_GROWFS_PROG" "$SCRATCH_MNT" 2>&1 | _filter_growfs >> "$seqres.full"
+$XFS_GROWFS_PROG $SCRATCH_MNT 2>&1 | _filter_growfs >> $seqres.full
_scratch_remount
echo "Create more reflink copies"
-_cp_reflink "$testdir/original" "$testdir/copy3"
+_cp_reflink $testdir/original $testdir/copy3
-xfs_info "$SCRATCH_MNT" >> "$seqres.full"
+xfs_info $SCRATCH_MNT >> $seqres.full
# success, all done
status=0
#-----------------------------------------------------------------------
#
-seq=`basename "$0"`
-seqres="$RESULT_DIR/$seq"
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
_cleanup()
{
cd /
- rm -f "$tmp".*
+ rm -f $tmp.*
}
# get standard environment, filters and checks
_require_cp_reflink
echo "Format and mount"
-_scratch_mkfs > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
-free_blocks0=$(stat -f "$testdir" -c '%f')
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
+free_blocks0=$(stat -f $testdir -c '%f')
echo "Create the original file and reflink to file2, file3"
blks=2000
blksz=65536
real_blksz="$(stat -f $testdir -c '%S')"
blksz_factor=$((blksz / real_blksz))
-_pwrite_byte 0x61 0 $((blks * blksz)) "$testdir/file1" >> "$seqres.full"
-_cp_reflink "$testdir/file1" "$testdir/file2"
-_cp_reflink "$testdir/file2" "$testdir/file3"
-_cp_reflink "$testdir/file3" "$testdir/file4"
+_pwrite_byte 0x61 0 $((blks * blksz)) $testdir/file1 >> $seqres.full
+_cp_reflink $testdir/file1 $testdir/file2
+_cp_reflink $testdir/file2 $testdir/file3
+_cp_reflink $testdir/file3 $testdir/file4
_test_remount
-free_blocks1=$(stat -f "$testdir" -c '%f')
+free_blocks1=$(stat -f $testdir -c '%f')
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file4" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file4 | _filter_scratch
-c01=$(_md5_checksum "$testdir/file1")
-c02=$(_md5_checksum "$testdir/file2")
-c03=$(_md5_checksum "$testdir/file3")
-c04=$(_md5_checksum "$testdir/file4")
+c01=$(_md5_checksum $testdir/file1)
+c02=$(_md5_checksum $testdir/file2)
+c03=$(_md5_checksum $testdir/file3)
+c04=$(_md5_checksum $testdir/file4)
echo "CoW the reflink copies"
-_pwrite_byte 0x62 $blksz $blksz "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x63 $(( blksz * (blks - 1) )) $blksz "$testdir/file3" >> "$seqres.full"
+_pwrite_byte 0x62 $blksz $blksz $testdir/file2 >> $seqres.full
+_pwrite_byte 0x63 $(( blksz * (blks - 1) )) $blksz $testdir/file3 >> $seqres.full
_test_remount
-free_blocks2=$(stat -f "$testdir" -c '%f')
+free_blocks2=$(stat -f $testdir -c '%f')
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file4" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file4 | _filter_scratch
-c11=$(_md5_checksum "$testdir/file1")
-c12=$(_md5_checksum "$testdir/file2")
-c13=$(_md5_checksum "$testdir/file3")
-c14=$(_md5_checksum "$testdir/file4")
+c11=$(_md5_checksum $testdir/file1)
+c12=$(_md5_checksum $testdir/file2)
+c13=$(_md5_checksum $testdir/file3)
+c14=$(_md5_checksum $testdir/file4)
echo "Defragment"
-lsattr -l "$testdir/" | _filter_scratch | _filter_spaces
-xfs_fsr -v -d "$testdir/file1" >> "$seqres.full"
-xfs_fsr -v -d "$testdir/file2" >> "$seqres.full" # fsr probably breaks the link
-xfs_fsr -v -d "$testdir/file3" >> "$seqres.full" # fsr probably breaks the link
-xfs_fsr -v -d "$testdir/file4" >> "$seqres.full" # fsr probably ignores this file
+lsattr -l $testdir/ | _filter_scratch | _filter_spaces
+xfs_fsr -v -d $testdir/file1 >> $seqres.full
+xfs_fsr -v -d $testdir/file2 >> $seqres.full # fsr probably breaks the link
+xfs_fsr -v -d $testdir/file3 >> $seqres.full # fsr probably breaks the link
+xfs_fsr -v -d $testdir/file4 >> $seqres.full # fsr probably ignores this file
_test_remount
-free_blocks3=$(stat -f "$testdir" -c '%f')
+free_blocks3=$(stat -f $testdir -c '%f')
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-md5sum "$testdir/file3" | _filter_scratch
-md5sum "$testdir/file4" | _filter_scratch
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+md5sum $testdir/file3 | _filter_scratch
+md5sum $testdir/file4 | _filter_scratch
-c21=$(_md5_checksum "$testdir/file1")
-c22=$(_md5_checksum "$testdir/file2")
-c23=$(_md5_checksum "$testdir/file3")
-c24=$(_md5_checksum "$testdir/file4")
+c21=$(_md5_checksum $testdir/file1)
+c22=$(_md5_checksum $testdir/file2)
+c23=$(_md5_checksum $testdir/file3)
+c24=$(_md5_checksum $testdir/file4)
echo "Check files"
test $c01 = $c02 || echo "Files 1-2 do not match"
# 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"
_cleanup()
{
cd /
- umount "$SCRATCH_MNT" > /dev/null 2>&1
- rm -rf "$tmp".* "$testdir" "$metadump_file" "$TEST_DIR/image"
+ umount $SCRATCH_MNT > /dev/null 2>&1
+ rm -rf $tmp.* $testdir $metadump_file $TEST_DIR/image
}
# get standard environment, filters and checks
_require_loop
_require_scratch_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
-metadump_file="$TEST_DIR/${seq}_metadump"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
+metadump_file=$TEST_DIR/${seq}_metadump
echo "Create the original file blocks"
-blksz="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
nr_blks=$((4 * blksz / 12))
-_pwrite_byte 0x61 0 $((blksz * nr_blks)) "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full
echo "Reflink every other block"
seq 1 2 $((nr_blks - 1)) | while read nr; do
- _reflink_range "$testdir/file1" $((nr * blksz)) \
- "$testdir/file2" $((nr * blksz)) $blksz >> "$seqres.full"
+ _reflink_range $testdir/file1 $((nr * blksz)) \
+ $testdir/file2 $((nr * blksz)) $blksz >> $seqres.full
done
echo "Create metadump file"
_scratch_unmount
-_scratch_metadump "$metadump_file"
+_scratch_metadump $metadump_file
# Now restore the obfuscated one back and take a look around
echo "Restore metadump"
-xfs_mdrestore "$metadump_file" "$TEST_DIR/image"
-_mount -t $FSTYP "$TEST_DIR/image" "$SCRATCH_MNT"
-umount "$SCRATCH_MNT"
+xfs_mdrestore $metadump_file $TEST_DIR/image
+_mount -t $FSTYP $TEST_DIR/image $SCRATCH_MNT
+umount $SCRATCH_MNT
echo "Check restored fs"
-_check_generic_filesystem "$metadump_file"
+_check_generic_filesystem $metadump_file
# success, all done
status=0
# 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"
_cleanup()
{
cd /
- umount "$SCRATCH_MNT" > /dev/null 2>&1
- rm -rf "$tmp".* "$testdir" "$metadump_file"
+ umount $SCRATCH_MNT > /dev/null 2>&1
+ rm -rf $tmp.* $testdir $metadump_file
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount scratch device"
-_scratch_mkfs >> "$seqres.full"
+_scratch_mkfs >> $seqres.full
_scratch_mount
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
echo "Create the original file blocks"
blksz=65536
-$XFS_IO_PROG -R -f -c "truncate $blksz" "$testdir/file1"
+$XFS_IO_PROG -R -f -c "truncate $blksz" $testdir/file1
echo "Reflink every block"
-_cp_reflink "$testdir/file1" "$testdir/file2" 2>&1 | _filter_scratch
+_cp_reflink $testdir/file1 $testdir/file2 2>&1 | _filter_scratch
-test -s "$testdir/file2" && _fail "Should not be able to reflink a realtime file."
+test -s $testdir/file2 && _fail "Should not be able to reflink a realtime file."
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_cp_reflink
_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="$(stat -f "$testdir" -c '%S')"
+blksz="$(stat -f $testdir -c '%S')"
blks=2000
margin=100
sz=$((blksz * blks))
-free_blocks0=$(stat -f "$testdir" -c '%f')
+free_blocks0=$(stat -f $testdir -c '%f')
nr=4
-_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full"
+filesize=$((blksz * nr))
+_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
_test_remount
echo "Create the reflink copies"
for i in `seq 2 $nr`; do
- _cp_reflink "$testdir/file1" "$testdir/file$i"
+ _cp_reflink $testdir/file1 $testdir/file$i
done
_test_remount
-free_blocks1=$(stat -f "$testdir" -c '%f')
+free_blocks1=$(stat -f $testdir -c '%f')
lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
echo "funshare part of a file"
-"$XFS_IO_PROG" -f -c "falloc 0 $((sz / 2))" "$testdir/file2"
+$XFS_IO_PROG -f -c "falloc 0 $((sz / 2))" $testdir/file2
_test_remount
lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
echo "funshare some of the copies"
-"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file2"
-"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file3"
+$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file2
+$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file3
_test_remount
-free_blocks2=$(stat -f "$testdir" -c '%f')
+free_blocks2=$(stat -f $testdir -c '%f')
lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
echo "funshare the rest of the files"
-"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file4"
-"$XFS_IO_PROG" -f -c "falloc 0 $sz" "$testdir/file1"
+$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file4
+$XFS_IO_PROG -f -c "falloc 0 $sz" $testdir/file1
_test_remount
-free_blocks3=$(stat -f "$testdir" -c '%f')
+free_blocks3=$(stat -f $testdir -c '%f')
lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
echo "Rewrite the original file"
-_pwrite_byte 0x65 0 $sz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x65 0 $sz $testdir/file1 >> $seqres.full
_test_remount
-free_blocks4=$(stat -f "$testdir" -c '%f')
+free_blocks4=$(stat -f $testdir -c '%f')
lsattr -l $testdir/ | _filter_test_dir | _filter_spaces
#echo $free_blocks0 $free_blocks1 $free_blocks2 $free_blocks3 $free_blocks4
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs -d agsize=$((32 * 1048576)) > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs -d agsize=$((32 * 1048576)) > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
-blksz="$(stat -f "$testdir" -c '%S')"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
+blksz="$(stat -f $testdir -c '%S')"
echo "Create the original files"
sz=$((48 * 1048576))
nr=$((sz / blksz))
-_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full"
-_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full"
+_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
+_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
_scratch_remount
echo "CoW every other block"
-_pwrite_byte 0x62 0 $sz "$testdir/file1" >> "$seqres.full"
+_pwrite_byte 0x62 0 $sz $testdir/file1 >> $seqres.full
_scratch_remount
echo "Compare files"
-md5sum "$testdir/file1" | _filter_scratch
-md5sum "$testdir/file2" | _filter_scratch
-#filefrag -v "$testdir/file1" "$testdir/file2"
+md5sum $testdir/file1 | _filter_scratch
+md5sum $testdir/file2 | _filter_scratch
+#filefrag -v $testdir/file1 $testdir/file2
# success, all done
status=0
# 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`
_cleanup()
{
cd /
- rm -rf "$tmp".* "$testdir"
+ rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
_require_scratch_reflink
_require_cp_reflink
-rm -f "$seqres.full"
+rm -f $seqres.full
echo "Format and mount"
-_scratch_mkfs -d agsize=$((32 * 1048576)) > "$seqres.full" 2>&1
-_scratch_mount >> "$seqres.full" 2>&1
+_scratch_mkfs -d agsize=$((32 * 1048576)) > $seqres.full 2>&1
+_scratch_mount >> $seqres.full 2>&1
-testdir="$SCRATCH_MNT/test-$seq"
-rm -rf "$testdir"
-mkdir "$testdir"
-blksz="$(stat -f -c '%S' "$testdir")"
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
+blksz=$(stat -f -c '%S' $testdir)
echo "Create the original files"
sz=$((48 * 1048576))
nr=$((sz / blksz))
-_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full"
-_cp_reflink "$testdir/file1" "$testdir/file2" >> "$seqres.full"
-_pwrite_byte 0x61 0 $sz "$testdir/file2.chk" >> "$seqres.full"
+_pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full
+_cp_reflink $testdir/file1 $testdir/file2 >> $seqres.full
+_pwrite_byte 0x61 0 $sz $testdir/file2.chk >> $seqres.full
_scratch_remount
echo "Compare files"
-cmp -s "$testdir/file1" "$testdir/file2" || echo "file1 and file2 do not match"
-cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match"
+cmp -s $testdir/file1 $testdir/file2 || echo "file1 and file2 do not match"
+cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match"
echo "CoW every other block"
seq 1 2 $((nr - 1)) | while read f; do
- _pwrite_byte 0x62 $((f * blksz)) $blksz "$testdir/file2" >> "$seqres.full"
- _pwrite_byte 0x62 $((f * blksz)) $blksz "$testdir/file2.chk" >> "$seqres.full"
+ _pwrite_byte 0x62 $((f * blksz)) $blksz $testdir/file2 >> $seqres.full
+ _pwrite_byte 0x62 $((f * blksz)) $blksz $testdir/file2.chk >> $seqres.full
done
_scratch_remount
echo "Compare files"
-! cmp -s "$testdir/file1" "$testdir/file2" || echo "file1 and file2 must not match"
-cmp -s "$testdir/file2" "$testdir/file2.chk" || echo "file2 and file2.chk do not match"
+! cmp -s $testdir/file1 $testdir/file2 || echo "file1 and file2 must not match"
+cmp -s $testdir/file2 $testdir/file2.chk || echo "file2 and file2.chk do not match"
# success, all done
status=0