blob: 5abda511e51b404f8a3e2775bd663159184f80c4 [file] [log] [blame]
mbligh9f857922008-06-05 16:19:07 +00001from autotest_lib.client.bin import test, autotest_utils
2from autotest_lib.client.bin import utils
3
mblighba8be6b2006-10-23 21:59:42 +00004
5class fsfuzzer(test.test):
6 version = 1
7
8 # http://people.redhat.com/sgrubb/files/fsfuzzer-0.6.tar.gz
9 def setup(self, tarball = 'fsfuzzer-0.6.tar.gz'):
mbligh9f857922008-06-05 16:19:07 +000010 tarball = autotest_utils.unmap_url(self.bindir, tarball,
11 self.tmpdir)
12 autotest_utils.extract_tarball_to_dir(tarball, self.srcdir)
mblighba8be6b2006-10-23 21:59:42 +000013 os.chdir(self.srcdir)
14
mbligh9f857922008-06-05 16:19:07 +000015 utils.system('make')
mblighba8be6b2006-10-23 21:59:42 +000016
17 def execute(self, iterations = 1, fstype = 'iso9660'):
mbligh9f5113d2007-06-25 23:41:10 +000018 profilers = self.job.profilers
19 args = fstype + ' 1'
20 if not profilers.only():
21 for i in range(iterations):
mbligh9f857922008-06-05 16:19:07 +000022 utils.system(self.srcdir + '/run_test ' + args)
mblighba8be6b2006-10-23 21:59:42 +000023
24 # Do a profiling run if necessary
mblighba8be6b2006-10-23 21:59:42 +000025 if profilers.present():
26 profilers.start(self)
mbligh9f857922008-06-05 16:19:07 +000027 utils.system(self.srcdir + '/run_test ' + args)
mblighba8be6b2006-10-23 21:59:42 +000028 profilers.stop(self)
29 profilers.report(self)