diff --git a/tests/zfs-tests/tests/functional/rsend/rsend.kshlib b/tests/zfs-tests/tests/functional/rsend/rsend.kshlib index 6f04a6b7bb..a18e69dbaf 100644 --- a/tests/zfs-tests/tests/functional/rsend/rsend.kshlib +++ b/tests/zfs-tests/tests/functional/rsend/rsend.kshlib @@ -207,14 +207,18 @@ function cmp_ds_cont # # $1 dataset 1 # $2 dataset 2 +# $3 -n == don't track property source +# $4 -n == don't track the origin property # function cmp_ds_prop { typeset dtst1=$1 typeset dtst2=$2 - typeset source=",source" - [ -n "$3" ] && source= - typeset props="type,origin,volblocksize,acltype,dnodesize" + typeset nosource=$3 + typeset noorigin=$4 + typeset source=",source"; [ -n "$nosource" ] && source= + typeset origin=",origin"; [ -n "$noorigin" ] && origin= + typeset props="type$origin,volblocksize,acltype,dnodesize" props+=",atime,canmount,checksum,compression,copies,devices" props+=",exec,quota,readonly,recordsize,reservation,setuid" props+=",snapdir,version,volsize,xattr,mountpoint" diff --git a/tests/zfs-tests/tests/functional/rsend/send-c_props.ksh b/tests/zfs-tests/tests/functional/rsend/send-c_props.ksh index 6e95c2c30b..82a2eb91e8 100755 --- a/tests/zfs-tests/tests/functional/rsend/send-c_props.ksh +++ b/tests/zfs-tests/tests/functional/rsend/send-c_props.ksh @@ -52,16 +52,27 @@ for opt in "-p" "-R"; do randomize_ds_props $POOL$ds done - log_must eval "zfs send -c $opt $POOL@final > $BACKDIR/pool-final$opt" - log_must eval "zfs receive -d -F $POOL2 < $BACKDIR/pool-final$opt" + if [ $opt = "-p" ]; then + for ds in ${datasets[@]}; do + log_must eval "zfs send -c $opt $POOL$ds@final > $BACKDIR/pool-final$opt" + log_must eval "zfs receive -dF $POOL2 < $BACKDIR/pool-final$opt" + done + else + log_must eval "zfs send -c $opt $POOL@final > $BACKDIR/pool-final$opt" + log_must eval "zfs receive -dF $POOL2 < $BACKDIR/pool-final$opt" + fi for ds in ${datasets[@]}; do - log_must cmp_ds_prop $POOL$ds $POOL2$ds + typeset origin= + if [ $opt = "-p" ] && [ ${ds/clone//} != $ds ]; then + origin=noorigin + fi + log_must cmp_ds_prop $POOL$ds $POOL2$ds nosource $origin log_must cmp_ds_prop $POOL$ds@final $POOL2$ds@final done # Don't cleanup the second time, since we do that on exit anyway. - [[ $opt = "-p" ]] && cleanup + [ $opt = "-p" ] && cleanup done log_pass "Compressed send doesn't interfere with preservation of properties"