blob: 92bec236027c5e77621e542b30057840c1cc7411 [file] [log] [blame]
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This test run is designed to test that the connection manager is able
# to roam to a previously connected AP when it loses connectivity to its
# current AP on resume. To accomplish this, we join one AP (so we are
# sure that flimflam remembers it), then join a second AP which we
# shut down while the DUT is suspended. We sit around and observe
# if and how long it takes for the connection manager to re-acquire
# connectivity to the first AP. We expect the DUT will resume, find
# the previous AP is gone, and then roam to the other AP.
{ "name":"SuspendRoamWPA",
"steps":[
[ "create", { "type":"hostap" } ],
# NB: use a fixed SSID so we know what to reference below
[ "config", { "channel":"2412", "mode":"11g",
"ssid": 'SuspendRoamWPA_t1',
"wpa":"1", "wpa_key_mgmt":"WPA-PSK",
"wpa_pairwise":"TKIP",
"wpa_passphrase":"chromeos"} ],
# Connect to the first AP. This just guarantees that this AP has
# been placed in the connection manager profile.
[ "connect", { "security":"wpa", "psk":"chromeos" } ],
[ "client_ping", { "count":"10" } ],
[ "deconfig" ],
# Configure and connect to the second AP.
[ "config", { "channel":"5240", "mode":"11a",
"ssid_suffix": "t2",
"wpa":"0"} ],
[ "connect", { "security":"none" } ],
[ "client_ping", { "count":"10" } ],
# Ask the DUT to sleep for 20 seconds while we switch things around,
# then see how long it takes for the DUT to return the service to the
# "ready" state. As a result, the arguments to this command are a
# combination of suspend and wait_service arguments. In this case,
# except for "suspend_time", all arguments are to wait_change. Note
# that the wait_change occurs AFTER the suspend, 20 seconds later in
# this specific example. Note also that we must specify the SSID of
# the previous AP to wait for; otherwise this will wait for the AP
# we just deconfig'd to come ready (and fail).
[ "wait_service_suspend_bg",
{ "suspend_time": "20", # How long to sleep
"run_timeout":20, # Maximum time to wait
"debug":True, # Output all state changes
"states": [ # Wait for "ready" state
('SuspendRoamWPA_t1', 'ready')
] } ],
# Locally, let's wait 10 seconds to make sure the DUT is really asleep
# before we proceed.
[ "sleep", { "time":"15" } ],
# Shut down the second AP and bring the first one back up
[ "deconfig" ],
[ "config", { "channel":"2412", "mode":"11g",
"ssid": 'SuspendRoamWPA_t1',
"wpa":"1", "wpa_key_mgmt":"WPA-PSK",
"wpa_pairwise":"TKIP",
"wpa_passphrase":"chromeos"} ],
# Wait for the DUT to wake up and return the results of wait_suspend
[ "wait_service_suspend_end", { } ],
[ "client_ping", { "count":"10" } ],
[ "destroy" ],
],
}