1#!/bin/sh 2 3dir=`dirname $0` 4. ${dir}/../../misc.sh 5 6echo "1..100" 7 8disks_create 7 9files_create 7 10names_create 1 11 12expect_ok ${ZPOOL} create ${name0} ${disk0} 13expect_fl ${ZPOOL} add ${name0} ${file0} 14exp=`( 15 echo " pool: ${name0}" 16 echo " state: ONLINE" 17 echo " scrub: none requested" 18 echo "config:" 19 echo " NAME STATE READ WRITE CKSUM" 20 echo " ${name0} ONLINE 0 0 0" 21 echo " ${disk0} ONLINE 0 0 0" 22 echo "errors: No known data errors" 23)` 24expect "${exp}" ${ZPOOL} status ${name0} 25expect_ok ${ZPOOL} destroy ${name0} 26expect_fl ${ZPOOL} status -x ${name0} 27 28expect_ok ${ZPOOL} create ${name0} ${disk0} 29expect_ok ${ZPOOL} add -f ${name0} ${file0} 30exp=`( 31 echo " pool: ${name0}" 32 echo " state: ONLINE" 33 echo " scrub: none requested" 34 echo "config:" 35 echo " NAME STATE READ WRITE CKSUM" 36 echo " ${name0} ONLINE 0 0 0" 37 echo " ${disk0} ONLINE 0 0 0" 38 echo " ${file0} ONLINE 0 0 0" 39 echo "errors: No known data errors" 40)` 41expect "${exp}" ${ZPOOL} status ${name0} 42expect_ok ${ZPOOL} destroy ${name0} 43expect_fl ${ZPOOL} status -x ${name0} 44 45expect_ok ${ZPOOL} create ${name0} ${file0} 46expect_fl ${ZPOOL} add ${name0} ${disk0} 47exp=`( 48 echo " pool: ${name0}" 49 echo " state: ONLINE" 50 echo " scrub: none requested" 51 echo "config:" 52 echo " NAME STATE READ WRITE CKSUM" 53 echo " ${name0} ONLINE 0 0 0" 54 echo " ${file0} ONLINE 0 0 0" 55 echo "errors: No known data errors" 56)` 57expect "${exp}" ${ZPOOL} status ${name0} 58expect_ok ${ZPOOL} destroy ${name0} 59expect_fl ${ZPOOL} status -x ${name0} 60 61expect_ok ${ZPOOL} create ${name0} ${file0} 62expect_ok ${ZPOOL} add -f ${name0} ${disk0} 63exp=`( 64 echo " pool: ${name0}" 65 echo " state: ONLINE" 66 echo " scrub: none requested" 67 echo "config:" 68 echo " NAME STATE READ WRITE CKSUM" 69 echo " ${name0} ONLINE 0 0 0" 70 echo " ${file0} ONLINE 0 0 0" 71 echo " ${disk0} ONLINE 0 0 0" 72 echo "errors: No known data errors" 73)` 74expect "${exp}" ${ZPOOL} status ${name0} 75expect_ok ${ZPOOL} destroy ${name0} 76expect_fl ${ZPOOL} status -x ${name0} 77 78expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} 79expect_fl ${ZPOOL} add ${name0} mirror ${disk2} ${file0} 80exp=`( 81 echo " pool: ${name0}" 82 echo " state: ONLINE" 83 echo " scrub: none requested" 84 echo "config:" 85 echo " NAME STATE READ WRITE CKSUM" 86 echo " ${name0} ONLINE 0 0 0" 87 echo " mirror ONLINE 0 0 0" 88 echo " ${disk0} ONLINE 0 0 0" 89 echo " ${disk1} ONLINE 0 0 0" 90 echo "errors: No known data errors" 91)` 92expect "${exp}" ${ZPOOL} status ${name0} 93expect_ok ${ZPOOL} destroy ${name0} 94expect_fl ${ZPOOL} status -x ${name0} 95 96expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1} 97expect_ok ${ZPOOL} add -f ${name0} mirror ${disk2} ${file0} 98exp=`( 99 echo " pool: ${name0}" 100 echo " state: ONLINE" 101 echo " scrub: none requested" 102 echo "config:" 103 echo " NAME STATE READ WRITE CKSUM" 104 echo " ${name0} ONLINE 0 0 0" 105 echo " mirror ONLINE 0 0 0" 106 echo " ${disk0} ONLINE 0 0 0" 107 echo " ${disk1} ONLINE 0 0 0" 108 echo " mirror ONLINE 0 0 0" 109 echo " ${disk2} ONLINE 0 0 0" 110 echo " ${file0} ONLINE 0 0 0" 111 echo "errors: No known data errors" 112)` 113expect "${exp}" ${ZPOOL} status ${name0} 114expect_ok ${ZPOOL} destroy ${name0} 115expect_fl ${ZPOOL} status -x ${name0} 116 117expect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1} 118expect_fl ${ZPOOL} add ${name0} mirror ${disk0} ${file2} 119exp=`( 120 echo " pool: ${name0}" 121 echo " state: ONLINE" 122 echo " scrub: none requested" 123 echo "config:" 124 echo " NAME STATE READ WRITE CKSUM" 125 echo " ${name0} ONLINE 0 0 0" 126 echo " mirror ONLINE 0 0 0" 127 echo " ${file0} ONLINE 0 0 0" 128 echo " ${file1} ONLINE 0 0 0" 129 echo "errors: No known data errors" 130)` 131expect "${exp}" ${ZPOOL} status ${name0} 132expect_ok ${ZPOOL} destroy ${name0} 133expect_fl ${ZPOOL} status -x ${name0} 134 135expect_ok ${ZPOOL} create ${name0} mirror ${file0} ${file1} 136expect_ok ${ZPOOL} add -f ${name0} mirror ${disk0} ${file2} 137exp=`( 138 echo " pool: ${name0}" 139 echo " state: ONLINE" 140 echo " scrub: none requested" 141 echo "config:" 142 echo " NAME STATE READ WRITE CKSUM" 143 echo " ${name0} ONLINE 0 0 0" 144 echo " mirror ONLINE 0 0 0" 145 echo " ${file0} ONLINE 0 0 0" 146 echo " ${file1} ONLINE 0 0 0" 147 echo " mirror ONLINE 0 0 0" 148 echo " ${disk0} ONLINE 0 0 0" 149 echo " ${file2} ONLINE 0 0 0" 150 echo "errors: No known data errors" 151)` 152expect "${exp}" ${ZPOOL} status ${name0} 153expect_ok ${ZPOOL} destroy ${name0} 154expect_fl ${ZPOOL} status -x ${name0} 155 156expect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2} 157expect_fl ${ZPOOL} add ${name0} raidz1 ${disk3} ${file0} ${disk4} 158exp=`( 159 echo " pool: ${name0}" 160 echo " state: ONLINE" 161 echo " scrub: none requested" 162 echo "config:" 163 echo " NAME STATE READ WRITE CKSUM" 164 echo " ${name0} ONLINE 0 0 0" 165 echo " raidz1 ONLINE 0 0 0" 166 echo " ${disk0} ONLINE 0 0 0" 167 echo " ${disk1} ONLINE 0 0 0" 168 echo " ${disk2} ONLINE 0 0 0" 169 echo "errors: No known data errors" 170)` 171expect "${exp}" ${ZPOOL} status ${name0} 172expect_ok ${ZPOOL} destroy ${name0} 173expect_fl ${ZPOOL} status -x ${name0} 174 175expect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2} 176expect_ok ${ZPOOL} add -f ${name0} raidz1 ${disk3} ${file0} ${disk4} 177exp=`( 178 echo " pool: ${name0}" 179 echo " state: ONLINE" 180 echo " scrub: none requested" 181 echo "config:" 182 echo " NAME STATE READ WRITE CKSUM" 183 echo " ${name0} ONLINE 0 0 0" 184 echo " raidz1 ONLINE 0 0 0" 185 echo " ${disk0} ONLINE 0 0 0" 186 echo " ${disk1} ONLINE 0 0 0" 187 echo " ${disk2} ONLINE 0 0 0" 188 echo " raidz1 ONLINE 0 0 0" 189 echo " ${disk3} ONLINE 0 0 0" 190 echo " ${file0} ONLINE 0 0 0" 191 echo " ${disk4} ONLINE 0 0 0" 192 echo "errors: No known data errors" 193)` 194expect "${exp}" ${ZPOOL} status ${name0} 195expect_ok ${ZPOOL} destroy ${name0} 196expect_fl ${ZPOOL} status -x ${name0} 197 198expect_ok ${ZPOOL} create ${name0} raidz1 ${file0} ${file1} ${file2} 199expect_fl ${ZPOOL} add ${name0} raidz1 ${file3} ${disk0} ${file4} 200exp=`( 201 echo " pool: ${name0}" 202 echo " state: ONLINE" 203 echo " scrub: none requested" 204 echo "config:" 205 echo " NAME STATE READ WRITE CKSUM" 206 echo " ${name0} ONLINE 0 0 0" 207 echo " raidz1 ONLINE 0 0 0" 208 echo " ${file0} ONLINE 0 0 0" 209 echo " ${file1} ONLINE 0 0 0" 210 echo " ${file2} ONLINE 0 0 0" 211 echo "errors: No known data errors" 212)` 213expect "${exp}" ${ZPOOL} status ${name0} 214expect_ok ${ZPOOL} destroy ${name0} 215expect_fl ${ZPOOL} status -x ${name0} 216 217expect_ok ${ZPOOL} create ${name0} raidz1 ${file0} ${file1} ${file2} 218expect_ok ${ZPOOL} add -f ${name0} raidz1 ${file3} ${disk0} ${file4} 219exp=`( 220 echo " pool: ${name0}" 221 echo " state: ONLINE" 222 echo " scrub: none requested" 223 echo "config:" 224 echo " NAME STATE READ WRITE CKSUM" 225 echo " ${name0} ONLINE 0 0 0" 226 echo " raidz1 ONLINE 0 0 0" 227 echo " ${file0} ONLINE 0 0 0" 228 echo " ${file1} ONLINE 0 0 0" 229 echo " ${file2} ONLINE 0 0 0" 230 echo " raidz1 ONLINE 0 0 0" 231 echo " ${file3} ONLINE 0 0 0" 232 echo " ${disk0} ONLINE 0 0 0" 233 echo " ${file4} ONLINE 0 0 0" 234 echo "errors: No known data errors" 235)` 236expect "${exp}" ${ZPOOL} status ${name0} 237expect_ok ${ZPOOL} destroy ${name0} 238expect_fl ${ZPOOL} status -x ${name0} 239 240expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3} 241expect_fl ${ZPOOL} add ${name0} raidz2 ${disk4} ${file0} ${disk5} ${disk6} 242exp=`( 243 echo " pool: ${name0}" 244 echo " state: ONLINE" 245 echo " scrub: none requested" 246 echo "config:" 247 echo " NAME STATE READ WRITE CKSUM" 248 echo " ${name0} ONLINE 0 0 0" 249 echo " raidz2 ONLINE 0 0 0" 250 echo " ${disk0} ONLINE 0 0 0" 251 echo " ${disk1} ONLINE 0 0 0" 252 echo " ${disk2} ONLINE 0 0 0" 253 echo " ${disk3} ONLINE 0 0 0" 254 echo "errors: No known data errors" 255)` 256expect "${exp}" ${ZPOOL} status ${name0} 257expect_ok ${ZPOOL} destroy ${name0} 258expect_fl ${ZPOOL} status -x ${name0} 259 260expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3} 261expect_ok ${ZPOOL} add -f ${name0} raidz2 ${disk4} ${file0} ${disk5} ${disk6} 262exp=`( 263 echo " pool: ${name0}" 264 echo " state: ONLINE" 265 echo " scrub: none requested" 266 echo "config:" 267 echo " NAME STATE READ WRITE CKSUM" 268 echo " ${name0} ONLINE 0 0 0" 269 echo " raidz2 ONLINE 0 0 0" 270 echo " ${disk0} ONLINE 0 0 0" 271 echo " ${disk1} ONLINE 0 0 0" 272 echo " ${disk2} ONLINE 0 0 0" 273 echo " ${disk3} ONLINE 0 0 0" 274 echo " raidz2 ONLINE 0 0 0" 275 echo " ${disk4} ONLINE 0 0 0" 276 echo " ${file0} ONLINE 0 0 0" 277 echo " ${disk5} ONLINE 0 0 0" 278 echo " ${disk6} ONLINE 0 0 0" 279 echo "errors: No known data errors" 280)` 281expect "${exp}" ${ZPOOL} status ${name0} 282expect_ok ${ZPOOL} destroy ${name0} 283expect_fl ${ZPOOL} status -x ${name0} 284 285expect_ok ${ZPOOL} create ${name0} raidz2 ${file0} ${file1} ${file2} ${file3} 286expect_fl ${ZPOOL} add ${name0} raidz2 ${file4} ${disk0} ${file5} ${file6} 287exp=`( 288 echo " pool: ${name0}" 289 echo " state: ONLINE" 290 echo " scrub: none requested" 291 echo "config:" 292 echo " NAME STATE READ WRITE CKSUM" 293 echo " ${name0} ONLINE 0 0 0" 294 echo " raidz2 ONLINE 0 0 0" 295 echo " ${file0} ONLINE 0 0 0" 296 echo " ${file1} ONLINE 0 0 0" 297 echo " ${file2} ONLINE 0 0 0" 298 echo " ${file3} ONLINE 0 0 0" 299 echo "errors: No known data errors" 300)` 301expect "${exp}" ${ZPOOL} status ${name0} 302expect_ok ${ZPOOL} destroy ${name0} 303expect_fl ${ZPOOL} status -x ${name0} 304 305expect_ok ${ZPOOL} create ${name0} raidz2 ${file0} ${file1} ${file2} ${file3} 306expect_ok ${ZPOOL} add -f ${name0} raidz2 ${file4} ${disk0} ${file5} ${file6} 307exp=`( 308 echo " pool: ${name0}" 309 echo " state: ONLINE" 310 echo " scrub: none requested" 311 echo "config:" 312 echo " NAME STATE READ WRITE CKSUM" 313 echo " ${name0} ONLINE 0 0 0" 314 echo " raidz2 ONLINE 0 0 0" 315 echo " ${file0} ONLINE 0 0 0" 316 echo " ${file1} ONLINE 0 0 0" 317 echo " ${file2} ONLINE 0 0 0" 318 echo " ${file3} ONLINE 0 0 0" 319 echo " raidz2 ONLINE 0 0 0" 320 echo " ${file4} ONLINE 0 0 0" 321 echo " ${disk0} ONLINE 0 0 0" 322 echo " ${file5} ONLINE 0 0 0" 323 echo " ${file6} ONLINE 0 0 0" 324 echo "errors: No known data errors" 325)` 326expect "${exp}" ${ZPOOL} status ${name0} 327expect_ok ${ZPOOL} destroy ${name0} 328expect_fl ${ZPOOL} status -x ${name0} 329 330expect_ok ${ZPOOL} create ${name0} ${disk0} 331add_msg="# TODO Sun CR 6726091, Lustre bug 16873" 332expect_fl ${ZPOOL} add ${name0} log mirror ${disk1} ${file0} 333exp=`( 334 echo " pool: ${name0}" 335 echo " state: ONLINE" 336 echo " scrub: none requested" 337 echo "config:" 338 echo " NAME STATE READ WRITE CKSUM" 339 echo " ${name0} ONLINE 0 0 0" 340 echo " ${disk0} ONLINE 0 0 0" 341 echo "errors: No known data errors" 342)` 343expect "${exp}" ${ZPOOL} status ${name0} 344add_msg="" 345expect_ok ${ZPOOL} destroy ${name0} 346expect_fl ${ZPOOL} status -x ${name0} 347 348expect_ok ${ZPOOL} create ${name0} ${disk0} 349expect_ok ${ZPOOL} add -f ${name0} log mirror ${disk1} ${file0} 350exp=`( 351 echo " pool: ${name0}" 352 echo " state: ONLINE" 353 echo " scrub: none requested" 354 echo "config:" 355 echo " NAME STATE READ WRITE CKSUM" 356 echo " ${name0} ONLINE 0 0 0" 357 echo " ${disk0} ONLINE 0 0 0" 358 echo " logs ONLINE 0 0 0" 359 echo " mirror ONLINE 0 0 0" 360 echo " ${disk1} ONLINE 0 0 0" 361 echo " ${file0} ONLINE 0 0 0" 362 echo "errors: No known data errors" 363)` 364expect "${exp}" ${ZPOOL} status ${name0} 365expect_ok ${ZPOOL} destroy ${name0} 366expect_fl ${ZPOOL} status -x ${name0} 367 368expect_ok ${ZPOOL} create ${name0} ${file0} 369add_msg="# TODO Sun CR 6726091, Lustre bug 16873" 370expect_fl ${ZPOOL} add ${name0} log mirror ${file1} ${disk0} 371exp=`( 372 echo " pool: ${name0}" 373 echo " state: ONLINE" 374 echo " scrub: none requested" 375 echo "config:" 376 echo " NAME STATE READ WRITE CKSUM" 377 echo " ${name0} ONLINE 0 0 0" 378 echo " ${file0} ONLINE 0 0 0" 379 echo "errors: No known data errors" 380)` 381expect "${exp}" ${ZPOOL} status ${name0} 382add_msg="" 383expect_ok ${ZPOOL} destroy ${name0} 384expect_fl ${ZPOOL} status -x ${name0} 385 386expect_ok ${ZPOOL} create ${name0} ${file0} 387expect_ok ${ZPOOL} add -f ${name0} log mirror ${file1} ${disk0} 388exp=`( 389 echo " pool: ${name0}" 390 echo " state: ONLINE" 391 echo " scrub: none requested" 392 echo "config:" 393 echo " NAME STATE READ WRITE CKSUM" 394 echo " ${name0} ONLINE 0 0 0" 395 echo " ${file0} ONLINE 0 0 0" 396 echo " logs ONLINE 0 0 0" 397 echo " mirror ONLINE 0 0 0" 398 echo " ${file1} ONLINE 0 0 0" 399 echo " ${disk0} ONLINE 0 0 0" 400 echo "errors: No known data errors" 401)` 402expect "${exp}" ${ZPOOL} status ${name0} 403expect_ok ${ZPOOL} destroy ${name0} 404expect_fl ${ZPOOL} status -x ${name0} 405 406disks_destroy 407files_destroy 408