diff options
author | liaoyuxiangqin <[email protected]> | 2016-09-30 03:46:13 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-09-29 12:46:13 -0700 |
commit | f25bc4938d8b2ac30fcbaaaf80d7867362b2095c (patch) | |
tree | ede1505079bf302ff970509d8258e0c969d9a07a /tests/zfs-tests | |
parent | 9ec0403d6acd3ab362905b74c5db6aaf31c71f47 (diff) |
Fix zfs_clone_010_pos.ksh to verify the space used by multiple copies
The default blocksize in Linux is 1024 due to a GNU-ism. Setting the
expected blocksize resolves the issue. As mentioned in the PR an
alternate solution would be to set POSIXLY_CORRECT=1.
Reviewed-by: Richard Laager <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: yuxiang <[email protected]>
Closes #5167
Diffstat (limited to 'tests/zfs-tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh index 46fe0f5a4..45ebd2bd7 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh @@ -77,9 +77,14 @@ for val in 1 2 3; do done log_note "Verify 'ls -s' can correctly list the space charged." +if is_linux; then + blksize=1024 +else + blksize=512 +fi for val in 1 2 3; do blks=`$LS -ls /$TESTPOOL/fs_$val/$FILE | $AWK '{print $1}'` - (( used = blks * 512 / (1024 * 1024) )) + (( used = blks * $blksize / (1024 * 1024) )) check_used $used $val done |