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 | 5 import logging, re |
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 | 8 |
8 def isLinuxRouter(router): | 9 def isLinuxRouter(router): |
9 router_uname = router.run('uname').stdout | 10 router_uname = router.run('uname').stdout |
10 return re.search('Linux', router_uname) | 11 return re.search('Linux', router_uname) |
11 | 12 |
12 class LinuxRouter(object): | 13 class LinuxRouter(object): |
13 """ | 14 """ |
14 Linux/mac80211-style WiFi Router support for WiFiTest class. | 15 Linux/mac80211-style WiFi Router support for WiFiTest class. |
15 | 16 |
16 This class implements test methods/steps that communicate with a | 17 This class implements test methods/steps that communicate with a |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 elif k == 'ht': | 248 elif k == 'ht': |
248 htcaps.add('') # NB: ensure 802.11n setup below | 249 htcaps.add('') # NB: ensure 802.11n setup below |
249 elif k == 'htprotmode': | 250 elif k == 'htprotmode': |
250 pass # TODO(sleffler) need hostapd support | 251 pass # TODO(sleffler) need hostapd support |
251 elif k == 'rifs': | 252 elif k == 'rifs': |
252 pass # TODO(sleffler) need hostapd support | 253 pass # TODO(sleffler) need hostapd support |
253 elif k == 'wepmode': | 254 elif k == 'wepmode': |
254 pass # NB: meaningless for hostapd; ignore | 255 pass # NB: meaningless for hostapd; ignore |
255 elif k == '-ampdu': | 256 elif k == '-ampdu': |
256 pass # TODO(sleffler) need hostapd support | 257 pass # TODO(sleffler) need hostapd support |
| 258 elif k == 'eap-tls': |
| 259 conf.update(site_eap_tls.router_config(self.router, v)) |
257 else: | 260 else: |
258 conf[k] = v | 261 conf[k] = v |
259 | 262 |
260 # Aggregate ht_capab. | 263 # Aggregate ht_capab. |
261 if htcaps: | 264 if htcaps: |
262 conf['ieee80211n'] = 1 | 265 conf['ieee80211n'] = 1 |
263 conf['ht_capab'] = ''.join(htcaps) | 266 conf['ht_capab'] = ''.join(htcaps) |
264 | 267 |
265 # Figure out the correct interface. | 268 # Figure out the correct interface. |
266 if conf.get('hw_mode', 'b') == 'a': | 269 if conf.get('hw_mode', 'b') == 'a': |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 self.router.run("%s link set %s down" % (self.cmd_ip, self.bridgeif), | 315 self.router.run("%s link set %s down" % (self.cmd_ip, self.bridgeif), |
313 ignore_status=True) | 316 ignore_status=True) |
314 self.router.run("%s delbr %s" % (self.cmd_brctl, self.bridgeif), | 317 self.router.run("%s delbr %s" % (self.cmd_brctl, self.bridgeif), |
315 ignore_status=True) | 318 ignore_status=True) |
316 | 319 |
317 self.hostapd['configured'] = False | 320 self.hostapd['configured'] = False |
318 | 321 |
319 | 322 |
320 def get_ssid(self): | 323 def get_ssid(self): |
321 return self.hostapd['conf']['ssid'] | 324 return self.hostapd['conf']['ssid'] |
OLD | NEW |