| 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 AUTHOR = "Sam Leffler <sleffler@google.com>" | 5 AUTHOR = "Sam Leffler <sleffler@google.com>" |
| 6 TIME = "LONG" | 6 TIME = "LONG" |
| 7 NAME = "WiFi SecMat" | 7 NAME = "WiFi SecMat" |
| 8 TEST_CATEGORY = "Stress" | 8 TEST_CATEGORY = "Stress" |
| 9 TEST_CLASS = "network" | 9 TEST_CLASS = "network" |
| 10 TEST_TYPE = "Server" | 10 TEST_TYPE = "Server" |
| 11 SYNC_COUNT = 2 | 11 SYNC_COUNT = 1 |
| 12 DOC = """ | 12 DOC = """ |
| 13 WiFiMatFunc is a suite of 3-machine tests to validate basic WiFi functionality. | 13 WiFiMatFunc is a suite of 3-machine tests to validate basic WiFi functionality. |
| 14 One client, one server, and one programmable WiFi AP/Router are required | 14 One client, one server, and one programmable WiFi AP/Router are required |
| 15 (either off-the-shelf with a network-accesible CLI or a Linux/BSD system | 15 (either off-the-shelf with a network-accesible CLI or a Linux/BSD system |
| 16 with a WiFi card that supports HostAP functionality). | 16 with a WiFi card that supports HostAP functionality). |
| 17 | 17 |
| 18 Configuration information to run_test: | 18 Configuration information to run_test: |
| 19 | 19 |
| 20 server - the IP address of the server (automatically filled in) | 20 server - the IP address of the server (automatically filled in) |
| 21 client - the IP address of the client (automatically filled in) | 21 client - the IP address of the client (automatically filled in) |
| 22 router - the IP address of the WiFi AP/Router and the names of the | 22 router - the IP address of the WiFi AP/Router and the names of the |
| 23 wifi and wired devices to configure | 23 wifi and wired devices to configure |
| 24 """ | 24 """ |
| 25 | 25 |
| 26 from autotest_lib.server import site_wifitest | 26 from autotest_lib.server import site_wifitest |
| 27 | 27 |
| 28 import os | 28 import os |
| 29 | 29 |
| 30 fd = open(os.path.join(job.configdir, "wifi_testbed_config")) | 30 config = site_wifitest.read_wifi_testbed_config( |
| 31 config = eval(fd.read()) | 31 os.path.join(job.configdir, "wifi_testbed_config"), |
| 32 client = config['client'] | 32 client_addr = machines[0]) # NB: take client identity from command line |
| 33 client['addr'] = machines[0] # NB: take client identity from command line | 33 |
| 34 client['host'] = hosts.create_host(client['addr']) | |
| 35 server = config['server'] | 34 server = config['server'] |
| 36 server['host'] = hosts.create_host(server['addr']) | |
| 37 router = config['router'] | 35 router = config['router'] |
| 38 router['host'] = hosts.create_host(router['addr']) | |
| 39 | 36 |
| 40 logging.info("Client %s, Server %s, AP %s" % \ | 37 logging.info("Client %s, Server %s, AP %s" % \ |
| 41 (client['addr'], server['addr'], router['addr'])) | 38 (machines[0], server.get('addr', 'N/A'), router['addr'])) |
| 42 | 39 |
| 43 tagname = router['addr'] | 40 tagname = config['tagname'] |
| 44 | 41 |
| 45 dir = os.path.join(job.serverdir, "site_tests", "network_WiFiSecMat") | 42 dir = os.path.join(job.serverdir, "site_tests", "network_WiFiSecMat") |
| 46 # TODO(sleffler) allow test list override from command line | 43 # TODO(sleffler) allow test list override from command line |
| 47 tests = site_wifitest.read_tests(dir, '[0-9]*') | 44 tests = site_wifitest.read_tests(dir, '[0-9]*') |
| 48 | 45 |
| 49 for t in tests: | 46 for t in tests: |
| 50 wt = site_wifitest.WiFiTest(t['name'], t['steps'], router, client, server) | 47 wt = site_wifitest.WiFiTest(t['name'], t['steps'], config) |
| 51 wt.run() | 48 wt.run() |
| OLD | NEW |