1# This requires aio headers to build. 2# Should work automagically out of deps now. 3 4# NOTE - this should also have the ability to mount a filesystem, 5# run the tests, unmount it, then fsck the filesystem 6import os 7from autotest_lib.client.bin import test, utils 8 9 10class fsx(test.test): 11 """Test to run fsx-linux.""" 12 version = 3 13 14 def initialize(self): 15 self.job.require_gcc() 16 17 18 # http://www.zip.com.au/~akpm/linux/patches/stuff/ext3-tools.tar.gz 19 def setup(self, tarball = 'ext3-tools.tar.gz'): 20 self.tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) 21 utils.extract_tarball_to_dir(self.tarball, self.srcdir) 22 23 os.chdir(self.srcdir) 24 for p in ['0001-Minor-fixes-to-PAGE_SIZE-handling.patch', 25 '0002-Enable-cross-compiling-for-fsx.patch', 26 '0003-Fix-Link-Options.patch']: 27 utils.system('patch -p1 < ../%s' % p) 28 utils.system('make fsx-linux') 29 30 31 def run_once(self, dir=None, repeat=100000): 32 args = '-N %s' % repeat 33 if not dir: 34 dir = self.tmpdir 35 os.chdir(dir) 36 utils.system(' '.join([os.path.join(self.srcdir,'/fsx-linux'), 37 args, 'poo'])) 38