| 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 common, fnmatch, logging, os, re, string, threading, time | 5 import common, fnmatch, logging, os, re, string, threading, time |
| 6 | 6 |
| 7 from autotest_lib.server import autotest, hosts, subcommand | 7 from autotest_lib.server import autotest, hosts, subcommand |
| 8 from autotest_lib.server import site_bsd_router | 8 from autotest_lib.server import site_bsd_router |
| 9 from autotest_lib.server import site_linux_router | 9 from autotest_lib.server import site_linux_router |
| 10 from autotest_lib.server import site_host_attributes | 10 from autotest_lib.server import site_host_attributes |
| 11 from autotest_lib.server import site_eap_tls | 11 from autotest_lib.server import site_eap |
| 12 from autotest_lib.server import test | 12 from autotest_lib.server import test |
| 13 from autotest_lib.client.common_lib import error | 13 from autotest_lib.client.common_lib import error |
| 14 | 14 |
| 15 class NotImplemented(Exception): | 15 class NotImplemented(Exception): |
| 16 def __init__(self, what): | 16 def __init__(self, what): |
| 17 self.what = what | 17 self.what = what |
| 18 | 18 |
| 19 | 19 |
| 20 def __str__(self): | 20 def __str__(self): |
| 21 return repr("Test method '%s' not implemented" % self.what) | 21 return repr("Test method '%s' not implemented" % self.what) |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 self.client.send_file(src_file, dest_file, delete_dest=True) | 318 self.client.send_file(src_file, dest_file, delete_dest=True) |
| 319 self.client_installed_scripts[script_name] = script_client_file | 319 self.client_installed_scripts[script_name] = script_client_file |
| 320 return script_client_file | 320 return script_client_file |
| 321 | 321 |
| 322 | 322 |
| 323 def connect(self, params): | 323 def connect(self, params): |
| 324 """ Connect client to AP/router """ | 324 """ Connect client to AP/router """ |
| 325 | 325 |
| 326 script_client_file = self.install_script('site_wlan_connect.py', | 326 script_client_file = self.install_script('site_wlan_connect.py', |
| 327 'site_wlan_wait_state.py') | 327 'site_wlan_wait_state.py') |
| 328 if 'eap-tls' in params: | 328 if 'eap' in params: |
| 329 params.update(site_eap_tls.client_config(self.client, | 329 params.update(site_eap.client_config(self.client, |
| 330 params['eap-tls'], | 330 params['eap'], |
| 331 params.get('server-auth', | 331 params.get('server-auth', |
| 332 None))) | 332 None))) |
| 333 | 333 |
| 334 flags = [] | 334 flags = [] |
| 335 if params.get('debug', True): | 335 if params.get('debug', True): |
| 336 flags.append('--debug') | 336 flags.append('--debug') |
| 337 if params.get('hidden', False): | 337 if params.get('hidden', False): |
| 338 flags.append('--hidden') | 338 flags.append('--hidden') |
| 339 | 339 |
| 340 result = self.client.run('python "%s" %s "%s" "%s" "%s" "%d" "%d"' % | 340 result = self.client.run('python "%s" %s "%s" "%s" "%s" "%d" "%d"' % |
| 341 (script_client_file, | 341 (script_client_file, |
| 342 ' '.join(flags), | 342 ' '.join(flags), |
| (...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 except error.TestFail: | 1142 except error.TestFail: |
| 1143 if 'expect_failure' in testcase: | 1143 if 'expect_failure' in testcase: |
| 1144 self.expect_failure(name, testcase['expect_failure']) | 1144 self.expect_failure(name, testcase['expect_failure']) |
| 1145 else: | 1145 else: |
| 1146 raise | 1146 raise |
| 1147 except Exception, e: | 1147 except Exception, e: |
| 1148 if 'expect_failure' in testcase: | 1148 if 'expect_failure' in testcase: |
| 1149 self.expect_failure(name, testcase['expect_failure']) | 1149 self.expect_failure(name, testcase['expect_failure']) |
| 1150 else: | 1150 else: |
| 1151 raise | 1151 raise |
| OLD | NEW |