From 0e28f5d821c6b4b242dae135a66b9f8263f331d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Misbach?= Date: Wed, 20 Mar 2024 18:17:29 +0100 Subject: [PATCH] [uss_qualifier/scenarios/utm/dss] Add report scenario (#553) * [uss_qualifier/scenarios/utm/dss] Add (partially implemented) availability arbitration scenario * remove availability arbitration scenario --- .../scenarios/astm/utm/dss/__init__.py | 1 + .../scenarios/astm/utm/dss/report.md | 20 ++++++ .../scenarios/astm/utm/dss/report.py | 66 +++++++++++++++++++ .../scenarios/astm/utm/test_steps.py | 2 +- .../suites/astm/utm/dss_probing.md | 6 ++ .../suites/astm/utm/dss_probing.yaml | 4 ++ .../uss_qualifier/suites/astm/utm/f3548_21.md | 5 ++ .../suites/faa/uft/message_signing.md | 5 ++ .../suites/interuss/dss/all_tests.md | 5 ++ .../suites/uspace/flight_auth.md | 5 ++ .../suites/uspace/required_services.md | 5 ++ 11 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 monitoring/uss_qualifier/scenarios/astm/utm/dss/report.md create mode 100644 monitoring/uss_qualifier/scenarios/astm/utm/dss/report.py diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/__init__.py b/monitoring/uss_qualifier/scenarios/astm/utm/dss/__init__.py index a877cf780f..47a422e5d9 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/dss/__init__.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/__init__.py @@ -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 diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/report.md b/monitoring/uss_qualifier/scenarios/astm/utm/dss/report.md new file mode 100644 index 0000000000..109954384a --- /dev/null +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/report.md @@ -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) diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/report.py b/monitoring/uss_qualifier/scenarios/astm/utm/dss/report.py new file mode 100644 index 0000000000..d18afa4982 --- /dev/null +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/report.py @@ -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() diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/test_steps.py b/monitoring/uss_qualifier/scenarios/astm/utm/test_steps.py index 2adaf0ac3a..4fb5018c6c 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/test_steps.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/test_steps.py @@ -701,7 +701,7 @@ def set_uss_down( return availability_version -def make_report( +def make_dss_report( scenario: TestScenarioType, dss: DSSInstance, exchange: ExchangeRecord, diff --git a/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md b/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md index aafcf4ab03..4f3808a99a 100644 --- a/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md +++ b/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md @@ -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) @@ -47,6 +48,11 @@ Implemented ASTM SCD DSS: Subscription Synchronization + + DSS0100,2 + Implemented + ASTM SCD DSS: Report + DSS0200 Implemented diff --git a/monitoring/uss_qualifier/suites/astm/utm/dss_probing.yaml b/monitoring/uss_qualifier/suites/astm/utm/dss_probing.yaml index 3a6b2a0b3b..f91516fd35 100644 --- a/monitoring/uss_qualifier/suites/astm/utm/dss_probing.yaml +++ b/monitoring/uss_qualifier/suites/astm/utm/dss_probing.yaml @@ -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 diff --git a/monitoring/uss_qualifier/suites/astm/utm/f3548_21.md b/monitoring/uss_qualifier/suites/astm/utm/f3548_21.md index 93a33e3924..6e085e6431 100644 --- a/monitoring/uss_qualifier/suites/astm/utm/f3548_21.md +++ b/monitoring/uss_qualifier/suites/astm/utm/f3548_21.md @@ -65,6 +65,11 @@ Implemented Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted + + DSS0100,2 + Implemented + ASTM SCD DSS: Report + DSS0200 Implemented diff --git a/monitoring/uss_qualifier/suites/faa/uft/message_signing.md b/monitoring/uss_qualifier/suites/faa/uft/message_signing.md index 0c4f49c84f..b8cadbc982 100644 --- a/monitoring/uss_qualifier/suites/faa/uft/message_signing.md +++ b/monitoring/uss_qualifier/suites/faa/uft/message_signing.md @@ -48,6 +48,11 @@ Implemented Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted + + DSS0100,2 + Implemented + ASTM SCD DSS: Report + DSS0200 Implemented diff --git a/monitoring/uss_qualifier/suites/interuss/dss/all_tests.md b/monitoring/uss_qualifier/suites/interuss/dss/all_tests.md index d89a6995bb..f4ed5d0281 100644 --- a/monitoring/uss_qualifier/suites/interuss/dss/all_tests.md +++ b/monitoring/uss_qualifier/suites/interuss/dss/all_tests.md @@ -433,6 +433,11 @@ Implemented ASTM SCD DSS: Subscription Synchronization + + DSS0100,2 + Implemented + ASTM SCD DSS: Report + DSS0200 Implemented diff --git a/monitoring/uss_qualifier/suites/uspace/flight_auth.md b/monitoring/uss_qualifier/suites/uspace/flight_auth.md index f2e8ab5ac8..7811acce4b 100644 --- a/monitoring/uss_qualifier/suites/uspace/flight_auth.md +++ b/monitoring/uss_qualifier/suites/uspace/flight_auth.md @@ -49,6 +49,11 @@ Implemented Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted + + DSS0100,2 + Implemented + ASTM SCD DSS: Report + DSS0200 Implemented diff --git a/monitoring/uss_qualifier/suites/uspace/required_services.md b/monitoring/uss_qualifier/suites/uspace/required_services.md index 1567131933..baa4184c53 100644 --- a/monitoring/uss_qualifier/suites/uspace/required_services.md +++ b/monitoring/uss_qualifier/suites/uspace/required_services.md @@ -484,6 +484,11 @@ Implemented Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted + + DSS0100,2 + Implemented + ASTM SCD DSS: Report + DSS0200 Implemented