diff --git a/src/agent/onefuzz-agent/src/tasks/analysis/generic.rs b/src/agent/onefuzz-agent/src/tasks/analysis/generic.rs index 1a0510b7bb..a697090656 100644 --- a/src/agent/onefuzz-agent/src/tasks/analysis/generic.rs +++ b/src/agent/onefuzz-agent/src/tasks/analysis/generic.rs @@ -129,7 +129,16 @@ pub async fn run_tool(input: impl AsRef, config: &Config) -> Result<()> { .tools_dir(&config.tools.path) .setup_dir(&config.common.setup_dir) .job_id(&config.common.job_id) - .task_id(&config.common.task_id); + .task_id(&config.common.task_id) + .set_optional_ref(&config.crashes, |tester, crashes| { + if let Some(url) = &crashes.url { + tester + .crashes_account(&url.account()) + .crashes_container(&url.container()) + } else { + tester + } + }); let analyzer_path = expand.evaluate_value(&config.analyzer_exe)?; diff --git a/src/agent/onefuzz-agent/src/tasks/fuzz/supervisor.rs b/src/agent/onefuzz-agent/src/tasks/fuzz/supervisor.rs index 32a4bf9303..0ba1393c35 100644 --- a/src/agent/onefuzz-agent/src/tasks/fuzz/supervisor.rs +++ b/src/agent/onefuzz-agent/src/tasks/fuzz/supervisor.rs @@ -192,6 +192,11 @@ async fn start_supervisor( }) .set_optional_ref(&config.target_options, |expand, target_options| { expand.target_options(target_options) + }) + .set_optional_ref(&config.crashes.url, |tester, url| { + tester + .crashes_account(&url.account()) + .crashes_container(&url.container()) }); let supervisor_path = expand.evaluate_value(&config.supervisor_exe)?; diff --git a/src/agent/onefuzz/src/expand.rs b/src/agent/onefuzz/src/expand.rs index 8c6562983b..6733a261fd 100644 --- a/src/agent/onefuzz/src/expand.rs +++ b/src/agent/onefuzz/src/expand.rs @@ -38,6 +38,8 @@ pub enum PlaceHolder { ReportsDir, JobId, TaskId, + CrashesContainer, + CrashesAccount, } impl PlaceHolder { @@ -64,6 +66,8 @@ impl PlaceHolder { Self::ReportsDir => "{reports_dir}", Self::JobId => "{job_id}", Self::TaskId => "{task_id}", + Self::CrashesContainer => "{crashes_container}", + Self::CrashesAccount => "{crashes_account}", } .to_string() } @@ -251,6 +255,20 @@ impl<'a> Expand<'a> { self.set_value(PlaceHolder::JobId, ExpandedValue::Scalar(value)) } + pub fn crashes_account(self, arg: &str) -> Self { + self.set_value( + PlaceHolder::CrashesAccount, + ExpandedValue::Scalar(String::from(arg)), + ) + } + + pub fn crashes_container(self, arg: &str) -> Self { + self.set_value( + PlaceHolder::CrashesContainer, + ExpandedValue::Scalar(String::from(arg)), + ) + } + fn replace_value( &self, fmtstr: &str,