tests: Pass apdev to hostapd.add_bss()

Pass apdev param to hostapd.add_bss(). Kill hardcoded phy param and get
phy base on apdev. These are needed to support operation with a remote
test host.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This commit is contained in:
Janusz Dziedzic 2016-04-07 07:38:02 +02:00 committed by Jouni Malinen
parent 29444a0863
commit 9cd6f4c015
6 changed files with 68 additions and 39 deletions

View file

@ -11,6 +11,7 @@ import binascii
import struct
import wpaspy
import remotehost
import utils
logger = logging.getLogger()
hapd_ctrl = '/var/run/hostapd'
@ -389,9 +390,16 @@ def add_ap(apdev, params, wait_enabled=True, no_enable=False, timeout=30):
raise Exception("AP startup failed")
return hapd
def add_bss(phy, ifname, confname, ignore_error=False, hostname=None,
port=8878):
logger.info("Starting BSS phy=" + phy + " ifname=" + ifname)
def add_bss(apdev, ifname, confname, ignore_error=False):
phy = utils.get_phy(apdev)
try:
hostname = apdev['hostname']
port = apdev['port']
logger.info("Starting BSS " + hostname + "/" + port + " phy=" + phy + " ifname=" + ifname)
except:
logger.info("Starting BSS phy=" + phy + " ifname=" + ifname)
hostname = None
port = 8878
hapd_global = HostapdGlobal(hostname=hostname, port=port)
hapd_global.add_bss(phy, confname, ignore_error)
port = hapd_global.get_ctrl_iface_port(ifname)