12fae26bdSAlan Somers#!/usr/local/bin/ksh93 -p 22fae26bdSAlan Somers# 32fae26bdSAlan Somers# CDDL HEADER START 42fae26bdSAlan Somers# 52fae26bdSAlan Somers# The contents of this file are subject to the terms of the 62fae26bdSAlan Somers# Common Development and Distribution License (the "License"). 72fae26bdSAlan Somers# You may not use this file except in compliance with the License. 82fae26bdSAlan Somers# 92fae26bdSAlan Somers# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 102fae26bdSAlan Somers# or http://www.opensolaris.org/os/licensing. 112fae26bdSAlan Somers# See the License for the specific language governing permissions 122fae26bdSAlan Somers# and limitations under the License. 132fae26bdSAlan Somers# 142fae26bdSAlan Somers# When distributing Covered Code, include this CDDL HEADER in each 152fae26bdSAlan Somers# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 162fae26bdSAlan Somers# If applicable, add the following below this CDDL HEADER, with the 172fae26bdSAlan Somers# fields enclosed by brackets "[]" replaced with your own identifying 182fae26bdSAlan Somers# information: Portions Copyright [yyyy] [name of copyright owner] 192fae26bdSAlan Somers# 202fae26bdSAlan Somers# CDDL HEADER END 212fae26bdSAlan Somers# 222fae26bdSAlan Somers 232fae26bdSAlan Somers# 242fae26bdSAlan Somers# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 252fae26bdSAlan Somers# Use is subject to license terms. 262fae26bdSAlan Somers 272fae26bdSAlan Somers. ${STF_SUITE}/include/libtest.kshlib 282fae26bdSAlan Somers. ${STF_SUITE}/tests/zones/zones_common.kshlib 292fae26bdSAlan Somers 302fae26bdSAlan Somersverify_runnable "both" 312fae26bdSAlan Somerscheck_version "5.11" 322fae26bdSAlan Somersif [ $? -eq 1 ] 332fae26bdSAlan Somersthen 342fae26bdSAlan Somers log_unsupported "ZFS zone clone tests unsupported on this release." 352fae26bdSAlan Somersfi 362fae26bdSAlan Somers 372fae26bdSAlan Somersif ! is_global_zone ; then 382fae26bdSAlan Somers log_pass 392fae26bdSAlan Somersfi 402fae26bdSAlan Somers 412fae26bdSAlan SomersDISK=${DISKS%% *} 422fae26bdSAlan Somersdefault_setup_noexit $DISK 432fae26bdSAlan Somers 442fae26bdSAlan Somers# create a zone on ZFS 452fae26bdSAlan Somerscreate_zone $ZONE /$TESTPOOL 462fae26bdSAlan Somersinstall_zone $ZONE 472fae26bdSAlan Somers 482fae26bdSAlan Somerslog_must $MKDIR -p -m 0700 /$TESTPOOL/simple_dir 492fae26bdSAlan Somers 502fae26bdSAlan Somers# create a normal zone - again on ZFS, but with the zonepath 512fae26bdSAlan Somers# being a simple directory, rather than a top-level filesystem. 522fae26bdSAlan Somers# We also create this as a branded zone. 532fae26bdSAlan Somerscreate_zone $ZONE2 /$TESTPOOL/simple_dir SUNWsn1 542fae26bdSAlan Somersinstall_zone $ZONE2 552fae26bdSAlan Somers 562fae26bdSAlan Somers# Now make sure those zones are visible 572fae26bdSAlan Somerslog_must eval "$ZONEADM -z $ZONE list > /dev/null 2>&1" 582fae26bdSAlan Somerslog_must eval "$ZONEADM -z $ZONE2 list > /dev/null 2>&1" 592fae26bdSAlan Somers 602fae26bdSAlan Somerslog_pass "Setup created zones $ZONE and $ZONE2" 61