Revision 83180411 qa/ganeti-qa.py
b/qa/ganeti-qa.py | ||
---|---|---|
34 | 34 |
import qa_config |
35 | 35 |
import qa_daemon |
36 | 36 |
import qa_env |
37 |
import qa_error |
|
37 | 38 |
import qa_group |
38 | 39 |
import qa_instance |
39 | 40 |
import qa_node |
... | ... | |
391 | 392 |
RunTest(qa_daemon.TestResumeWatcher) |
392 | 393 |
|
393 | 394 |
|
395 |
def RunSingleHomedHardwareFailureTests(instance, pnode): |
|
396 |
"""Test hardware failure recovery for single-homed instances. |
|
397 |
|
|
398 |
""" |
|
399 |
if qa_config.TestEnabled("instance-recreate-disks"): |
|
400 |
othernode = qa_config.AcquireNode(exclude=[pnode]) |
|
401 |
try: |
|
402 |
RunTest(qa_instance.TestRecreateDisks, |
|
403 |
instance, pnode, None, [othernode]) |
|
404 |
finally: |
|
405 |
qa_config.ReleaseNode(othernode) |
|
406 |
|
|
407 |
|
|
394 | 408 |
def RunHardwareFailureTests(instance, pnode, snode): |
395 | 409 |
"""Test cluster internal hardware failure recovery. |
396 | 410 |
|
... | ... | |
412 | 426 |
finally: |
413 | 427 |
qa_config.ReleaseNode(othernode) |
414 | 428 |
|
429 |
if qa_config.TestEnabled("instance-recreate-disks"): |
|
430 |
othernode1 = qa_config.AcquireNode(exclude=[pnode, snode]) |
|
431 |
try: |
|
432 |
othernode2 = qa_config.AcquireNode(exclude=[pnode, snode, othernode1]) |
|
433 |
except qa_error.OutOfNodesError: |
|
434 |
# Let's reuse one of the nodes if the cluster is not big enough |
|
435 |
othernode2 = pnode |
|
436 |
try: |
|
437 |
RunTest(qa_instance.TestRecreateDisks, |
|
438 |
instance, pnode, snode, [othernode1, othernode2]) |
|
439 |
finally: |
|
440 |
qa_config.ReleaseNode(othernode1) |
|
441 |
if othernode2 != pnode: |
|
442 |
qa_config.ReleaseNode(othernode2) |
|
443 |
|
|
415 | 444 |
RunTestIf("node-evacuate", qa_node.TestNodeEvacuate, pnode, snode) |
416 | 445 |
|
417 | 446 |
RunTestIf("node-failover", qa_node.TestNodeFailover, pnode, snode) |
... | ... | |
477 | 506 |
RunExportImportTests(instance, pnode, None) |
478 | 507 |
RunDaemonTests(instance) |
479 | 508 |
RunRepairDiskSizes() |
509 |
RunSingleHomedHardwareFailureTests(instance, pnode) |
|
480 | 510 |
RunTest(qa_instance.TestInstanceRemove, instance) |
481 | 511 |
del instance |
482 | 512 |
|
Also available in: Unified diff