[PATCH 2/6] tests: pass apdev to add_bss() remove_bss()

Jouni Malinen j at w1.fi
Sun Apr 3 14:21:33 PDT 2016

On Wed, Mar 30, 2016 at 10:55:57AM +0200, Janusz Dziedzic wrote:
> Pass apdev dictionary to add_bss()/remove_bss()
> funtions instead of ifname. This allow us to handle
> remote hosts correctly while we can get hostname
> form apdev['hostname'].

Passing apdev as an additional argument would likely be acceptable, but
doing this instead of ifname sounds strange. apdev is supposed to
describe the main interface and the BSSes are independent of that and
use different ifname.

> diff --git a/tests/hwsim/test_ap_dynamic.py b/tests/hwsim/test_ap_dynamic.py
> @@ -92,111 +92,117 @@ def _test_ap_bss_add_remove(dev, apdev):
> -    ifname1 = apdev[0]['ifname']
> -    ifname2 = apdev[0]['ifname'] + '-2'
> -    ifname3 = apdev[0]['ifname'] + '-3'
> +    apdev1 = apdev[0].copy()
> +    apdev2 = apdev[0].copy()
> +    apdev2['ifname'] = apdev[0]['ifname'] + '-2'

This does not really make any sense to me. Why would there be multiple
apdev dicts for the same apdev with the ifname changed to point to a BSS

> -    hostapd.add_bss('phy3', ifname1, 'bss-1.conf')
> +    hostapd.add_bss('phy3', apdev1, 'bss-1.conf')

If we need apdev in add_bss(), I'd just add apdev[0] here as an argument
and leave ifname1 as-is.

I'm dropping this version and since the following patches in this series
were dependent on the changes from this patch, I'm also dropping them.
Please resubmit if you end up modifying this patch to leave in the
ifname argument.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list