Home | History | Annotate | Download | only in hardware_StorageQualTrimStress
      1 # Copyright (c) 2013 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 import time
      6 from autotest_lib.server import autotest
      7 from autotest_lib.server import hosts
      8 from autotest_lib.server import test
      9 
     10 class hardware_StorageQualTrimStress(test.test):
     11     """Do traffic and trim while suspending aggressively."""
     12 
     13     version = 1
     14     def run_once(self, client_ip, duration, cq=False):
     15 
     16         # in a cq run, do not execute the test, just output
     17         # the order that the test would have run in
     18         if cq:
     19             self.write_test_keyval({'storage_qual_cq':
     20                 '%f hardware_StorageQualTrimStress' % time.time()})
     21             return
     22 
     23         client = hosts.create_host(client_ip)
     24         client_at = autotest.Autotest(client)
     25         control = """job.parallel(
     26             [lambda: job.run_test('power_SuspendStress', tag='disk',
     27                 duration=%d, init_delay=10, min_suspend=7, min_resume=30,
     28                 check_connection=True)],
     29             [lambda: job.run_test('hardware_TrimIntegrity', test_length=%d,
     30                 disable_sysinfo=True,
     31                 tag='qual_trim')])""" % (duration, duration)
     32         client_at.run(control, '.', None)
     33 
     34