Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Tool info module for "cetfuzz" #956

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions benchexec/tools/cetfuzz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0

from benchexec.tools.sv_benchmarks_util import get_data_model_from_task, ILP32, LP64
import benchexec.tools.template
import benchexec.result as result


class Tool(benchexec.tools.template.BaseTool2):
"""
Tool info for CETFUZZ
An Automatic Test Suit Generator
URL: https://gitlab.com/Sarathkrishnan/cetfuzz
https://zenodo.org/records/10065857

Testing tool namely cetfuzz for testing C programs. Our tool uses AFL++, a
genetic algorithm based fuzz test generator as a basic building block.
AFL++ is parameterised to enable a user to configure fuzzing by assigning
permissible values to its parameters. It supports several parameters yielding
to a large number of configurations. Finding an optimal configuration for
maximising given test objective (specified via a property) for a given C
program is a challenging task. We have selected 20 most important AFL++
configurations based on some heuristics. We trained a supervised model that
can infer one out of the 20 as the best configurations for the given
test objective and the program. We use AFL++ to fuzz the program with
the suggested configuration and output the test vectors for validation.
"""

REQUIRED_PATH = [
"fuzzer",
"verifier_codes",
]

def executable(self, tool_locator):
return tool_locator.find_executable("runTool.py")

def version(self, executable):
return self._version_from_tool(executable, use_stderr=True)

def name(self):
return "cetfuzz"

def cmdline(self, executable, options, task, rlimits):
if task.property_file:
options = options + ["--propertyFile", task.property_file]

data_model_param = get_data_model_from_task(task, {ILP32: "32", LP64: "64"})
if data_model_param and "--bit" not in options:
options += ["--bit", data_model_param]

return [executable] + options + [task.single_input_file]

def determine_result(self, run):
for line in run.output:
if "TEST_SUIT_CREATED" in line:
return result.RESULT_DONE
elif "NOT_SUPPORTED" in line or "CETFUZZ_UNKNOWN" in line:
return result.RESULT_UNKNOWN
return result.RESULT_ERROR