mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-18 04:38:09 +00:00
expose input_blob fields needed to generate crash reports (#551)
This commit is contained in:
@ -129,7 +129,16 @@ pub async fn run_tool(input: impl AsRef<Path>, config: &Config) -> Result<()> {
|
|||||||
.tools_dir(&config.tools.path)
|
.tools_dir(&config.tools.path)
|
||||||
.setup_dir(&config.common.setup_dir)
|
.setup_dir(&config.common.setup_dir)
|
||||||
.job_id(&config.common.job_id)
|
.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)?;
|
let analyzer_path = expand.evaluate_value(&config.analyzer_exe)?;
|
||||||
|
|
||||||
|
@ -192,6 +192,11 @@ async fn start_supervisor(
|
|||||||
})
|
})
|
||||||
.set_optional_ref(&config.target_options, |expand, target_options| {
|
.set_optional_ref(&config.target_options, |expand, target_options| {
|
||||||
expand.target_options(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)?;
|
let supervisor_path = expand.evaluate_value(&config.supervisor_exe)?;
|
||||||
|
@ -38,6 +38,8 @@ pub enum PlaceHolder {
|
|||||||
ReportsDir,
|
ReportsDir,
|
||||||
JobId,
|
JobId,
|
||||||
TaskId,
|
TaskId,
|
||||||
|
CrashesContainer,
|
||||||
|
CrashesAccount,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PlaceHolder {
|
impl PlaceHolder {
|
||||||
@ -64,6 +66,8 @@ impl PlaceHolder {
|
|||||||
Self::ReportsDir => "{reports_dir}",
|
Self::ReportsDir => "{reports_dir}",
|
||||||
Self::JobId => "{job_id}",
|
Self::JobId => "{job_id}",
|
||||||
Self::TaskId => "{task_id}",
|
Self::TaskId => "{task_id}",
|
||||||
|
Self::CrashesContainer => "{crashes_container}",
|
||||||
|
Self::CrashesAccount => "{crashes_account}",
|
||||||
}
|
}
|
||||||
.to_string()
|
.to_string()
|
||||||
}
|
}
|
||||||
@ -251,6 +255,20 @@ impl<'a> Expand<'a> {
|
|||||||
self.set_value(PlaceHolder::JobId, ExpandedValue::Scalar(value))
|
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(
|
fn replace_value(
|
||||||
&self,
|
&self,
|
||||||
fmtstr: &str,
|
fmtstr: &str,
|
||||||
|
Reference in New Issue
Block a user