reflink: fix style problems in existing tests

Fix style problems such as unnecessary use of quotes, add helper
variables to reduce visual clutter, and other minor fixes to make the
first batch of tests more closely resemble the second round tests.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
Darrick J. Wong
2016-02-10 00:33:10 -08:00
parent 96de24c84a
commit 2616587012
87 changed files with 2159 additions and 2143 deletions
+12 -11
View File
@@ -23,8 +23,8 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#-----------------------------------------------------------------------
seq=`basename "$0"`
seqres="$RESULT_DIR/$seq"
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
@@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
rm -rf "$tmp".* "$testdir"
rm -rf $tmp.* $testdir
}
# get standard environment, filters and checks
@@ -48,11 +48,11 @@ _supported_os Linux
_require_test_reflink
_require_cp_reflink
rm -f "$seqres.full"
rm -f $seqres.full
testdir="$TEST_DIR/test-$seq"
rm -rf "$testdir"
mkdir "$testdir"
testdir=$TEST_DIR/test-$seq
rm -rf $testdir
mkdir $testdir
echo "Create the original file blocks"
blksz="$(stat -f $testdir -c '%S')"
@@ -60,16 +60,17 @@ blks=2000
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