root / qa / ganeti-qa.py @ 6d4a1656
History | View | Annotate | Download (9.1 kB)
1 | a8083063 | Iustin Pop | #!/usr/bin/python
|
---|---|---|---|
2 | a8083063 | Iustin Pop | #
|
3 | a8083063 | Iustin Pop | |
4 | cec9845c | Michael Hanselmann | # Copyright (C) 2007 Google Inc.
|
5 | a8083063 | Iustin Pop | #
|
6 | a8083063 | Iustin Pop | # This program is free software; you can redistribute it and/or modify
|
7 | a8083063 | Iustin Pop | # it under the terms of the GNU General Public License as published by
|
8 | a8083063 | Iustin Pop | # the Free Software Foundation; either version 2 of the License, or
|
9 | a8083063 | Iustin Pop | # (at your option) any later version.
|
10 | a8083063 | Iustin Pop | #
|
11 | a8083063 | Iustin Pop | # This program is distributed in the hope that it will be useful, but
|
12 | a8083063 | Iustin Pop | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | a8083063 | Iustin Pop | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 | a8083063 | Iustin Pop | # General Public License for more details.
|
15 | a8083063 | Iustin Pop | #
|
16 | a8083063 | Iustin Pop | # You should have received a copy of the GNU General Public License
|
17 | a8083063 | Iustin Pop | # along with this program; if not, write to the Free Software
|
18 | a8083063 | Iustin Pop | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
19 | a8083063 | Iustin Pop | # 02110-1301, USA.
|
20 | a8083063 | Iustin Pop | |
21 | a8083063 | Iustin Pop | |
22 | cec9845c | Michael Hanselmann | """Script for doing QA on Ganeti.
|
23 | 94508060 | Michael Hanselmann |
|
24 | 94508060 | Michael Hanselmann | """
|
25 | a8083063 | Iustin Pop | |
26 | a8083063 | Iustin Pop | import sys |
27 | c68d1f43 | Michael Hanselmann | import datetime |
28 | c68d1f43 | Michael Hanselmann | import optparse |
29 | a8083063 | Iustin Pop | |
30 | cec9845c | Michael Hanselmann | import qa_cluster |
31 | cec9845c | Michael Hanselmann | import qa_config |
32 | cec9845c | Michael Hanselmann | import qa_daemon |
33 | cec9845c | Michael Hanselmann | import qa_env |
34 | cec9845c | Michael Hanselmann | import qa_instance |
35 | cec9845c | Michael Hanselmann | import qa_node |
36 | 8947cf2b | Michael Hanselmann | import qa_os |
37 | a47f574c | Oleksiy Mishchenko | import qa_rapi |
38 | d74c2ca1 | Michael Hanselmann | import qa_tags |
39 | 1672a0d1 | Michael Hanselmann | import qa_utils |
40 | a8083063 | Iustin Pop | |
41 | a8083063 | Iustin Pop | |
42 | cec9845c | Michael Hanselmann | def RunTest(fn, *args): |
43 | a8083063 | Iustin Pop | """Runs a test after printing a header.
|
44 | a8083063 | Iustin Pop |
|
45 | a8083063 | Iustin Pop | """
|
46 | cec9845c | Michael Hanselmann | if fn.__doc__:
|
47 | cec9845c | Michael Hanselmann | desc = fn.__doc__.splitlines()[0].strip()
|
48 | a8083063 | Iustin Pop | else:
|
49 | cec9845c | Michael Hanselmann | desc = '%r' % fn
|
50 | a8083063 | Iustin Pop | |
51 | c68d1f43 | Michael Hanselmann | now = str(datetime.datetime.now())
|
52 | a8083063 | Iustin Pop | |
53 | a8083063 | Iustin Pop | print
|
54 | a8083063 | Iustin Pop | print '---', now, ('-' * (55 - len(now))) |
55 | a8083063 | Iustin Pop | print desc
|
56 | a8083063 | Iustin Pop | print '-' * 60 |
57 | a8083063 | Iustin Pop | |
58 | cec9845c | Michael Hanselmann | return fn(*args)
|
59 | a8083063 | Iustin Pop | |
60 | a8083063 | Iustin Pop | |
61 | b1ffe1eb | Michael Hanselmann | def RunEnvTests(): |
62 | b1ffe1eb | Michael Hanselmann | """Run several environment tests.
|
63 | a8083063 | Iustin Pop |
|
64 | a8083063 | Iustin Pop | """
|
65 | b1ffe1eb | Michael Hanselmann | if not qa_config.TestEnabled('env'): |
66 | b1ffe1eb | Michael Hanselmann | return
|
67 | a8083063 | Iustin Pop | |
68 | b1ffe1eb | Michael Hanselmann | RunTest(qa_env.TestSshConnection) |
69 | b1ffe1eb | Michael Hanselmann | RunTest(qa_env.TestIcmpPing) |
70 | b1ffe1eb | Michael Hanselmann | RunTest(qa_env.TestGanetiCommands) |
71 | a8083063 | Iustin Pop | |
72 | 94508060 | Michael Hanselmann | |
73 | b1ffe1eb | Michael Hanselmann | def SetupCluster(): |
74 | b1ffe1eb | Michael Hanselmann | """Initializes the cluster.
|
75 | a8083063 | Iustin Pop |
|
76 | b1ffe1eb | Michael Hanselmann | """
|
77 | a5b9d725 | Iustin Pop | if qa_config.TestEnabled('create-cluster'): |
78 | a5b9d725 | Iustin Pop | RunTest(qa_cluster.TestClusterInit) |
79 | a5b9d725 | Iustin Pop | RunTest(qa_node.TestNodeAddAll) |
80 | 8e671b7c | Iustin Pop | else:
|
81 | 8e671b7c | Iustin Pop | # consider the nodes are already there
|
82 | 8e671b7c | Iustin Pop | qa_node.MarkNodeAddedAll() |
83 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('node-info'): |
84 | b1ffe1eb | Michael Hanselmann | RunTest(qa_node.TestNodeInfo) |
85 | b1ffe1eb | Michael Hanselmann | |
86 | b1ffe1eb | Michael Hanselmann | |
87 | b1ffe1eb | Michael Hanselmann | def RunClusterTests(): |
88 | b1ffe1eb | Michael Hanselmann | """Runs tests related to gnt-cluster.
|
89 | 180bdd1f | Michael Hanselmann |
|
90 | b1ffe1eb | Michael Hanselmann | """
|
91 | 6d4a1656 | Michael Hanselmann | if qa_config.TestEnabled("cluster-renew-crypto"): |
92 | 6d4a1656 | Michael Hanselmann | RunTest(qa_cluster.TestClusterRenewCrypto) |
93 | 6d4a1656 | Michael Hanselmann | |
94 | cec9845c | Michael Hanselmann | if qa_config.TestEnabled('cluster-verify'): |
95 | cec9845c | Michael Hanselmann | RunTest(qa_cluster.TestClusterVerify) |
96 | e9e35aaa | Michael Hanselmann | |
97 | caea3b32 | Iustin Pop | if qa_config.TestEnabled('cluster-rename'): |
98 | caea3b32 | Iustin Pop | RunTest(qa_cluster.TestClusterRename) |
99 | caea3b32 | Iustin Pop | |
100 | cec9845c | Michael Hanselmann | if qa_config.TestEnabled('cluster-info'): |
101 | 62843684 | Michael Hanselmann | RunTest(qa_cluster.TestClusterVersion) |
102 | cec9845c | Michael Hanselmann | RunTest(qa_cluster.TestClusterInfo) |
103 | 283f9d4c | Michael Hanselmann | RunTest(qa_cluster.TestClusterGetmaster) |
104 | 283f9d4c | Michael Hanselmann | |
105 | cec9845c | Michael Hanselmann | if qa_config.TestEnabled('cluster-copyfile'): |
106 | cec9845c | Michael Hanselmann | RunTest(qa_cluster.TestClusterCopyfile) |
107 | a8083063 | Iustin Pop | |
108 | 830da270 | Michael Hanselmann | if qa_config.TestEnabled('cluster-command'): |
109 | 830da270 | Michael Hanselmann | RunTest(qa_cluster.TestClusterCommand) |
110 | 830da270 | Michael Hanselmann | |
111 | cec9845c | Michael Hanselmann | if qa_config.TestEnabled('cluster-burnin'): |
112 | cec9845c | Michael Hanselmann | RunTest(qa_cluster.TestClusterBurnin) |
113 | a8083063 | Iustin Pop | |
114 | cec9845c | Michael Hanselmann | if qa_config.TestEnabled('cluster-master-failover'): |
115 | cec9845c | Michael Hanselmann | RunTest(qa_cluster.TestClusterMasterFailover) |
116 | a8083063 | Iustin Pop | |
117 | a47f574c | Oleksiy Mishchenko | if qa_rapi.Enabled():
|
118 | a47f574c | Oleksiy Mishchenko | RunTest(qa_rapi.TestVersion) |
119 | a47f574c | Oleksiy Mishchenko | RunTest(qa_rapi.TestEmptyCluster) |
120 | 8947cf2b | Michael Hanselmann | |
121 | 6d4a1656 | Michael Hanselmann | |
122 | b1ffe1eb | Michael Hanselmann | def RunOsTests(): |
123 | b1ffe1eb | Michael Hanselmann | """Runs all tests related to gnt-os.
|
124 | 5d640672 | Michael Hanselmann |
|
125 | b1ffe1eb | Michael Hanselmann | """
|
126 | b1ffe1eb | Michael Hanselmann | if not qa_config.TestEnabled('os'): |
127 | b1ffe1eb | Michael Hanselmann | return
|
128 | b1ffe1eb | Michael Hanselmann | |
129 | b1ffe1eb | Michael Hanselmann | RunTest(qa_os.TestOsList) |
130 | b1ffe1eb | Michael Hanselmann | RunTest(qa_os.TestOsDiagnose) |
131 | b1ffe1eb | Michael Hanselmann | RunTest(qa_os.TestOsValid) |
132 | b1ffe1eb | Michael Hanselmann | RunTest(qa_os.TestOsInvalid) |
133 | b1ffe1eb | Michael Hanselmann | RunTest(qa_os.TestOsPartiallyValid) |
134 | fca11dec | Renรฉ Nussbaumer | RunTest(qa_os.TestOsModifyValid) |
135 | fca11dec | Renรฉ Nussbaumer | RunTest(qa_os.TestOsModifyInvalid) |
136 | b1ffe1eb | Michael Hanselmann | |
137 | b1ffe1eb | Michael Hanselmann | |
138 | b1ffe1eb | Michael Hanselmann | def RunCommonInstanceTests(instance): |
139 | b1ffe1eb | Michael Hanselmann | """Runs a few tests that are common to all disk types.
|
140 | b1ffe1eb | Michael Hanselmann |
|
141 | b1ffe1eb | Michael Hanselmann | """
|
142 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('instance-shutdown'): |
143 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceShutdown, instance) |
144 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceStartup, instance) |
145 | a8083063 | Iustin Pop | |
146 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('instance-list'): |
147 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceList) |
148 | 283f9d4c | Michael Hanselmann | |
149 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('instance-info'): |
150 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceInfo, instance) |
151 | e9e35aaa | Michael Hanselmann | |
152 | c0f74c55 | Iustin Pop | if qa_config.TestEnabled('instance-modify'): |
153 | c0f74c55 | Iustin Pop | RunTest(qa_instance.TestInstanceModify, instance) |
154 | c0f74c55 | Iustin Pop | |
155 | 4379b1fa | Michael Hanselmann | if qa_config.TestEnabled('instance-console'): |
156 | 4379b1fa | Michael Hanselmann | RunTest(qa_instance.TestInstanceConsole, instance) |
157 | 4379b1fa | Michael Hanselmann | |
158 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('instance-reinstall'): |
159 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceShutdown, instance) |
160 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceReinstall, instance) |
161 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceStartup, instance) |
162 | a8083063 | Iustin Pop | |
163 | 8a4e8898 | Michael Hanselmann | if qa_config.TestEnabled('instance-reboot'): |
164 | 8a4e8898 | Michael Hanselmann | RunTest(qa_instance.TestInstanceReboot, instance) |
165 | 8a4e8898 | Michael Hanselmann | |
166 | 18337ca9 | Iustin Pop | if qa_config.TestEnabled('instance-rename'): |
167 | 18337ca9 | Iustin Pop | RunTest(qa_instance.TestInstanceShutdown, instance) |
168 | 18337ca9 | Iustin Pop | RunTest(qa_instance.TestInstanceRename, instance) |
169 | 18337ca9 | Iustin Pop | RunTest(qa_instance.TestInstanceStartup, instance) |
170 | 18337ca9 | Iustin Pop | |
171 | d74c2ca1 | Michael Hanselmann | if qa_config.TestEnabled('tags'): |
172 | d74c2ca1 | Michael Hanselmann | RunTest(qa_tags.TestInstanceTags, instance) |
173 | d74c2ca1 | Michael Hanselmann | |
174 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('node-volumes'): |
175 | b1ffe1eb | Michael Hanselmann | RunTest(qa_node.TestNodeVolumes) |
176 | 23269c5b | Michael Hanselmann | |
177 | 8e1db003 | Michael Hanselmann | if qa_config.TestEnabled("node-storage"): |
178 | 8e1db003 | Michael Hanselmann | RunTest(qa_node.TestNodeStorage) |
179 | 8e1db003 | Michael Hanselmann | |
180 | a47f574c | Oleksiy Mishchenko | if qa_rapi.Enabled():
|
181 | a47f574c | Oleksiy Mishchenko | RunTest(qa_rapi.TestInstance, instance) |
182 | 23269c5b | Michael Hanselmann | |
183 | 6d4a1656 | Michael Hanselmann | |
184 | b1ffe1eb | Michael Hanselmann | def RunExportImportTests(instance, pnode): |
185 | b1ffe1eb | Michael Hanselmann | """Tries to export and import the instance.
|
186 | a8083063 | Iustin Pop |
|
187 | b1ffe1eb | Michael Hanselmann | """
|
188 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('instance-export'): |
189 | b1ffe1eb | Michael Hanselmann | expnode = qa_config.AcquireNode(exclude=pnode) |
190 | b1ffe1eb | Michael Hanselmann | try:
|
191 | b1ffe1eb | Michael Hanselmann | name = RunTest(qa_instance.TestInstanceExport, instance, expnode) |
192 | b1ffe1eb | Michael Hanselmann | |
193 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestBackupList, expnode) |
194 | b1ffe1eb | Michael Hanselmann | |
195 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('instance-import'): |
196 | b1ffe1eb | Michael Hanselmann | newinst = qa_config.AcquireInstance() |
197 | 5d640672 | Michael Hanselmann | try:
|
198 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceImport, pnode, newinst, |
199 | b1ffe1eb | Michael Hanselmann | expnode, name) |
200 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceRemove, newinst) |
201 | 5d640672 | Michael Hanselmann | finally:
|
202 | b1ffe1eb | Michael Hanselmann | qa_config.ReleaseInstance(newinst) |
203 | b1ffe1eb | Michael Hanselmann | finally:
|
204 | b1ffe1eb | Michael Hanselmann | qa_config.ReleaseNode(expnode) |
205 | 5d640672 | Michael Hanselmann | |
206 | 283f9d4c | Michael Hanselmann | |
207 | b1ffe1eb | Michael Hanselmann | def RunDaemonTests(instance, pnode): |
208 | b1ffe1eb | Michael Hanselmann | """Test the ganeti-watcher script.
|
209 | 9df6d173 | Michael Hanselmann |
|
210 | b1ffe1eb | Michael Hanselmann | """
|
211 | b1ffe1eb | Michael Hanselmann | automatic_restart = \ |
212 | b1ffe1eb | Michael Hanselmann | qa_config.TestEnabled('instance-automatic-restart')
|
213 | b1ffe1eb | Michael Hanselmann | consecutive_failures = \ |
214 | b1ffe1eb | Michael Hanselmann | qa_config.TestEnabled('instance-consecutive-failures')
|
215 | a8083063 | Iustin Pop | |
216 | b1ffe1eb | Michael Hanselmann | if automatic_restart or consecutive_failures: |
217 | b1ffe1eb | Michael Hanselmann | qa_daemon.PrintCronWarning() |
218 | 5d640672 | Michael Hanselmann | |
219 | b1ffe1eb | Michael Hanselmann | if automatic_restart:
|
220 | b1ffe1eb | Michael Hanselmann | RunTest(qa_daemon.TestInstanceAutomaticRestart, pnode, instance) |
221 | e9e35aaa | Michael Hanselmann | |
222 | b1ffe1eb | Michael Hanselmann | if consecutive_failures:
|
223 | 6623a5c1 | Michael Hanselmann | RunTest(qa_daemon.TestInstanceConsecutiveFailures, pnode, instance) |
224 | e9e35aaa | Michael Hanselmann | |
225 | 9df6d173 | Michael Hanselmann | |
226 | b1ffe1eb | Michael Hanselmann | def RunHardwareFailureTests(instance, pnode, snode): |
227 | b1ffe1eb | Michael Hanselmann | """Test cluster internal hardware failure recovery.
|
228 | a8083063 | Iustin Pop |
|
229 | b1ffe1eb | Michael Hanselmann | """
|
230 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('instance-failover'): |
231 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceFailover, instance) |
232 | b1ffe1eb | Michael Hanselmann | |
233 | 7910e7a5 | Michael Hanselmann | if qa_config.TestEnabled('instance-replace-disks'): |
234 | 76f59a32 | Michael Hanselmann | othernode = qa_config.AcquireNode(exclude=[pnode, snode]) |
235 | 7910e7a5 | Michael Hanselmann | try:
|
236 | 7910e7a5 | Michael Hanselmann | RunTest(qa_instance.TestReplaceDisks, |
237 | 7910e7a5 | Michael Hanselmann | instance, pnode, snode, othernode) |
238 | 7910e7a5 | Michael Hanselmann | finally:
|
239 | 7910e7a5 | Michael Hanselmann | qa_config.ReleaseNode(othernode) |
240 | 7910e7a5 | Michael Hanselmann | |
241 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('node-evacuate'): |
242 | b1ffe1eb | Michael Hanselmann | RunTest(qa_node.TestNodeEvacuate, pnode, snode) |
243 | b1ffe1eb | Michael Hanselmann | |
244 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('node-failover'): |
245 | b1ffe1eb | Michael Hanselmann | RunTest(qa_node.TestNodeFailover, pnode, snode) |
246 | b1ffe1eb | Michael Hanselmann | |
247 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('instance-disk-failure'): |
248 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceMasterDiskFailure, |
249 | b1ffe1eb | Michael Hanselmann | instance, pnode, snode) |
250 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceSecondaryDiskFailure, |
251 | b1ffe1eb | Michael Hanselmann | instance, pnode, snode) |
252 | b1ffe1eb | Michael Hanselmann | |
253 | b1ffe1eb | Michael Hanselmann | |
254 | b1ffe1eb | Michael Hanselmann | def main(): |
255 | b1ffe1eb | Michael Hanselmann | """Main program.
|
256 | b1ffe1eb | Michael Hanselmann |
|
257 | b1ffe1eb | Michael Hanselmann | """
|
258 | a39ec11a | Michael Hanselmann | parser = optparse.OptionParser(usage="%prog [options] <config-file>")
|
259 | b1ffe1eb | Michael Hanselmann | parser.add_option('--yes-do-it', dest='yes_do_it', |
260 | b1ffe1eb | Michael Hanselmann | action="store_true",
|
261 | b1ffe1eb | Michael Hanselmann | help="Really execute the tests")
|
262 | b1ffe1eb | Michael Hanselmann | (qa_config.options, args) = parser.parse_args() |
263 | 5d640672 | Michael Hanselmann | |
264 | a39ec11a | Michael Hanselmann | if len(args) == 1: |
265 | a39ec11a | Michael Hanselmann | (config_file, ) = args |
266 | b1ffe1eb | Michael Hanselmann | else:
|
267 | a39ec11a | Michael Hanselmann | parser.error("Wrong number of arguments.")
|
268 | a8083063 | Iustin Pop | |
269 | b1ffe1eb | Michael Hanselmann | if not qa_config.options.yes_do_it: |
270 | b1ffe1eb | Michael Hanselmann | print ("Executing this script irreversibly destroys any Ganeti\n" |
271 | b1ffe1eb | Michael Hanselmann | "configuration on all nodes involved. If you really want\n"
|
272 | b1ffe1eb | Michael Hanselmann | "to start testing, supply the --yes-do-it option.")
|
273 | b1ffe1eb | Michael Hanselmann | sys.exit(1)
|
274 | e9e35aaa | Michael Hanselmann | |
275 | b1ffe1eb | Michael Hanselmann | qa_config.Load(config_file) |
276 | a8083063 | Iustin Pop | |
277 | b1ffe1eb | Michael Hanselmann | RunEnvTests() |
278 | b1ffe1eb | Michael Hanselmann | SetupCluster() |
279 | b1ffe1eb | Michael Hanselmann | RunClusterTests() |
280 | b1ffe1eb | Michael Hanselmann | RunOsTests() |
281 | 4b62db14 | Michael Hanselmann | |
282 | d74c2ca1 | Michael Hanselmann | if qa_config.TestEnabled('tags'): |
283 | d74c2ca1 | Michael Hanselmann | RunTest(qa_tags.TestClusterTags) |
284 | d74c2ca1 | Michael Hanselmann | |
285 | 102b115b | Michael Hanselmann | if qa_config.TestEnabled('node-readd'): |
286 | 102b115b | Michael Hanselmann | master = qa_config.GetMasterNode() |
287 | 102b115b | Michael Hanselmann | pnode = qa_config.AcquireNode(exclude=master) |
288 | 102b115b | Michael Hanselmann | try:
|
289 | 102b115b | Michael Hanselmann | RunTest(qa_node.TestNodeReadd, pnode) |
290 | 102b115b | Michael Hanselmann | finally:
|
291 | 102b115b | Michael Hanselmann | qa_config.ReleaseNode(pnode) |
292 | 102b115b | Michael Hanselmann | |
293 | b1ffe1eb | Michael Hanselmann | pnode = qa_config.AcquireNode() |
294 | b1ffe1eb | Michael Hanselmann | try:
|
295 | d74c2ca1 | Michael Hanselmann | if qa_config.TestEnabled('tags'): |
296 | d74c2ca1 | Michael Hanselmann | RunTest(qa_tags.TestNodeTags, pnode) |
297 | d74c2ca1 | Michael Hanselmann | |
298 | a47f574c | Oleksiy Mishchenko | if qa_rapi.Enabled():
|
299 | a47f574c | Oleksiy Mishchenko | RunTest(qa_rapi.TestNode, pnode) |
300 | a47f574c | Oleksiy Mishchenko | |
301 | b1ffe1eb | Michael Hanselmann | if qa_config.TestEnabled('instance-add-plain-disk'): |
302 | b1ffe1eb | Michael Hanselmann | instance = RunTest(qa_instance.TestInstanceAddWithPlainDisk, pnode) |
303 | b1ffe1eb | Michael Hanselmann | RunCommonInstanceTests(instance) |
304 | b1ffe1eb | Michael Hanselmann | RunExportImportTests(instance, pnode) |
305 | b1ffe1eb | Michael Hanselmann | RunDaemonTests(instance, pnode) |
306 | b1ffe1eb | Michael Hanselmann | RunTest(qa_instance.TestInstanceRemove, instance) |
307 | b1ffe1eb | Michael Hanselmann | del instance
|
308 | 9df6d173 | Michael Hanselmann | |
309 | 7d7609a3 | Michael Hanselmann | multinode_tests = [ |
310 | 7d7609a3 | Michael Hanselmann | ('instance-add-drbd-disk',
|
311 | 7d7609a3 | Michael Hanselmann | qa_instance.TestInstanceAddWithDrbdDisk), |
312 | 7d7609a3 | Michael Hanselmann | ] |
313 | 7d7609a3 | Michael Hanselmann | |
314 | 7d7609a3 | Michael Hanselmann | for name, func in multinode_tests: |
315 | 7d7609a3 | Michael Hanselmann | if qa_config.TestEnabled(name):
|
316 | 7d7609a3 | Michael Hanselmann | snode = qa_config.AcquireNode(exclude=pnode) |
317 | 7d7609a3 | Michael Hanselmann | try:
|
318 | 7d7609a3 | Michael Hanselmann | instance = RunTest(func, pnode, snode) |
319 | 7d7609a3 | Michael Hanselmann | RunCommonInstanceTests(instance) |
320 | 7d7609a3 | Michael Hanselmann | RunExportImportTests(instance, pnode) |
321 | 7d7609a3 | Michael Hanselmann | RunHardwareFailureTests(instance, pnode, snode) |
322 | 7d7609a3 | Michael Hanselmann | RunTest(qa_instance.TestInstanceRemove, instance) |
323 | 7d7609a3 | Michael Hanselmann | del instance
|
324 | 7d7609a3 | Michael Hanselmann | finally:
|
325 | 7d7609a3 | Michael Hanselmann | qa_config.ReleaseNode(snode) |
326 | a8083063 | Iustin Pop | |
327 | a8083063 | Iustin Pop | finally:
|
328 | b1ffe1eb | Michael Hanselmann | qa_config.ReleaseNode(pnode) |
329 | a8083063 | Iustin Pop | |
330 | a5b9d725 | Iustin Pop | if qa_config.TestEnabled('create-cluster'): |
331 | a5b9d725 | Iustin Pop | RunTest(qa_node.TestNodeRemoveAll) |
332 | a8083063 | Iustin Pop | |
333 | cec9845c | Michael Hanselmann | if qa_config.TestEnabled('cluster-destroy'): |
334 | cec9845c | Michael Hanselmann | RunTest(qa_cluster.TestClusterDestroy) |
335 | a8083063 | Iustin Pop | |
336 | cec9845c | Michael Hanselmann | |
337 | cec9845c | Michael Hanselmann | if __name__ == '__main__': |
338 | cec9845c | Michael Hanselmann | main() |