| # 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 seeks to place the DUT in suspend-to-RAM, rearrange the |
| # environment behind the DUT's back and watch what happens when the |
| # DUT wakes up. |
| { "name":"Suspend", |
| "steps":[ # Channel 1,6,11 |
| [ "create", { "type":"hostap" } ], |
| |
| # Connect the DUT to an AP |
| [ "config", { "channel":"2412", "mode":"11b", |
| "ssid_suffix": "t1"} ], |
| [ "connect", { "security":"none" } ], |
| [ "client_ping", { "count":"10" } ], |
| |
| # Put the system to sleep for 10 seconds |
| [ "client_suspend", { "suspend_time": "10" } ], |
| |
| # For this short of a duration, the DUT should still consider itself |
| # connected to the AP and simply resume without re-associating |
| [ "client_ping", { "count":"10" } ], |
| |
| # TODO(pstew): Do a test run where the AP is configured to forget |
| # the DUT fairly quickly, and suspend the DUT long enough that this |
| # happens. |
| |
| # TODO(pstew): Try this with more and different (more widely spaced) |
| # channels, different bands, differnt operating modes, crypto, etc. |
| |
| # 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. |
| [ "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": [ |
| (None, '+ready') # Wait for "ready" state |
| ] } ], |
| |
| # Locally, let's wait 10 seconds to make sure the DUT is really asleep |
| # before we proceed. |
| [ "sleep", { "time":"15" } ], |
| |
| # Change the channel that the AP sits on. Switch bands too, which has |
| # the side-effect on our APs of changing the MAC address as well |
| [ "config", { "channel":"5240", "mode":"11a", |
| "ssid_suffix": "t1"} ], |
| |
| # Wait for the DUT to wake up and return the results of wait_suspend |
| [ "wait_service_suspend_end", { } ], |
| |
| [ "client_ping", { "count":"10" } ], |
| |
| [ "destroy" ], |
| |
| ], |
| } |