-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[uss_qualifier/scenarios/utm/dss] Add report scenario (#553)
* [uss_qualifier/scenarios/utm/dss] Add (partially implemented) availability arbitration scenario * remove availability arbitration scenario
- Loading branch information
Showing
11 changed files
with
123 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters