def test_RunStationModeAlreadyConnected(self): wlan_ap = WLAN() netcon = NetCon(self.DIR, self.ApCfg, NetCon.MODE_STATION, wlan_ap) netcon.StationSettingsStore(self.ApCfg["ssid"], self.ApCfg["pwd"]) netcon.SvcRun() exc_occurred = False try: netcon.SvcRun() except ServiceExceptionSuspend: exc_occurred = True self.assertTrue(exc_occurred) self.assertTrue(wlan_ap.active()) self.assertTrue(netcon.IsConnected()) netcon.StationSettingsReset()
def test_RunApMode(self): wlan_ap = WLAN() netcon = NetCon(self.DIR, self.ApCfg, NetCon.MODE_ACCESS_POINT, wlan_ap) netcon.SvcRun() self.assertTrue(wlan_ap.active()) netcon.StationSettingsReset()
def test_RunStationModeConnectOnFirstTry(self): wlan_ap = WLAN() netcon = NetCon(self.DIR, self.ApCfg, NetCon.MODE_STATION, wlan_ap) netcon.StationSettingsStore(self.ApCfg["ssid"], self.ApCfg["pwd"]) netcon.SvcRun() self.assertTrue(wlan_ap.active()) self.assertTrue(netcon.IsConnected()) netcon.StationSettingsReset()
def test_RunStationModeConnectAfterRetries(self): wlan_ap = WLAN() netcon = NetCon(self.DIR, self.ApCfg, NetCon.MODE_STATION, wlan_ap) wlan_ap.retries_set(NetCon.CONN_RETRIES - 1) netcon.StationSettingsStore(self.ApCfg["ssid"], self.ApCfg["pwd"]) netcon.SvcRun() self.assertTrue(wlan_ap.active()) self.assertTrue(netcon.IsConnected()) netcon.StationSettingsReset()
def test_DeinitApMode(self): wlan_ap = WLAN() netcon = NetCon(self.DIR, self.ApCfg, NetCon.MODE_ACCESS_POINT, wlan_ap) netcon.SvcRun() netcon.SvcDeinit() self.assertFalse(wlan_ap.active()) self.assertFalse(wlan_ap.isconnected()) netcon.StationSettingsReset()
def test_RunStationModeNoSettings(self): wlan_ap = WLAN() netcon = NetCon(self.DIR, self.ApCfg, NetCon.MODE_STATION, wlan_ap) exc_occurred = False try: netcon.SvcRun() except NetConExceptionNoStationSettings: exc_occurred = True self.assertTrue(exc_occurred) netcon.StationSettingsReset()