Home | History | Annotate | Download | only in kernel_Bootcache
      1 #!/usr/bin/python
      2 #
      3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
      4 # Use of this source code is governed by a BSD-style license that can be
      5 # found in the LICENSE file.
      6 
      7 import logging, optparse, os, shutil, re, string
      8 from autotest_lib.client.bin import utils, test
      9 
     10 class kernel_Bootcache(test.test):
     11     """Run the boot cache test
     12     """
     13     version = 1
     14     Bin = '/usr/local/opt/punybench/bin/'
     15 
     16 
     17     def initialize(self):
     18         self.results = []
     19         self.job.drop_caches_between_iterations = True
     20 
     21 
     22     def _run(self, cmd, args):
     23         """Run a puny test
     24 
     25         Prepends the path to the puny benchmark bin.
     26 
     27         Args:
     28           cmd: command to be run
     29           args: arguments for the command
     30         """
     31         result = utils.system_output(
     32             os.path.join(self.Bin, cmd) + ' ' + args)
     33         logging.debug(result)
     34         return result
     35 
     36 
     37     def run_once(self, args=[]):
     38         """Run the boot cache test.
     39         """
     40         self._run('bootcachetest', "")
     41