]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix zfs_clone_010_pos.ksh to verify zfs clones property displays right
authorliaoyuxiangqin <guo.yong33@zte.com.cn>
Thu, 29 Sep 2016 20:08:44 +0000 (04:08 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 29 Sep 2016 20:08:44 +0000 (13:08 -0700)
Because the macro ZFS_MAXPROPLEN used in function print_dataset
differs between platforms set it appropriately and calculate the expected
number of passes.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: yuxiang <guo.yong33@zte.com.cn>
Closes #5154

tests/runfiles/linux.run
tests/zfs-tests/tests/functional/cli_root/zfs_clone/zfs_clone_010_pos.ksh

index ac6dc9f9bd4b32e4ac62314aa4be8b41ceadb37d..b9bcfc8647c1971932b2f3427b70fa8b629a28a4 100644 (file)
@@ -74,11 +74,11 @@ tests = ['zfs_001_neg', 'zfs_002_pos', 'zfs_003_neg']
 
 # DISABLED:
 # zfs_clone_005_pos - busy unmount
-# zfs_clone_010_pos - needs investigation
 [tests/functional/cli_root/zfs_clone]
 tests = ['zfs_clone_001_neg', 'zfs_clone_002_pos', 'zfs_clone_003_pos',
     'zfs_clone_004_pos', 'zfs_clone_006_pos',
-    'zfs_clone_007_pos', 'zfs_clone_008_neg', 'zfs_clone_009_neg']
+    'zfs_clone_007_pos', 'zfs_clone_008_neg', 'zfs_clone_009_neg',
+    'zfs_clone_010_pos']
 
 # DISABLED:
 # zfs_copies_003_pos - zpool on zvol
index 8f405a0a52a5558f51a326267862dec38c5cf595..f22e3a1f6844c5ef8fbaad97135808a6d1a0614a 100755 (executable)
@@ -217,16 +217,21 @@ log_note "verify clone list truncated correctly"
 typeset -i j=200
 i=1
 fs=$TESTPOOL/$TESTFS1
+if is_linux; then
+       ZFS_MAXPROPLEN=4096
+else
+       ZFS_MAXPROPLEN=1024
+fi
 log_must $ZFS create $fs
 log_must $ZFS snapshot $fs@snap
-while((i < 7)); do
+while((i <= $(( $ZFS_MAXPROPLEN/200+1 )))); do
        log_must $ZFS clone $fs@snap $fs/$TESTCLONE$(python -c 'print "x" * 200').$i
        ((i=i+1))
        ((j=j+200))
 done
 clone_list=$($ZFS list -o clones $fs@snap)
 char_count=$($ECHO "$clone_list" | $TAIL -1 | wc | $AWK '{print $3}')
-[[ $char_count -eq 1024 ]] || \
+[[ $char_count -eq $ZFS_MAXPROPLEN ]] || \
     log_fail "Clone list not truncated correctly. Unexpected character count" \
         "$char_count"