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