Print this page
NEX-3974 Remove timing issues so the robot can run consistently
Reviewed by: Steve Peng <steve.peng@nexenta.com>
Reviewed by: Josef Sipek <josef.sipek@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_006_pos.ksh
+++ new/usr/src/test/zfs-tests/tests/functional/bootfs/bootfs_006_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]
19 19 #
|
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
20 20 # CDDL HEADER END
21 21 #
22 22
23 23 #
24 24 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 27
28 28 #
29 29 # Copyright (c) 2012, 2016 by Delphix. All rights reserved.
30 +# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
30 31 #
31 32
32 33 . $STF_SUITE/include/libtest.shlib
33 34
34 35 #
35 36 # DESCRIPTION:
36 37 #
37 38 # Pools of correct vdev types accept boot property
38 39 #
39 40 # STRATEGY:
40 41 # 1. create pools of each vdev type (raid, raidz, raidz2, mirror + hotspares)
41 42 # 2. verify we can set bootfs on each pool type according to design
42 43 #
43 44
44 45 verify_runnable "global"
45 46
46 47
47 48 zpool set 2>&1 | grep bootfs > /dev/null
48 49 if [ $? -ne 0 ]
49 50 then
50 51 log_unsupported "bootfs pool property not supported on this release."
51 52 fi
52 53
53 54 VDEV1=/bootfs_006_pos_a.$$.dat
54 55 VDEV2=/bootfs_006_pos_b.$$.dat
55 56 VDEV3=/bootfs_006_pos_c.$$.dat
56 57 VDEV4=/bootfs_006_pos_d.$$.dat
57 58
58 59 function verify_bootfs { # $POOL
59 60 POOL=$1
|
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
60 61 log_must zfs create $POOL/$TESTFS
61 62
62 63 log_must zpool set bootfs=$POOL/$TESTFS $POOL
63 64 VAL=$(zpool get bootfs $POOL | tail -1 | awk '{print $3}' )
64 65 if [ $VAL != "$POOL/$TESTFS" ]
65 66 then
66 67 log_must zpool status -v $POOL
67 68 log_fail \
68 69 "set/get failed on $POOL - expected $VAL == $POOL/$TESTFS"
69 70 fi
70 - log_must zpool destroy $POOL
71 + log_must destroy_pool_no_force $POOL
71 72 }
72 73
73 74 function verify_no_bootfs { # $POOL
74 75 POOL=$1
75 76 log_must zfs create $POOL/$TESTFS
76 77 log_mustnot zpool set bootfs=$POOL/$TESTFS $POOL
77 78 VAL=$(zpool get bootfs $POOL | tail -1 | awk '{print $3}' )
78 79 if [ $VAL == "$POOL/$TESTFS" ]
79 80 then
80 81 log_must zpool status -v $POOL
81 82 log_fail "set/get unexpectedly failed $VAL != $POOL/$TESTFS"
82 83 fi
83 - log_must zpool destroy $POOL
84 + log_must destroy_pool_no_force $POOL
84 85 }
85 86
86 87 function cleanup {
87 88 if poolexists $TESTPOOL
88 89 then
89 - log_must zpool destroy $TESTPOOL
90 + log_must destroy_pool_no_force $TESTPOOL
90 91 fi
91 92 log_must rm $VDEV1 $VDEV2 $VDEV3 $VDEV4
92 93 }
93 94
94 95 log_assert "Pools of correct vdev types accept boot property"
95 96
96 97
97 98
98 99 log_onexit cleanup
99 100 log_must mkfile $MINVDEVSIZE $VDEV1 $VDEV2 $VDEV3 $VDEV4
100 101
101 102
102 103 ## the following configurations are supported bootable pools
103 104
104 105 # normal
105 106 log_must zpool create $TESTPOOL $VDEV1
106 107 verify_bootfs $TESTPOOL
107 108
108 109 # normal + hotspare
109 110 log_must zpool create $TESTPOOL $VDEV1 spare $VDEV2
110 111 verify_bootfs $TESTPOOL
111 112
112 113 # mirror
113 114 log_must zpool create $TESTPOOL mirror $VDEV1 $VDEV2
114 115 verify_bootfs $TESTPOOL
115 116
116 117 # mirror + hotspare
117 118 log_must zpool create $TESTPOOL mirror $VDEV1 $VDEV2 spare $VDEV3
118 119 verify_bootfs $TESTPOOL
119 120
120 121 ## the following configurations are not supported as bootable pools
121 122
122 123 # stripe
123 124 log_must zpool create $TESTPOOL $VDEV1 $VDEV2
124 125 verify_no_bootfs $TESTPOOL
125 126
126 127 # stripe + hotspare
127 128 log_must zpool create $TESTPOOL $VDEV1 $VDEV2 spare $VDEV3
128 129 verify_no_bootfs $TESTPOOL
129 130
130 131 # raidz
131 132 log_must zpool create $TESTPOOL raidz $VDEV1 $VDEV2
132 133 verify_bootfs $TESTPOOL
133 134
134 135 # raidz + hotspare
135 136 log_must zpool create $TESTPOOL raidz $VDEV1 $VDEV2 spare $VDEV3
136 137 verify_bootfs $TESTPOOL
137 138
138 139 # raidz2
139 140 log_must zpool create $TESTPOOL raidz2 $VDEV1 $VDEV2 $VDEV3
140 141 verify_bootfs $TESTPOOL
141 142
142 143 # raidz2 + hotspare
143 144 log_must zpool create $TESTPOOL raidz2 $VDEV1 $VDEV2 $VDEV3 spare $VDEV4
144 145 verify_bootfs $TESTPOOL
145 146
146 147 log_pass "Pools of correct vdev types accept boot property"
|
↓ open down ↓ |
47 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX