1# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5AUTHOR = 'wiley, pstew, quiche' 6NAME = 'network_WiFi_SimpleConnect.wifi_checkNonAsciiSSID' 7TIME = 'SHORT' 8TEST_TYPE = 'Server' 9ATTRIBUTES = ('suite:wifi_correctness_cros_core, suite:wifi_matfunc, ' 10 'suite:wifi_matfunc_bcm4371, suite:wifi_release, subsystem:wifi,' 11 'suite:android_wifi_connect') 12DEPENDENCIES = 'wificell' 13 14DOC = """ 15This test case verifies that the DUT accepts ascii and non-ascii 16type characters as the SSID 17""" 18 19 20from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes 21from autotest_lib.server.cros.network import hostap_config 22 23 24def get_ssids(): 25 SSID_SIZE = 32 26 ssids = [] 27 for i in range(256 / SSID_SIZE): 28 base = i * SSID_SIZE 29 ssids.append(''.join(map(chr, range(base, base + SSID_SIZE)))) 30 # Using valid Unicode characters only as SSID 31 ssids.append('\xe4\xb8\xad\xe5\x9b\xbd') 32 # Using a single extended ASCII character (a-grave) as SSID 33 ssids.append('\xe0') 34 # Using mix of ASCII and Unicode characters as SSID 35 ssids.append('Chrome\xe7\xac\x94\xe8\xae\xb0\xe6\x9c\xac') 36 return ssids 37 38 39def run(machine): 40 g_mode = hostap_config.HostapConfig.MODE_11G 41 configurations = [] 42 for ssid in get_ssids(): 43 ap_config = hostap_config.HostapConfig(channel=1, mode=g_mode) 44 client_config = xmlrpc_datatypes.AssociationParameters() 45 configurations.append((ap_config, client_config)) 46 host = hosts.create_host(machine) 47 job.run_test('network_WiFi_SimpleConnect', 48 tag=NAME.split('.')[1], 49 host=host, 50 raw_cmdline_args=args, 51 additional_params=configurations) 52 53 54parallel_simple(run, machines) 55