if [[ -z "$zapobj" ]]; then
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"
fi
}
function cleanup
{
if datasetexists $TESTPOOL ; then
- log_must zpool destroy -f $TESTPOOL
+ log_must $ZPOOL destroy -f $TESTPOOL
fi
if [[ -e $conf ]]; then
log_must $RM -f "$conf"
fi
if [[ -e $POOL2 ]]; then
- log_must zpool destroy -f $POOL2
+ log_must $ZPOOL destroy -f $POOL2
fi
}
DISK=${DISKS%% *}
-log_must zpool create -f $TESTPOOL $DISK
+log_must $ZPOOL create -f $TESTPOOL $DISK
conf="$TESTDIR/vz001"
-log_must zdb -PC $TESTPOOL > $conf
+log_must $ZDB -PC $TESTPOOL > $conf
assert_top_zap $TESTPOOL $DISK "$conf"
assert_leaf_zap $TESTPOOL $DISK "$conf"
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"
-log_must zdb -PC $TESTPOOL > $conf
+log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf"
for DISK in $DISKS; do
log_assert "Per-vdev ZAPs are created on pool creation with multi-level vdev "\
"trees."
-log_must zpool create -f $TESTPOOL mirror $DISKS
+log_must $ZPOOL create -f $TESTPOOL mirror $DISKS
conf="$TESTDIR/vz003"
-log_must zdb -PC $TESTPOOL > $conf
+log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf"
assert_top_zap $TESTPOOL "type: 'mirror'" "$conf"
log_assert "Per-vdev ZAPs are transferred properly on attach/detach"
DISK=${DISKS%% *}
-log_must zpool create -f $TESTPOOL $DISK
+log_must $ZPOOL create -f $TESTPOOL $DISK
# Make the pool.
conf="$TESTDIR/vz004"
-log_must zdb -PC $TESTPOOL > $conf
+log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf"
orig_top=$(get_top_vd_zap $DISK $conf)
orig_leaf=$(get_leaf_vd_zap $DISK $conf)
#
disk2=$(echo $DISKS | awk '{print $2}')
-log_must zpool attach $TESTPOOL $DISK $disk2
-log_must zdb -PC $TESTPOOL > $conf
+log_must $ZPOOL attach $TESTPOOL $DISK $disk2
+log_must $ZDB -PC $TESTPOOL > $conf
# Ensure top-level ZAP was transferred successfully.
new_top=$(get_top_vd_zap "type: 'mirror'" $conf)
# Detach original disk.
#
-log_must zpool detach $TESTPOOL $DISK
-log_must zdb -PC $TESTPOOL > $conf
+log_must $ZPOOL detach $TESTPOOL $DISK
+log_must $ZDB -PC $TESTPOOL > $conf
final_top=$(get_top_vd_zap $disk2 $conf)
final_leaf=$(get_leaf_vd_zap $disk2 $conf)
log_assert "Per-vdev ZAPs persist across export/import."
DISK=${DISKS%% *}
-log_must zpool create -f $TESTPOOL $DISK
+log_must $ZPOOL create -f $TESTPOOL $DISK
# Make the pool.
conf="$TESTDIR/vz005"
-log_must zdb -PC $TESTPOOL > $conf
+log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf"
orig_top=$(get_top_vd_zap $DISK $conf)
orig_leaf=$(get_leaf_vd_zap $DISK $conf)
assert_zap_common $TESTPOOL $DISK "leaf" $orig_leaf
# Export the pool.
-log_must zpool export $TESTPOOL
+log_must $ZPOOL export $TESTPOOL
# Import the pool.
-log_must zpool import $TESTPOOL
+log_must $ZPOOL import $TESTPOOL
# 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_leaf=$(get_leaf_vd_zap $DISK $conf)
DISK_ARR=($DISKS)
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_must zpool add -f $TESTPOOL ${DISK_ARR[1]}
+log_must $ZPOOL add -f $TESTPOOL ${DISK_ARR[1]}
conf="$TESTDIR/vz006"
-log_must zdb -PC $TESTPOOL > $conf
+log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf"
orig_top=$(get_top_vd_zap ${DISK_ARR[1]} $conf)
DISK_ARR=($DISKS)
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."
conf="$TESTDIR/vz007"
-log_must zdb -PC $TESTPOOL > $conf
+log_must $ZDB -PC $TESTPOOL > $conf
assert_has_sentinel "$conf"
orig_top=$(get_top_vd_zap "type: 'mirror'" $conf)
assert_zap_common $TESTPOOL ${DISK_ARR[0]} "leaf" $orig_leaf0
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.
-log_must zdb -PC $TESTPOOL > $conf
+log_must $ZDB -PC $TESTPOOL > $conf
new_leaf0=$(get_leaf_vd_zap ${DISK_ARR[0]} $conf)
new_top_s0=$(get_top_vd_zap ${DISK_ARR[0]} $conf)
log_assert "Per-vdev ZAPs persist on the new pool after import."
# Import the split pool.
-log_must zpool import $POOL2
-log_must zdb -PC $TESTPOOL > $conf
+log_must $ZPOOL import $POOL2
+log_must $ZDB -PC $TESTPOOL > $conf
new_leaf1=$(get_leaf_vd_zap ${DISK_ARR[1]} $conf)
new_top_s1=$(get_top_vd_zap ${DISK_ARR[1]} $conf)