autotests: test1AP: fix hw.conf for test-runner

This commit is contained in:
Rahul Rahul 2016-07-25 15:13:38 -07:00 committed by Denis Kenzior
parent f76a86d2b0
commit 6a4f24c920
8 changed files with 17 additions and 18 deletions

View File

@ -32,7 +32,8 @@ class TestAPShutdown(unittest.TestCase):
stdout_handle.close() stdout_handle.close()
os.close(slave) os.close(slave)
networkToConnect = utility.getNetworkToConnectTo(objectList) networkToConnect = utility.getNetworkToConnectTo(objectList,
"IntelWIFI")
# check if networkToConnect is not null. If yes, restart program # check if networkToConnect is not null. If yes, restart program
# so that the network list is updated. Alternatively, we can scan # so that the network list is updated. Alternatively, we can scan
# for networks. # for networks.
@ -58,10 +59,10 @@ class TestAPShutdown(unittest.TestCase):
"IntelWIFI") "IntelWIFI")
#kill AP #kill AP
pid_bytes = check_output("pgrep hostapd", shell=True) pid_bytes = check_output("pgrep -o -x hostapd", shell=True)
pid = pid_bytes.decode('utf-8') pid = pid_bytes.decode('utf-8')
logger.debug("shutting down AP with pid: %s", pid) logger.debug("shutting down AP with pid: %s", pid)
os.system("kill %d"%int(pid)) os.system("kill " + pid)
#should not be connected to any network after AP shutdown #should not be connected to any network after AP shutdown
logger.info("After AP shutdown, connected to: %s", logger.info("After AP shutdown, connected to: %s",
@ -82,6 +83,7 @@ class TestAPShutdown(unittest.TestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
global logger, bus, mainloop global logger, bus, mainloop
os.system("rm -rf /var/lib/iwd")
utility.initLogger() utility.initLogger()
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
bus = dbus.SystemBus() bus = dbus.SystemBus()

View File

@ -1,6 +1,3 @@
interface=wln0
driver=nl80211
hw_mode=g hw_mode=g
channel=1 channel=1
ssid=IntelWIFI ssid=IntelWIFI

View File

@ -1,6 +1,3 @@
interface=wln0
driver=nl80211
hw_mode=g hw_mode=g
channel=1 channel=1
ssid=IntelWIFI ssid=IntelWIFI

View File

@ -31,7 +31,8 @@ class TestConnectDisconnect(unittest.TestCase):
stdout_handle.close() stdout_handle.close()
os.close(slave) os.close(slave)
networkToConnect = utility.getNetworkToConnectTo(objectList) networkToConnect = utility.getNetworkToConnectTo(objectList,
"IntelWIFI")
# check if networkToConnect is not null. If yes, restart program # check if networkToConnect is not null. If yes, restart program
# so that the network list is updated. Alternatively, we can scan # so that the network list is updated. Alternatively, we can scan
# for networks. # for networks.

View File

@ -1,5 +1,6 @@
[SETUP] [SETUP]
num_radios=2 num_radios=3
[HOSTAPD] [HOSTAPD]
rad0=IntelWIFI.conf rad0=IntelWIFI_TKIP.conf
rad1=invalidPassphrase.conf

View File

@ -1,9 +1,6 @@
interface=wln0
driver=nl80211
hw_mode=g hw_mode=g
channel=1 channel=1
ssid=IntelWIFI ssid=IntelWIFI_WrongPW
wpa=1 wpa=1
wpa_pairwise=TKIP wpa_pairwise=TKIP

View File

@ -9,6 +9,7 @@ import logging
import os import os
from subprocess import Popen, PIPE, STDOUT from subprocess import Popen, PIPE, STDOUT
import sys import sys
import subprocess
sys.path.append('../utility') #needed to import all the utility modules sys.path.append('../utility') #needed to import all the utility modules
import utility import utility
import pty import pty
@ -31,7 +32,8 @@ class TestInvalidPassphrase(unittest.TestCase):
stdout_handle.close() stdout_handle.close()
os.close(slave) os.close(slave)
networkToConnect = utility.getNetworkToConnectTo(objectList) networkToConnect = utility.getNetworkToConnectTo(objectList,
"IntelWIFI_WrongPW")
# check if networkToConnect is not null. If yes, restart program # check if networkToConnect is not null. If yes, restart program
# so that the network list is updated. Alternatively, we can scan # so that the network list is updated. Alternatively, we can scan
# for networks. # for networks.
@ -66,6 +68,7 @@ class TestInvalidPassphrase(unittest.TestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
global logger, bus, mainloop global logger, bus, mainloop
os.system("rm -rf /var/lib/iwd")
utility.initLogger() utility.initLogger()
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
bus = dbus.SystemBus() bus = dbus.SystemBus()

View File

@ -23,7 +23,8 @@ class TestScanNetwork(unittest.TestCase):
os.execl(sys.executable, sys.executable, * sys.argv) os.execl(sys.executable, sys.executable, * sys.argv)
logger.info("Network Found: %s", networkName) logger.info("Network Found: %s", networkName)
self.assertEqual(networkName, "IntelWIFI") networkListToMatch = ["IntelWIFI", "IntelWIFI_WrongPW"]
self.assertIn(networkName, networkListToMatch)
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):