• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2018 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 = "puthik"
6NAME = "power_Dashboard.fast"
7TIME = "MEDIUM"
8TEST_CATEGORY = "Stress"
9TEST_CLASS = "suite"
10TEST_TYPE = "server"
11
12DOC = """
13Sequence to make sure that power_Dashboard tests work fine.
14"""
15
16from autotest_lib.client.common_lib import utils
17
18# Need separate list for client and server test due to how these test work.
19CLIENT_TESTS = [
20    ('power_Standby', {
21        'tag' : '36sec', 'sample_hours' : 0.01, 'test_hours' : 0.01,
22        'bypass_check' : True}),
23    ('power_LoadTest', {
24        'tag' : 'fast', 'loop_time' : 180, 'loop_count' : 1,
25        'test_low_batt_p' : 6, 'check_network': False, 'ac_ok' : True,
26        'gaia_login' : False}),
27    ('power_Idle', {
28        'tag' : 'fast', 'warmup_secs' : 2, 'idle_secs' : 10}),
29    ('power_VideoPlayback', {
30        'tag' : 'fast', 'secs_per_video' : 10, 'fast' : True }),
31    ('power_VideoPlayback', {
32        'tag' : 'sw_decoder_fast', 'use_hw_decode' : False,
33        'secs_per_video' : 10, 'fast' : True }),
34    ('power_Display', {
35        'tag' : 'fast', 'secs_per_page' : 2}),
36    ('power_WebGL', {
37        'tag' : 'fast', 'duration' : 10}),
38]
39
40# Tagged test name and sweetberry interval
41SWEETBERRY_TESTS = [
42    ('power_Standby.36sec', 1),
43    ('power_LoadTest.fast', 1),
44    ('power_Idle.fast', 1),
45    ('power_VideoPlayback.fast', 1),
46    ('power_VideoPlayback.sw_decoder_fast', 1),
47    ('power_Display.fast', 1),
48    ('power_WebGL.fast', 1),
49]
50
51POWERLOG_TESTNAME = 'power_PowerlogWrapper'
52
53# Workaround to make it compatible with moblab autotest UI.
54global args_dict
55try:
56    args_dict
57except NameError:
58    args_dict = utils.args_to_dict(args)
59
60pdash_note = args_dict.get('pdash_note', '')
61sweetberry_serial = args_dict.get('sweetberry_serial', None)
62
63def run_client_test(machine):
64    client = hosts.create_host(machine)
65    client_at = autotest.Autotest(client)
66    for test, argv in CLIENT_TESTS:
67        client.reboot()
68        argv['pdash_note'] = pdash_note
69        client_at.run_test(test, **argv)
70
71def run_sweetberry_wrapper_test(machine):
72    client = hosts.create_host(machine)
73    for test, sweetberry_interval in SWEETBERRY_TESTS:
74        client.reboot()
75        argv = {
76            'pdash_note': pdash_note,
77            'test': test,
78            'sweetberry_interval': sweetberry_interval,
79        }
80        job.run_test(POWERLOG_TESTNAME, host=client, config=argv, tag=test)
81
82
83if sweetberry_serial:
84    parallel_simple(run_sweetberry_wrapper_test, machines)
85else:
86    job.parallel_on_machines(run_client_test, machines)
87