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