Per-vdev ZAP tests must use $ZPOOL and $ZDB

Commit e0ab3ab introduced new per-vdev ZAP tests which should have
used the $ZPOOL and $ZDB variabled.  The tests passed the automated
testing since both utilities but when running in-tree all of the new
tests fail.

Signed-off-by: Don Brady <don.brady@intel.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4515
This commit is contained in:
Brian Behlendorf 2016-05-06 18:13:17 -07:00
parent ae6d0c601e
commit d5167616bb
8 changed files with 29 additions and 29 deletions

View File

@ -69,7 +69,7 @@ function assert_zap_common # pool vd lvl zapobj
if [[ -z "$zapobj" ]]; then if [[ -z "$zapobj" ]]; then
log_fail "$vd on $pool has no $lvl ZAP in config" log_fail "$vd on $pool has no $lvl ZAP in config"
elif [[ -z "$(zdb -d $pool $zapobj | grep 'zap')" ]]; then elif [[ -z "$($ZDB -d $pool $zapobj | grep 'zap')" ]]; then
log_fail "$vd on $pool has no $lvl ZAP in MOS" log_fail "$vd on $pool has no $lvl ZAP in MOS"
fi fi
} }
@ -101,13 +101,13 @@ function assert_leaf_zap # pool vd conf
function cleanup function cleanup
{ {
if datasetexists $TESTPOOL ; then if datasetexists $TESTPOOL ; then
log_must zpool destroy -f $TESTPOOL log_must $ZPOOL destroy -f $TESTPOOL
fi fi
if [[ -e $conf ]]; then if [[ -e $conf ]]; then
log_must $RM -f "$conf" log_must $RM -f "$conf"
fi fi
if [[ -e $POOL2 ]]; then if [[ -e $POOL2 ]]; then
log_must zpool destroy -f $POOL2 log_must $ZPOOL destroy -f $POOL2
fi fi
} }

View File

@ -31,9 +31,9 @@ log_assert "Per-vdev ZAPs are created on pool creation with one disk."
DISK=${DISKS%% *} DISK=${DISKS%% *}
log_must zpool create -f $TESTPOOL $DISK log_must $ZPOOL create -f $TESTPOOL $DISK
conf="$TESTDIR/vz001" conf="$TESTDIR/vz001"
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
assert_top_zap $TESTPOOL $DISK "$conf" assert_top_zap $TESTPOOL $DISK "$conf"
assert_leaf_zap $TESTPOOL $DISK "$conf" assert_leaf_zap $TESTPOOL $DISK "$conf"

View File

@ -30,10 +30,10 @@
log_assert "Per-vdev ZAPs are created on pool creation with many disks." log_assert "Per-vdev ZAPs are created on pool creation with many disks."
log_must zpool create -f $TESTPOOL $DISKS log_must $ZPOOL create -f $TESTPOOL $DISKS
conf="$TESTDIR/vz002" conf="$TESTDIR/vz002"
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf" assert_has_sentinel "$conf"
for DISK in $DISKS; do for DISK in $DISKS; do

View File

@ -31,10 +31,10 @@
log_assert "Per-vdev ZAPs are created on pool creation with multi-level vdev "\ log_assert "Per-vdev ZAPs are created on pool creation with multi-level vdev "\
"trees." "trees."
log_must zpool create -f $TESTPOOL mirror $DISKS log_must $ZPOOL create -f $TESTPOOL mirror $DISKS
conf="$TESTDIR/vz003" conf="$TESTDIR/vz003"
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf" assert_has_sentinel "$conf"
assert_top_zap $TESTPOOL "type: 'mirror'" "$conf" assert_top_zap $TESTPOOL "type: 'mirror'" "$conf"

View File

@ -34,11 +34,11 @@
log_assert "Per-vdev ZAPs are transferred properly on attach/detach" log_assert "Per-vdev ZAPs are transferred properly on attach/detach"
DISK=${DISKS%% *} DISK=${DISKS%% *}
log_must zpool create -f $TESTPOOL $DISK log_must $ZPOOL create -f $TESTPOOL $DISK
# Make the pool. # Make the pool.
conf="$TESTDIR/vz004" conf="$TESTDIR/vz004"
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf" assert_has_sentinel "$conf"
orig_top=$(get_top_vd_zap $DISK $conf) orig_top=$(get_top_vd_zap $DISK $conf)
orig_leaf=$(get_leaf_vd_zap $DISK $conf) orig_leaf=$(get_leaf_vd_zap $DISK $conf)
@ -49,8 +49,8 @@ assert_zap_common $TESTPOOL $DISK "top" $orig_top
# #
disk2=$(echo $DISKS | awk '{print $2}') disk2=$(echo $DISKS | awk '{print $2}')
log_must zpool attach $TESTPOOL $DISK $disk2 log_must $ZPOOL attach $TESTPOOL $DISK $disk2
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
# Ensure top-level ZAP was transferred successfully. # Ensure top-level ZAP was transferred successfully.
new_top=$(get_top_vd_zap "type: 'mirror'" $conf) new_top=$(get_top_vd_zap "type: 'mirror'" $conf)
@ -78,8 +78,8 @@ dsk2_leaf=$(get_leaf_vd_zap $disk2 $conf)
# Detach original disk. # Detach original disk.
# #
log_must zpool detach $TESTPOOL $DISK log_must $ZPOOL detach $TESTPOOL $DISK
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
final_top=$(get_top_vd_zap $disk2 $conf) final_top=$(get_top_vd_zap $disk2 $conf)
final_leaf=$(get_leaf_vd_zap $disk2 $conf) final_leaf=$(get_leaf_vd_zap $disk2 $conf)

