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_bcm4371, suite:wifi_release, subsystem:wifi,'
     11               'suite:android_wifi_connect')
     12 DEPENDENCIES = 'wificell'
     13 
     14 DOC = """
     15 This test case verifies that the DUT accepts ascii and non-ascii
     16 type characters as the SSID
     17 """
     18 
     19 
     20 from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
     21 from autotest_lib.server.cros.network import hostap_config
     22 
     23 
     24 def 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 
     39 def 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 
     54 parallel_simple(run, machines)
     55