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.fast"
      7 TIME = "MEDIUM"
      8 TEST_CATEGORY = "Stress"
      9 TEST_CLASS = "suite"
     10 TEST_TYPE = "server"
     11 
     12 DOC = """
     13 Sequence to make sure that power_Dashboard tests work fine.
     14 """
     15 
     16 from autotest_lib.client.common_lib import utils
     17 
     18 # Need separate list for client and server test due to how these test work.
     19 CLIENT_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
     40 SWEETBERRY_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 
     50 POWERLOG_TESTNAME = 'power_PowerlogWrapper'
     51 
     52 # Workaround to make it compatible with moblab autotest UI.
     53 global args_dict
     54 try:
     55     args_dict
     56 except NameError:
     57     args_dict = utils.args_to_dict(args)
     58 
     59 pdash_note = args_dict.get('pdash_note', '')
     60 sweetberry_serial = args_dict.get('sweetberry_serial', None)
     61 
     62 def 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 
     70 def 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 
     82 if sweetberry_serial:
     83     parallel_simple(run_sweetberry_wrapper_test, machines)
     84 else:
     85     job.parallel_on_machines(run_client_test, machines)
     86