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 """WiFiMatFunc is a suite of 3-machine tests to validate basic WiFi functionalit
y. | 5 """WiFiMatFunc is a suite of 3-machine tests to validate basic WiFi functionalit
y. |
6 One client, one server, and one programmable WiFi AP/Router are required | 6 One client, one server, and one programmable WiFi AP/Router are required |
7 (either off-the-shelf with a network-accesible CLI or a Linux/BSD system | 7 (either off-the-shelf with a network-accesible CLI or a Linux/BSD system |
8 with a WiFi card that supports HostAP functionality). | 8 with a WiFi card that supports HostAP functionality). |
9 | 9 |
10 Configuration information to run_test: | 10 Configuration information to run_test: |
11 | 11 |
12 server - the IP address of the server (automatically filled in) | 12 server - the IP address of the server (automatically filled in) |
13 client - the IP address of the client (automatically filled in) | 13 client - the IP address of the client (automatically filled in) |
14 router - the IP address of the WiFi AP/Router and the names of the | 14 router - the IP address of the WiFi AP/Router and the names of the |
15 wifi and wired devices to configure | 15 wifi and wired devices to configure |
16 """ | 16 """ |
17 | 17 |
| 18 from autotest_lib.server import site_wifitest |
18 | 19 |
19 from autotest_lib.client.bin import utils | 20 class network_WiFiMatFunc(site_wifitest.test): |
20 from autotest_lib.client.common_lib import error | 21 pass |
21 from autotest_lib.server import autotest, site_wifitest, test | |
22 | |
23 import logging | |
24 | |
25 | |
26 class network_WiFiMatFunc(test.test): | |
27 version = 1 | |
28 | |
29 def expect_failure(self, name, reason): | |
30 if reason is None: | |
31 reason = "no reason given" | |
32 logging.info("%s: ignore failure (%s)", name, reason) | |
33 | |
34 | |
35 # The testcase config, setup, etc are done out side the individual | |
36 # test loop, in the control file. | |
37 def run_once(self, testcase, config): | |
38 name = testcase['name'] | |
39 try: | |
40 if 'skip_test' in testcase: | |
41 logging.info("%s: SKIP: %s", name, testcase['skip_test']) | |
42 else: | |
43 wt = site_wifitest.WiFiTest(name, testcase['steps'], config) | |
44 wt.run() | |
45 wt.write_keyvals(self) | |
46 except error.TestFail: | |
47 if 'expect_failure' in testcase: | |
48 self.expect_failure(name, testcase['expect_failure']) | |
49 else: | |
50 raise | |
51 except Exception, e: | |
52 if 'expect_failure' in testcase: | |
53 self.expect_failure(name, testcase['expect_failure']) | |
54 else: | |
55 raise error.TestFail(e) | |
56 | |
OLD | NEW |