mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-09 08:41:34 +00:00
Kanan/test template fix (#3308)
* Fix test_template logic * Rewrite test_template logic to make it's intention more clear
This commit is contained in:
parent
9bc1ab3c55
commit
06fb0d3fd0
@ -822,29 +822,26 @@ class DebugNotification(Command):
|
|||||||
) -> responses.NotificationTestResponse:
|
) -> responses.NotificationTestResponse:
|
||||||
"""Test a notification template"""
|
"""Test a notification template"""
|
||||||
|
|
||||||
if task_id is None and report is None:
|
|
||||||
raise Exception("must specify either task_id or report")
|
|
||||||
|
|
||||||
endpoint = Endpoint(self.onefuzz)
|
|
||||||
if task_id is not None:
|
if task_id is not None:
|
||||||
task = self.onefuzz.tasks.get(task_id)
|
task = self.onefuzz.tasks.get(task_id)
|
||||||
input_blob_ref = BlobRef(
|
if report is None:
|
||||||
account="dummy-storage-account",
|
input_blob_ref = BlobRef(
|
||||||
container="test-notification-crashes",
|
account="dummy-storage-account",
|
||||||
name="fake-crash-sample",
|
container="test-notification-crashes",
|
||||||
)
|
name="fake-crash-sample",
|
||||||
|
)
|
||||||
if report is None:
|
report = self._create_report(
|
||||||
report = self._create_report(
|
task.job_id, task.task_id, "fake_target.exe", input_blob_ref
|
||||||
task.job_id, task.task_id, "fake_target.exe", input_blob_ref
|
)
|
||||||
)
|
else:
|
||||||
|
report.task_id = task.task_id
|
||||||
if task is not None:
|
report.job_id = task.job_id
|
||||||
report.task_id = task.task_id
|
elif report is None:
|
||||||
report.job_id = task.job_id
|
raise Exception("must specify either task_id or report")
|
||||||
|
|
||||||
report.report_url = "https://dummy-container.blob.core.windows.net/dummy-reports/dummy-report.json"
|
report.report_url = "https://dummy-container.blob.core.windows.net/dummy-reports/dummy-report.json"
|
||||||
|
|
||||||
|
endpoint = Endpoint(self.onefuzz)
|
||||||
return endpoint._req_model(
|
return endpoint._req_model(
|
||||||
"POST",
|
"POST",
|
||||||
responses.NotificationTestResponse,
|
responses.NotificationTestResponse,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user