Skip to content

Commit

Permalink
tests: rsend.kshlib: cmp_ds_prop: allow skipping source
Browse files Browse the repository at this point in the history
This fixes rsend_012_pos:
20:28:50.50 SUCCESS: eval zfs receive -d -F testpool2 < /mnt/testroot/backdir-rsend/pool-final-R
20:28:50.53 4,6c4,6
20:28:50.53 < acltype   off     local
20:28:50.53 < dnodesize 4k      local
20:28:50.53 < atime     off     local
20:28:50.53 ---
20:28:50.53 > acltype   off     received
20:28:50.53 > dnodesize 4k      received
20:28:50.53 > atime     off     received
20:28:50.53 8,13c8,13
20:28:50.53 < checksum  sha256  local
20:28:50.53 < compression       off     local
20:28:50.53 < copies    2       local
20:28:50.53 < devices   on      local
20:28:50.53 < exec      on      local
20:28:50.53 < quota     1G      local
20:28:50.53 ---
20:28:50.53 > checksum  sha256  received
20:28:50.53 > compression       off     received
20:28:50.53 > copies    2       received
20:28:50.53 > devices   on      received
20:28:50.53 > exec      on      received
20:28:50.53 > quota     1G      received
20:28:50.53 15c15
20:28:50.53 < recordsize        128K    local
20:28:50.53 ---
20:28:50.53 > recordsize        128K    received
20:28:50.53 17,18c17,18
20:28:50.53 < setuid    off     local
20:28:50.53 < snapdir   visible local
20:28:50.53 ---
20:28:50.53 > setuid    off     received
20:28:50.53 > snapdir   visible received
20:28:50.53 ERROR: cmp_ds_prop testpool testpool2 exited 1

Ref: openzfs#13250
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
  • Loading branch information
nabijaczleweli committed Mar 27, 2022
1 parent 0ecc681 commit 98e60f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tests/zfs-tests/tests/functional/rsend/rsend.kshlib
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ function cmp_ds_prop
{
typeset dtst1=$1
typeset dtst2=$2
typeset source=",source"
[ -n "$3" ] && source=
typeset props="type,origin,volblocksize,acltype,dnodesize"
props+=",atime,canmount,checksum,compression,copies,devices"
props+=",exec,quota,readonly,recordsize,reservation,setuid"
Expand All @@ -223,8 +225,8 @@ function cmp_ds_prop
fi

diff \
<(zfs get -Ho property,value,source $props $dtst1 | sed -e "s:$dtst1:PREFIX:g" -e 's/^origin [^@]*/origin POOL/') \
<(zfs get -Ho property,value,source $props $dtst2 | sed -e "s:$dtst2:PREFIX:g" -e 's/^origin [^@]*/origin POOL/')
<(zfs get -Ho property,value$source $props $dtst1 | sed -e "s:$dtst1:PREFIX:g" -e 's/^origin [^@]*/origin POOL/') \
<(zfs get -Ho property,value$source $props $dtst2 | sed -e "s:$dtst2:PREFIX:g" -e 's/^origin [^@]*/origin POOL/')
}

#
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ set -A pair "$POOL" "$POOL2" \

typeset -i i=0
while ((i < ${#pair[@]})); do
log_must cmp_ds_prop ${pair[$i]} ${pair[((i+1))]}
log_must cmp_ds_prop ${pair[$i]} ${pair[((i+1))]} nosource
((i += 2))
done

Expand Down

0 comments on commit 98e60f8

Please sign in to comment.