mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 04:18:07 +00:00
allow tasks environment variables to be set (#3294)
* allow tasks environment variables to be set * build fix * build fix * build fix * another fix * ajusting the analysis paramters * make tools dir optional in the analysis task * bug fix
This commit is contained in:
@ -1023,6 +1023,7 @@ class Tasks(Endpoint):
|
||||
minimized_stack_depth: Optional[int] = None,
|
||||
module_allowlist: Optional[str] = None,
|
||||
source_allowlist: Optional[str] = None,
|
||||
task_env: Optional[Dict[str, str]] = None,
|
||||
) -> models.Task:
|
||||
"""
|
||||
Create a task
|
||||
@ -1100,6 +1101,7 @@ class Tasks(Endpoint):
|
||||
minimized_stack_depth=minimized_stack_depth,
|
||||
module_allowlist=module_allowlist,
|
||||
source_allowlist=source_allowlist,
|
||||
task_env=task_env,
|
||||
),
|
||||
)
|
||||
|
||||
|
@ -82,6 +82,7 @@ class Libfuzzer(Command):
|
||||
analyzer_options: Optional[List[str]] = None,
|
||||
analyzer_env: Optional[Dict[str, str]] = None,
|
||||
tools: Optional[Container] = None,
|
||||
task_env: Optional[Dict[str, str]] = None,
|
||||
) -> None:
|
||||
target_options = target_options or []
|
||||
regression_containers = [
|
||||
@ -125,6 +126,7 @@ class Libfuzzer(Command):
|
||||
debug=debug,
|
||||
colocate=colocate_all_tasks or colocate_secondary_tasks,
|
||||
minimized_stack_depth=minimized_stack_depth,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
fuzzer_containers = [
|
||||
@ -176,6 +178,7 @@ class Libfuzzer(Command):
|
||||
colocate=colocate_all_tasks,
|
||||
check_fuzzer_help=check_fuzzer_help,
|
||||
expect_crash_on_failure=expect_crash_on_failure,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
prereq_tasks = [fuzzer_task.task_id, regression_task.task_id]
|
||||
@ -238,6 +241,7 @@ class Libfuzzer(Command):
|
||||
check_fuzzer_help=check_fuzzer_help,
|
||||
module_allowlist=module_allowlist,
|
||||
source_allowlist=source_allowlist,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
report_containers = [
|
||||
@ -274,24 +278,21 @@ class Libfuzzer(Command):
|
||||
debug=debug,
|
||||
colocate=colocate_all_tasks or colocate_secondary_tasks,
|
||||
minimized_stack_depth=minimized_stack_depth,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
if analyzer_exe is not None:
|
||||
self.logger.info("creating custom analysis")
|
||||
|
||||
if tools is None:
|
||||
self.logger.error(
|
||||
"tools container cannot be empty when specifying a custom analyzer"
|
||||
)
|
||||
return None
|
||||
|
||||
analysis_containers = [
|
||||
(ContainerType.setup, containers[ContainerType.setup]),
|
||||
(ContainerType.tools, tools),
|
||||
(ContainerType.analysis, containers[ContainerType.analysis]),
|
||||
(ContainerType.crashes, containers[ContainerType.crashes]),
|
||||
]
|
||||
|
||||
if tools is not None:
|
||||
analysis_containers.append((ContainerType.tools, tools))
|
||||
|
||||
self._add_optional_containers(
|
||||
analysis_containers,
|
||||
containers,
|
||||
@ -317,6 +318,7 @@ class Libfuzzer(Command):
|
||||
colocate=colocate_all_tasks or colocate_secondary_tasks,
|
||||
debug=debug,
|
||||
target_timeout=target_timeout,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
def basic(
|
||||
@ -365,6 +367,7 @@ class Libfuzzer(Command):
|
||||
extra_setup_container: Optional[Container] = None,
|
||||
extra_output_container: Optional[Container] = None,
|
||||
crashes: Optional[Container] = None,
|
||||
task_env: Optional[Dict[str, str]] = None,
|
||||
) -> Optional[Job]:
|
||||
"""
|
||||
Basic libfuzzer job
|
||||
@ -496,6 +499,7 @@ class Libfuzzer(Command):
|
||||
analyzer_options=analyzer_options,
|
||||
analyzer_env=analyzer_env,
|
||||
tools=tools,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
self.logger.info("done creating tasks")
|
||||
@ -531,6 +535,7 @@ class Libfuzzer(Command):
|
||||
check_fuzzer_help: bool = False,
|
||||
no_check_fuzzer_help: bool = False,
|
||||
extra_setup_container: Optional[Container] = None,
|
||||
task_env: Optional[Dict[str, str]] = None,
|
||||
) -> Optional[Job]:
|
||||
"""
|
||||
libfuzzer merge task
|
||||
@ -628,6 +633,7 @@ class Libfuzzer(Command):
|
||||
debug=debug,
|
||||
preserve_existing_outputs=preserve_existing_outputs,
|
||||
check_fuzzer_help=check_fuzzer_help,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
self.logger.info("done creating tasks")
|
||||
@ -668,6 +674,7 @@ class Libfuzzer(Command):
|
||||
notification_config: Optional[NotificationConfig] = None,
|
||||
extra_setup_container: Optional[Container] = None,
|
||||
crashes: Optional[Container] = None,
|
||||
task_env: Optional[Dict[str, str]] = None,
|
||||
) -> Optional[Job]:
|
||||
pool = self.onefuzz.pools.get(pool_name)
|
||||
|
||||
@ -782,6 +789,7 @@ class Libfuzzer(Command):
|
||||
ensemble_sync_delay=ensemble_sync_delay,
|
||||
expect_crash_on_failure=expect_crash_on_failure,
|
||||
check_fuzzer_help=False,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
# Ensure the fuzzing task starts before we schedule the coverage and
|
||||
@ -829,6 +837,7 @@ class Libfuzzer(Command):
|
||||
prereq_tasks=prereq_tasks,
|
||||
debug=debug,
|
||||
colocate=colocate_all_tasks or colocate_secondary_tasks,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
report_containers = [
|
||||
@ -861,6 +870,7 @@ class Libfuzzer(Command):
|
||||
check_retry_count=check_retry_count,
|
||||
debug=debug,
|
||||
colocate=colocate_all_tasks or colocate_secondary_tasks,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
self.logger.info("done creating tasks")
|
||||
@ -901,6 +911,7 @@ class Libfuzzer(Command):
|
||||
extra_setup_container: Optional[Container] = None,
|
||||
crashes: Optional[Container] = None,
|
||||
readonly_inputs: Optional[Container] = None,
|
||||
task_env: Optional[Dict[str, str]] = None,
|
||||
) -> Optional[Job]:
|
||||
"""
|
||||
libfuzzer tasks, wrapped via qemu-user (PREVIEW FEATURE)
|
||||
@ -1057,6 +1068,7 @@ class Libfuzzer(Command):
|
||||
ensemble_sync_delay=ensemble_sync_delay,
|
||||
expect_crash_on_failure=False,
|
||||
check_fuzzer_help=check_fuzzer_help,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
report_containers = [
|
||||
@ -1093,6 +1105,7 @@ class Libfuzzer(Command):
|
||||
colocate=colocate_all_tasks,
|
||||
expect_crash_on_failure=False,
|
||||
check_fuzzer_help=check_fuzzer_help,
|
||||
task_env=task_env,
|
||||
)
|
||||
|
||||
self.logger.info("done creating tasks")
|
||||
|
Reference in New Issue
Block a user