diff mbox

[KVM-AUTOTEST,15/17] KVM test: use VM.migrate() instead of kvm_test_utils.migrate()

Message ID 1294079238-21239-15-git-send-email-mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Jan. 3, 2011, 6:27 p.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/tests/migration.py b/client/tests/kvm/tests/migration.py
index 76cbcfc..d6dc1b0 100644
--- a/client/tests/kvm/tests/migration.py
+++ b/client/tests/kvm/tests/migration.py
@@ -26,7 +26,7 @@  def run_migration(test, params, env):
 
     mig_timeout = float(params.get("mig_timeout", "3600"))
     mig_protocol = params.get("migration_protocol", "tcp")
-    mig_cancel = bool(params.get("mig_cancel"))
+    mig_cancel_delay = int(params.get("mig_cancel") == "yes") * 2
     offline = params.get("offline", "no") == "yes"
     check = params.get("vmstate_check", "no") == "yes"
 
@@ -49,12 +49,11 @@  def run_migration(test, params, env):
         session2.close()
 
         # Migrate the VM
-        dest_vm = kvm_test_utils.migrate(vm, env,mig_timeout, mig_protocol,
-                                         mig_cancel, offline, check)
+        vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay, offline, check)
 
         # Log into the guest again
         logging.info("Logging into guest after migration...")
-        session2 = dest_vm.wait_for_login(timeout=30)
+        session2 = vm.wait_for_login(timeout=30)
         logging.info("Logged in after migration")
 
         # Make sure the background process is still running
diff --git a/client/tests/kvm/tests/migration_multi_host.py b/client/tests/kvm/tests/migration_multi_host.py
index 12d70ef..7647af4 100644
--- a/client/tests/kvm/tests/migration_multi_host.py
+++ b/client/tests/kvm/tests/migration_multi_host.py
@@ -67,8 +67,7 @@  def run_migration_multi_host(test, params, env):
         c_socket.close()
 
         logging.info("Start migrating now...")
-        kvm_test_utils.migrate(vm=vm, dest_host=dsthost, mig_port=mig_port,
-                               env=env)
+        vm.migrate(dest_host=dsthost, remote_port=mig_port)
 
         # Wait up to 30 seconds for dest to reach this point
         test.job.barrier(srchost, 'mig_finished', 30).rendezvous(srchost,
diff --git a/client/tests/kvm/tests/timedrift_with_migration.py b/client/tests/kvm/tests/timedrift_with_migration.py
index b8d3e6c..66e8fde 100644
--- a/client/tests/kvm/tests/timedrift_with_migration.py
+++ b/client/tests/kvm/tests/timedrift_with_migration.py
@@ -48,7 +48,7 @@  def run_timedrift_with_migration(test, params, env):
             # Run current iteration
             logging.info("Migrating: iteration %d of %d..." %
                          (i + 1, migration_iterations))
-            vm = kvm_test_utils.migrate(vm, env)
+            vm.migrate()
             # Log in
             logging.info("Logging in after migration...")
             session = vm.wait_for_login(timeout=30)