zpool_import_006_pos.ksh revision d583b39bfb4e2571d3e41097c5c357ffe353ad45
6185db853e024a486ff8837e6784dd290d866112dougm# CDDL HEADER START
6185db853e024a486ff8837e6784dd290d866112dougm# The contents of this file are subject to the terms of the
6185db853e024a486ff8837e6784dd290d866112dougm# Common Development and Distribution License (the "License").
6185db853e024a486ff8837e6784dd290d866112dougm# You may not use this file except in compliance with the License.
6185db853e024a486ff8837e6784dd290d866112dougm# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
6185db853e024a486ff8837e6784dd290d866112dougm# See the License for the specific language governing permissions
6185db853e024a486ff8837e6784dd290d866112dougm# and limitations under the License.
6185db853e024a486ff8837e6784dd290d866112dougm# When distributing Covered Code, include this CDDL HEADER in each
6185db853e024a486ff8837e6784dd290d866112dougm# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
6185db853e024a486ff8837e6784dd290d866112dougm# If applicable, add the following below this CDDL HEADER, with the
6185db853e024a486ff8837e6784dd290d866112dougm# fields enclosed by brackets "[]" replaced with your own identifying
6185db853e024a486ff8837e6784dd290d866112dougm# information: Portions Copyright [yyyy] [name of copyright owner]
6185db853e024a486ff8837e6784dd290d866112dougm# CDDL HEADER END
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
6185db853e024a486ff8837e6784dd290d866112dougm# Use is subject to license terms.
6185db853e024a486ff8837e6784dd290d866112dougm# Copyright (c) 2012 by Delphix. All rights reserved.
6185db853e024a486ff8837e6784dd290d866112dougm. $STF_SUITE/tests/functional/cli_root/zpool_import/zpool_import.cfg
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# DESCRIPTION:
6185db853e024a486ff8837e6784dd290d866112dougm# For mirror, N-1 destroyed pools devices was removed or used by other
6185db853e024a486ff8837e6784dd290d866112dougm# pool, it still can be imported correctly.
5359815feb11a102a85ff1b899512fa9553b8c25dougm# 1. Create mirror with N disks.
5359815feb11a102a85ff1b899512fa9553b8c25dougm# 2. Destroy this mirror.
6185db853e024a486ff8837e6784dd290d866112dougm# 3. Create another pool with N-1 disks which was used by this mirror.
6185db853e024a486ff8837e6784dd290d866112dougm# 4. Verify import mirror can succeed.
6185db853e024a486ff8837e6784dd290d866112dougm typeset i=0
6185db853e024a486ff8837e6784dd290d866112dougm log_must $MKFILE $FILE_SIZE ${DEVICE_DIR}/${DEVICE_FILE}$i
549ec3fff108310966327d1dc9004551b63210b7dougmlog_assert "For mirror, N-1 destroyed pools devices was removed or used " \
6185db853e024a486ff8837e6784dd290d866112dougm "by other pool, it still can be imported correctly."
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazalog_must $ZPOOL create $TESTPOOL1 mirror $VDEV0 $VDEV1 $VDEV2