[PATCH 17/24] tests: Modify test_autogo_bridge() test to use group interface

Peer, Ilan ilan.peer at intel.com
Fri Feb 6 02:21:57 EST 2015



> -----Original Message-----
> From: hostap-bounces at lists.shmoo.com [mailto:hostap-
> bounces at lists.shmoo.com] On Behalf Of Jouni Malinen
> Sent: Thursday, February 05, 2015 13:52
> To: hostap at lists.shmoo.com
> Subject: Re: [PATCH 17/24] tests: Modify test_autogo_bridge() test to use
> group interface
> 
> On Wed, Feb 04, 2015 at 04:30:29AM -0500, Ilan Peer wrote:
> > 1. Add get_group_ifname() to wpasupplicant.py 2. Use the function to
> > get the interface name for the bridge.
> 
> That approach in general looks fine..
> 
> > diff --git a/tests/hwsim/test_p2p_autogo.py
> > b/tests/hwsim/test_p2p_autogo.py @@ -451,17 +451,17 @@ def
> test_autogo_bridge(dev):
> > -        dev[0].remove_group()
> >      finally:
> >          dev[0].request("AUTOSCAN ")
> > -        subprocess.Popen(['sudo', 'brctl', 'delif', 'p2p-br0', dev[0].ifname],
> > +        subprocess.Popen(['sudo', 'brctl', 'delif', 'p2p-br0',
> > + dev[0].get_group_ifname()],
> >                           stderr=open('/dev/null', 'w'))
> >          subprocess.Popen(['sudo', 'ip', 'link', 'set', 'dev', 'p2p-br0', 'down'],
> >                           stderr=open('/dev/null', 'w'))
> >          subprocess.Popen(['sudo', 'brctl', 'delbr', 'p2p-br0'],
> >                           stderr=open('/dev/null', 'w'))
> > +        dev[0].remove_group()
> 
> ... but I'm not that sure about move dev[0].remove_group() in this way.
> That function can fail and raise an exception. I'd rather leave it where it was
> and store the dev[0].get_group_ifname() result locally so that it can be used
> in finally-processing.
> 

This was the reason for this change. remove_group() has the logic to deduce what is the group interface name. I might be missing something here ..

Ilan.


More information about the HostAP mailing list