Exemplo n.º 1
0
 def connect_vpn(self):
     """Connects the client to the VPN server."""
     proxy = self._shill_proxy
     with tpm_store.TPMStore() as tpm:
         service = proxy.get_service(self.get_vpn_client_properties(tpm))
         service.Connect()
         result = proxy.wait_for_property_in(service,
                                             proxy.SERVICE_PROPERTY_STATE,
                                             ('ready', 'online'),
                                             self.CONNECT_TIMEOUT_SECONDS)
     (successful, _, _) = result
     if not successful and self._expect_success:
         raise error.TestFail('VPN connection failed')
     if successful and not self._expect_success:
         raise error.TestFail('VPN connection suceeded '
                              'when it should have failed')
Exemplo n.º 2
0
 def __init__(self):
     self._wifi_proxy = wifi_proxy.WifiProxy()
     self._tpm_store = tpm_store.TPMStore()