Skip to content

Commit

Permalink
ping.ext_host: rewrite to support passt tests
Browse files Browse the repository at this point in the history
Rewrite the code to support passt tests

Signed-off-by: Lei Yang <[email protected]>
  • Loading branch information
yanglei-rh committed Jul 26, 2024
1 parent 3e4211a commit dd1ce30
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions generic/tests/ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ def run(test, params, env):
ping_ext_host = params.get("ping_ext_host", "no") == "yes"
pre_cmd = params.get("pre_cmd", None)
vm = env.get_vm(params["main_vm"])
serial_status = params.get_boolean("serial_login", "no")

error_context.context("Login to guest", test.log.info)
vm.verify_alive()
session = vm.wait_for_login(timeout=timeout)
session = vm.wait_for_login(timeout=timeout, serial=serial_status)

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

# ping with flood
if not ping_ext_host or params.get("os_type") == "linux":
error_context.context("Flood ping test", test.log.info)
_ping_with_params(test, params, ip, interface,
session=session, flood=True)
if params.get_boolean("flood_ping", "yes"):
if not ping_ext_host or params.get("os_type") == "linux":
error_context.context("Flood ping test", test.log.info)
_ping_with_params(test, params, ip, interface,
session=session, flood=True)

# ping to check whether the network is alive
error_context.context("Ping test after flood ping,"
" Check if the network is still alive",
test.log.info)
_ping_with_params(test, params, ip, interface,
session=session, count=counts)
# ping to check whether the network is alive
error_context.context("Ping test after flood ping,"
" Check if the network is still alive",
test.log.info)
_ping_with_params(test, params, ip, interface,
session=session, count=counts)

0 comments on commit dd1ce30

Please sign in to comment.