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.full" 7TIME = "MEDIUM" 8TEST_CATEGORY = "Stress" 9TEST_CLASS = "suite" 10TEST_TYPE = "server" 11 12DOC = """ 13Sequence for upload common power test data to dashboard. 14""" 15 16from autotest_lib.client.common_lib import utils 17 18CLIENT_TESTS = [ 19 ('power_Standby', { 20 'tag' : 'fast', 'sample_hours' : 0.334, 'test_hours' : 0.334}), 21 ('power_LoadTest', { 22 'tag' : '1hour', 'loop_time' : 3600, 'loop_count' : 1, 23 'test_low_batt_p' : 6}), 24 ('power_Idle', {}), 25 ('power_VideoPlayback', {}), 26 ('power_VideoPlayback', { 27 'tag' : 'sw_decoder', 'use_hw_decode' : False}), 28 ('power_Display', {}), 29 ('power_WebGL', {}), 30] 31 32# Tagged test name and sweetberry interval 33SWEETBERRY_TESTS = [ 34 ('power_Standby.fast', 1), 35 ('power_LoadTest.1hour', 20), 36 ('power_Idle', 1), 37 ('power_VideoPlayback', 5), 38 ('power_VideoPlayback.sw_decoder', 5), 39 ('power_Display', 5), 40 ('power_WebGL', 5), 41] 42 43POWERLOG_TESTNAME = 'power_PowerlogWrapper' 44 45# Workaround to make it compatible with moblab autotest UI. 46global args_dict 47try: 48 args_dict 49except NameError: 50 args_dict = utils.args_to_dict(args) 51 52pdash_note = args_dict.get('pdash_note', '') 53sweetberry_serial = args_dict.get('sweetberry_serial', None) 54 55 56def run_client_test(machine): 57 client = hosts.create_host(machine) 58 client_at = autotest.Autotest(client) 59 for test, argv in CLIENT_TESTS: 60 client.reboot() 61 argv['pdash_note'] = pdash_note 62 client_at.run_test(test, **argv) 63 64def run_sweetberry_wrapper_test(machine): 65 client = hosts.create_host(machine) 66 for test, sweetberry_interval in SWEETBERRY_TESTS: 67 client.reboot() 68 argv = { 69 'pdash_note': pdash_note, 70 'test': test, 71 'sweetberry_interval': sweetberry_interval, 72 } 73 job.run_test(POWERLOG_TESTNAME, host=client, config=argv, tag=test) 74 75if sweetberry_serial: 76 parallel_simple(run_sweetberry_wrapper_test, machines) 77else: 78 job.parallel_on_machines(run_client_test, machines) 79