3 # The contents of this file are subject to the terms of the
4 # Common Development and Distribution License (the "License").
5 # You may not use this file except in compliance with the License.
7 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8 # or http://www.opensolaris.org/os/licensing.
9 # See the License for the specific language governing permissions
10 # and limitations under the License.
12 # When distributing Covered Code, include this CDDL HEADER in each
13 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14 # If applicable, add the following below this CDDL HEADER, with the
15 # fields enclosed by brackets "[]" replaced with your own identifying
16 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright 2012 Spectra Logic. All rights reserved.
25 # Use is subject to license terms.
29 atf_test_case zpool_clear_001_pos cleanup
30 zpool_clear_001_pos_head()
32 atf_set "descr" "Verify 'zpool clear' can clear errors of a storage pool."
33 atf_set "require.progs" zpool zfs
34 atf_set "timeout" 2100
36 zpool_clear_001_pos_body()
38 . $(atf_get_srcdir)/../../../include/default.cfg
39 . $(atf_get_srcdir)/zpool_clear.cfg
41 ksh93 $(atf_get_srcdir)/zpool_clear_001_pos.ksh || atf_fail "Testcase failed"
43 zpool_clear_001_pos_cleanup()
45 . $(atf_get_srcdir)/../../../include/default.cfg
46 . $(atf_get_srcdir)/zpool_clear.cfg
48 ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed"
52 atf_test_case zpool_clear_002_neg cleanup
53 zpool_clear_002_neg_head()
55 atf_set "descr" "Execute 'zpool clear' using invalid parameters."
56 atf_set "require.progs" zpool
57 atf_set "timeout" 2100
59 zpool_clear_002_neg_body()
61 . $(atf_get_srcdir)/../../../include/default.cfg
62 . $(atf_get_srcdir)/zpool_clear.cfg
64 ksh93 $(atf_get_srcdir)/zpool_clear_002_neg.ksh || atf_fail "Testcase failed"
66 zpool_clear_002_neg_cleanup()
68 . $(atf_get_srcdir)/../../../include/default.cfg
69 . $(atf_get_srcdir)/zpool_clear.cfg
71 ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed"
75 atf_test_case zpool_clear_003_neg cleanup
76 zpool_clear_003_neg_head()
78 atf_set "descr" "Verify 'zpool clear' cannot clear error for available spare devices."
79 atf_set "require.progs" zpool
80 atf_set "timeout" 2100
82 zpool_clear_003_neg_body()
84 . $(atf_get_srcdir)/../../../include/default.cfg
85 . $(atf_get_srcdir)/zpool_clear.cfg
87 ksh93 $(atf_get_srcdir)/zpool_clear_003_neg.ksh || atf_fail "Testcase failed"
89 zpool_clear_003_neg_cleanup()
91 . $(atf_get_srcdir)/../../../include/default.cfg
92 . $(atf_get_srcdir)/zpool_clear.cfg
94 ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed"
97 atf_test_case zpool_clear_004_pos cleanup
98 zpool_clear_004_pos_head()
100 atf_set "descr" "Verify 'zpool clear' can work on spare vdevs"
101 atf_set "require.progs" zpool
102 atf_set "timeout" 2100
104 zpool_clear_004_pos_body()
106 . $(atf_get_srcdir)/../../../include/default.cfg
107 . $(atf_get_srcdir)/zpool_clear.cfg
109 ksh93 $(atf_get_srcdir)/zpool_clear_004_pos.ksh || atf_fail "Testcase failed"
111 zpool_clear_004_pos_cleanup()
113 . $(atf_get_srcdir)/../../../include/default.cfg
114 . $(atf_get_srcdir)/zpool_clear.cfg
116 ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed"
119 atf_test_case zpool_clear_005_pos cleanup
120 zpool_clear_005_pos_head()
122 atf_set "descr" "'zpool clear' can online an UNAVAIL pool after all vdevs have reappeared"
123 atf_set "require.progs" gnop zpool
125 zpool_clear_005_pos_body()
127 atf_skip "Fails on OpenZFS, causing eventual deadlock. PR tests/248910"
128 . $(atf_get_srcdir)/../../../include/default.cfg
129 . $(atf_get_srcdir)/zpool_clear.cfg
131 verify_disk_count "$DISKS" 3
132 ksh93 $(atf_get_srcdir)/zpool_clear_005_pos.ksh || atf_fail "Testcase failed"
134 zpool_clear_005_pos_cleanup()
136 . $(atf_get_srcdir)/../../../include/default.cfg
137 . $(atf_get_srcdir)/zpool_clear.cfg
139 ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed"
144 atf_init_test_cases()
147 atf_add_test_case zpool_clear_001_pos
148 atf_add_test_case zpool_clear_002_neg
149 atf_add_test_case zpool_clear_003_neg
150 atf_add_test_case zpool_clear_004_pos
151 atf_add_test_case zpool_clear_005_pos