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

Commit

Permalink
allow report to be sent when debugging (#3206)
Browse files Browse the repository at this point in the history
  • Loading branch information
chkeita committed Jun 21, 2023
1 parent c752114 commit a720dd1
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions src/cli/onefuzz/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,20 +815,34 @@ def task(
)

def test_template(
self, task_id: UUID_EXPANSION, notificationConfig: models.NotificationConfig
self,
notificationConfig: models.NotificationConfig,
task_id: Optional[UUID] = None,
report: Optional[Report] = None,
) -> responses.NotificationTestResponse:
"""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)
task = self.onefuzz.tasks.get(task_id)
input_blob_ref = BlobRef(
account="dummy-storage-account",
container="test-notification-crashes",
name="fake-crash-sample",
)
if task_id is not None:
task = self.onefuzz.tasks.get(task_id)
input_blob_ref = BlobRef(
account="dummy-storage-account",
container="test-notification-crashes",
name="fake-crash-sample",
)

if report is None:
report = self._create_report(
task.job_id, task.task_id, "fake_target.exe", input_blob_ref
)

if task is not None:
report.task_id = task.task_id
report.job_id = task.job_id

report = self._create_report(
task.job_id, task.task_id, "fake_target.exe", input_blob_ref
)
report.report_url = "https://dummy-container.blob.core.windows.net/dummy-reports/dummy-report.json"

return endpoint._req_model(
Expand Down

0 comments on commit a720dd1

Please sign in to comment.