diff --git a/qa/ganeti-qa.py b/qa/ganeti-qa.py index de9c194d14977663846b5b0f7d2f70331c30a674..e7112ca7f8c3368c295b60daba96cd369cbd9bcc 100755 --- a/qa/ganeti-qa.py +++ b/qa/ganeti-qa.py @@ -268,19 +268,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 88902b4f9129cd8918b6ba36b9b5547754820291..4ac45f4400c897826776a2cc9db9ca256d8fca7f 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": {},