Home | History | Annotate | Download | only in moblab_RunSuite
      1 # Copyright (c) 2014 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 = "chromeos-moblab (a] google.com"
      6 NAME = "moblab_SmokeSuite"
      7 PURPOSE = "Test that Moblab can run the smoke suite."
      8 ATTRIBUTES = "suite:moblab"
      9 TIME = "MEDIUM"
     10 TEST_CATEGORY = "Functional"
     11 TEST_CLASS = "moblab"
     12 TEST_TYPE = "server"
     13 MAX_RESULT_SIZE_KB = 5120000
     14 
     15 DOC = """
     16 Kicks off the smoke suite on a Moblab host against the DUTs on its subnet
     17 and ensures the suite completes successfully.
     18 
     19 To invole this test locally:
     20   test_that -b stumpy_moblab <remote> moblab_SmokeSuite --args="<ARGLIST>"
     21 
     22 where ARGLIST is a whitespace separated list of the following key=value pairs.
     23 Values pertaining to the test case include:
     24 
     25   boto_path=<boto_path>                path to the boto file to be installed on
     26                                        the Moblab DUT. If not specified, the
     27                                        boto file in the current home directory
     28                                        will be installed if it exists.
     29   image_storage_server=<server_name>   Google Storage Bucket from which to
     30                                        fetch test images from. If not
     31                                        specified, the value will be fetched
     32                                        from global_config.
     33   service_init_timeout_m=<int>         Timeout (in minutes) to wait for upstart
     34                                        services to start on the moblab host.
     35                                        This can take ~5 minutes on a physical
     36                                        devices and ~10 minutes on a VM.
     37   test_timeout_hint_m=<int>            The overall timeout to expect for the
     38                                        test run. For this test, it is very
     39                                        important to collect post failure data
     40                                        from the moblab device. If the overall
     41                                        timeout is provided, the test will try to
     42                                        fail early to save some time for log
     43                                        collection from the DUT.
     44   clear_devserver_cache=<boolean>      If True, image cache of the devserver
     45                                        running on moblab is cleared before
     46                                        running the test to validate devserver
     47                                        imaging staging flow.
     48 """
     49 from autotest_lib.client.bin import sysinfo
     50 from autotest_lib.client.common_lib import utils
     51 
     52 MOBLAB_AUTOTEST_FOLDERS = ['/usr/local/autotest/logs']
     53 
     54 
     55 def run(machine):
     56     host = hosts.create_host(machine)
     57     args_dict = utils.args_to_dict(args)
     58 
     59     logging.info('Logs from moblab\'s instance of autotest will be collected '
     60                  'under the sysinfo/ folder in results.')
     61     for folder in MOBLAB_AUTOTEST_FOLDERS:
     62         logging.info('  Will collect %s', folder)
     63         job.sysinfo.add_logdir(sysinfo.logdir(folder, excludes=()))
     64 
     65     job.run_test('moblab_RunSuite', host=host, suite_name='smoke',
     66                  moblab_suite_max_retries=1, **args_dict)
     67 
     68 parallel_simple(run, machines)
     69