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
5from autotest_lib.server import autotest
6from autotest_lib.server import hosts
7from autotest_lib.server import test
8
9
10class hardware_StorageQualSuspendStress(test.test):
11    """ Run Fio while suspending aggressively."""
12
13    version = 1
14
15    def run_once(self, client_ip, duration):
16        client = hosts.create_host(client_ip)
17        client_at = autotest.Autotest(client)
18        control = """job.parallel(
19            [lambda: job.run_test('power_SuspendStress', tag='disk',
20                duration=%d, init_delay=10, min_suspend=7, min_resume=30,
21                check_connection=True)],
22            [lambda: job.run_test('hardware_StorageFio', test_length=%d,
23                disable_sysinfo=True, requirements=[('write_stress', [])],
24                tag='qual_suspend')])""" % (duration, duration)
25        client_at.run(control, '.', None)
26
27