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

[fuzzbench] Added Command-Line Argument for Fuzzing Engine Selection in FuzzBench Integration #12711

Closed
wants to merge 1 commit into from
Closed
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
18 changes: 12 additions & 6 deletions infra/build/functions/fuzzbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
################################################################################
"""Does fuzzbench runs on Google Cloud Build."""

import argparse
import logging
import os
import sys
Expand Down Expand Up @@ -99,7 +100,7 @@ def get_build_fuzzers_step(fuzzing_engine, project, env, build):

def get_build_steps( # pylint: disable=too-many-locals, too-many-arguments
project_name, project_yaml, dockerfile_lines, image_project,
base_images_project, config):
base_images_project, config, fuzzing_engine):
"""Returns build steps for project."""
del base_images_project
project = build_project.Project(project_name, project_yaml, dockerfile_lines,
Expand All @@ -111,9 +112,6 @@ def get_build_steps( # pylint: disable=too-many-locals, too-many-arguments
config = build_project.Config(config.testing, None, config.repo,
config.branch, config.parallel, config.upload)

# TODO(metzman): Make this a command line argument
fuzzing_engine = 'libfuzzer'

steps = [
{
'args': [
Expand Down Expand Up @@ -185,8 +183,16 @@ def get_build_steps( # pylint: disable=too-many-locals, too-many-arguments

def main():
"""Build and run fuzzbench for OSS-Fuzz projects."""
return build_project.build_script_main('Does a FuzzBench run.',
get_build_steps, FUZZBENCH_BUILD_TYPE)
parser = argparse.ArgumentParser(description='Run FuzzBench on Google Cloud Build.')
parser.add_argument('--fuzzing_engine', default='libfuzzer',
help='The fuzzing engine to use for the build (e.g., libfuzzer, afl, honggfuzz).')
args = parser.parse_args()

return build_project.build_script_main(
'Does a FuzzBench run.',
lambda *args_: get_build_steps(*args_, args.fuzzing_engine),
FUZZBENCH_BUILD_TYPE
)


if __name__ == '__main__':
Expand Down
Loading