1*215198a6SJoe Stein#!/bin/ksh 2*215198a6SJoe Stein 3*215198a6SJoe Stein# 4*215198a6SJoe Stein# This file and its contents are supplied under the terms of the 5*215198a6SJoe Stein# Common Development and Distribution License ("CDDL"), version 1.0. 6*215198a6SJoe Stein# You may only use this file in accordance with the terms of version 7*215198a6SJoe Stein# 1.0 of the CDDL. 8*215198a6SJoe Stein# 9*215198a6SJoe Stein# A full copy of the text of the CDDL should have accompanied this 10*215198a6SJoe Stein# source. A copy of the CDDL is also available via the Internet at 11*215198a6SJoe Stein# http://www.illumos.org/license/CDDL. 12*215198a6SJoe Stein# 13*215198a6SJoe Stein 14*215198a6SJoe Stein# 15*215198a6SJoe Stein# Copyright (c) 2015, 2016 by Delphix. All rights reserved. 16*215198a6SJoe Stein# 17*215198a6SJoe Stein 18*215198a6SJoe Stein# 19*215198a6SJoe Stein# Description: 20*215198a6SJoe Stein# Verify that top-level per-vdev ZAPs are created for added devices 21*215198a6SJoe Stein# 22*215198a6SJoe Stein# Strategy: 23*215198a6SJoe Stein# 1. Create a pool with one disk. 24*215198a6SJoe Stein# 2. Add a disk. 25*215198a6SJoe Stein# 3. Verify its ZAPs were created. 26*215198a6SJoe Stein# 27*215198a6SJoe Stein 28*215198a6SJoe Stein. $STF_SUITE/include/libtest.shlib 29*215198a6SJoe Stein. $STF_SUITE/tests/functional/vdev_zaps/vdev_zaps.kshlib 30*215198a6SJoe Stein 31*215198a6SJoe SteinDISK_ARR=($DISKS) 32*215198a6SJoe SteinDISK=${DISK_ARR[0]} 33*215198a6SJoe Steinlog_must zpool create -f $TESTPOOL $DISK 34*215198a6SJoe Stein 35*215198a6SJoe Steinlog_assert "Per-vdev ZAPs are created for added vdevs." 36*215198a6SJoe Stein 37*215198a6SJoe Steinlog_must zpool add -f $TESTPOOL ${DISK_ARR[1]} 38*215198a6SJoe Steinconf="$TESTDIR/vz006" 39*215198a6SJoe Steinlog_must zdb -PC $TESTPOOL > $conf 40*215198a6SJoe Stein 41*215198a6SJoe Steinassert_has_sentinel "$conf" 42*215198a6SJoe Steinorig_top=$(get_top_vd_zap ${DISK_ARR[1]} $conf) 43*215198a6SJoe Steinassert_zap_common $TESTPOOL ${DISK_ARR[1]} "top" $orig_top 44*215198a6SJoe Steinassert_leaf_zap $TESTPOOL ${DISK_ARR[1]} "$conf" 45*215198a6SJoe Stein 46*215198a6SJoe Steinlog_pass 47