common/rc: generalize _get_filesize()
[xfstests-dev.git] / tests / overlay / 060
index 2e0764e9450f96024945c3208184f87496154c8f..34140e1256702bd813bbadcb14bebf81c8d2be19 100755 (executable)
@@ -36,6 +36,7 @@ _supported_os Linux
 # them explicity after test.
 _require_scratch_nocheck
 _require_scratch_overlay_features index redirect_dir metacopy
+_require_xfs_io_command "falloc"
 
 # remove all files from previous tests
 _scratch_mkfs
@@ -98,7 +99,7 @@ check_file_size()
 {
        local target=$1 expected_size=$2 actual_size
 
-       actual_size=$(stat -c "%s" $target)
+       actual_size=$(_get_filesize $target)
 
        [ "$actual_size" == "$expected_size" ] || echo "Expected file size $expected_size but actual size is $actual_size"
 }
@@ -170,7 +171,7 @@ test_common()
 
        # Trigger data copy up and check absence of metacopy xattr.
        mount_overlay $_lowerdir
-       $XFS_IO_PROG -c "open -a $SCRATCH_MNT/$_target"
+       $XFS_IO_PROG -c "falloc 0 1" $SCRATCH_MNT/$_target >> $seqres.full
        echo "check properties of data copied up file"
        check_file_size_contents $SCRATCH_MNT/$_target $_size "$_data"
        umount_overlay