Home | History | Annotate | Download | only in ap_configurators
      1 # Copyright (c) 2014 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 import ap_spec
      6 import belkinF9K_ap_configurator
      7 
      8 
      9 class BelkinF9K1002v4APConfigurator(belkinF9K_ap_configurator.
     10                                     BelkinF9KAPConfigurator):
     11     """Derived class to control the BelkinF9K 1002v4 AP configurator."""
     12 
     13     def __init__(self, ap_config):
     14         super(BelkinF9K1002v4APConfigurator, self).__init__(ap_config)
     15         self._dhcp_delay = 0
     16 
     17 
     18     def _set_security_wpapsk(self, security, shared_key, update_interval=None):
     19         security_popup = '//select[@name="security_type"]'
     20         key_field = '//input[@name="wpa_key_text"]'
     21         psk = '//select[@name="authentication"]'
     22         self.select_item_from_popup_by_xpath('WPA/WPA2-Personal (PSK)',
     23                                              self.security_popup,
     24                                              wait_for_xpath=key_field,
     25                                              alert_handler=self._security_alert)
     26         auth_type = 'WPA-PSK'
     27         if security == ap_spec.SECURITY_TYPE_WPA2PSK:
     28             auth_type = 'WPA2-PSK'
     29         self.select_item_from_popup_by_xpath(auth_type, psk,
     30                                              wait_for_xpath=key_field,
     31                                              alert_handler=self._security_alert)
     32         self.set_content_of_text_field_by_xpath(shared_key, key_field,
     33                                                 abort_check=True)
     34