Example #1
0
 def setUp(self):
     self.sf = seedfile_obj = MockSeedfile()
     self.tempdir = tempfile.mkdtemp()
     self.outdir = outdir_base = tempfile.mkdtemp(prefix='outdir_base',
                                                  dir=self.tempdir)
     iteration = 0
     self.options = {'min_ratio': 0.1, 'max_ratio': 0.2}
     self.args = (seedfile_obj, outdir_base, iteration, self.options)
Example #2
0
 def setUp(self):
     self.sf = seedfile_obj = MockSeedfile()
     self.tempdir = tempfile.mkdtemp()
     self.outdir = outdir_base = tempfile.mkdtemp(prefix='outdir_base',
                                                  dir=self.tempdir)
     iteration = 0
     options = {}
     self.args = (seedfile_obj, outdir_base, iteration, options)
Example #3
0
 def setUp(self):
     self.sf = seedfile_obj = MockSeedfile()
     self.sf.value = bytearray(self.sf.value)
     self.chars_inserted = 0
     self.sf.value, self.chars_inserted = _insert_crlf(
         bytearray(self.sf.value))
     self.tempdir = tempfile.mkdtemp()
     self.outdir = outdir_base = tempfile.mkdtemp(prefix='outdir_base',
                                                  dir=self.tempdir)
     iteration = 0
     self.options = {'min_ratio': 0.1, 'max_ratio': 0.2}
     self.args = (seedfile_obj, outdir_base, iteration, self.options)
Example #4
0
    def setUp(self):
        self.sf = seedfile_obj = MockSeedfile()
        self.sf.value = bytearray(self.sf.value)
        self.nulls_inserted = 0
        for i in xrange(0, len(self.sf.value), 10):
            self.sf.value[i] = 0x00
            self.nulls_inserted += 1

        self.tempdir = tempfile.mkdtemp()
        self.outdir = outdir_base = tempfile.mkdtemp(prefix='outdir_base',
                                                     dir=self.tempdir)
        iteration = 0
        self.options = {'min_ratio': 0.1, 'max_ratio': 0.2}
        self.args = (seedfile_obj, outdir_base, iteration, self.options)
Example #5
0
    def setUp(self):
        self.tmpdir = tempfile.mkdtemp(prefix='bff-test-')
        self.sf = MockSeedfile()
        self.ff = MockFuzzedFile()
        cfg = {}
        program = 'foo'
        cmd_template = 'foo a b c'
        workdir_base = os.path.join(self.tmpdir, 'workdir_base')
        cmdlist = cmd_template.split()

        self.tc = certfuzz.testcase.testcase_base.TestCaseBase(cfg,
                                                               self.sf,
                                                               self.ff,
                                                               program,
                                                               cmd_template,
                                                               workdir_base,
                                                               cmdlist,)
        pass
Example #6
0
    def setUp(self):
        # zzuf might not be in the default paths, so check a few other
        # locations too
        alternate_bin_locs = set(['/opt/local/bin'])
        alt_bin_locs_exist = (l for l in alternate_bin_locs
                              if os.path.exists(l))
        add_locs = (l for l in alt_bin_locs_exist
                    if not l in os.environ['PATH'])
        for loc in add_locs:
            os.environ['PATH'] += os.pathsep + loc

        self.sf = seedfile_obj = MockSeedfile()
        self.tempdir = tempfile.mkdtemp()
        self.outdir = outdir_base = tempfile.mkdtemp(prefix='outdir_base',
                                                     dir=self.tempdir)

        iteration = 0
        self.options = {}
        #        self.options = {'min_ratio': 0.1, 'max_ratio': 0.2}
        self.args = (seedfile_obj, outdir_base, iteration, self.options)
    def setUp(self):
        self.tmpdir = tempfile.mkdtemp(prefix='test_iteration_windows_')
        self.workdirbase = tempfile.mkdtemp(prefix='workdirbase_',
                                            dir=self.tmpdir)
        self.outdir = tempfile.mkdtemp(prefix='outdir_', dir=self.tmpdir)

        _cfg = MockCfg()

        kwargs = {
            'seedfile': MockSeedfile(),
            'seednum': 0,
            'workdirbase': self.workdirbase,
            'outdir': self.outdir,
            'sf_set': 'a',
            'uniq_func': None,
            'config': _cfg,
            'fuzzer_cls': MockFuzzer,
            'runner_cls': MockRunner,
            'debug': False,
        }

        self.iteration = WindowsIteration(**kwargs)