Home | History | Annotate | Download | only in network_WiFi_SuspendStress
      1 # Copyright 2016 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 = 'krisr, tienchang, bmahadev'
      6 NAME = 'network_WiFi_SuspendStress.stress_24HT40'
      7 TIME = 'LONG'
      8 TEST_TYPE = 'Server'
      9 DEPENDENCIES = 'servo, wificell'
     10 ATTRIBUTES = 'suite:wifi_stress'
     11 
     12 DOC = """
     13 This test uses servo to simulate lid close and open events and checks that the
     14 wifi adapter is brought back up and connects to a 802.11n network on 2.4 GHz.
     15 """
     16 
     17 from autotest_lib.client.common_lib.cros.network import xmlrpc_datatypes
     18 from autotest_lib.server.cros.network import hostap_config
     19 from autotest_lib.server import utils
     20 
     21 args_dict = utils.args_to_dict(args)
     22 servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
     23 
     24 def run(machine):
     25     try:
     26         host = hosts.create_host(machine, servo_args=servo_args)
     27     except IOError:
     28         # We probably failed to connect to the servo. That's probably
     29         # because the cell doesn't have a servo.
     30         #
     31         # Ideally, we'd raise TestNAError here, and be done. But the
     32         # test isn't actually running yet. So we instantiate a host
     33         # without servo, and let the network_WiFi_SuspendStress
     34         # instance report the TestNAError.
     35         host = hosts.create_host(machine)
     36 
     37     caps = [hostap_config.HostapConfig.N_CAPABILITY_GREENFIELD,
     38             hostap_config.HostapConfig.N_CAPABILITY_HT40]
     39     n = hostap_config.HostapConfig.MODE_11N_PURE
     40     configurations = [(hostap_config.HostapConfig(frequency=2437, mode=n,
     41                                                   n_capabilities=caps),
     42                        xmlrpc_datatypes.AssociationParameters())]
     43     job.run_test('network_WiFi_SuspendStress',
     44                  host=host,
     45                  tag=NAME.split('.')[1],
     46                  suspends=690,
     47                  raw_cmdline_args=args,
     48                  additional_params=configurations)
     49 
     50 parallel_simple(run, machines)
     51