aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliaoyuxiangqin <[email protected]>2016-09-30 03:46:13 +0800
committerBrian Behlendorf <[email protected]>2016-09-29 12:46:13 -0700
commitf25bc4938d8b2ac30fcbaaaf80d7867362b2095c (patch)
treeede1505079bf302ff970509d8258e0c969d9a07a
parent9ec0403d6acd3ab362905b74c5db6aaf31c71f47 (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
-rw-r--r--tests/runfiles/linux.run4
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh7
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