diff --git a/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh b/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh index b92e5c460c..48d70ec2d6 100755 --- a/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh +++ b/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh @@ -47,28 +47,21 @@ function edited_prop typeset behaviour=$1 typeset ds=$2 typeset backfile=$TESTDIR/edited_prop_$ds + typeset te=0 case $behaviour in "get") + is_te_enabled && te=1 typeset props=$(zfs inherit 2>&1 | \ - awk '$2=="YES" && $1 !~ /^vol|\.\.\.$/ {print $1}') - for item in $props ; do - if [[ $item == "mlslabel" ]] && \ - ! is_te_enabled ; then - continue - fi - log_must eval "zfs get -H -o property,value $item $ds >> $backfile" - done + awk -v te=$te '$2=="YES" && $1 !~ /^vol|\.\.\.$/ && (te || $1 != "mlslabel") {printf("%s,", $1)}') + log_must eval "zfs get -Ho property,value ${props%,} $ds >> $backfile" ;; "set") if [[ ! -f $backfile ]] ; then log_fail "$ds need backup properties firstly." fi - typeset prop value - while read -r prop value; do - log_must zfs set "$prop=$value" "$ds" - done < $backfile + log_must zfs set $(tr '\t' '=' < $backfile) "$ds" ;; *) log_fail "Unrecognized behaviour: $behaviour"