zpool_create_008_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.
#
#
# Copyright (c) 2012 by Delphix. All rights reserved.
#
#
# DESCRIPTION:
# 'zpool create' have to use '-f' scenarios
#
# STRATEGY:
# 1. Prepare the scenarios
# 2. Create pool without '-f' and verify it fails
# 3. Create pool with '-f' and verify it succeeds
#
verify_runnable "global"
function cleanup
{
if [[ $exported_pool == true ]]; then
if [[ $force_pool == true ]]; then
else
fi
fi
if poolexists $TESTPOOL ; then
fi
if poolexists $TESTPOOL1 ; then
fi
#
# recover it back to EFI label
#
}
#
# create overlap slice 0 and 1 on $disk
#
function create_overlap_slice
{
typeset format_file=/var/tmp/format_overlap.$$
typeset disk=$1
$FORMAT -e -s -d $disk -f $format_file
typeset -i ret=$?
log_fail "unable to create overlap slice."
fi
return 0
}
log_assert "'zpool create' have to use '-f' scenarios"
typeset exported_pool=false
typeset force_pool=false
if [[ -n $DISK ]]; then
else
fi
# overlapped slices as vdev need -f to create pool
# Make the disk is EFI labeled first via pool creation
# Make the disk is VTOC labeled since only VTOC label supports overlap
# exported device to be as spare vdev need -f to create pool
exported_pool=true
force_pool=true
log_pass "'zpool create' have to use '-f' scenarios"