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

@ -6,6 +6,7 @@
import os
import time
import remotehost
def get_ifnames():
ifnames = []
@ -80,3 +81,24 @@ def skip_with_fips(dev, reason="Not supported in FIPS mode"):
res = dev.get_capability("fips")
if res and 'FIPS' in res:
raise HwsimSkip(reason)
def get_phy(ap, ifname=None):
phy = "phy3"
try:
hostname = ap['hostname']
except:
hostname = None
host = remotehost.Host(hostname)
if ifname == None:
ifname = ap['ifname']
status, buf = host.execute("iw dev " + ifname + " info")
if status != 0:
raise Exception("iw " + ifname + " info failed")
lines = buf.split("\n")
for line in lines:
if "wiphy" in line:
words = line.split()
phy = "phy" + words[1]
break
return phy