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 6from autotest_lib.server import autotest 7from autotest_lib.server import hosts 8from autotest_lib.server import test 9 10 11class hardware_StorageQualSuspendStress(test.test): 12 """ Run Fio while suspending aggressively.""" 13 14 version = 1 15 16 def run_once(self, client_ip, duration, other_dev=False): 17 client = hosts.create_host(client_ip) 18 client_at = autotest.Autotest(client) 19 timeout = int(duration * 1.5) 20 fio_test = "hardware_StorageFio" 21 if other_dev: 22 fio_test = "hardware_StorageFioOther" 23 control = """REQUIRE_SSP = True \n\njob.parallel( 24 [lambda: job.run_test('power_SuspendStress', tag='disk', 25 duration=%d, init_delay=10, min_suspend=7, min_resume=30, 26 check_connection=True)], 27 [lambda: job.run_test('%s', test_length=%d, 28 disable_sysinfo=True, requirements=[('write_stress', [])], 29 tag='qual_suspend')], timeout=%d)""" % \ 30 (duration, fio_test, duration, timeout) 31 client_at.run(control, '.', None) 32 client_at.run_test(fio_test, wait=60, disable_sysinfo=True, 33 blkdiscard=False, 34 requirements=[('write_stress', ['v'])], 35 tag='qual_verify') 36