• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2017 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 = "ChromeOS Team"
6NAME = "moblab_DummyServerNoSspSuite"
7PURPOSE = "Test that Moblab can run the Dummy Server suite without SSP."
8TIME = "MEDIUM"
9TEST_CATEGORY = "Functional"
10TEST_CLASS = "moblab"
11TEST_TYPE = "server"
12
13DOC = """
14Kicks off the Dummy Server NoSSp suite on a Moblab host against the DUTs on its
15subnet and ensures the suite completes successfully.
16
17To invole this test locally:
18  test_that -b stumpy_moblab <remote> moblab_DummyServerSuiteNoSsp
19  --args="<ARGLIST>"
20
21where ARGLIST is a whitespace separated list of the following key=value pairs.
22Values pertaining to the test case include:
23
24  boto_path=<boto_path>                path to the boto file to be installed on
25                                       the Moblab DUT. If not specified, the
26                                       boto file in the current home directory
27                                       will be installed if it exists.
28  image_storage_server=<server_name>   Google Storage Bucket from which to
29                                       fetch test images from. If not
30                                       specified, the value will be fetched
31                                       from global_config.
32  service_init_timeout_m=<int>         Timeout (in minutes) to wait for upstart
33                                       services to start on the moblab host.
34                                       This can take ~5 minutes on a physical
35                                       devices and ~10 minutes on a VM.
36  test_timeout_hint_m=<int>            The overall timeout to expect for the
37                                       test run. For this test, it is very
38                                       important to collect post failure data
39                                       from the moblab device. If the overall
40                                       timeout is provided, the test will try to
41                                       fail early to save some time for log
42                                       collection from the DUT.
43  clear_devserver_cache=<boolean>      If True, image cache of the devserver
44                                       running on moblab is cleared before
45                                       running the test to validate devserver
46                                       imaging staging flow.
47"""
48from autotest_lib.client.bin import sysinfo
49from autotest_lib.client.common_lib import utils
50
51MOBLAB_AUTOTEST_FOLDERS = ['/usr/local/autotest/results',
52                           '/usr/local/autotest/logs']
53
54
55def 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='dummy_server_nossp',
66                 moblab_suite_max_retries=1, **args_dict)
67
68parallel_simple(run, machines)
69