View File

@ -31,11 +31,11 @@
log_assert "Per-vdev ZAPs persist across export/import." log_assert "Per-vdev ZAPs persist across export/import."
DISK=${DISKS%% *} DISK=${DISKS%% *}
log_must zpool create -f $TESTPOOL $DISK log_must $ZPOOL create -f $TESTPOOL $DISK
# Make the pool. # Make the pool.
conf="$TESTDIR/vz005" conf="$TESTDIR/vz005"
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf" assert_has_sentinel "$conf"
orig_top=$(get_top_vd_zap $DISK $conf) orig_top=$(get_top_vd_zap $DISK $conf)
orig_leaf=$(get_leaf_vd_zap $DISK $conf) orig_leaf=$(get_leaf_vd_zap $DISK $conf)
@ -43,13 +43,13 @@ assert_zap_common $TESTPOOL $DISK "top" $orig_top
assert_zap_common $TESTPOOL $DISK "leaf" $orig_leaf assert_zap_common $TESTPOOL $DISK "leaf" $orig_leaf
# Export the pool. # Export the pool.
log_must zpool export $TESTPOOL log_must $ZPOOL export $TESTPOOL
# Import the pool. # Import the pool.
log_must zpool import $TESTPOOL log_must $ZPOOL import $TESTPOOL
# Verify that ZAPs persisted. # Verify that ZAPs persisted.
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
new_top=$(get_top_vd_zap $DISK $conf) new_top=$(get_top_vd_zap $DISK $conf)
new_leaf=$(get_leaf_vd_zap $DISK $conf) new_leaf=$(get_leaf_vd_zap $DISK $conf)

View File

@ -30,13 +30,13 @@
DISK_ARR=($DISKS) DISK_ARR=($DISKS)
DISK=${DISK_ARR[0]} DISK=${DISK_ARR[0]}
log_must zpool create -f $TESTPOOL $DISK log_must $ZPOOL create -f $TESTPOOL $DISK
log_assert "Per-vdev ZAPs are created for added vdevs." log_assert "Per-vdev ZAPs are created for added vdevs."
log_must zpool add -f $TESTPOOL ${DISK_ARR[1]} log_must $ZPOOL add -f $TESTPOOL ${DISK_ARR[1]}
conf="$TESTDIR/vz006" conf="$TESTDIR/vz006"
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf" assert_has_sentinel "$conf"
orig_top=$(get_top_vd_zap ${DISK_ARR[1]} $conf) orig_top=$(get_top_vd_zap ${DISK_ARR[1]} $conf)

View File

@ -32,11 +32,11 @@
DISK_ARR=($DISKS) DISK_ARR=($DISKS)
POOL2=${TESTPOOL}2 POOL2=${TESTPOOL}2
log_must zpool create -f $TESTPOOL mirror ${DISK_ARR[0]} ${DISK_ARR[1]} log_must $ZPOOL create -f $TESTPOOL mirror ${DISK_ARR[0]} ${DISK_ARR[1]}
log_assert "Per-vdev ZAPs persist correctly on the original pool after split." log_assert "Per-vdev ZAPs persist correctly on the original pool after split."
conf="$TESTDIR/vz007" conf="$TESTDIR/vz007"
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf" assert_has_sentinel "$conf"
orig_top=$(get_top_vd_zap "type: 'mirror'" $conf) orig_top=$(get_top_vd_zap "type: 'mirror'" $conf)
@ -46,10 +46,10 @@ assert_zap_common $TESTPOOL "type: 'mirror'" "top" $orig_top
assert_zap_common $TESTPOOL ${DISK_ARR[0]} "leaf" $orig_leaf0 assert_zap_common $TESTPOOL ${DISK_ARR[0]} "leaf" $orig_leaf0
assert_zap_common $TESTPOOL ${DISK_ARR[1]} "leaf" $orig_leaf1 assert_zap_common $TESTPOOL ${DISK_ARR[1]} "leaf" $orig_leaf1
log_must zpool split $TESTPOOL $POOL2 ${DISK_ARR[1]} log_must $ZPOOL split $TESTPOOL $POOL2 ${DISK_ARR[1]}
# Make sure old pool's ZAPs are consistent. # Make sure old pool's ZAPs are consistent.
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
new_leaf0=$(get_leaf_vd_zap ${DISK_ARR[0]} $conf) new_leaf0=$(get_leaf_vd_zap ${DISK_ARR[0]} $conf)
new_top_s0=$(get_top_vd_zap ${DISK_ARR[0]} $conf) new_top_s0=$(get_top_vd_zap ${DISK_ARR[0]} $conf)
@ -61,8 +61,8 @@ new_top_s0=$(get_top_vd_zap ${DISK_ARR[0]} $conf)
log_assert "Per-vdev ZAPs persist on the new pool after import." log_assert "Per-vdev ZAPs persist on the new pool after import."
# Import the split pool. # Import the split pool.
log_must zpool import $POOL2 log_must $ZPOOL import $POOL2
log_must zdb -PC $TESTPOOL > $conf log_must $ZDB -PC $TESTPOOL > $conf
new_leaf1=$(get_leaf_vd_zap ${DISK_ARR[1]} $conf) new_leaf1=$(get_leaf_vd_zap ${DISK_ARR[1]} $conf)
new_top_s1=$(get_top_vd_zap ${DISK_ARR[1]} $conf) new_top_s1=$(get_top_vd_zap ${DISK_ARR[1]} $conf)