zfs_rename_005_neg.ksh revision d583b39bfb4e2571d3e41097c5c357ffe353ad45
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# CDDL HEADER START
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# The contents of this file are subject to the terms of the
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# Common Development and Distribution License (the "License").
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# You may not use this file except in compliance with the License.
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# or http://www.opensolaris.org/os/licensing.
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# See the License for the specific language governing permissions
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# and limitations under the License.
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# When distributing Covered Code, include this CDDL HEADER in each
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# If applicable, add the following below this CDDL HEADER, with the
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# fields enclosed by brackets "[]" replaced with your own identifying
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# information: Portions Copyright [yyyy] [name of copyright owner]
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# CDDL HEADER END
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# Use is subject to license terms.
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara. $STF_SUITE/tests/functional/cli_root/zfs_rename/zfs_rename.kshlib
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# 'zfs rename' should fail when the dataset are not within the same pool
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# 1. Given a file system, snapshot and volume.
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# 2. Rename each dataset object to a different pool.
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# 3. Verify the operation fails, and only the original name
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# is displayed by zfs list.
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara "$TESTPOOL/$TESTFS1" "$TESTPOOL/$TESTCTR1" \
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara "$TESTPOOL/$TESTCTR/$TESTFS1" "$TESTPOOL/$TESTVOL" \
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara "$TESTPOOL/$TESTFS@snapshot" "$TESTPOOL/$TESTFS-clone"
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara# cleanup defined in zfs_rename.kshlib
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwaralog_assert "'zfs rename' should fail while datasets are within different pool."
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwaralog_must $MKFILE $FILESIZE $TESTDIR/$TESTFILE1
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwaracreate_pool $TESTPOOL1 $TESTDIR/$TESTFILE1
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwara # Verify original dataset name still in use
33f285ae904939ecef3a4a660b9e72942e10d37dVallish Vaidyeshwaralog_pass "'zfs rename' fail while datasets are within different pool."