Commit 69bc7a38 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

QA: Use instance name for rename test



Reported in issue 341. In some setups the instance live in a different
netblock from the cluster. Therefore a the configuration-global “rename”
name shouldn't be used for them. Instead another instance name is used.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 63b883de
......@@ -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)
......
......@@ -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": {},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment