| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging, re, time | 5 import logging, re, time |
| 6 from autotest_lib.client.common_lib import error | 6 from autotest_lib.client.common_lib import error |
| 7 from autotest_lib.server import site_eap_tls | 7 from autotest_lib.server import site_eap |
| 8 | 8 |
| 9 def isLinuxRouter(router): | 9 def isLinuxRouter(router): |
| 10 router_uname = router.run('uname').stdout | 10 router_uname = router.run('uname').stdout |
| 11 return re.search('Linux', router_uname) | 11 return re.search('Linux', router_uname) |
| 12 | 12 |
| 13 class LinuxRouter(object): | 13 class LinuxRouter(object): |
| 14 """ | 14 """ |
| 15 Linux/mac80211-style WiFi Router support for WiFiTest class. | 15 Linux/mac80211-style WiFi Router support for WiFiTest class. |
| 16 | 16 |
| 17 This class implements test methods/steps that communicate with a | 17 This class implements test methods/steps that communicate with a |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 elif k == 'ht': | 251 elif k == 'ht': |
| 252 htcaps.add('') # NB: ensure 802.11n setup below | 252 htcaps.add('') # NB: ensure 802.11n setup below |
| 253 elif k == 'htprotmode': | 253 elif k == 'htprotmode': |
| 254 pass # TODO(sleffler) need hostapd support | 254 pass # TODO(sleffler) need hostapd support |
| 255 elif k == 'rifs': | 255 elif k == 'rifs': |
| 256 pass # TODO(sleffler) need hostapd support | 256 pass # TODO(sleffler) need hostapd support |
| 257 elif k == 'wepmode': | 257 elif k == 'wepmode': |
| 258 pass # NB: meaningless for hostapd; ignore | 258 pass # NB: meaningless for hostapd; ignore |
| 259 elif k == '-ampdu': | 259 elif k == '-ampdu': |
| 260 pass # TODO(sleffler) need hostapd support | 260 pass # TODO(sleffler) need hostapd support |
| 261 elif k == 'eap-tls': | 261 elif k == 'eap': |
| 262 conf.update(site_eap_tls.router_config(self.router, v)) | 262 conf.update(site_eap.router_config(self.router, v)) |
| 263 else: | 263 else: |
| 264 conf[k] = v | 264 conf[k] = v |
| 265 | 265 |
| 266 # Aggregate ht_capab. | 266 # Aggregate ht_capab. |
| 267 if htcaps: | 267 if htcaps: |
| 268 conf['ieee80211n'] = 1 | 268 conf['ieee80211n'] = 1 |
| 269 conf['ht_capab'] = ''.join(htcaps) | 269 conf['ht_capab'] = ''.join(htcaps) |
| 270 | 270 |
| 271 # Figure out the correct interface. | 271 # Figure out the correct interface. |
| 272 if conf.get('hw_mode', 'b') == 'a': | 272 if conf.get('hw_mode', 'b') == 'a': |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 def get_ssid(self): | 345 def get_ssid(self): |
| 346 return self.hostapd['conf']['ssid'] | 346 return self.hostapd['conf']['ssid'] |
| 347 | 347 |
| 348 | 348 |
| 349 def set_txpower(self, params): | 349 def set_txpower(self, params): |
| 350 self.router.run("%s dev %s set txpower %s" % | 350 self.router.run("%s dev %s set txpower %s" % |
| 351 (self.cmd_iw, params.get('interface', | 351 (self.cmd_iw, params.get('interface', |
| 352 self.hostapd['interface']), | 352 self.hostapd['interface']), |
| 353 params.get('power', 'auto'))) | 353 params.get('power', 'auto'))) |
| OLD | NEW |