vdev_zaps_007_pos.ksh revision 215198a6ad15cf4832370e2f19247abeb36b951a
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
#
#
# Copyright (c) 2015 by Delphix. All rights reserved.
#
#
# Description:
# Verify that ZAPs are handled properly during mirror pool splitting.
#
# Strategy:
# 1. Create a pool with a two-way mirror.
# 2. Split the pool.
# 3. Verify that the ZAPs in the old pool persisted.
# 4. Import the new pool.
# 5. Verify that the ZAPs in the new pool persisted.
#
log_assert "Per-vdev ZAPs persist correctly on the original pool after split."
orig_leaf0=$(get_leaf_vd_zap ${DISK_ARR[0]} $conf)
orig_leaf1=$(get_leaf_vd_zap ${DISK_ARR[1]} $conf)
# Make sure old pool's ZAPs are consistent.
new_leaf0=$(get_leaf_vd_zap ${DISK_ARR[0]} $conf)
new_top_s0=$(get_top_vd_zap ${DISK_ARR[0]} $conf)
"didn't persist (expected $orig_leaf0, got $new_leaf0)"
"didn't persist (expected $orig_top, got $new_top_s0)"
log_assert "Per-vdev ZAPs persist on the new pool after import."
# Import the split pool.
new_leaf1=$(get_leaf_vd_zap ${DISK_ARR[1]} $conf)
new_top_s1=$(get_top_vd_zap ${DISK_ARR[1]} $conf)
"didn't persist (expected $orig_leaf1, got $new_leaf1)"
"didn't persist (expected $orig_top, got $new_top_s1)"