• 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    ('power_LoadTest', {
23        'tag' : 'fast', 'loop_time' : 180, 'loop_count' : 1,
24        'test_low_batt_p' : 6, 'check_network': False, 'ac_ok' : True,
25        'gaia_login' : False}),
26    ('power_Idle', {
27        'tag' : 'fast', 'warmup_secs' : 2, 'idle_secs' : 10}),
28    ('power_VideoPlayback', {
29        'tag' : 'fast', 'secs_per_video' : 2}),
30    ('power_VideoPlayback', {
31        'tag' : 'sw_decoder_fast', 'use_hw_decode' : False,
32        'secs_per_video' : 2}),
33    ('power_Display', {
34        'tag' : 'fast', 'secs_per_page' : 2}),
35    ('power_WebGL', {
36        'tag' : 'fast', 'duration' : 10}),
37]
38
39# Tagged test name and sweetberry interval
40SWEETBERRY_TESTS = [
41    ('power_Standby.36sec', 1),
42    ('power_LoadTest.fast', 1),
43    ('power_Idle.fast', 1),
44    ('power_VideoPlayback.fast', 1),
45    ('power_VideoPlayback.sw_decoder_fast', 1),
46    ('power_Display.fast', 1),
47    ('power_WebGL.fast', 1),
48]
49
50POWERLOG_TESTNAME = 'power_PowerlogWrapper'
51
52# Workaround to make it compatible with moblab autotest UI.
53global args_dict
54try:
55    args_dict
56except NameError:
57    args_dict = utils.args_to_dict(args)
58
59pdash_note = args_dict.get('pdash_note', '')
60sweetberry_serial = args_dict.get('sweetberry_serial', None)
61
62def run_client_test(machine):
63    client = hosts.create_host(machine)
64    client_at = autotest.Autotest(client)
65    for test, argv in CLIENT_TESTS:
66        client.reboot()
67        argv['pdash_note'] = pdash_note
68        client_at.run_test(test, **argv)
69
70def run_sweetberry_wrapper_test(machine):
71    client = hosts.create_host(machine)
72    for test, sweetberry_interval in SWEETBERRY_TESTS:
73        client.reboot()
74        argv = {
75            'pdash_note': pdash_note,
76            'test': test,
77            'sweetberry_interval': sweetberry_interval,
78        }
79        job.run_test(POWERLOG_TESTNAME, host=client, config=argv, tag=test)
80
81
82if sweetberry_serial:
83    parallel_simple(run_sweetberry_wrapper_test, machines)
84else:
85    job.parallel_on_machines(run_client_test, machines)
86