]> git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/online_offline/online_offline_003_neg.ksh
OpenZFS 7104 - increase indirect block size
[mirror_zfs.git] / tests / zfs-tests / tests / functional / online_offline / online_offline_003_neg.ksh
1 #!/bin/ksh -p
2 #
3 # CDDL HEADER START
4 #
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.
8 #
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.
13 #
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]
19 #
20 # CDDL HEADER END
21 #
22
23 #
24 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
26 #
27
28 #
29 # Copyright (c) 2013, 2015 by Delphix. All rights reserved.
30 #
31
32 . $STF_SUITE/include/libtest.shlib
33
34 #
35 # DESCRIPTION:
36 # Offlining disks in a non-redundant pool should fail.
37 #
38 # STRATEGY:
39 # 1. Create a multidisk stripe and start some random I/O
40 # 2. zpool offline should fail on each disk.
41 #
42
43 verify_runnable "global"
44
45 function cleanup
46 {
47 if poolexists $TESTPOOL1; then
48 destroy_pool $TESTPOOL1
49 fi
50
51 $KILL $killpid >/dev/null 2>&1
52 [[ -e $TESTDIR ]] && log_must $RM -rf $TESTDIR/*
53 }
54
55 log_assert "Offlining disks in a non-redundant pool should fail."
56
57 log_onexit cleanup
58
59 specials_list=""
60 for i in 0 1 2; do
61 $MKFILE $MINVDEVSIZE $TESTDIR/$TESTFILE1.$i
62 specials_list="$specials_list $TESTDIR/$TESTFILE1.$i"
63 done
64 disk=($specials_list)
65
66 create_pool $TESTPOOL1 $specials_list
67 log_must $ZFS create $TESTPOOL1/$TESTFS1
68 log_must $ZFS set mountpoint=$TESTDIR1 $TESTPOOL1/$TESTFS1
69
70 $FILE_TRUNC -f $((64 * 1024 * 1024)) -b 8192 -c 0 -r $TESTDIR/$TESTFILE1 &
71 typeset killpid="$! "
72
73 for i in 0 1 2; do
74 log_mustnot $ZPOOL offline $TESTPOOL1 ${disk[$i]}
75 check_state $TESTPOOL1 ${disk[$i]} "online"
76 done
77
78 log_must $KILL $killpid
79 $SYNC
80
81 log_pass