Esempio n. 1
0
    def setUp(self):
        # Set up fake filesystem.
        test_helpers.patch_environ(self)
        test_utils.set_up_pyfakefs(self)

        test_helpers.patch(self, [
            'bot.fuzzers.engine_common.unpack_seed_corpus_if_needed',
        ])

        self.fs.create_dir('/inputs')
        self.fs.create_file('/path/target')
        self.fs.create_file('/path/blah.dict')
        self.fs.create_file('/path/target_seed_corpus.zip')
        self.fs.create_file('/path/target.options',
                            contents=('[libfuzzer]\n'
                                      'max_len=31337\n'
                                      'timeout=11\n'
                                      'dict=blah.dict\n'))

        os.environ['FAIL_RETRIES'] = '1'
        os.environ['FUZZ_INPUTS_DISK'] = '/inputs'

        test_helpers.patch(self, ['bot.fuzzers.libfuzzer.pick_strategies'])

        self.mock.pick_strategies.return_value = libfuzzer.StrategyInfo(
            fuzzing_strategies=[
                'unknown_1', 'value_profile', 'corpus_subset_20', 'fork_2'
            ],
            arguments=['-arg1'],
            additional_corpus_dirs=['/new_corpus_dir'],
            extra_env={'extra_env': '1'},
            use_dataflow_tracing=False,
            is_mutations_run=True)
Esempio n. 2
0
  def setUp(self):
    # Set up fake filesystem.
    test_helpers.patch_environ(self)
    test_utils.set_up_pyfakefs(self)

    test_helpers.patch(
        self, ["bot.fuzzers.engine_common.unpack_seed_corpus_if_needed"])

    self.fs.create_dir("/inputs")
    self.fs.create_file("/path/target")
    self.fs.create_file("/path/blah.dict")
    self.fs.create_file("/path/target_seed_corpus.zip")
    self.fs.create_file(
        "/path/target.options",
        contents=("[libfuzzer]\n"
                  "max_len=31337\n"
                  "timeout=11\n"
                  "dict=blah.dict\n"),
    )

    os.environ["FAIL_RETRIES"] = "1"
    os.environ["FUZZ_INPUTS_DISK"] = "/inputs"

    test_helpers.patch(self, ["bot.fuzzers.libfuzzer.pick_strategies"])

    self.mock.pick_strategies.return_value = libfuzzer.StrategyInfo(
        fuzzing_strategies=[
            "unknown_1",
            "value_profile",
            "corpus_subset_20",
            "fork_2",
        ],
        arguments=["-arg1"],
        additional_corpus_dirs=["/new_corpus_dir"],
        extra_env={"extra_env": "1"},
        use_dataflow_tracing=False,
        is_mutations_run=True,
    )