Home | History | Annotate | Download | only in power_Standby
      1 # Copyright (c) 2012 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 import re
      5 
      6 AUTHOR = "Chrome OS Team"
      7 NAME = "power_Standby"
      8 TIME = "LONG"
      9 TEST_CATEGORY = "Benchmark"
     10 TEST_CLASS = "power"
     11 TEST_TYPE = "client"
     12 
     13 DOC = """
     14 This test measures the power draw during standby (S3).
     15 
     16 Test uses RTC wake to transistion from S3 to S0 every sample_hours for a total
     17   standby time of test_hours.  The S3->S0 transistions are added to
     18   1. Validate battery use
     19   2. Guarantee that S3 was maintained (no external/false wake)
     20   3. Create S3->S0->S3 transistions which more closely model user's interaction.
     21 
     22 Arguments:
     23   sample_hours: float, number of hours between charge use samples.
     24   test_hours: float, the number of hours to run the test.
     25 
     26 Test must meet the following criteria:
     27   Battery must contain ~20% of its charge.
     28   Must be run on battery power
     29   sample_hours > 0.1
     30   test_hours > sample_hours
     31 """
     32 
     33 opts = {}
     34 sample_hours = 1.0
     35 test_hours = 12.0
     36 max_milliwatts_standby = 500.0
     37 
     38 for arg in args:
     39     match = re.search("^(\w+)=(.+)", arg)
     40     if match:
     41         opts[match.group(1)] = match.group(2)
     42 
     43 if 'test_hours' in opts:
     44     test_hours = float(opts['test_hours'])
     45 
     46 if 'sample_hours' in opts:
     47     sample_hours = float(opts['sample_hours'])
     48 
     49 
     50 constraints = []
     51 constraints.append("milliwatts_standby_power <= %.2f" % max_milliwatts_standby)
     52 
     53 job.run_test('power_Standby', sample_hours=sample_hours, test_hours=test_hours,
     54              constraints=constraints,
     55              max_milliwatts_standby=max_milliwatts_standby)
     56