|
2 | 2 | import re
|
3 | 3 |
|
4 | 4 | from aexpect import ShellTimeoutError
|
5 |
| -from virttest import error_context, utils_misc |
| 5 | +from virttest import error_context, utils_misc, utils_net |
6 | 6 | from virttest.utils_test.qemu import windrv_verify_running
|
7 | 7 | from virttest.utils_windows import virtio_win, wmic
|
8 | 8 |
|
@@ -147,7 +147,8 @@ def run(test, params, env):
|
147 | 147 | vm.destroy()
|
148 | 148 | vm.create()
|
149 | 149 | vm = env.get_vm(params["main_vm"])
|
150 |
| - session = vm.wait_for_login() |
| 150 | + # This is a workaround for session logout issue |
| 151 | + session = vm.wait_for_serial_login() |
151 | 152 | else:
|
152 | 153 | session = vm.reboot(session)
|
153 | 154 |
|
@@ -175,6 +176,18 @@ def run(test, params, env):
|
175 | 176 | lambda: not session.cmd_status(chk_cmd), 600, 60, 10
|
176 | 177 | ):
|
177 | 178 | test.fail("Failed to install driver '%s'" % driver_name)
|
| 179 | + if "Red Hat VirtIO Ethernet Adapter" in device_name: |
| 180 | + ext_host = utils_net.get_ip_address_by_interface( |
| 181 | + ifname="%s" % params.get("netdst") |
| 182 | + ) |
| 183 | + test.log.info("ext_host of netkvm adapter is %s", ext_host) |
| 184 | + guest_ip = vm.get_address("nic2") |
| 185 | + test.log.info("guest_ip of netkvm adapter is %s", guest_ip) |
| 186 | + status, output = utils_net.ping( |
| 187 | + ext_host, interface=guest_ip, count=10, timeout=60, session=session |
| 188 | + ) |
| 189 | + if status: |
| 190 | + test.fail("Ping %s failed, output=%s" % (ext_host, output)) |
178 | 191 |
|
179 | 192 | installed_any |= True
|
180 | 193 | if not installed_any:
|
|
0 commit comments