Commit 938bde86 authored by Michael Hanselmann's avatar Michael Hanselmann

QA: Test instance migration via CLI and RAPI

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent e0ac6ce6
......@@ -254,6 +254,12 @@ def RunHardwareFailureTests(instance, pnode, snode):
if qa_config.TestEnabled('instance-failover'):
RunTest(qa_instance.TestInstanceFailover, instance)
if qa_config.TestEnabled("instance-migrate"):
RunTest(qa_instance.TestInstanceMigrate, instance)
if qa_rapi.Enabled():
RunTest(qa_rapi.TestRapiInstanceMigrate, instance)
if qa_config.TestEnabled('instance-replace-disks'):
othernode = qa_config.AcquireNode(exclude=[pnode, snode])
try:
......
......@@ -72,6 +72,7 @@
"instance-import": true,
"instance-info": true,
"instance-list": true,
"instance-migrate": true,
"instance-modify": true,
"instance-reboot": true,
"instance-reinstall": true,
......
......@@ -160,6 +160,20 @@ def TestInstanceFailover(instance):
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestInstanceMigrate(instance):
"""gnt-instance migrate"""
master = qa_config.GetMasterNode()
cmd = ["gnt-instance", "migrate", "--force", instance["name"]]
AssertEqual(StartSSH(master["primary"],
utils.ShellQuoteArgs(cmd)).wait(), 0)
# ... and back
cmd = ["gnt-instance", "migrate", "--force", instance["name"]]
AssertEqual(StartSSH(master["primary"],
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestInstanceInfo(instance):
"""gnt-instance info"""
master = qa_config.GetMasterNode()
......
......@@ -341,6 +341,14 @@ def TestRapiInstanceRemove(instance, use_client):
qa_config.ReleaseInstance(instance)
def TestRapiInstanceMigrate(instance):
"""Test migrating instance via RAPI"""
# Move to secondary node
_WaitForRapiJob(_rapi_client.MigrateInstance(instance["name"]))
# And back to previous primary
_WaitForRapiJob(_rapi_client.MigrateInstance(instance["name"]))
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