blob: b0114688cefd5a65fcc1d0250ecad6d824f4e366 [file] [log] [blame]
# Copyright (c) 2013 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.
AUTHOR = 'wiley, pstew, quiche'
NAME = 'network_WiFi_SimpleConnect.wifi_checkNonAsciiSSID'
TIME = 'SHORT'
TEST_TYPE = 'Server'
ATTRIBUTES = ('suite:wifi_matfunc, suite:wifi_release, subsystem:wifi')
DEPENDENCIES = 'wificell'
DOC = """
This test case verifies that the DUT accepts ascii and non-ascii
type characters as the SSID
"""
from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
from autotest_lib.server.cros.network import hostap_config
def get_ssids():
SSID_SIZE = 32
ssids = []
for i in range(256 / SSID_SIZE):
base = i * SSID_SIZE
ssids.append(''.join(map(chr, range(base, base + SSID_SIZE))))
# Using valid Unicode characters only as SSID
ssids.append('\xe4\xb8\xad\xe5\x9b\xbd')
# Using a single extended ASCII character (a-grave) as SSID
ssids.append('\xe0')
# Using mix of ASCII and Unicode characters as SSID
ssids.append('Chrome\xe7\xac\x94\xe8\xae\xb0\xe6\x9c\xac')
return ssids
def run(machine):
g_mode = hostap_config.HostapConfig.MODE_11G
configurations = []
for ssid in get_ssids():
ap_config = hostap_config.HostapConfig(channel=1, mode=g_mode)
client_config = xmlrpc_datatypes.AssociationParameters()
configurations.append((ap_config, client_config))
host = hosts.create_host(machine)
job.run_test('network_WiFi_SimpleConnect',
tag=NAME.split('.')[1],
host=host,
raw_cmdline_args=args,
additional_params=configurations)
parallel_simple(run, machines)