mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-01 16:22:44 +01:00
auto-t: add test_ip_connected to testutil
Used to check IP connectivity between namespaces. The input should be two tuples containing the IP and namespace to ping from/to.
This commit is contained in:
parent
5a7eb91378
commit
4168e20243
@ -152,3 +152,13 @@ def test_ip_address_match(intf, ip):
|
|||||||
|
|
||||||
if ip != addr:
|
if ip != addr:
|
||||||
raise Exception('IP for %s did not match %s (was %s)' % (intf, ip, addr))
|
raise Exception('IP for %s did not match %s (was %s)' % (intf, ip, addr))
|
||||||
|
|
||||||
|
def test_ip_connected(tup0, tup1):
|
||||||
|
ip0, ns0 = tup0
|
||||||
|
ip1, ns1 = tup1
|
||||||
|
|
||||||
|
try:
|
||||||
|
ns0.start_process(['ping', '-c', '5', '-i', '0.2', ip1], check=True)
|
||||||
|
ns1.start_process(['ping', '-c', '5', '-i', '0.2', ip0], check=True)
|
||||||
|
except:
|
||||||
|
raise Exception('Could not ping between %s and %s' % (ip0, ip1))
|
||||||
|
Loading…
Reference in New Issue
Block a user