grow_replicas_001_pos.ksh revision f38cb554a534c6df738be3f4d23327e69888e634
2N/A#! /bin/ksh -p
2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2N/A
2N/A#
2N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2N/A# Use is subject to license terms.
2N/A#
2N/A
2N/A#
2N/A# Copyright (c) 2013 by Delphix. All rights reserved.
2N/A#
2N/A
2N/A. $STF_SUITE/tests/functional/grow_replicas/grow_replicas.cfg
2N/A. $STF_SUITE/include/libtest.shlib
2N/A
2N/A#
2N/A# DESCRIPTION:
2N/A# A ZFS file system is limited by the amount of disk space
2N/A# available to the pool. Growing the pool by adding a disk
2N/A# increases the amount of space.
2N/A#
2N/A# STRATEGY:
2N/A# 1) Fill a ZFS filesystem mirror/raidz until ENOSPC by creating lots
2N/A# of files
2N/A# 2) Grow the mirror/raidz by adding a disk
2N/A# 3) Verify that more data can now be written to the file system
2N/A#
2N/A
2N/Averify_runnable "global"
2N/A
2N/Alog_assert "A zpool mirror/raidz may be increased in capacity by adding a disk."
2N/A
2N/Alog_must $ZFS set compression=off $TESTPOOL/$TESTFS
2N/A$FILE_WRITE -o create -f $TESTDIR/$TESTFILE1 \
2N/A -b $BLOCK_SIZE -c $WRITE_COUNT -d 0
2N/A
2N/Atypeset -i zret=$?
2N/Areadonly ENOSPC=28
2N/Aif [[ $zret -ne $ENOSPC ]]; then
2N/A log_fail "file_write completed w/o ENOSPC, aborting!!!"
2N/Afi
2N/A
2N/Aif [[ ! -s $TESTDIR/$TESTFILE1 ]]; then
2N/A log_fail "$TESTDIR/$TESTFILE1 was not created"
2N/Afi
2N/A
2N/A#
2N/A# $DISK will be set if we're using slices on one disk
2N/A#
2N/Aif [[ -n $DISK ]]; then
2N/A log_must $ZPOOL add $TESTPOOL $POOLTYPE $DISK"s"$SLICE3 \
2N/A $DISK"s"$SLICE4
2N/Aelse
2N/A [[ -z $DISK2 || -z $DISK3 ]] && \
2N/A log_unsupported "No spare disks available."
2N/A log_must $ZPOOL add -f $TESTPOOL $POOLTYPE $DISK2"s"$SLICE \
2N/A $DISK3"s"$SLICE
2N/Afi
2N/A
2N/Alog_must $FILE_WRITE -o append -f $TESTDIR/$TESTFILE1 \
2N/A -b $BLOCK_SIZE -c $SMALL_WRITE_COUNT -d 0
2N/A
2N/Alog_must $ZFS inherit compression $TESTPOOL/$TESTFS
2N/Alog_pass "TESTPOOL mirror/raidz successfully grown"
2N/A