diff --git a/qa/ganeti-qa.py b/qa/ganeti-qa.py index d8f71b0ac1ec05e89d3833412ce9691b2917dac9..26c2407ac0c01e8457427a2dbd29fabf62651f4e 100755 --- a/qa/ganeti-qa.py +++ b/qa/ganeti-qa.py @@ -269,19 +269,23 @@ def RunCommonInstanceTests(instance): qa_rapi.TestRapiInstanceReinstall, instance) if qa_config.TestEnabled("instance-rename"): - rename_source = instance["name"] - rename_target = qa_config.get("rename", None) - # perform instance rename to the same name - RunTest(qa_instance.TestInstanceRenameAndBack, - rename_source, rename_source) - RunTestIf("rapi", qa_rapi.TestRapiInstanceRenameAndBack, - rename_source, rename_source) - if rename_target is not None: - # perform instance rename to a different name, if we have one configured + tgt_instance = qa_config.AcquireInstance() + try: + rename_source = instance["name"] + rename_target = tgt_instance["name"] + # perform instance rename to the same name RunTest(qa_instance.TestInstanceRenameAndBack, - rename_source, rename_target) + rename_source, rename_source) RunTestIf("rapi", qa_rapi.TestRapiInstanceRenameAndBack, + rename_source, rename_source) + if rename_target is not None: + # perform instance rename to a different name, if we have one configured + RunTest(qa_instance.TestInstanceRenameAndBack, rename_source, rename_target) + RunTestIf("rapi", qa_rapi.TestRapiInstanceRenameAndBack, + rename_source, rename_target) + finally: + qa_config.ReleaseInstance(tgt_instance) RunTestIf(["instance-grow-disk"], qa_instance.TestInstanceGrowDisk, instance) diff --git a/qa/qa-sample.json b/qa/qa-sample.json index e598e9fae09b414d332badd1b6dd8c05d3be9dc8..9b96484b69ebd2e9076134ecb49252c86bae3f51 100644 --- a/qa/qa-sample.json +++ b/qa/qa-sample.json @@ -5,7 +5,10 @@ "# sign (#).": null, "name": "xen-test", + + "# Name used for renaming cluster": null, "rename": "xen-test-rename", + "enabled-hypervisors": "xen-pvm", "# Dict of hypervisor name and parameters (like on the cmd line)": null, "hypervisor-parameters": {},