| 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 | |
| 8 | 7 |
| 9 def isLinuxRouter(router): | 8 def isLinuxRouter(router): |
| 10 router_uname = router.run('uname').stdout | 9 router_uname = router.run('uname').stdout |
| 11 return re.search('Linux', router_uname) | 10 return re.search('Linux', router_uname) |
| 12 | 11 |
| 13 class LinuxRouter(object): | 12 class LinuxRouter(object): |
| 14 """ | 13 """ |
| 15 Linux/mac80211-style WiFi Router support for WiFiTest class. | 14 Linux/mac80211-style WiFi Router support for WiFiTest class. |
| 16 | 15 |
| 17 This class implements test methods/steps that communicate with a | 16 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': | 250 elif k == 'ht': |
| 252 htcaps.add('') # NB: ensure 802.11n setup below | 251 htcaps.add('') # NB: ensure 802.11n setup below |
| 253 elif k == 'htprotmode': | 252 elif k == 'htprotmode': |
| 254 pass # TODO(sleffler) need hostapd support | 253 pass # TODO(sleffler) need hostapd support |
| 255 elif k == 'rifs': | 254 elif k == 'rifs': |
| 256 pass # TODO(sleffler) need hostapd support | 255 pass # TODO(sleffler) need hostapd support |
| 257 elif k == 'wepmode': | 256 elif k == 'wepmode': |
| 258 pass # NB: meaningless for hostapd; ignore | 257 pass # NB: meaningless for hostapd; ignore |
| 259 elif k == '-ampdu': | 258 elif k == '-ampdu': |
| 260 pass # TODO(sleffler) need hostapd support | 259 pass # TODO(sleffler) need hostapd support |
| 261 elif k == 'eap-tls': | |
| 262 conf.update(site_eap_tls.router_config(self.router, v)) | |
| 263 else: | 260 else: |
| 264 conf[k] = v | 261 conf[k] = v |
| 265 | 262 |
| 266 # Aggregate ht_capab. | 263 # Aggregate ht_capab. |
| 267 if htcaps: | 264 if htcaps: |
| 268 conf['ieee80211n'] = 1 | 265 conf['ieee80211n'] = 1 |
| 269 conf['ht_capab'] = ''.join(htcaps) | 266 conf['ht_capab'] = ''.join(htcaps) |
| 270 | 267 |
| 271 # Figure out the correct interface. | 268 # Figure out the correct interface. |
| 272 if conf.get('hw_mode', 'b') == 'a': | 269 if conf.get('hw_mode', 'b') == 'a': |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 341 |
| 345 def get_ssid(self): | 342 def get_ssid(self): |
| 346 return self.hostapd['conf']['ssid'] | 343 return self.hostapd['conf']['ssid'] |
| 347 | 344 |
| 348 | 345 |
| 349 def set_txpower(self, params): | 346 def set_txpower(self, params): |
| 350 self.router.run("%s dev %s set txpower %s" % | 347 self.router.run("%s dev %s set txpower %s" % |
| 351 (self.cmd_iw, params.get('interface', | 348 (self.cmd_iw, params.get('interface', |
| 352 self.hostapd['interface']), | 349 self.hostapd['interface']), |
| 353 params.get('power', 'auto'))) | 350 params.get('power', 'auto'))) |
| OLD | NEW |