From f25bc4938d8b2ac30fcbaaaf80d7867362b2095c Mon Sep 17 00:00:00 2001 From: liaoyuxiangqin Date: Fri, 30 Sep 2016 03:46:13 +0800 Subject: [PATCH] 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 Reviewed-by: Brian Behlendorf Signed-off-by: yuxiang Closes #5167 --- tests/runfiles/linux.run | 4 ++-- .../functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run index 086774404..9ab9c60f9 100644 --- a/tests/runfiles/linux.run +++ b/tests/runfiles/linux.run @@ -81,11 +81,11 @@ tests = ['zfs_clone_001_neg', 'zfs_clone_002_pos', 'zfs_clone_003_pos', 'zfs_clone_007_pos', 'zfs_clone_008_neg', 'zfs_clone_009_neg'] # DISABLED: -# zfs_copies_002_pos - needs investigation # zfs_copies_003_pos - zpool on zvol # zfs_copies_005_neg - nested pools [tests/functional/cli_root/zfs_copies] -tests = ['zfs_copies_001_pos', 'zfs_copies_004_neg', 'zfs_copies_006_pos'] +tests = ['zfs_copies_001_pos', 'zfs_copies_002_pos', 'zfs_copies_004_neg', + 'zfs_copies_006_pos'] [tests/functional/cli_root/zfs_create] tests = ['zfs_create_001_pos', 'zfs_create_002_pos', 'zfs_create_003_pos', 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