mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 23:09:34 +01:00
autotests: Test GO-side IP Allocation in testP2P
Check if our wpa_supplicant P2P Client has received the allocated Clieant IP/netmask/GO IP values we sent in the 4-Way Handshake.
This commit is contained in:
parent
bc046994db
commit
3eff81864c
@ -91,6 +91,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd.wait_for_object_condition(wpas, 'obj.p2p_group is not None', max_wait=3)
|
wd.wait_for_object_condition(wpas, 'obj.p2p_group is not None', max_wait=3)
|
||||||
peer_ifname = wpas.p2p_group['ifname']
|
peer_ifname = wpas.p2p_group['ifname']
|
||||||
|
self.assertEqual(wpas.p2p_group['role'], 'GO' if not go else 'client')
|
||||||
|
|
||||||
if not go:
|
if not go:
|
||||||
ctx.start_process(['ifconfig', peer_ifname, '192.168.1.20', 'netmask', '255.255.255.0'], wait=True)
|
ctx.start_process(['ifconfig', peer_ifname, '192.168.1.20', 'netmask', '255.255.255.0'], wait=True)
|
||||||
@ -102,6 +103,9 @@ class Test(unittest.TestCase):
|
|||||||
client = wpas.p2p_clients[request['peer_iface']]
|
client = wpas.p2p_clients[request['peer_iface']]
|
||||||
self.assertEqual(client['p2p_dev_addr'], wpas_peer['p2p_dev_addr'])
|
self.assertEqual(client['p2p_dev_addr'], wpas_peer['p2p_dev_addr'])
|
||||||
else:
|
else:
|
||||||
|
self.assertEqual(wpas.p2p_group['ip_addr'], '192.168.1.2')
|
||||||
|
self.assertEqual(wpas.p2p_group['ip_mask'], '255.255.255.240')
|
||||||
|
self.assertEqual(wpas.p2p_group['go_ip_addr'], '192.168.1.1')
|
||||||
dhcp = ctx.start_process(['dhclient', '-v', '-d', '--no-pid', '-cf', '/dev/null', '-lf', '/tmp/dhcp.leases',
|
dhcp = ctx.start_process(['dhclient', '-v', '-d', '--no-pid', '-cf', '/dev/null', '-lf', '/tmp/dhcp.leases',
|
||||||
'-sf', '/tmp/dhclient-script', peer_ifname])
|
'-sf', '/tmp/dhclient-script', peer_ifname])
|
||||||
self.dhcp = dhcp
|
self.dhcp = dhcp
|
||||||
@ -136,7 +140,10 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
if self.p2p is not None:
|
if self.p2p is not None:
|
||||||
self.p2p.enabled = False
|
try:
|
||||||
|
self.p2p.enabled = False
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if self.wpas is not None:
|
if self.wpas is not None:
|
||||||
self.wpas.clean_up()
|
self.wpas.clean_up()
|
||||||
self.wpas = None
|
self.wpas = None
|
||||||
|
@ -159,6 +159,7 @@ class Wpas:
|
|||||||
elif event['event'] == 'P2P-GROUP-STARTED':
|
elif event['event'] == 'P2P-GROUP-STARTED':
|
||||||
event.pop('event')
|
event.pop('event')
|
||||||
event['ifname'] = event.pop('arg1')
|
event['ifname'] = event.pop('arg1')
|
||||||
|
event['role'] = event.pop('arg2')
|
||||||
self.p2p_group = event
|
self.p2p_group = event
|
||||||
elif event['event'] == 'P2P-GROUP-REMOVED':
|
elif event['event'] == 'P2P-GROUP-REMOVED':
|
||||||
self.p2p_group = None
|
self.p2p_group = None
|
||||||
|
Loading…
Reference in New Issue
Block a user