blob: 07d2c0952de5090ab3da826f09a3617c0fd46465 [file] [log] [blame]
mbligh34d01172008-06-05 16:26:31 +00001import os
mbligh9f857922008-06-05 16:19:07 +00002from autotest_lib.client.bin import test, autotest_utils
mbligh34d01172008-06-05 16:26:31 +00003from autotest_lib.client.common_lib import utils
mbligh9f857922008-06-05 16:19:07 +00004
mblighba8be6b2006-10-23 21:59:42 +00005
6class fsfuzzer(test.test):
7 version = 1
8
9 # http://people.redhat.com/sgrubb/files/fsfuzzer-0.6.tar.gz
10 def setup(self, tarball = 'fsfuzzer-0.6.tar.gz'):
mbligh34d01172008-06-05 16:26:31 +000011 tarball = utils.unmap_url(self.bindir, tarball,
mbligh9f857922008-06-05 16:19:07 +000012 self.tmpdir)
13 autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
mblighba8be6b2006-10-23 21:59:42 +000014 os.chdir(self.srcdir)
15
mbligh9f857922008-06-05 16:19:07 +000016 utils.system('make')
mblighba8be6b2006-10-23 21:59:42 +000017
18 def execute(self, iterations = 1, fstype = 'iso9660'):
mbligh9f5113d2007-06-25 23:41:10 +000019 profilers = self.job.profilers
20 args = fstype + ' 1'
21 if not profilers.only():
22 for i in range(iterations):
mbligh9f857922008-06-05 16:19:07 +000023 utils.system(self.srcdir + '/run_test ' + args)
mblighba8be6b2006-10-23 21:59:42 +000024
25 # Do a profiling run if necessary
mblighba8be6b2006-10-23 21:59:42 +000026 if profilers.present():
27 profilers.start(self)
mbligh9f857922008-06-05 16:19:07 +000028 utils.system(self.srcdir + '/run_test ' + args)
mblighba8be6b2006-10-23 21:59:42 +000029 profilers.stop(self)
30 profilers.report(self)