]>
git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_001_pos.ksh
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
28 .
$STF_SUITE/include
/libtest.shlib
29 .
$STF_SUITE/tests
/functional
/cli_root
/zfs_copies
/zfs_copies.kshlib
33 # Verify "copies" property can be correctly set as 1,2 and 3 and different
34 # filesystem can have different value of "copies" property within the same pool.
37 # 1. Create different filesystems with copies set as 1,2,3;
38 # 2. Verify that the "copies" property has been set correctly
41 verify_runnable
"both"
47 for ds
in $fs1 $fs2 $vol1 $vol2; do
48 if datasetexists
$ds; then
49 log_must
$ZFS destroy
$ds
54 log_assert
"Verify 'copies' property with correct arguments works or not."
58 fs1
=$TESTPOOL/$TESTFS1
59 fs2
=$TESTPOOL/$TESTFS2
60 vol
=$TESTPOOL/$TESTVOL
61 vol1
=$TESTPOOL/$TESTVOL1
62 vol2
=$TESTPOOL/$TESTVOL2
65 # Check the default value for copies property
67 for ds
in $fs $vol; do
72 log_must
$ZFS create
-o copies
=$val $fs1
73 if is_global_zone
; then
74 log_must
$ZFS create
-V $VOLSIZE -o copies
=$val $vol1
76 log_must
$ZFS create
-o copies
=$val $vol1
78 for ds
in $fs1 $vol1; do
83 log_must
$ZFS create
-o copies
=$val2 $fs2
84 if is_global_zone
; then
85 log_must
$ZFS create
-V $VOLSIZE -o copies
=$val2 $vol2
87 log_must
$ZFS create
-o copies
=$val2 $vol2
89 for ds
in $fs2 $vol2; do
91 log_must
$ZFS destroy
$ds
95 for ds
in $fs1 $vol1; do
96 log_must
$ZFS destroy
$ds
102 for ds
in $fs $vol; do
103 log_must
$ZFS set copies
=$val $ds
108 log_pass
"'copies' property with correct arguments works as expected. "