|
|
|
@ -342,11 +342,11 @@ def ping_run(host, ip, result, ifname=None, addr_type="ipv4", deadline="5", qos=
|
|
|
|
|
|
|
|
|
|
flush_arp_cache(host)
|
|
|
|
|
|
|
|
|
|
thread = host.execute_run(ping, result)
|
|
|
|
|
thread = host.thread_run(ping, result)
|
|
|
|
|
return thread
|
|
|
|
|
|
|
|
|
|
def ping_wait(host, thread, timeout=None):
|
|
|
|
|
host.wait_execute_complete(thread, timeout)
|
|
|
|
|
host.thread_wait(thread, timeout)
|
|
|
|
|
if thread.isAlive():
|
|
|
|
|
raise Exception("ping thread still alive")
|
|
|
|
|
|
|
|
|
@ -496,23 +496,23 @@ def iperf_run(server, client, server_ip, client_res, server_res,
|
|
|
|
|
flush_arp_cache(server)
|
|
|
|
|
flush_arp_cache(client)
|
|
|
|
|
|
|
|
|
|
server_thread = server.execute_run(iperf_server, server_res)
|
|
|
|
|
server_thread = server.thread_run(iperf_server, server_res)
|
|
|
|
|
time.sleep(1)
|
|
|
|
|
client_thread = client.execute_run(iperf_client, client_res)
|
|
|
|
|
client_thread = client.thread_run(iperf_client, client_res)
|
|
|
|
|
|
|
|
|
|
return server_thread, client_thread
|
|
|
|
|
|
|
|
|
|
def iperf_wait(server, client, server_thread, client_thread, timeout=None, iperf="iperf"):
|
|
|
|
|
client.wait_execute_complete(client_thread, timeout)
|
|
|
|
|
client.thread_wait(client_thread, timeout)
|
|
|
|
|
if client_thread.isAlive():
|
|
|
|
|
raise Exception("iperf client thread still alive")
|
|
|
|
|
|
|
|
|
|
server.wait_execute_complete(server_thread, 5)
|
|
|
|
|
server.thread_wait(server_thread, 5)
|
|
|
|
|
if server_thread.isAlive():
|
|
|
|
|
server.execute(["killall", "-s", "INT", iperf])
|
|
|
|
|
time.sleep(1)
|
|
|
|
|
|
|
|
|
|
server.wait_execute_complete(server_thread, 5)
|
|
|
|
|
server.thread_wait(server_thread, 5)
|
|
|
|
|
if server_thread.isAlive():
|
|
|
|
|
raise Exception("iperf server thread still alive")
|
|
|
|
|
|
|
|
|
|