zpool_add_006_pos.ksh revision d583b39bfb4e2571d3e41097c5c357ffe353ad45
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# DESCRIPTION:
# 'zpool add [-f]' can add large numbers of file-in-zfs-filesystem-based vdevs
# to the specified pool without any errors.
#
# STRATEGY:
# 1. Create assigned number of files in ZFS filesystem as vdevs and use the first
# file to create a pool
# 2. Add other vdevs to the pool should get success
# 3 Fill in the filesystem and create a partially written file
# as vdev
# 4. Add the new file into the pool should be failed.
#
verify_runnable "global"
function cleanup
{
poolexists $TESTPOOL1 && \
poolexists $TESTPOOL && \
if [[ -d $TESTDIR ]]; then
fi
}
#
# Create a pool and fs on the assigned disk, and dynamically create large
# numbers of files as vdevs.(the default value is <VDEVS_NUM>)
# the first file will be used to create a pool for other vdevs to be added into
#
function setup_vdevs #<disk>
{
typeset disk=$1
typeset -l count=0
typeset -l largest_num=0
typeset -l slicesize=0
typeset vdev=""
#
# Get disk size for zfs filesystem
#
#64m is the minmum size for pool
# minus $largest_num/40 to leave 2.5% space for metadata.
file_size=64
else
fi
# plus $vdevs_num/40 to provide enough space for metadata.
fi
[[ -d $TESTDIR ]] && \
# Create a pool first using the first file, and make subsequent files
# ready as vdevs to add to the pool
create_pool "$TESTPOOL1" "${TESTDIR}/file.$count"
vdevs_list="$vdevs_list ${TESTDIR}/file.$count"
done
}
log_assert " 'zpool add [-f]' can add large numbers of vdevs to the specified" \
" pool without any errors."
if [[ $DISK_ARRAY_NUM == 0 ]]; then
else
fi
vdevs_list=""
log_pass "'zpool successfully add [-f]' can add large numbers of vdevs to the" \
"specified pool without any errors."