blob: 999df4536e4cba4a3bc5c3d8bbf2681776fd8e28 [file] [log] [blame] [edit]
# Copyright (c) 2012 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.
# Purpose: This test case verifies the API for accessing Profiles and Entries.
# In particular, this test verifies that autoconnect works correctly on push
# and pop.
# TODO(wdg): All of this should also be done for users/logging-in so that we
# test a different type of profile.
# NOTE: this needs to be run on the hardware. The VM won't handle 2 access
# points and 'create' throws-away the old SSID in favor of the new one.
{ "name":"TestProfilePopPush",
"steps":[
# Start with the 'test' profile and build a connection on it.
[ "create", { "type":"hostap" } ],
[ "config", { "ssid":"BottomSSID093",
"channel":"2412", "mode":"11g", "pureg":None,
"wepmode":"on",
"wep_key0": '"abcde"',
"wep_key1": '"vwxyz"',
"wep_key2": '"decba"',
"wep_key3": '"zyxwv"',
"deftxkey":"0" } ],
[ "connect", { "ssid":"BottomSSID093",
"security":"wep", "psk":"0:abcde" } ],
[ "client_check_service_properties",
{ "service":"BottomSSID093", "AutoConnect":1} ],
[ "client_check_profile_properties",
{ "entry":"BottomSSID093", "AutoConnect":1} ],
# Now, add a new profile with a new connection on it.
[ "profile_create", { "name":"top" } ],
[ "profile_push", { "name":"top" } ],
[ "create", { "type":"hostap" } ],
[ "config", { "ssid":"TopSSID093",
"channel":"5240", "ht40-":None, "puren":None,
"multi_interface":None, # Create 2nd access point.
"wepmode":"on",
"wep_key0": '"abcde"',
"wep_key1": '"vwxyz"',
"wep_key2": '"decba"',
"wep_key3": '"zyxwv"',
"deftxkey":"0" } ],
[ "connect", { "ssid":"TopSSID093",
"security":"wep", "psk":"0:abcde" } ],
[ "client_check_service_properties",
{ "service":"TopSSID093", "AutoConnect":1} ],
[ "client_check_profile_properties",
{ "entry":"TopSSID093", "AutoConnect":1} ],
# Pop the profile. Tests Disconnect on pop, Verify autoconnect if
# disconnect on pop.
[ "profile_pop", { "name":"top" } ],
# Verify that 'TopSSID093' disconnects and 'BottomSSID093' connects.
[ "wait_service", { "run_timeout":10, # Wait up to 10 seconds
"debug":True, # Output all state changes
"states": [ # Wait for non-ready state
('TopSSID093', '-ready')
] } ],
[ "wait_service", { "run_timeout":10, # Wait up to 10 seconds
"debug":True, # Output all state changes
"states": [ # Wait for "ready" state
('BottomSSID093', 'ready') # TODO: not ready
] } ],
[ "disconnect", { "ssid":"BottomSSID093" } ],
# Verify that autoconnect happens if device is disconnected on push.
[ "profile_push", { "name":"top" } ],
# Verify TopSSID093 autoconnect
[ "wait_service", { "run_timeout":10, # Wait up to 10 seconds
"debug":True, # Output all state changes
"states": [ # Wait for non-ready state
('TopSSID093', 'ready')
] } ],
# Cleanup.
[ "~deconfig" ], # TopSSID093
[ "~destroy" ], # TopSSID093
[ "~profile_pop", { "name":"top" } ],
[ "~profile_remove", { "name":"top" } ],
[ "~deconfig" ], # BottomSSID093
[ "~client_profile_delete_entry",
{ "profile":"test",
"entry":"BottomSSID093" } ],
[ "~destroy" ], # BottomSSID093
],
}