• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Lint as: python2, python3
2# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6import time
7from autotest_lib.server import autotest
8from autotest_lib.server import hosts
9from autotest_lib.server import test
10
11class hardware_StorageQualTrimStress(test.test):
12    """Do traffic and trim while suspending aggressively."""
13
14    version = 1
15    def run_once(self, client_ip, duration, cq=False):
16
17        # in a cq run, do not execute the test, just output
18        # the order that the test would have run in
19        if cq:
20            self.write_test_keyval({'storage_qual_cq':
21                '%f hardware_StorageQualTrimStress' % time.time()})
22            return
23
24        client = hosts.create_host(client_ip)
25        client_at = autotest.Autotest(client)
26        control = """REQUIRE_SSP = True \n\njob.parallel(
27            [lambda: job.run_test('power_SuspendStress', tag='disk',
28                duration=%d, init_delay=10, min_suspend=7, min_resume=30,
29                check_connection=True)],
30            [lambda: job.run_test('hardware_TrimIntegrity', test_length=%d,
31                disable_sysinfo=True,
32                tag='qual_trim')])""" % (duration, duration)
33        client_at.run(control, '.', None)
34