Home | History | Annotate | Download | only in sequences
      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 
      5 AUTHOR = "puthik"
      6 NAME = "power_Dashboard.full"
      7 TIME = "MEDIUM"
      8 TEST_CATEGORY = "Stress"
      9 TEST_CLASS = "suite"
     10 TEST_TYPE = "server"
     11 
     12 DOC = """
     13 Sequence for upload common power test data to dashboard.
     14 """
     15 
     16 from autotest_lib.client.common_lib import utils
     17 
     18 CLIENT_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
     33 SWEETBERRY_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 
     43 POWERLOG_TESTNAME = 'power_PowerlogWrapper'
     44 
     45 # Workaround to make it compatible with moblab autotest UI.
     46 global args_dict
     47 try:
     48     args_dict
     49 except NameError:
     50     args_dict = utils.args_to_dict(args)
     51 
     52 pdash_note = args_dict.get('pdash_note', '')
     53 sweetberry_serial = args_dict.get('sweetberry_serial', None)
     54 
     55 
     56 def 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 
     64 def 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 
     75 if sweetberry_serial:
     76     parallel_simple(run_sweetberry_wrapper_test, machines)
     77 else:
     78     job.parallel_on_machines(run_client_test, machines)
     79