1# CDDL HEADER START
2#
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.
6#
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.
11#
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]
17#
18# CDDL HEADER END
19#
20
21#
22# Copyright 2012 Spectra Logic.  All rights reserved.
23# Use is subject to license terms.
24#
25
26
27atf_test_case zinject_001_pos cleanup
28zinject_001_pos_head()
29{
30	atf_set "descr" "Verify fault inject handle content error successfully."
31	atf_set "require.progs" "ksh93 zfs zpool"
32	atf_set "timeout" 1800
33}
34zinject_001_pos_body()
35{
36	. $(atf_get_srcdir)/../../include/default.cfg
37	. $(atf_get_srcdir)/zinject.kshlib
38	. $(atf_get_srcdir)/zinject.cfg
39
40	ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed"
41	ksh93 $(atf_get_srcdir)/zinject_001_pos.ksh || atf_fail "Testcase failed"
42}
43zinject_001_pos_cleanup()
44{
45	. $(atf_get_srcdir)/../../include/default.cfg
46	. $(atf_get_srcdir)/zinject.kshlib
47	. $(atf_get_srcdir)/zinject.cfg
48
49	ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed"
50}
51
52
53atf_test_case zinject_002_pos cleanup
54zinject_002_pos_head()
55{
56	atf_set "descr" "Verify fault inject handle metadnode error successfully."
57	atf_set "require.progs" "ksh93 zfs zpool"
58	atf_set "timeout" 1800
59}
60zinject_002_pos_body()
61{
62	. $(atf_get_srcdir)/../../include/default.cfg
63	. $(atf_get_srcdir)/zinject.kshlib
64	. $(atf_get_srcdir)/zinject.cfg
65
66	ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed"
67	ksh93 $(atf_get_srcdir)/zinject_002_pos.ksh || atf_fail "Testcase failed"
68}
69zinject_002_pos_cleanup()
70{
71	. $(atf_get_srcdir)/../../include/default.cfg
72	. $(atf_get_srcdir)/zinject.kshlib
73	. $(atf_get_srcdir)/zinject.cfg
74
75	ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed"
76}
77
78
79atf_test_case zinject_003_pos cleanup
80zinject_003_pos_head()
81{
82	atf_set "descr" "Verify fault inject handle into first metadnodecause filesystem unmountable."
83	atf_set "require.progs" "ksh93 zfs zpool"
84	atf_set "timeout" 1800
85}
86zinject_003_pos_body()
87{
88	. $(atf_get_srcdir)/../../include/default.cfg
89	. $(atf_get_srcdir)/zinject.kshlib
90	. $(atf_get_srcdir)/zinject.cfg
91
92	ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed"
93	ksh93 $(atf_get_srcdir)/zinject_003_pos.ksh || atf_fail "Testcase failed"
94}
95zinject_003_pos_cleanup()
96{
97	. $(atf_get_srcdir)/../../include/default.cfg
98	. $(atf_get_srcdir)/zinject.kshlib
99	. $(atf_get_srcdir)/zinject.cfg
100
101	ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed"
102}
103
104
105atf_test_case zinject_004_pos cleanup
106zinject_004_pos_head()
107{
108	atf_set "descr" "Verify fault inject handle device error successfully."
109	atf_set "require.progs" "ksh93 zfs zpool"
110	atf_set "timeout" 1800
111}
112zinject_004_pos_body()
113{
114	. $(atf_get_srcdir)/../../include/default.cfg
115	. $(atf_get_srcdir)/zinject.kshlib
116	. $(atf_get_srcdir)/zinject.cfg
117
118	ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed"
119	ksh93 $(atf_get_srcdir)/zinject_004_pos.ksh || atf_fail "Testcase failed"
120}
121zinject_004_pos_cleanup()
122{
123	. $(atf_get_srcdir)/../../include/default.cfg
124	. $(atf_get_srcdir)/zinject.kshlib
125	. $(atf_get_srcdir)/zinject.cfg
126
127	ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed"
128}
129
130
131atf_init_test_cases()
132{
133
134	atf_add_test_case zinject_001_pos
135	atf_add_test_case zinject_002_pos
136	atf_add_test_case zinject_003_pos
137	atf_add_test_case zinject_004_pos
138}
139