[PATCH] virt: trans_hugepage_swapping: Fix test to use current APIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Test was using a reference to an old API that no longer
exists in virt_utils. Instead, let's use the current
methods to grab a VM class (methods of the env object).

Also, use up to date methods to get an ssh session to the vm.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@xxxxxxxxxx>
---
 client/virt/tests/trans_hugepage_swapping.py |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/client/virt/tests/trans_hugepage_swapping.py b/client/virt/tests/trans_hugepage_swapping.py
index 056ad8a..9a2608b 100644
--- a/client/virt/tests/trans_hugepage_swapping.py
+++ b/client/virt/tests/trans_hugepage_swapping.py
@@ -71,23 +71,22 @@ def run_trans_hugepage_swapping(test, params, env):
 
             # Set the memory size of vm
             # To ignore the oom killer set it to the free swap size
-            vm = virt_test_utils.get_living_vm(env, params.get("main_vm"))
+            vm = env.get_vm(params.get("main_vm"))
+            vm.verify_alive()
             if int(params['mem']) > swap_free[0]:
                 vm.destroy()
                 vm_name = 'vmsw'
                 vm0 =  params.get("main_vm")
-                vm0_key = virt_utils.env_get_vm(env, vm0)
+                vm0_key = env.get_vm(vm0)
                 params['vms'] = params['vms'] + " " + vm_name
                 params['mem'] = str(swap_free[0])
                 vm_key = vm0_key.clone(vm0, params)
                 virt_utils.env_register_vm(env, vm_name, vm_key)
                 virt_env_process.preprocess_vm(test, params, env, vm_name)
                 vm_key.create()
-                session = virt_utils.wait_for(vm_key.remote_login,
-                                              timeout=login_timeout)
+                session = vm_key.wait_for_login(timeout=login_timeout)
             else:
-                session = virt_test_utils.wait_for_login(vm,
-                                                        timeout=login_timeout)
+                session = vm.wait_for_login(timeout=login_timeout)
 
             error.context("making guest to swap memory")
             cmd = ("dd if=/dev/zero of=%s/zero bs=%s000000 count=%s" %
-- 
1.7.10

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux