Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
make merge conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
chkeita committed Oct 31, 2020
1 parent df4aea0 commit 4dc9d87
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions src/cli/onefuzz/templates/libfuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def _create_tasks(
crash_report_timeout: Optional[int] = None,
debug: Optional[List[TaskDebugFlag]] = None,
ensemble_sync_delay: Optional[int] = None,
merge: bool = False,
) -> None:

fuzzer_containers = [
Expand Down Expand Up @@ -127,30 +128,31 @@ def _create_tasks(
debug=debug,
)

merge_containers = [
(ContainerType.setup, containers[ContainerType.setup]),
(ContainerType.unique_inputs, containers[ContainerType.unique_inputs]),
(ContainerType.inputs, containers[ContainerType.inputs]),
]

self.logger.info("creating libfuzzer_merge task")
self.onefuzz.tasks.create(
job.job_id,
TaskType.libfuzzer_merge,
target_exe,
merge_containers,
pool_name=pool_name,
duration=duration,
vm_count=1,
reboot_after_setup=reboot_after_setup,
target_options=target_options,
target_env=target_env,
tags=tags,
prereq_tasks=[fuzzer_task.task_id],
target_timeout=crash_report_timeout,
check_retry_count=check_retry_count,
debug=debug,
)
if merge:
merge_containers = [
(ContainerType.setup, containers[ContainerType.setup]),
(ContainerType.unique_inputs, containers[ContainerType.unique_inputs]),
(ContainerType.inputs, containers[ContainerType.inputs]),
]

self.logger.info("creating libfuzzer_merge task")
self.onefuzz.tasks.create(
job.job_id,
TaskType.libfuzzer_merge,
target_exe,
merge_containers,
pool_name=pool_name,
duration=duration,
vm_count=1,
reboot_after_setup=reboot_after_setup,
target_options=target_options,
target_env=target_env,
tags=tags,
prereq_tasks=[fuzzer_task.task_id],
target_timeout=crash_report_timeout,
check_retry_count=check_retry_count,
debug=debug,
)

def basic(
self,
Expand Down Expand Up @@ -179,6 +181,7 @@ def basic(
notification_config: Optional[NotificationConfig] = None,
debug: Optional[List[TaskDebugFlag]] = None,
ensemble_sync_delay: Optional[int] = None,
merge: bool = False,
) -> Optional[Job]:
"""
Basic libfuzzer job
Expand Down Expand Up @@ -218,7 +221,7 @@ def basic(
ContainerType.unique_reports,
ContainerType.no_repro,
ContainerType.coverage,
ContainerType.unique_inputs
ContainerType.unique_inputs,
)

if existing_inputs:
Expand Down Expand Up @@ -253,6 +256,7 @@ def basic(
check_retry_count=check_retry_count,
debug=debug,
ensemble_sync_delay=ensemble_sync_delay,
merge=merge,
)

self.logger.info("done creating tasks")
Expand Down

0 comments on commit 4dc9d87

Please sign in to comment.