Revision 301adaae qa/ganeti-qa.py
b/qa/ganeti-qa.py | ||
---|---|---|
189 | 189 |
qa_cluster.TestClusterMasterFailoverWithDrainedQueue), |
190 | 190 |
(["cluster-oob", qa_config.NoVirtualCluster], |
191 | 191 |
qa_cluster.TestClusterOob), |
192 |
("rapi", qa_rapi.TestVersion),
|
|
193 |
("rapi", qa_rapi.TestEmptyCluster),
|
|
194 |
("rapi", qa_rapi.TestRapiQuery),
|
|
192 |
(qa_rapi.Enabled, qa_rapi.TestVersion),
|
|
193 |
(qa_rapi.Enabled, qa_rapi.TestEmptyCluster),
|
|
194 |
(qa_rapi.Enabled, qa_rapi.TestRapiQuery),
|
|
195 | 195 |
]: |
196 | 196 |
RunTestIf(test, fn) |
197 | 197 |
|
... | ... | |
209 | 209 |
""" |
210 | 210 |
os_enabled = ["os", qa_config.NoVirtualCluster] |
211 | 211 |
|
212 |
if qa_config.TestEnabled("rapi"):
|
|
212 |
if qa_config.TestEnabled(qa_rapi.Enabled):
|
|
213 | 213 |
rapi_getos = qa_rapi.GetOperatingSystems |
214 | 214 |
else: |
215 | 215 |
rapi_getos = None |
... | ... | |
240 | 240 |
|
241 | 241 |
""" |
242 | 242 |
RunTestIf("instance-shutdown", qa_instance.TestInstanceShutdown, instance) |
243 |
RunTestIf(["instance-shutdown", "instance-console", "rapi"],
|
|
243 |
RunTestIf(["instance-shutdown", "instance-console", qa_rapi.Enabled],
|
|
244 | 244 |
qa_rapi.TestRapiStoppedInstanceConsole, instance) |
245 | 245 |
RunTestIf(["instance-shutdown", "instance-modify"], |
246 | 246 |
qa_instance.TestInstanceStoppedModify, instance) |
247 | 247 |
RunTestIf("instance-shutdown", qa_instance.TestInstanceStartup, instance) |
248 | 248 |
|
249 | 249 |
# Test shutdown/start via RAPI |
250 |
RunTestIf(["instance-shutdown", "rapi"],
|
|
250 |
RunTestIf(["instance-shutdown", qa_rapi.Enabled],
|
|
251 | 251 |
qa_rapi.TestRapiInstanceShutdown, instance) |
252 |
RunTestIf(["instance-shutdown", "rapi"],
|
|
252 |
RunTestIf(["instance-shutdown", qa_rapi.Enabled],
|
|
253 | 253 |
qa_rapi.TestRapiInstanceStartup, instance) |
254 | 254 |
|
255 | 255 |
RunTestIf("instance-list", qa_instance.TestInstanceList) |
... | ... | |
257 | 257 |
RunTestIf("instance-info", qa_instance.TestInstanceInfo, instance) |
258 | 258 |
|
259 | 259 |
RunTestIf("instance-modify", qa_instance.TestInstanceModify, instance) |
260 |
RunTestIf(["instance-modify", "rapi"],
|
|
260 |
RunTestIf(["instance-modify", qa_rapi.Enabled],
|
|
261 | 261 |
qa_rapi.TestRapiInstanceModify, instance) |
262 | 262 |
|
263 | 263 |
RunTestIf("instance-console", qa_instance.TestInstanceConsole, instance) |
264 |
RunTestIf(["instance-console", "rapi"],
|
|
264 |
RunTestIf(["instance-console", qa_rapi.Enabled],
|
|
265 | 265 |
qa_rapi.TestRapiInstanceConsole, instance) |
266 | 266 |
|
267 | 267 |
DOWN_TESTS = qa_config.Either([ |
... | ... | |
275 | 275 |
|
276 | 276 |
# now run the 'down' state tests |
277 | 277 |
RunTestIf("instance-reinstall", qa_instance.TestInstanceReinstall, instance) |
278 |
RunTestIf(["instance-reinstall", "rapi"],
|
|
278 |
RunTestIf(["instance-reinstall", qa_rapi.Enabled],
|
|
279 | 279 |
qa_rapi.TestRapiInstanceReinstall, instance) |
280 | 280 |
|
281 | 281 |
if qa_config.TestEnabled("instance-rename"): |
... | ... | |
286 | 286 |
# perform instance rename to the same name |
287 | 287 |
RunTest(qa_instance.TestInstanceRenameAndBack, |
288 | 288 |
rename_source, rename_source) |
289 |
RunTestIf("rapi", qa_rapi.TestRapiInstanceRenameAndBack,
|
|
289 |
RunTestIf(qa_rapi.Enabled, qa_rapi.TestRapiInstanceRenameAndBack,
|
|
290 | 290 |
rename_source, rename_source) |
291 | 291 |
if rename_target is not None: |
292 | 292 |
# perform instance rename to a different name, if we have one configured |
293 | 293 |
RunTest(qa_instance.TestInstanceRenameAndBack, |
294 | 294 |
rename_source, rename_target) |
295 |
RunTestIf("rapi", qa_rapi.TestRapiInstanceRenameAndBack,
|
|
295 |
RunTestIf(qa_rapi.Enabled, qa_rapi.TestRapiInstanceRenameAndBack,
|
|
296 | 296 |
rename_source, rename_target) |
297 | 297 |
finally: |
298 | 298 |
tgt_instance.Release() |
... | ... | |
308 | 308 |
|
309 | 309 |
RunTestIf("cluster-verify", qa_cluster.TestClusterVerify) |
310 | 310 |
|
311 |
RunTestIf("rapi", qa_rapi.TestInstance, instance)
|
|
311 |
RunTestIf(qa_rapi.Enabled, qa_rapi.TestInstance, instance)
|
|
312 | 312 |
|
313 | 313 |
# Lists instances, too |
314 | 314 |
RunTestIf("node-list", qa_node.TestNodeList) |
... | ... | |
349 | 349 |
RunTestIf("group-rwops", qa_group.TestGroupAddRemoveRename) |
350 | 350 |
RunTestIf("group-rwops", qa_group.TestGroupAddWithOptions) |
351 | 351 |
RunTestIf("group-rwops", qa_group.TestGroupModify) |
352 |
RunTestIf(["group-rwops", "rapi"], qa_rapi.TestRapiNodeGroups)
|
|
352 |
RunTestIf(["group-rwops", qa_rapi.Enabled], qa_rapi.TestRapiNodeGroups)
|
|
353 | 353 |
RunTestIf(["group-rwops", "tags"], qa_tags.TestGroupTags, |
354 | 354 |
qa_group.GetDefaultGroup()) |
355 | 355 |
|
... | ... | |
384 | 384 |
finally: |
385 | 385 |
expnode.Release() |
386 | 386 |
|
387 |
if qa_config.TestEnabled(["rapi", "inter-cluster-instance-move"]):
|
|
387 |
if qa_config.TestEnabled([qa_rapi.Enabled, "inter-cluster-instance-move"]):
|
|
388 | 388 |
newinst = qa_config.AcquireInstance() |
389 | 389 |
try: |
390 | 390 |
tnode = qa_config.AcquireNode(exclude=inodes) |
... | ... | |
416 | 416 |
|
417 | 417 |
""" |
418 | 418 |
RunTestIf("instance-failover", qa_instance.TestInstanceFailover, instance) |
419 |
RunTestIf(["instance-failover", "rapi"],
|
|
419 |
RunTestIf(["instance-failover", qa_rapi.Enabled],
|
|
420 | 420 |
qa_rapi.TestRapiInstanceFailover, instance) |
421 | 421 |
|
422 | 422 |
RunTestIf("instance-migrate", qa_instance.TestInstanceMigrate, instance) |
423 |
RunTestIf(["instance-migrate", "rapi"],
|
|
423 |
RunTestIf(["instance-migrate", qa_rapi.Enabled],
|
|
424 | 424 |
qa_rapi.TestRapiInstanceMigrate, instance) |
425 | 425 |
|
426 | 426 |
if qa_config.TestEnabled("instance-replace-disks"): |
427 | 427 |
# We just need alternative secondary nodes, hence "- 1" |
428 | 428 |
othernodes = qa_config.AcquireManyNodes(len(inodes) - 1, exclude=inodes) |
429 | 429 |
try: |
430 |
RunTestIf("rapi", qa_rapi.TestRapiInstanceReplaceDisks, instance)
|
|
430 |
RunTestIf(qa_rapi.Enabled, qa_rapi.TestRapiInstanceReplaceDisks, instance)
|
|
431 | 431 |
RunTest(qa_instance.TestReplaceDisks, |
432 | 432 |
instance, inodes, othernodes) |
433 | 433 |
finally: |
Also available in: Unified diff