Commit 7fb50870 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

QA: Test renaming instance via RAPI


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent d654aae1
......@@ -175,9 +175,16 @@ def RunCommonInstanceTests(instance):
RunTest(qa_instance.TestInstanceReboot, instance)
if qa_config.TestEnabled('instance-rename'):
RunTest(qa_instance.TestInstanceShutdown, instance)
RunTest(qa_instance.TestInstanceRename, instance)
RunTest(qa_instance.TestInstanceStartup, instance)
rename_target = qa_config.get("rename", None)
if rename_target is None:
print qa_utils.FormatError("Can rename instance, 'rename' entry is"
" missing from configuration")
else:
RunTest(qa_instance.TestInstanceShutdown, instance)
RunTest(qa_instance.TestInstanceRename, instance, rename_target)
if qa_rapi.Enabled():
RunTest(qa_rapi.TestRapiInstanceRename, instance, rename_target)
RunTest(qa_instance.TestInstanceStartup, instance)
if qa_config.TestEnabled('tags'):
RunTest(qa_tags.TestInstanceTags, instance)
......
......@@ -129,15 +129,11 @@ def TestInstanceReinstall(instance):
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestInstanceRename(instance):
def TestInstanceRename(instance, rename_target):
"""gnt-instance rename"""
master = qa_config.GetMasterNode()
rename_source = instance['name']
rename_target = qa_config.get('rename', None)
if rename_target is None:
print qa_utils.FormatError('"rename" entry is missing')
return
for name1, name2 in [(rename_source, rename_target),
(rename_target, rename_source)]:
......
......@@ -349,6 +349,15 @@ def TestRapiInstanceMigrate(instance):
_WaitForRapiJob(_rapi_client.MigrateInstance(instance["name"]))
def TestRapiInstanceRename(instance, rename_target):
"""Test renaming instance via RAPI"""
rename_source = instance["name"]
for name1, name2 in [(rename_source, rename_target),
(rename_target, rename_source)]:
_WaitForRapiJob(_rapi_client.RenameInstance(name1, name2))
def TestInterClusterInstanceMove(src_instance, dest_instance, pnode, snode):
"""Test tools/move-instance"""
master = qa_config.GetMasterNode()
......
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