Print this page
7290 ZFS test suite needs to control what utilities it can run
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/test/zfs-tests/tests/functional/userquota/userquota_011_pos.ksh
+++ new/usr/src/test/zfs-tests/tests/functional/userquota/userquota_011_pos.ksh
1 1 #!/usr/bin/ksh -p
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
|
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22
23 23 #
24 24 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 27
28 28 #
29 -# Copyright (c) 2013 by Delphix. All rights reserved.
29 +# Copyright (c) 2013, 2016 by Delphix. All rights reserved.
30 30 #
31 31
32 32 . $STF_SUITE/include/libtest.shlib
33 33 . $STF_SUITE/tests/functional/userquota/userquota_common.kshlib
34 34
35 35 #
36 36 # DESCRIPTION:
37 37 # the userquota and groupquota will not change during zfs actions, such as
38 38 # snapshot,clone,rename,upgrade,send,receive.
39 39 #
40 40 #
41 41 # STRATEGY:
42 42 # 1. Create a pool, and create fs with preset user,group quota
|
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
43 43 # 2. Check set user|group quota via zfs snapshot|clone|list -o
44 44 # 3. Check the user|group quota can not change during zfs rename|upgrade|promote
45 45 # 4. Check the user|group quota can not change during zfs clone
46 46 # 5. Check the user|group quota can not change during zfs send/receive
47 47 #
48 48
49 49 function cleanup
50 50 {
51 51 for ds in $TESTPOOL/fs $TESTPOOL/fs-rename $TESTPOOL/fs-clone; do
52 52 if datasetexists $ds; then
53 - log_must $ZFS destroy -rRf $ds
53 + log_must zfs destroy -rRf $ds
54 54 fi
55 55 done
56 56 }
57 57
58 58 log_onexit cleanup
59 59
60 60 log_assert \
61 61 "the userquota and groupquota can't change during zfs actions"
62 62
63 63 cleanup
64 64
65 -log_must $ZFS create -o userquota@$QUSER1=$UQUOTA_SIZE \
65 +log_must zfs create -o userquota@$QUSER1=$UQUOTA_SIZE \
66 66 -o groupquota@$QGROUP=$GQUOTA_SIZE $TESTPOOL/fs
67 67
68 -log_must $ZFS snapshot $TESTPOOL/fs@snap
69 -log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
68 +log_must zfs snapshot $TESTPOOL/fs@snap
69 +log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
70 70 $TESTPOOL >/dev/null 2>&1"
71 71
72 72 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs@snap "$UQUOTA_SIZE"
73 73 log_must check_quota "groupquota@$QGROUP" $TESTPOOL/fs@snap "$GQUOTA_SIZE"
74 74
75 75
76 76 log_note "clone fs gets its parent's userquota/groupquota initially"
77 -log_must $ZFS clone -o userquota@$QUSER1=$UQUOTA_SIZE \
77 +log_must zfs clone -o userquota@$QUSER1=$UQUOTA_SIZE \
78 78 -o groupquota@$QGROUP=$GQUOTA_SIZE \
79 79 $TESTPOOL/fs@snap $TESTPOOL/fs-clone
80 80
81 -log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
81 +log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
82 82 $TESTPOOL >/dev/null 2>&1"
83 83
84 84 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs-clone "$UQUOTA_SIZE"
85 85 log_must check_quota "groupquota@$QGROUP" $TESTPOOL/fs-clone "$GQUOTA_SIZE"
86 86
87 -log_must eval "$ZFS list -o userquota@$QUSER1,groupquota@$QGROUP \
87 +log_must eval "zfs list -o userquota@$QUSER1,groupquota@$QGROUP \
88 88 $TESTPOOL/fs-clone >/dev/null 2>&1"
89 89
90 90 log_note "zfs promote can not change the previously set user|group quota"
91 -log_must $ZFS promote $TESTPOOL/fs-clone
91 +log_must zfs promote $TESTPOOL/fs-clone
92 92
93 -log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
93 +log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
94 94 $TESTPOOL >/dev/null 2>&1"
95 95
96 96 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs-clone "$UQUOTA_SIZE"
97 97 log_must check_quota "groupquota@$QGROUP" $TESTPOOL/fs-clone "$GQUOTA_SIZE"
98 98
99 99 log_note "zfs send receive can not change the previously set user|group quota"
100 -log_must $ZFS send $TESTPOOL/fs-clone@snap | $ZFS receive $TESTPOOL/fs-rev
100 +log_must zfs send $TESTPOOL/fs-clone@snap | zfs receive $TESTPOOL/fs-rev
101 101
102 -log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
102 +log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
103 103 $TESTPOOL >/dev/null 2>&1"
104 104
105 105 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs-rev "$UQUOTA_SIZE"
106 106 log_must check_quota "groupquota@$QGROUP" $TESTPOOL/fs-rev "$GQUOTA_SIZE"
107 107
108 108 log_note "zfs rename can not change the previously set user|group quota"
109 -log_must $ZFS rename $TESTPOOL/fs-rev $TESTPOOL/fs-rename
109 +log_must zfs rename $TESTPOOL/fs-rev $TESTPOOL/fs-rename
110 110
111 -log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
111 +log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
112 112 $TESTPOOL >/dev/null 2>&1"
113 113
114 114 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs-rename "$UQUOTA_SIZE"
115 115 log_must check_quota "groupquota@$QGROUP" $TESTPOOL/fs-rename "$GQUOTA_SIZE"
116 116
117 117 log_note "zfs upgrade can not change the previously set user|group quota"
118 -log_must $ZFS upgrade $TESTPOOL/fs-rename
118 +log_must zfs upgrade $TESTPOOL/fs-rename
119 119
120 -log_must eval "$ZFS list -r -o userquota@$QUSER1,groupquota@$QGROUP \
120 +log_must eval "zfs list -r -o userquota@$QUSER1,groupquota@$QGROUP \
121 121 $TESTPOOL >/dev/null 2>&1"
122 122
123 123 log_must check_quota "userquota@$QUSER1" $TESTPOOL/fs-rename "$UQUOTA_SIZE"
124 124 log_must check_quota "groupquota@$QGROUP" $TESTPOOL/fs-rename "$GQUOTA_SIZE"
125 125
126 126 log_pass \
127 127 "the userquota and groupquota can't change during zfs actions"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX