diff mbox

[KVM-AUTOTEST,14/14] KVM test: migration: support QMP

Message ID 1276439625-32472-14-git-send-email-mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish June 13, 2010, 2:33 p.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_test_utils.py b/client/tests/kvm/kvm_test_utils.py
index c3b6b8a..9fdea87 100644
--- a/client/tests/kvm/kvm_test_utils.py
+++ b/client/tests/kvm/kvm_test_utils.py
@@ -120,15 +120,24 @@  def migrate(vm, env=None):
     # Helper functions
     def mig_finished():
         o = vm.monitor.info("migrate")
-        return "status: active" not in o
+        if isinstance(o, str):
+            return "status: active" not in o
+        else:
+            return o.get("status") != "active"
 
     def mig_succeeded():
         o = vm.monitor.info("migrate")
-        return "status: completed" in o
+        if isinstance(o, str):
+            return "status: completed" in o
+        else:
+            return o.get("status") == "completed"
 
     def mig_failed():
         o = vm.monitor.info("migrate")
-        return "status: failed" in o
+        if isinstance(o, str):
+            return "status: failed" in o
+        else:
+            return o.get("status") == "failed"
 
     # Clone the source VM and ask the clone to wait for incoming migration
     dest_vm = vm.clone()