diff --git a/autotests/testP2P/connection_test.py b/autotests/testP2P/connection_test.py index 22871547..52da0edc 100644 --- a/autotests/testP2P/connection_test.py +++ b/autotests/testP2P/connection_test.py @@ -91,6 +91,7 @@ class Test(unittest.TestCase): wd.wait_for_object_condition(wpas, 'obj.p2p_group is not None', max_wait=3) peer_ifname = wpas.p2p_group['ifname'] + self.assertEqual(wpas.p2p_group['role'], 'GO' if not go else 'client') if not go: 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']] self.assertEqual(client['p2p_dev_addr'], wpas_peer['p2p_dev_addr']) 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', '-sf', '/tmp/dhclient-script', peer_ifname]) self.dhcp = dhcp @@ -136,7 +140,10 @@ class Test(unittest.TestCase): def tearDown(self): if self.p2p is not None: - self.p2p.enabled = False + try: + self.p2p.enabled = False + except: + pass if self.wpas is not None: self.wpas.clean_up() self.wpas = None diff --git a/autotests/util/wpas.py b/autotests/util/wpas.py index 1758eede..8fb725f8 100644 --- a/autotests/util/wpas.py +++ b/autotests/util/wpas.py @@ -159,6 +159,7 @@ class Wpas: elif event['event'] == 'P2P-GROUP-STARTED': event.pop('event') event['ifname'] = event.pop('arg1') + event['role'] = event.pop('arg2') self.p2p_group = event elif event['event'] == 'P2P-GROUP-REMOVED': self.p2p_group = None