blob: 802ad400f193de922f3bbd130937a86a6e20832b [file] [log] [blame]
# 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, tests that things autoconnect and disconnect properly when a
# profile is deleted.
# 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":"TestProfileDeleteEntry",
"steps":[
# Start with the 'test' profile and build a connection on it.
[ "create", { "type":"hostap" } ],
[ "config", { "ssid":"BottomSSID094",
"channel":"2412", "mode":"11g", "pureg":None,
"wepmode":"on",
"wep_key0": '"abcde"',
"wep_key1": '"vwxyz"',
"wep_key2": '"decba"',
"wep_key3": '"zyxwv"',
"deftxkey":"0" } ],
[ "connect", { "ssid":"BottomSSID094",
"security":"wep", "psk":"0:abcde" } ],
[ "client_check_service_properties",
{ "service":"BottomSSID094", "AutoConnect":1} ],
[ "client_check_profile_properties",
{ "entry":"BottomSSID094", "AutoConnect":1} ],
# Now, add a new profile with a new connection on it.
[ "profile_create", { "name":"top" } ],
[ "profile_push", { "name":"top" } ],
[ "config", { "ssid":"TopSSID094",
"channel":"5240", "mode":"11a",
"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":"TopSSID094",
"security":"wep", "psk":"0:abcde" } ],
[ "client_check_service_properties",
{ "service":"TopSSID094", "AutoConnect":1} ],
[ "client_check_profile_properties",
{ "entry":"TopSSID094", "AutoConnect":1} ],
# Delete the entry used by the profile. Tests Disconnect, verify
# autoconnect if disconnect.
[ "client_profile_delete_entry",
{ "profile":"top",
"entry":"TopSSID094" } ],
# Verify that 'TopSSID094' disconnects and 'BottomSSID094' connects.
[ "wait_service", { "run_timeout":10, # Wait up to 10 seconds
"debug":True, # Output all state changes
"states": [ # Wait for non-ready state
("TopSSID094", "idle")
] } ],
[ "wait_service", { "run_timeout":10, # Wait up to 10 seconds
"debug":True, # Output all state changes
"states": [ # Wait for "ready" state
("BottomSSID094", "online")
] } ],
# Cleanup.
[ "~deconfig" ], # TopSSID094
[ "~destroy" ],
[ "~profile_pop", { "name":"top" } ],
[ "~profile_remove", { "name":"top" } ],
[ "~disconnect" ], # BottomSSID094
[ "~deconfig" ],
[ "~client_profile_delete_entry",
{ "profile":"test",
"entry":"BottomSSID094" } ],
[ "~destroy" ],
],
}