Skip to content

Commit dd1ce30

Browse files
committed
ping.ext_host: rewrite to support passt tests
Rewrite the code to support passt tests Signed-off-by: Lei Yang <[email protected]>
1 parent 3e4211a commit dd1ce30

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

generic/tests/ping.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ def run(test, params, env):
5454
ping_ext_host = params.get("ping_ext_host", "no") == "yes"
5555
pre_cmd = params.get("pre_cmd", None)
5656
vm = env.get_vm(params["main_vm"])
57+
serial_status = params.get_boolean("serial_login", "no")
5758

5859
error_context.context("Login to guest", test.log.info)
5960
vm.verify_alive()
60-
session = vm.wait_for_login(timeout=timeout)
61+
session = vm.wait_for_login(timeout=timeout, serial=serial_status)
6162

6263
# get the test ip, interface & session
6364
dest_ips = []
@@ -108,14 +109,15 @@ def run(test, params, env):
108109
interval, session=session, count=counts)
109110

110111
# ping with flood
111-
if not ping_ext_host or params.get("os_type") == "linux":
112-
error_context.context("Flood ping test", test.log.info)
113-
_ping_with_params(test, params, ip, interface,
114-
session=session, flood=True)
112+
if params.get_boolean("flood_ping", "yes"):
113+
if not ping_ext_host or params.get("os_type") == "linux":
114+
error_context.context("Flood ping test", test.log.info)
115+
_ping_with_params(test, params, ip, interface,
116+
session=session, flood=True)
115117

116-
# ping to check whether the network is alive
117-
error_context.context("Ping test after flood ping,"
118-
" Check if the network is still alive",
119-
test.log.info)
120-
_ping_with_params(test, params, ip, interface,
121-
session=session, count=counts)
118+
# ping to check whether the network is alive
119+
error_context.context("Ping test after flood ping,"
120+
" Check if the network is still alive",
121+
test.log.info)
122+
_ping_with_params(test, params, ip, interface,
123+
session=session, count=counts)

0 commit comments

Comments
 (0)