It looks cleaner even though it's 1 extra line. Signed-off-by: Michael Goldish <mgoldish@xxxxxxxxxx> --- client/tests/kvm/tests/autotest.py | 3 ++- client/tests/kvm/tests/balloon_check.py | 3 ++- client/tests/kvm/tests/boot.py | 3 ++- client/tests/kvm/tests/boot_savevm.py | 3 ++- client/tests/kvm/tests/clock_getres.py | 3 ++- client/tests/kvm/tests/ethtool.py | 3 ++- client/tests/kvm/tests/file_transfer.py | 3 ++- client/tests/kvm/tests/guest_s4.py | 3 ++- client/tests/kvm/tests/guest_test.py | 3 ++- client/tests/kvm/tests/iofuzz.py | 3 ++- client/tests/kvm/tests/ioquit.py | 3 ++- client/tests/kvm/tests/iozone_windows.py | 3 ++- client/tests/kvm/tests/jumbo.py | 3 ++- client/tests/kvm/tests/kdump.py | 3 ++- client/tests/kvm/tests/linux_s3.py | 3 ++- client/tests/kvm/tests/mac_change.py | 3 ++- client/tests/kvm/tests/migration.py | 3 ++- client/tests/kvm/tests/migration_multi_host.py | 3 ++- .../kvm/tests/migration_with_file_transfer.py | 3 ++- client/tests/kvm/tests/migration_with_reboot.py | 3 ++- client/tests/kvm/tests/multicast.py | 3 ++- client/tests/kvm/tests/netperf.py | 3 ++- client/tests/kvm/tests/nic_bonding.py | 3 ++- client/tests/kvm/tests/nic_promisc.py | 3 ++- client/tests/kvm/tests/nicdriver_unload.py | 3 ++- client/tests/kvm/tests/pci_hotplug.py | 3 ++- client/tests/kvm/tests/physical_resources_check.py | 3 ++- client/tests/kvm/tests/ping.py | 3 ++- client/tests/kvm/tests/pxe.py | 3 ++- client/tests/kvm/tests/qmp_basic.py | 3 ++- client/tests/kvm/tests/shutdown.py | 3 ++- client/tests/kvm/tests/stress_boot.py | 3 ++- client/tests/kvm/tests/timedrift.py | 3 ++- client/tests/kvm/tests/timedrift_with_migration.py | 3 ++- client/tests/kvm/tests/timedrift_with_reboot.py | 3 ++- client/tests/kvm/tests/timedrift_with_stop.py | 3 ++- client/tests/kvm/tests/unattended_install.py | 3 ++- client/tests/kvm/tests/vlan.py | 6 ++++-- client/tests/kvm/tests/vmstop.py | 3 ++- client/tests/kvm/tests/whql_client_install.py | 3 ++- client/tests/kvm/tests/whql_submission.py | 3 ++- client/tests/kvm/tests/yum_update.py | 3 ++- 42 files changed, 86 insertions(+), 43 deletions(-) diff --git a/client/tests/kvm/tests/autotest.py b/client/tests/kvm/tests/autotest.py index ec4bd9f..0b97b03 100644 --- a/client/tests/kvm/tests/autotest.py +++ b/client/tests/kvm/tests/autotest.py @@ -12,7 +12,8 @@ def run_autotest(test, params, env): @param params: Dictionary with test parameters. @param env: Dictionary with the test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/balloon_check.py b/client/tests/kvm/tests/balloon_check.py index a9226c3..9ed0a7e 100644 --- a/client/tests/kvm/tests/balloon_check.py +++ b/client/tests/kvm/tests/balloon_check.py @@ -65,7 +65,8 @@ def run_balloon_check(test, params, env): fail = 0 - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/boot.py b/client/tests/kvm/tests/boot.py index 936ce65..54db1c6 100644 --- a/client/tests/kvm/tests/boot.py +++ b/client/tests/kvm/tests/boot.py @@ -15,7 +15,8 @@ def run_boot(test, params, env): @param params: Dictionary with the test parameters @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = float(params.get("login_timeout", 240)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/boot_savevm.py b/client/tests/kvm/tests/boot_savevm.py index c805816..6acd0a2 100644 --- a/client/tests/kvm/tests/boot_savevm.py +++ b/client/tests/kvm/tests/boot_savevm.py @@ -13,7 +13,8 @@ def run_boot_savevm(test, params, env): @param params: Dictionary with the test parameters @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() savevm_delay = float(params.get("savevm_delay")) savevm_login_delay = float(params.get("savevm_login_delay")) logging.info("savevm_delay = %f" % savevm_delay) diff --git a/client/tests/kvm/tests/clock_getres.py b/client/tests/kvm/tests/clock_getres.py index 7c828f2..1a762e5 100644 --- a/client/tests/kvm/tests/clock_getres.py +++ b/client/tests/kvm/tests/clock_getres.py @@ -28,7 +28,8 @@ def run_clock_getres(test, params, env): if not os.path.isfile(test_clock): raise error.TestError("Could not find %s" % t_name) - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) vm.copy_files_to(test_clock, base_dir) diff --git a/client/tests/kvm/tests/ethtool.py b/client/tests/kvm/tests/ethtool.py index be8f1d2..011df29 100644 --- a/client/tests/kvm/tests/ethtool.py +++ b/client/tests/kvm/tests/ethtool.py @@ -175,7 +175,8 @@ def run_ethtool(test, params, env): return True - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360))) # Let's just error the test if we identify that there's no ethtool installed session.cmd("ethtool -h") diff --git a/client/tests/kvm/tests/file_transfer.py b/client/tests/kvm/tests/file_transfer.py index eb856d4..a192f19 100644 --- a/client/tests/kvm/tests/file_transfer.py +++ b/client/tests/kvm/tests/file_transfer.py @@ -17,7 +17,8 @@ def run_file_transfer(test, params, env): @param params: Dictionary with the test parameters. @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout=int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/guest_s4.py b/client/tests/kvm/tests/guest_s4.py index 72f255d..7f61c33 100644 --- a/client/tests/kvm/tests/guest_s4.py +++ b/client/tests/kvm/tests/guest_s4.py @@ -11,7 +11,8 @@ def run_guest_s4(test, params, env): @param params: Dictionary with test parameters. @param env: Dictionary with the test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/guest_test.py b/client/tests/kvm/tests/guest_test.py index 54f64ca..cd902df 100644 --- a/client/tests/kvm/tests/guest_test.py +++ b/client/tests/kvm/tests/guest_test.py @@ -19,7 +19,8 @@ def run_guest_test(test, params, env): login_timeout = int(params.get("login_timeout", 360)) reboot = params.get("reboot", "no") - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() if params.get("serial_login") == "yes": session = vm.wait_for_serial_login(timeout=login_timeout) else: diff --git a/client/tests/kvm/tests/iofuzz.py b/client/tests/kvm/tests/iofuzz.py index 0642e79..d995509 100644 --- a/client/tests/kvm/tests/iofuzz.py +++ b/client/tests/kvm/tests/iofuzz.py @@ -90,7 +90,8 @@ def run_iofuzz(test, params, env): login_timeout = float(params.get("login_timeout", 240)) - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() session = vm.wait_for_login(timeout=login_timeout) try: diff --git a/client/tests/kvm/tests/ioquit.py b/client/tests/kvm/tests/ioquit.py index ca08b96..80c8221 100644 --- a/client/tests/kvm/tests/ioquit.py +++ b/client/tests/kvm/tests/ioquit.py @@ -11,7 +11,8 @@ def run_ioquit(test, params, env): @param params: Dictionary with the test parameters. @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() login_timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=login_timeout) session2 = vm.wait_for_login(timeout=login_timeout) diff --git a/client/tests/kvm/tests/iozone_windows.py b/client/tests/kvm/tests/iozone_windows.py index 6171906..15b135e 100644 --- a/client/tests/kvm/tests/iozone_windows.py +++ b/client/tests/kvm/tests/iozone_windows.py @@ -17,7 +17,8 @@ def run_iozone_windows(test, params, env): @param params: Dictionary with the test parameters @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) results_path = os.path.join(test.resultsdir, diff --git a/client/tests/kvm/tests/jumbo.py b/client/tests/kvm/tests/jumbo.py index fd9fb3e..e20aa9f 100644 --- a/client/tests/kvm/tests/jumbo.py +++ b/client/tests/kvm/tests/jumbo.py @@ -22,7 +22,8 @@ def run_jumbo(test, params, env): @param params: Dictionary with the test parameters. @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360))) mtu = params.get("mtu", "1500") flood_time = params.get("flood_time", "300") diff --git a/client/tests/kvm/tests/kdump.py b/client/tests/kvm/tests/kdump.py index 3d9f142..bfcbae1 100644 --- a/client/tests/kvm/tests/kdump.py +++ b/client/tests/kvm/tests/kdump.py @@ -14,7 +14,8 @@ def run_kdump(test, params, env): @param params: Dictionary with the test parameters @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = float(params.get("login_timeout", 240)) crash_timeout = float(params.get("crash_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/linux_s3.py b/client/tests/kvm/tests/linux_s3.py index 7758d08..ece8676 100644 --- a/client/tests/kvm/tests/linux_s3.py +++ b/client/tests/kvm/tests/linux_s3.py @@ -11,7 +11,8 @@ def run_linux_s3(test, params, env): @param params: Dictionary with test parameters. @param env: Dictionary with the test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/mac_change.py b/client/tests/kvm/tests/mac_change.py index 4876719..3fd196f 100644 --- a/client/tests/kvm/tests/mac_change.py +++ b/client/tests/kvm/tests/mac_change.py @@ -15,7 +15,8 @@ def run_mac_change(test, params, env): @param params: Dictionary with the test parameters. @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session_serial = vm.wait_for_serial_login(timeout=timeout) # This session will be used to assess whether the IP change worked diff --git a/client/tests/kvm/tests/migration.py b/client/tests/kvm/tests/migration.py index 234120c..76cbcfc 100644 --- a/client/tests/kvm/tests/migration.py +++ b/client/tests/kvm/tests/migration.py @@ -19,7 +19,8 @@ def run_migration(test, params, env): @param params: Dictionary with test parameters. @param env: Dictionary with the test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/migration_multi_host.py b/client/tests/kvm/tests/migration_multi_host.py index 4569531..12d70ef 100644 --- a/client/tests/kvm/tests/migration_multi_host.py +++ b/client/tests/kvm/tests/migration_multi_host.py @@ -37,7 +37,8 @@ def run_migration_multi_host(test, params, env): else: return o.get("status") == "running" - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() login_timeout = int(params.get("login_timeout", 360)) role = params.get("role") srchost = params.get("srchost") diff --git a/client/tests/kvm/tests/migration_with_file_transfer.py b/client/tests/kvm/tests/migration_with_file_transfer.py index f614d63..f641451 100644 --- a/client/tests/kvm/tests/migration_with_file_transfer.py +++ b/client/tests/kvm/tests/migration_with_file_transfer.py @@ -19,7 +19,8 @@ def run_migration_with_file_transfer(test, params, env): @param params: Dictionary with test parameters. @param env: Dictionary with the test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/migration_with_reboot.py b/client/tests/kvm/tests/migration_with_reboot.py index 3d7ace8..c96a4d7 100644 --- a/client/tests/kvm/tests/migration_with_reboot.py +++ b/client/tests/kvm/tests/migration_with_reboot.py @@ -44,7 +44,8 @@ def run_migration_with_reboot(test, params, env): logging.info("Guest is up again") session.close() - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/multicast.py b/client/tests/kvm/tests/multicast.py index 9b63146..ddb7807 100644 --- a/client/tests/kvm/tests/multicast.py +++ b/client/tests/kvm/tests/multicast.py @@ -18,7 +18,8 @@ def run_multicast(test, params, env): @param params: Dictionary with the test parameters. @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360))) def run_guest(cmd): diff --git a/client/tests/kvm/tests/netperf.py b/client/tests/kvm/tests/netperf.py index eaa868e..819562a 100644 --- a/client/tests/kvm/tests/netperf.py +++ b/client/tests/kvm/tests/netperf.py @@ -16,7 +16,8 @@ def run_netperf(test, params, env): @param params: Dictionary with the test parameters. @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() login_timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=login_timeout) diff --git a/client/tests/kvm/tests/nic_bonding.py b/client/tests/kvm/tests/nic_bonding.py index 222ace2..692978c 100644 --- a/client/tests/kvm/tests/nic_bonding.py +++ b/client/tests/kvm/tests/nic_bonding.py @@ -31,7 +31,8 @@ def run_nic_bonding(test, params, env): break timeout = int(params.get("login_timeout", 1200)) - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() session_serial = vm.wait_for_serial_login(timeout=timeout) script_path = kvm_utils.get_path(test.bindir, "scripts/bonding_setup.py") vm.copy_files_to(script_path, "/tmp/bonding_setup.py") diff --git a/client/tests/kvm/tests/nic_promisc.py b/client/tests/kvm/tests/nic_promisc.py index abcef25..b9a52ff 100644 --- a/client/tests/kvm/tests/nic_promisc.py +++ b/client/tests/kvm/tests/nic_promisc.py @@ -18,7 +18,8 @@ def run_nic_promisc(test, params, env): @param params: Dictionary with the test parameters. @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) session_serial = vm.wait_for_serial_login(timeout=timeout) diff --git a/client/tests/kvm/tests/nicdriver_unload.py b/client/tests/kvm/tests/nicdriver_unload.py index 3c629bf..d4ddfdd 100644 --- a/client/tests/kvm/tests/nicdriver_unload.py +++ b/client/tests/kvm/tests/nicdriver_unload.py @@ -18,7 +18,8 @@ def run_nicdriver_unload(test, params, env): @param env: Dictionary with test environment. """ timeout = int(params.get("login_timeout", 360)) - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() session = vm.wait_for_login(timeout=timeout) session_serial = vm.wait_for_serial_login(timeout=timeout) diff --git a/client/tests/kvm/tests/pci_hotplug.py b/client/tests/kvm/tests/pci_hotplug.py index 1270f15..3ce2f87 100644 --- a/client/tests/kvm/tests/pci_hotplug.py +++ b/client/tests/kvm/tests/pci_hotplug.py @@ -19,7 +19,8 @@ def run_pci_hotplug(test, params, env): @param params: Dictionary with the test parameters. @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/physical_resources_check.py b/client/tests/kvm/tests/physical_resources_check.py index 1875f07..b9542b7 100644 --- a/client/tests/kvm/tests/physical_resources_check.py +++ b/client/tests/kvm/tests/physical_resources_check.py @@ -17,7 +17,8 @@ def run_physical_resources_check(test, params, env): @param params: Dictionary with the test parameters @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_serial_login(timeout=timeout) diff --git a/client/tests/kvm/tests/ping.py b/client/tests/kvm/tests/ping.py index d206848..0dbbdf6 100644 --- a/client/tests/kvm/tests/ping.py +++ b/client/tests/kvm/tests/ping.py @@ -18,7 +18,8 @@ def run_ping(test, params, env): @param params: Dictionary with the test parameters. @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360))) counts = params.get("ping_counts", 100) diff --git a/client/tests/kvm/tests/pxe.py b/client/tests/kvm/tests/pxe.py index ec9a549..026e397 100644 --- a/client/tests/kvm/tests/pxe.py +++ b/client/tests/kvm/tests/pxe.py @@ -15,7 +15,8 @@ def run_pxe(test, params, env): @param params: Dictionary with the test parameters. @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("pxe_timeout", 60)) logging.info("Try to boot from PXE") diff --git a/client/tests/kvm/tests/qmp_basic.py b/client/tests/kvm/tests/qmp_basic.py index 985ad15..952da99 100644 --- a/client/tests/kvm/tests/qmp_basic.py +++ b/client/tests/kvm/tests/qmp_basic.py @@ -381,7 +381,8 @@ def run_qmp_basic(test, params, env): check_error_resp(resp, "CommandNotFound", { "name": cmd }) - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() # Run all suites greeting_suite(vm.monitor) diff --git a/client/tests/kvm/tests/shutdown.py b/client/tests/kvm/tests/shutdown.py index 1150211..fc0407f 100644 --- a/client/tests/kvm/tests/shutdown.py +++ b/client/tests/kvm/tests/shutdown.py @@ -15,7 +15,8 @@ def run_shutdown(test, params, env): @param params: Dictionary with the test parameters @param env: Dictionary with test environment """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/stress_boot.py b/client/tests/kvm/tests/stress_boot.py index 620d5f0..752bd72 100644 --- a/client/tests/kvm/tests/stress_boot.py +++ b/client/tests/kvm/tests/stress_boot.py @@ -17,7 +17,8 @@ def run_stress_boot(tests, params, env): @param env: Dictionary with test environment. """ # boot the first vm - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() logging.info("Waiting for first guest to be up...") diff --git a/client/tests/kvm/tests/timedrift.py b/client/tests/kvm/tests/timedrift.py index 1dea364..348efb8 100644 --- a/client/tests/kvm/tests/timedrift.py +++ b/client/tests/kvm/tests/timedrift.py @@ -52,7 +52,8 @@ def run_timedrift(test, params, env): for tid, mask in prev_masks.items(): commands.getoutput("taskset -p %s %s" % (mask, tid)) - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/timedrift_with_migration.py b/client/tests/kvm/tests/timedrift_with_migration.py index 6cb79dc..b8d3e6c 100644 --- a/client/tests/kvm/tests/timedrift_with_migration.py +++ b/client/tests/kvm/tests/timedrift_with_migration.py @@ -17,7 +17,8 @@ def run_timedrift_with_migration(test, params, env): @param params: Dictionary with test parameters. @param env: Dictionary with the test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/timedrift_with_reboot.py b/client/tests/kvm/tests/timedrift_with_reboot.py index 7668bdd..8ec121d 100644 --- a/client/tests/kvm/tests/timedrift_with_reboot.py +++ b/client/tests/kvm/tests/timedrift_with_reboot.py @@ -17,7 +17,8 @@ def run_timedrift_with_reboot(test, params, env): @param params: Dictionary with test parameters. @param env: Dictionary with the test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/timedrift_with_stop.py b/client/tests/kvm/tests/timedrift_with_stop.py index 27a1472..cf396cb 100644 --- a/client/tests/kvm/tests/timedrift_with_stop.py +++ b/client/tests/kvm/tests/timedrift_with_stop.py @@ -21,7 +21,8 @@ def run_timedrift_with_stop(test, params, env): """ login_timeout = int(params.get("login_timeout", 360)) sleep_time = int(params.get("sleep_time", 30)) - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() session = vm.wait_for_login(timeout=login_timeout) # Collect test parameters: diff --git a/client/tests/kvm/tests/unattended_install.py b/client/tests/kvm/tests/unattended_install.py index 471ab56..9617603 100644 --- a/client/tests/kvm/tests/unattended_install.py +++ b/client/tests/kvm/tests/unattended_install.py @@ -14,7 +14,8 @@ def run_unattended_install(test, params, env): @param env: Dictionary with test environment. """ buf = 1024 - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() port = vm.get_port(int(params.get("guest_port_unattended_install"))) if params.get("post_install_delay"): diff --git a/client/tests/kvm/tests/vlan.py b/client/tests/kvm/tests/vlan.py index f35e3a7..19a9250 100644 --- a/client/tests/kvm/tests/vlan.py +++ b/client/tests/kvm/tests/vlan.py @@ -30,8 +30,10 @@ def run_vlan(test, params, env): maximal = int(params.get("maximal")) file_size = params.get("file_size") - vm.append(kvm_test_utils.get_living_vm(env, params.get("main_vm"))) - vm.append(kvm_test_utils.get_living_vm(env, "vm2")) + vm.append(env.get_vm(params["main_vm"])) + vm.append(env.get_vm("vm2")) + for vm_ in vm: + vm_.verify_alive() def add_vlan(session, id, iface="eth0"): session.cmd("vconfig add %s %s" % (iface, id)) diff --git a/client/tests/kvm/tests/vmstop.py b/client/tests/kvm/tests/vmstop.py index c3a4cb5..5bff3b3 100644 --- a/client/tests/kvm/tests/vmstop.py +++ b/client/tests/kvm/tests/vmstop.py @@ -18,7 +18,8 @@ def run_vmstop(test, params, env): @param params: Dictionary with the test parameters @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = float(params.get("login_timeout", 240)) session = vm.wait_for_login(timeout=timeout) diff --git a/client/tests/kvm/tests/whql_client_install.py b/client/tests/kvm/tests/whql_client_install.py index 589f258..5a2ed4d 100644 --- a/client/tests/kvm/tests/whql_client_install.py +++ b/client/tests/kvm/tests/whql_client_install.py @@ -21,7 +21,8 @@ def run_whql_client_install(test, params, env): @param params: Dictionary with the test parameters @param env: Dictionary with test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() session = vm.wait_for_login(timeout=int(params.get("login_timeout", 360))) # Collect test params diff --git a/client/tests/kvm/tests/whql_submission.py b/client/tests/kvm/tests/whql_submission.py index 2c0f367..afd613e 100644 --- a/client/tests/kvm/tests/whql_submission.py +++ b/client/tests/kvm/tests/whql_submission.py @@ -23,7 +23,8 @@ def run_whql_submission(test, params, env): vms = [] sessions = [] for vm_name in params.objects("vms"): - vms.append(kvm_test_utils.get_living_vm(env, vm_name)) + vms.append(env.get_vm(vm_name)) + vms[-1].verify_alive() sessions.append(vms[-1].wait_for_login(timeout=login_timeout)) # Make sure all NICs of all client VMs are up diff --git a/client/tests/kvm/tests/yum_update.py b/client/tests/kvm/tests/yum_update.py index 62bb4f3..849a67a 100644 --- a/client/tests/kvm/tests/yum_update.py +++ b/client/tests/kvm/tests/yum_update.py @@ -38,7 +38,8 @@ def run_yum_update(test, params, env): @param params: Dictionary with test parameters. @param env: Dictionary with the test environment. """ - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() timeout = int(params.get("login_timeout", 360)) session = vm.wait_for_login(timeout=timeout) -- 1.7.3.4 -- 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