• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2015 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
5import logging
6
7from autotest_lib.client.common_lib import utils
8
9
10AUTHOR = "kathrelkeld"
11NAME = "stress_ClientTestReboot"
12TIME = "SHORT"
13TEST_CATEGORY = "Functional"
14TEST_CLASS = "Stress"
15TEST_TYPE = "server"
16
17DOC = """
18This test takes the name of a client side test.  This test is run many times
19over, rebooting the DUT in between each time.
20
21Example usage:
22test_that stress_ClientTestReboot <ip> --board=<board>
23                                       --args="testname=NAME loops=N"
24"""
25
26args_dict = utils.args_to_dict(args)
27
28def run_reboot_stress(machine):
29    if 'testname' in args_dict and 'loops' in args_dict:
30        testname = args_dict.get('testname')
31        loops = int(args_dict.get('loops'))
32        job.run_test('stress_ClientTestReboot', client_ip=machine,
33                     testname=testname, loops=loops)
34    else:
35        logging.info('Please provide the name of a client autotest and the '
36                     'number of times the test should be run. '
37                     '"testname=<test> loops=<number>"')
38
39parallel_simple(run_reboot_stress, machines)
40