f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# CDDL HEADER START
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# The contents of this file are subject to the terms of the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Common Development and Distribution License (the "License").
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# You may not use this file except in compliance with the License.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# or http://www.opensolaris.org/os/licensing.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# See the License for the specific language governing permissions
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# and limitations under the License.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# When distributing Covered Code, include this CDDL HEADER in each
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# If applicable, add the following below this CDDL HEADER, with the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# fields enclosed by brackets "[]" replaced with your own identifying
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# information: Portions Copyright [yyyy] [name of copyright owner]
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# CDDL HEADER END
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Use is subject to license terms.
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy. $STF_SUITE/tests/functional/largest_pool/largest_pool.cfg
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# The largest pool can be created and a dataset in that
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# pool can be created and mounted.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# create a pool which will contain a volume device.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# create a volume device of desired sizes.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# create the largest pool allowed using the volume vdev.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# create and mount a dataset in the largest pool.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# create some files in the zfs file system.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# do some zpool list commands and parse the output.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Parse the results of zpool & zfs creation with specified size
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# $1: volume size
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# return value:
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy UNITS=`echo $1 | sed -e 's/^\([0-9].*\)\([a-z].\)/\2/'`
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy log_note "Detect zpool $TESTPOOL in this test machine."
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy log_must eval "zpool list $TESTPOOL > /tmp/j.$$"
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy log_must eval "grep $TESTPOOL /tmp/j.$$ | \
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy awk '{print $2}' | grep $CHKUNIT"
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy log_note "Detect the file system in this test machine."
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy log_must eval "grep $TESTPOOL /tmp/j.$$ | \
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy awk '{print $2}' | grep $CHKUNIT"
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Check and destroy zfs, volume & zpool remove the temporary files
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedylog_assert "The largest pool can be created and a dataset in that" \
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy "pool can be created and mounted."
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Set trigger. When the test case exit, cleanup is executed.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# -----------------------------------------------------------------------
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# volume sizes with unit designations.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# Note: specifying the number '1' as size will not give the correct
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# units for 'df'. It must be greater than one.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy# -----------------------------------------------------------------------
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy log_note "Create a pool which will contain a volume device"
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy log_note "Create a volume device of desired sizes: $volsize"
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy str=$(zfs create -sV $volsize $TESTPOOL2/$TESTVOL 2>&1)
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy "Max volume size is 1TB on 32-bit systems."
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy log_fail "zfs create -sV $volsize $TESTPOOL2/$TESTVOL"
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy log_note "Create the largest pool allowed using the volume vdev"
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy log_note "Create a zfs file system in the largest pool"
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy log_note "unmount this zfs file system $TESTPOOL/$TESTFS"
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedylog_pass "Dateset can be created, mounted & destroy in largest pool succeeded."