提交 7316613f 编写于 作者: Y Yu Wang

Add windows support for virtual_nic.with_stress

Ping host when running heavyload stress tool
Signed-off-by: NYu Wang <wyu@redhat.com>
上级 d33f6e8d
......@@ -59,13 +59,11 @@
- default_buf:
#don't add 'sndbuf' option, buffer size is zero
- with_stress:
only Linux
type = virtual_nic_stress
count = 10
flood_minutes = 25
test_timeout = 1800
test_timeout = 2500
Windows:
# TODO, will support later
autostress = yes
stress_test = win_heavyload
backup_image_before_testing = yes
......
import logging
import aexpect
from virttest import error_context
from virttest import utils_net
......@@ -29,11 +30,15 @@ def run(test, params, env):
"""
flood_minutes = int(params["flood_minutes"])
logging.info("Flood ping for %s minutes" % flood_minutes)
# TODO: windows guest doesn't have proper flood ping like linux,
# will consider how to implement it for windows later
if os_type == "linux":
try:
utils_net.ping(host_ip, flood=True,
session=session, timeout=flood_minutes * 60)
except aexpect.ExpectProcessTerminatedError:
if os_type == "windows":
session.close()
session = vm.wait_for_login(timeout=timeout)
pass
return session
def load_stress():
"""
......@@ -76,7 +81,7 @@ def run(test, params, env):
stress_test.load_stress_tool()
else:
load_stress()
flood_ping(session, host_ip, os_type)
session = flood_ping(session, host_ip, os_type)
if os_type == "linux":
stress_test.unload_stress()
stress_test.clean()
......@@ -87,7 +92,7 @@ def run(test, params, env):
" Check if the network is still alive",
logging.info)
count = params["count"]
timeout = float(count) * 1.5
timeout = float(count) * 2
status, output = utils_net.ping(host_ip, count, session=session,
timeout=timeout)
if status != 0:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册