Skip to content

Commit

Permalink
[uss_qualifier/scenarios/utm/dss] Add report scenario (#553)
Browse files Browse the repository at this point in the history
* [uss_qualifier/scenarios/utm/dss] Add (partially implemented)  availability arbitration scenario

* remove availability arbitration scenario
  • Loading branch information
mickmis authored Mar 20, 2024
1 parent 121b066 commit 0e28f5d
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
from .crdb_access import CRDBAccess
from .op_intent_ref_access_control import OpIntentReferenceAccessControl
from .dss_interoperability import DSSInteroperability
from .report import Report
20 changes: 20 additions & 0 deletions monitoring/uss_qualifier/scenarios/astm/utm/dss/report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ASTM SCD DSS: Report test scenario

## Overview

This scenario tests the ability of the DSS to receive DSS reports.

## Resources

### dss

[`DSSInstanceResource`](../../../../resources/astm/f3548/v21/dss.py) to be tested in this scenario.

## DSS Report test case

This test attempts to submit to the DSS a report about a communication issue with a DSS that might otherwise go unnoticed.
A dummy `getOperationalIntentReference` query is made to a non-existent DSS in order to produce a realistic report, as if a DSS was not reachable when trying to retrieve an operational intent reference.

### Make valid DSS report test step

#### [Make report to DSS](../make_dss_report.md)
66 changes: 66 additions & 0 deletions monitoring/uss_qualifier/scenarios/astm/utm/dss/report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
from uas_standards.astm.f3548.v21.api import ExchangeRecord, OPERATIONS, OperationID
from uas_standards.astm.f3548.v21.constants import (
Scope,
)

from monitoring.monitorlib.fetch import QueryError, query_and_describe, QueryType
from monitoring.uss_qualifier.resources.astm.f3548.v21.dss import (
DSSInstanceResource,
)
from monitoring.uss_qualifier.scenarios.astm.utm.test_steps import make_dss_report

from monitoring.uss_qualifier.scenarios.scenario import (
TestScenario,
ScenarioCannotContinueError,
)
from monitoring.uss_qualifier.suites.suite import ExecutionContext

from monitoring.monitorlib import scd as scd_lib, infrastructure


class Report(TestScenario):
def __init__(
self,
dss: DSSInstanceResource,
):
super().__init__()
scopes = {
Scope.StrategicCoordination: "get operational intent reference and submit a DSS report"
}
self._dss = dss.get_instance(scopes)

def run(self, context: ExecutionContext):
self.begin_test_scenario(context)

self.begin_test_case("DSS Report")
self._dss_report_case()
self.end_test_case()

self.end_test_scenario()

def _dss_report_case(self):
def gen_record() -> ExchangeRecord:
try:
op = OPERATIONS[OperationID.GetOperationalIntentReference]
query_and_describe(
infrastructure.UTMClientSession("https://dummy.interuss.org"),
op.verb,
op.path.format(entityid="dummy_op_intent_id"),
QueryType.F3548v21DSSGetOperationalIntentReference,
"dummy_dss",
)
except QueryError as qe:
return scd_lib.make_exchange_record(
qe.cause, "this is a dummy record created by the USS qualifier"
)

# we are not supposed to reach this state
raise ScenarioCannotContinueError(
"illegal state: getOperationalIntentReference to a dummy DSS did not raise a QueryError"
)

self.begin_test_step("Make valid DSS report")
dummy_record = gen_record()
report_id = make_dss_report(self, self._dss, dummy_record)
self.record_note(f"{self._dss.participant_id}/report_id", report_id)
self.end_test_step()
2 changes: 1 addition & 1 deletion monitoring/uss_qualifier/scenarios/astm/utm/test_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def set_uss_down(
return availability_version


def make_report(
def make_dss_report(
scenario: TestScenarioType,
dss: DSSInstance,
exchange: ExchangeRecord,
Expand Down
6 changes: 6 additions & 0 deletions monitoring/uss_qualifier/suites/astm/utm/dss_probing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
5. Scenario: [ASTM F3548-21 UTM DSS interoperability](../../../scenarios/astm/utm/dss/dss_interoperability.md) ([`scenarios.astm.utm.dss.DSSInteroperability`](../../../scenarios/astm/utm/dss/dss_interoperability.py))
6. Scenario: [ASTM SCD DSS: Subscription Synchronization](../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md) ([`scenarios.astm.utm.dss.synchronization.SubscriptionSynchronization`](../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.py))
7. Scenario: [ASTM UTM DSS: Direct CRDB access](../../../scenarios/astm/utm/dss/crdb_access.md) ([`scenarios.astm.utm.dss.CRDBAccess`](../../../scenarios/astm/utm/dss/crdb_access.py))
8. Scenario: [ASTM SCD DSS: Report](../../../scenarios/astm/utm/dss/report.md) ([`scenarios.astm.utm.dss.Report`](../../../scenarios/astm/utm/dss/report.py))

## [Checked requirements](../../README.md#checked-requirements)

Expand Down Expand Up @@ -47,6 +48,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0100,2</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/report.md">ASTM SCD DSS: Report</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0200</a></td>
<td>Implemented</td>
Expand Down
4 changes: 4 additions & 0 deletions monitoring/uss_qualifier/suites/astm/utm/dss_probing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ actions:
scenario_type: scenarios.astm.utm.dss.CRDBAccess
resources:
crdb_cluster: dss_crdb_cluster
- test_scenario:
scenario_type: scenarios.astm.utm.dss.Report
resources:
dss: dss
5 changes: 5 additions & 0 deletions monitoring/uss_qualifier/suites/astm/utm/f3548_21.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/off_nominal_planning/down_uss.md">Off-Nominal planning: down USS</a><br><a href="../../../scenarios/astm/utm/off_nominal_planning/down_uss_equal_priority_not_permitted.md">Off-Nominal planning: down USS with equal priority conflicts not permitted</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0100,2</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/report.md">ASTM SCD DSS: Report</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0200</a></td>
<td>Implemented</td>
Expand Down
5 changes: 5 additions & 0 deletions monitoring/uss_qualifier/suites/faa/uft/message_signing.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/off_nominal_planning/down_uss.md">Off-Nominal planning: down USS</a><br><a href="../../../scenarios/astm/utm/off_nominal_planning/down_uss_equal_priority_not_permitted.md">Off-Nominal planning: down USS with equal priority conflicts not permitted</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0100,2</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/report.md">ASTM SCD DSS: Report</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0200</a></td>
<td>Implemented</td>
Expand Down
5 changes: 5 additions & 0 deletions monitoring/uss_qualifier/suites/interuss/dss/all_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0100,2</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/report.md">ASTM SCD DSS: Report</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0200</a></td>
<td>Implemented</td>
Expand Down
5 changes: 5 additions & 0 deletions monitoring/uss_qualifier/suites/uspace/flight_auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
<td>Implemented</td>
<td><a href="../../scenarios/astm/utm/off_nominal_planning/down_uss.md">Off-Nominal planning: down USS</a><br><a href="../../scenarios/astm/utm/off_nominal_planning/down_uss_equal_priority_not_permitted.md">Off-Nominal planning: down USS with equal priority conflicts not permitted</a></td>
</tr>
<tr>
<td><a href="../../requirements/astm/f3548/v21.md">DSS0100,2</a></td>
<td>Implemented</td>
<td><a href="../../scenarios/astm/utm/dss/report.md">ASTM SCD DSS: Report</a></td>
</tr>
<tr>
<td><a href="../../requirements/astm/f3548/v21.md">DSS0200</a></td>
<td>Implemented</td>
Expand Down
5 changes: 5 additions & 0 deletions monitoring/uss_qualifier/suites/uspace/required_services.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,11 @@
<td>Implemented</td>
<td><a href="../../scenarios/astm/utm/off_nominal_planning/down_uss.md">Off-Nominal planning: down USS</a><br><a href="../../scenarios/astm/utm/off_nominal_planning/down_uss_equal_priority_not_permitted.md">Off-Nominal planning: down USS with equal priority conflicts not permitted</a></td>
</tr>
<tr>
<td><a href="../../requirements/astm/f3548/v21.md">DSS0100,2</a></td>
<td>Implemented</td>
<td><a href="../../scenarios/astm/utm/dss/report.md">ASTM SCD DSS: Report</a></td>
</tr>
<tr>
<td><a href="../../requirements/astm/f3548/v21.md">DSS0200</a></td>
<td>Implemented</td>
Expand Down

0 comments on commit 0e28f5d

Please sign in to comment.