• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import os, time
2import subprocess
3from autotest_lib.client.bin import test
4from autotest_lib.client.common_lib import utils, error
5
6
7class iosched_bugs(test.test):
8    version = 1
9    preserve_srcdir = True
10
11    def initialize(self):
12        self.job.require_gcc()
13
14
15    def setup(self):
16        os.chdir(self.srcdir)
17        utils.make()
18
19
20    def execute(self):
21        os.chdir(self.tmpdir)
22        (p1, _) = utils.run_bg('dd if=/dev/hda3 of=/dev/null')
23        time.sleep(60)
24        blah = os.path.join(self.tmpdir, 'blah')
25        dirty_bin = os.path.join(self.srcdir, 'dirty')
26        dirty_op = os.path.join(self.tmpdir, 'dirty')
27        utils.system('echo AA > ' + blah)
28        p2 = subprocess.Popen(dirty_bin + ' ' + blah + ' 1 > ' + dirty_op,
29                              shell=True)
30        time.sleep(600)
31        if p2.poll() is None:
32            utils.nuke_subprocess(p1)
33            utils.nuke_subprocess(p2)
34            raise error.TestFail('Writes made no progress')
35# Commenting out use of utils.run as there is a timeout bug
36#
37#       try:
38#           utils.run(dirty_bin + ' ' + blah + '1 > ' + dirty_op, 900, False,
39#                     None, None)
40#       except:
41#           utils.nuke_subprocess(p1)
42#           raise error.TestFail('Writes made no progress')
43        utils.nuke_subprocess(p1)
44