1import os 2from autotest_lib.client.bin import test, utils 3 4 5class flail(test.test): 6 """ 7 This autotest module runs the flail system call fuzzer. 8 9 Fuzzing is slang for fault injection . It runs all system calls for that 10 kernel version with random args. The goal is to find bugs in software 11 without reading code or designing detailed test cases. 12 13 @author: Pradeep K Surisetty (psuriset@linux.vnet.ibm.com) 14 @see: http://www.risesecurity.org/ (Website of Ramon Valle, flail's creator) 15 """ 16 version = 1 17 18 def initialize(self): 19 self.job.require_gcc() 20 21 22 def setup(self, tarball = 'flail-0.2.0.tar.gz'): 23 """ 24 Compiles flail with the appropriate parameters. 25 26 @param tarball: Path or URL for the flail tarball. 27 """ 28 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) 29 utils.extract_tarball_to_dir(tarball, self.srcdir) 30 os.chdir(self.srcdir) 31 utils.make() 32 33 34 def run_once(self, fstype = 'iso9660'): 35 """ 36 Runs flail with the appropriate parameters. 37 38 @param fstype: Filesystem type you wish to run flail on. 39 """ 40 args = fstype + ' 1' 41 flail_cmd = os.path.join(self.srcdir, 'flail %s' % args) 42 utils.system(flail_cmd) 43