def testConnectToSharedHiddenNetwork(self): """Can connect to shared hidden network and verify that it's shared.""" router_name = 'Netgear_WGR614' test_utils.LoginToDevice(self) router = self._SetupRouter(router_name) error = self.ConnectToWifiRouter(router_name) self.assertFalse(error, msg='Failed to connect to hidden network %s. ' 'Reason: %s.' % (router['ssid'], error)) service_path = self.GetServicePath(router['ssid']) self.assertTrue( service_path in self.NetworkScan()['remembered_wifi'], msg='Hidden network is not added to the remembered list.') self.Logout() test_utils.LoginToDevice(self, test_account='test_google_account_2') self.assertTrue(service_path in self.NetworkScan()['remembered_wifi'], msg='Shared hidden network is not in other user\'s ' 'remembered list.')
def testConnectToNonSharedHiddenNetwork(self): """Can connect to a non-shared hidden network. Verify that it is not shared with other users. """ router_name = 'Linksys_WRT54GL' test_utils.LoginToDevice(self) router = self._SetupRouter(router_name) error = self.ConnectToWifiRouter(router_name, shared=False) self.assertFalse(error, msg='Failed to connect to hidden network %s. ' 'Reason: %s.' % (router['ssid'], error)) service_path = self.GetServicePath(router['ssid']) self.assertTrue( service_path in self.NetworkScan()['remembered_wifi'], msg='Hidden network is not added to the remembered list.') self.Logout() test_utils.LoginToDevice(self, test_account='test_google_account_2') self.assertFalse(service_path in self.NetworkScan()['remembered_wifi'], msg='Non-shared hidden network %s is shared.' % router['ssid'])
def testConnectToSharedOpenNetwork(self): """Can connect to a shared open network. Verify that the connected network is in the remembered network list for all the users. """ router_name = 'Trendnet_639gr_4' test_utils.LoginToDevice(self) router = self._SetupRouter(router_name) error = self.ConnectToWifiRouter(router_name) self.assertFalse(error, msg='Failed to connect to wifi network %s. ' 'Reason: %s.' % (router['ssid'], error)) service_path = self.GetServicePath(router['ssid']) self.assertTrue( service_path in self.GetNetworkInfo()['remembered_wifi'], msg='Open wifi is not remembered for the current user.') self.Logout() test_utils.LoginToDevice(self, test_account='test_google_account_2') self.assertTrue(service_path in self.NetworkScan()['remembered_wifi'], msg='Open network is not shared with other users.')
def testConnectToEncryptedNetworkInLoginScreen(self): """Can connect to encrypted network in login screen. Verify that this network is in the remembered list after login. """ router_name = 'Belkin_G' if self.GetLoginInfo()['is_logged_in']: self.Logout() router = self._SetupRouter(router_name) error = self.ConnectToWifiRouter(router_name) self.assertFalse( error, 'Failed to connect to wifi network %s. ' 'Reason: %s.' % (router['ssid'], error)) service_path = self.GetServicePath(router['ssid']) self._VerifyIfConnectedToNetwork(router['ssid'], 'Connected') test_utils.LoginToDevice(self) self.assertTrue(service_path in self.NetworkScan()['remembered_wifi'], msg='Network is not added to the remembered list.')
def testConnectNoShareEncryptedNetwork(self): """A non-shared encrypted network can connect and is remembered. Note: This test does not verify that the network is added to the private profile """ router_name = 'D-Link_N150' test_utils.LoginToDevice(self) router = self._SetupRouter(router_name) error = self.ConnectToWifiRouter(router_name, shared=False) self.assertFalse( error, 'Failed to connect to wifi network %s. ' 'Reason: %s.' % (router['ssid'], error)) service_path = self.GetServicePath(router['ssid']) self.assertTrue( service_path in self.GetNetworkInfo()['remembered_wifi'], 'Connected wifi was not added to the remembered list.') self.ForgetWifiNetwork(service_path) self.assertFalse( service_path in self.GetNetworkInfo()['remembered_wifi'], 'Connected wifi was not removed from the remembered list.')