Sam Leffler | 7c77fc3 | 2011-02-11 17:05:55 -0800 | [diff] [blame] | 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 |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | # This test run is designed to test that the connection manager is able |
| 6 | # to roam to a previously connected AP when it loses connectivity to its |
| 7 | # current AP on resume. To accomplish this, we join one AP (so we are |
| 8 | # sure that flimflam remembers it), then join a second AP which we |
| 9 | # shut down while the DUT is suspended. We sit around and observe |
| 10 | # if and how long it takes for the connection manager to re-acquire |
| 11 | # connectivity to the first AP. We expect the DUT will resume, find |
| 12 | # the previous AP is gone, and then roam to the other AP. |
| 13 | { "name":"SuspendRoamRSN", |
| 14 | "steps":[ |
| 15 | [ "create", { "type":"hostap" } ], |
| 16 | |
| 17 | # NB: use a fixed SSID so we know what to reference below |
| 18 | [ "config", { "channel":"2412", "mode":"11g", |
| 19 | "ssid": 'SuspendRoamRSN_t1', |
| 20 | "wpa":"2", "wpa_key_mgmt":"WPA-PSK", |
| 21 | "wpa_pairwise":"CCMP", |
| 22 | "wpa_passphrase":"chromeos"} ], |
| 23 | |
| 24 | # Connect to the first AP. This just guarantees that this AP has |
| 25 | # been placed in the connection manager profile. |
| 26 | [ "connect", { "security":"rsn", "psk":"chromeos" } ], |
| 27 | [ "client_ping", { "count":"10" } ], |
| 28 | [ "deconfig" ], |
| 29 | |
| 30 | # Configure and connect to the second AP. |
| 31 | [ "config", { "channel":"5240", "mode":"11a", |
Sam Leffler | fcf4ba2 | 2011-10-31 12:54:42 -0700 | [diff] [blame] | 32 | "ssid_suffix": "t2", |
Sam Leffler | c9a3a4b | 2011-02-22 16:35:48 -0800 | [diff] [blame] | 33 | "wpa":"0"} ], |
Sam Leffler | 7c77fc3 | 2011-02-11 17:05:55 -0800 | [diff] [blame] | 34 | [ "connect", { "security":"none" } ], |
| 35 | [ "client_ping", { "count":"10" } ], |
Sam Leffler | 7c77fc3 | 2011-02-11 17:05:55 -0800 | [diff] [blame] | 36 | |
| 37 | # Ask the DUT to sleep for 20 seconds while we switch things around, |
| 38 | # then see how long it takes for the DUT to return the service to the |
| 39 | # "ready" state. As a result, the arguments to this command are a |
| 40 | # combination of suspend and wait_service arguments. In this case, |
| 41 | # except for "suspend_time", all arguments are to wait_change. Note |
| 42 | # that the wait_change occurs AFTER the suspend, 20 seconds later in |
| 43 | # this specific example. Note also that we must specify the SSID of |
| 44 | # the previous AP to wait for; otherwise this will wait for the AP |
| 45 | # we just deconfig'd to come ready (and fail). |
| 46 | [ "wait_service_suspend_bg", |
| 47 | { "suspend_time": "20", # How long to sleep |
| 48 | "run_timeout":20, # Maximum time to wait |
| 49 | "debug":True, # Output all state changes |
| 50 | "states": [ # Wait for "ready" state |
| 51 | ('SuspendRoamRSN_t1', 'ready') |
| 52 | ] } ], |
| 53 | |
| 54 | # Locally, let's wait 10 seconds to make sure the DUT is really asleep |
| 55 | # before we proceed. |
| 56 | [ "sleep", { "time":"15" } ], |
| 57 | |
| 58 | # Shut down the second AP and bring the first one back up |
mukesh agrawal | 0f358d9 | 2012-01-24 17:45:31 -0800 | [diff] [blame^] | 59 | [ "deconfig" ], |
Sam Leffler | 7c77fc3 | 2011-02-11 17:05:55 -0800 | [diff] [blame] | 60 | [ "config", { "channel":"2412", "mode":"11g", |
| 61 | "ssid": 'SuspendRoamRSN_t1', |
| 62 | "wpa":"2", "wpa_key_mgmt":"WPA-PSK", |
| 63 | "wpa_pairwise":"CCMP", |
| 64 | "wpa_passphrase":"chromeos"} ], |
| 65 | |
| 66 | # Wait for the DUT to wake up and return the results of wait_suspend |
| 67 | [ "wait_service_suspend_end", { } ], |
| 68 | |
| 69 | [ "client_ping", { "count":"10" } ], |
| 70 | |
| 71 | [ "destroy" ], |
| 72 | ], |
| 73 | } |