@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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")
@@ -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)
@@ -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)
@@ -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:
@@ -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:
@@ -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)
@@ -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,
@@ -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")
@@ -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)
@@ -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)
@@ -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
@@ -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)
@@ -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")
@@ -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)
@@ -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)
@@ -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):
@@ -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)
@@ -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")
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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")
@@ -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)
@@ -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)
@@ -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...")
@@ -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)
@@ -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)
@@ -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)
@@ -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:
@@ -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"):
@@ -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))
@@ -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)
@@ -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
@@ -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
@@ -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)