tests: hostapd.py/wpasupplicant.py use Host when executing commands
Execute commands using the Host class. This enables use of remote hosts as well. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This commit is contained in:
parent
2fa2671573
commit
8ce4855b23
2 changed files with 17 additions and 17 deletions
|
@ -10,6 +10,7 @@ import logging
|
|||
import binascii
|
||||
import struct
|
||||
import wpaspy
|
||||
import remotehost
|
||||
|
||||
logger = logging.getLogger()
|
||||
hapd_ctrl = '/var/run/hostapd'
|
||||
|
@ -20,6 +21,7 @@ def mac2tuple(mac):
|
|||
|
||||
class HostapdGlobal:
|
||||
def __init__(self, hostname=None, port=8878):
|
||||
self.host = remotehost.Host(hostname)
|
||||
self.hostname = hostname
|
||||
self.port = port
|
||||
if hostname is None:
|
||||
|
@ -110,6 +112,7 @@ class HostapdGlobal:
|
|||
|
||||
class Hostapd:
|
||||
def __init__(self, ifname, bssidx=0, hostname=None, port=8877):
|
||||
self.host = remotehost.Host(hostname, ifname)
|
||||
self.ifname = ifname
|
||||
if hostname is None:
|
||||
self.ctrl = wpaspy.Ctrl(os.path.join(hapd_ctrl, ifname))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue