From 7d2b5be1211010aca19835c9057e983920aa12fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Misbach?= Date: Wed, 13 Mar 2024 12:53:26 +0100 Subject: [PATCH] [uss_qualifier/scenarios/utm/dss] Add (partially implemented) availability arbitration scenario --- .../scenarios/astm/utm/dss/__init__.py | 1 + .../astm/utm/dss/availability_arbitration.md | 25 +++++++ .../astm/utm/dss/availability_arbitration.py | 68 +++++++++++++++++++ .../suites/astm/utm/dss_probing.md | 8 ++- .../suites/astm/utm/dss_probing.yaml | 4 ++ .../uss_qualifier/suites/astm/utm/f3548_21.md | 7 +- .../suites/faa/uft/message_signing.md | 7 +- .../suites/interuss/dss/all_tests.md | 7 +- .../suites/uspace/flight_auth.md | 7 +- .../suites/uspace/required_services.md | 7 +- 10 files changed, 135 insertions(+), 6 deletions(-) create mode 100644 monitoring/uss_qualifier/scenarios/astm/utm/dss/availability_arbitration.md create mode 100644 monitoring/uss_qualifier/scenarios/astm/utm/dss/availability_arbitration.py diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/__init__.py b/monitoring/uss_qualifier/scenarios/astm/utm/dss/__init__.py index ed1e46c50f..412e1721b8 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/dss/__init__.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/__init__.py @@ -1,3 +1,4 @@ from .subscription_validation import SubscriptionValidation from .subscription_simple import SubscriptionSimple from .crdb_access import CRDBAccess +from .availability_arbitration import AvailabilityArbitration diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/availability_arbitration.md b/monitoring/uss_qualifier/scenarios/astm/utm/dss/availability_arbitration.md new file mode 100644 index 0000000000..fcca44388c --- /dev/null +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/availability_arbitration.md @@ -0,0 +1,25 @@ +# ASTM SCD DSS: Availability Arbitration test scenario + +## Overview + +Ensures that a DSS properly enforces limitations on created subscriptions + +## 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 USS that might otherwise go unnoticed. +A dummy `getOperationalIntentDetails` query is made to a non-existent USS in order to produce a realistic report, as if a USS was not reachable when trying to retrieve one of its operational intent. + +### Make valid DSS report test step + +#### [Make report to DSS](../make_dss_report.md) + + +## USS Availability test case + +TODO: migrate [`test_uss_availability` prober test](../../../../../prober/scd/test_uss_availability.py) diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/availability_arbitration.py b/monitoring/uss_qualifier/scenarios/astm/utm/dss/availability_arbitration.py new file mode 100644 index 0000000000..17781d8418 --- /dev/null +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/availability_arbitration.py @@ -0,0 +1,68 @@ +from uas_standards.astm.f3548.v21.api import ExchangeRecord +from uas_standards.astm.f3548.v21.constants import ( + Scope, +) + +from monitoring.monitorlib.fetch import QueryError +from monitoring.uss_qualifier.resources.astm.f3548.v21.dss import DSSInstanceResource +from monitoring.uss_qualifier.scenarios.astm.utm.test_steps import make_report + +from monitoring.uss_qualifier.scenarios.scenario import ( + TestScenario, + ScenarioCannotContinueError, +) +from monitoring.uss_qualifier.suites.suite import ExecutionContext + +from monitoring.monitorlib.clients import scd as scd_client +from monitoring.monitorlib import scd as scd_lib + + +class AvailabilityArbitration(TestScenario): + def __init__( + self, + dss: DSSInstanceResource, + ): + super().__init__() + scopes = { + Scope.AvailabilityArbitration: "get/set USS availability and submit DSS reports" + } + 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.begin_test_case("USS Availability") + self._uss_availability_case() + self.end_test_case() + + self.end_test_scenario() + + def _dss_report_case(self): + def gen_record() -> ExchangeRecord: + try: + op_intent, _ = scd_client.get_operational_intent_details( + self._dss.client, "http://dummy.interuss.org", "dummy_id" + ) + except QueryError as qe: + return scd_lib.make_exchange_record( + qe.queries[0], "this is a dummy record created by the USS qualifier" + ) + + # we are not supposed to reach this state + raise ScenarioCannotContinueError( + "illegal state: get_operational_intent_details to a dummy USS did not raise a QueryError" + ) + + self.begin_test_step("Make valid DSS report") + dummy_record = gen_record() + report_id = make_report(self, self._dss, dummy_record) + self.record_note(f"{self._dss.participant_id}/report_id", report_id) + self.end_test_step() + + def _uss_availability_case(self): + # TODO: implement me + pass diff --git a/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md b/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md index c9d4e631c4..fb89bad8a1 100644 --- a/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md +++ b/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md @@ -10,6 +10,7 @@ 4. Scenario: [ASTM F3548-21 UTM DSS interoperability](../../../scenarios/astm/utm/dss_interoperability.md) ([`scenarios.astm.utm.DSSInteroperability`](../../../scenarios/astm/utm/dss_interoperability.py)) 5. 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)) 6. 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)) +7. Scenario: [ASTM SCD DSS: Availability Arbitration](../../../scenarios/astm/utm/dss/availability_arbitration.md) ([`scenarios.astm.utm.dss.AvailabilityArbitration`](../../../scenarios/astm/utm/dss/availability_arbitration.py)) ## [Checked requirements](../../README.md#checked-requirements) @@ -21,7 +22,7 @@ Checked in - astm
.f3548
.v21
+ astm
.f3548
.v21
DSS0005,1 Implemented ASTM F3548-21 UTM DSS Operational Intent Reference Access Control
ASTM SCD DSS: Subscription Simple
ASTM SCD DSS: Subscription Synchronization
ASTM SCD DSS: Subscription Validation @@ -41,6 +42,11 @@ Implemented ASTM SCD DSS: Subscription Validation + + DSS0100,2 + Implemented + ASTM SCD DSS: Availability Arbitration + 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 46b4fbb4b1..52fa02dad8 100644 --- a/monitoring/uss_qualifier/suites/astm/utm/dss_probing.yaml +++ b/monitoring/uss_qualifier/suites/astm/utm/dss_probing.yaml @@ -46,3 +46,7 @@ actions: scenario_type: scenarios.astm.utm.dss.CRDBAccess resources: crdb_cluster: dss_crdb_cluster + - test_scenario: + scenario_type: scenarios.astm.utm.dss.AvailabilityArbitration + 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 fb9a9fec82..e734a520ef 100644 --- a/monitoring/uss_qualifier/suites/astm/utm/f3548_21.md +++ b/monitoring/uss_qualifier/suites/astm/utm/f3548_21.md @@ -35,7 +35,7 @@ Checked in - astm
.f3548
.v21
+ astm
.f3548
.v21
DSS0005,1 Implemented ASTM F3548 flight planners preparation
ASTM F3548-21 UTM DSS Operational Intent Reference Access Control
ASTM SCD DSS: Subscription Simple
ASTM SCD DSS: Subscription Synchronization
ASTM SCD DSS: Subscription Validation
Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted @@ -60,6 +60,11 @@ Implemented Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted + + DSS0100,2 + Implemented + ASTM SCD DSS: Availability Arbitration + 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 b3e69423ea..fd2249d61a 100644 --- a/monitoring/uss_qualifier/suites/faa/uft/message_signing.md +++ b/monitoring/uss_qualifier/suites/faa/uft/message_signing.md @@ -18,7 +18,7 @@ Checked in - astm
.f3548
.v21
+ astm
.f3548
.v21
DSS0005,1 Implemented ASTM F3548 flight planners preparation
ASTM F3548-21 UTM DSS Operational Intent Reference Access Control
ASTM SCD DSS: Subscription Simple
ASTM SCD DSS: Subscription Synchronization
ASTM SCD DSS: Subscription Validation
Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted @@ -43,6 +43,11 @@ Implemented Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted + + DSS0100,2 + Implemented + ASTM SCD DSS: Availability Arbitration + 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 053a6748f6..1da62b1e8d 100644 --- a/monitoring/uss_qualifier/suites/interuss/dss/all_tests.md +++ b/monitoring/uss_qualifier/suites/interuss/dss/all_tests.md @@ -408,7 +408,7 @@ ASTM NetRID DSS: Concurrent Requests
ASTM NetRID DSS: ISA Expiry
ASTM NetRID DSS: ISA Subscription Interactions
ASTM NetRID DSS: Simple ISA
ASTM NetRID DSS: Submitted ISA Validations
ASTM NetRID DSS: Subscription Simple
ASTM NetRID DSS: Subscription Validation
ASTM NetRID DSS: Token Validation - astm
.f3548
.v21
+ astm
.f3548
.v21
DSS0005,1 Implemented ASTM F3548-21 UTM DSS Operational Intent Reference Access Control
ASTM SCD DSS: Subscription Simple
ASTM SCD DSS: Subscription Synchronization
ASTM SCD DSS: Subscription Validation @@ -428,6 +428,11 @@ Implemented ASTM SCD DSS: Subscription Validation + + DSS0100,2 + Implemented + ASTM SCD DSS: Availability Arbitration + DSS0200 Implemented diff --git a/monitoring/uss_qualifier/suites/uspace/flight_auth.md b/monitoring/uss_qualifier/suites/uspace/flight_auth.md index f6500b179e..a2580eb813 100644 --- a/monitoring/uss_qualifier/suites/uspace/flight_auth.md +++ b/monitoring/uss_qualifier/suites/uspace/flight_auth.md @@ -19,7 +19,7 @@ Checked in - astm
.f3548
.v21
+ astm
.f3548
.v21
DSS0005,1 Implemented ASTM F3548 flight planners preparation
ASTM F3548-21 UTM DSS Operational Intent Reference Access Control
ASTM SCD DSS: Subscription Simple
ASTM SCD DSS: Subscription Synchronization
ASTM SCD DSS: Subscription Validation
Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted @@ -44,6 +44,11 @@ Implemented Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted + + DSS0100,2 + Implemented + ASTM SCD DSS: Availability Arbitration + DSS0200 Implemented diff --git a/monitoring/uss_qualifier/suites/uspace/required_services.md b/monitoring/uss_qualifier/suites/uspace/required_services.md index 2878452b5c..47c8ada587 100644 --- a/monitoring/uss_qualifier/suites/uspace/required_services.md +++ b/monitoring/uss_qualifier/suites/uspace/required_services.md @@ -454,7 +454,7 @@ ASTM NetRID DSS: Concurrent Requests
ASTM NetRID DSS: ISA Expiry
ASTM NetRID DSS: ISA Subscription Interactions
ASTM NetRID DSS: Simple ISA
ASTM NetRID DSS: Submitted ISA Validations
ASTM NetRID DSS: Subscription Simple
ASTM NetRID DSS: Subscription Validation
ASTM NetRID DSS: Token Validation - astm
.f3548
.v21
+ astm
.f3548
.v21
DSS0005,1 Implemented ASTM F3548 flight planners preparation
ASTM F3548-21 UTM DSS Operational Intent Reference Access Control
ASTM SCD DSS: Subscription Simple
ASTM SCD DSS: Subscription Synchronization
ASTM SCD DSS: Subscription Validation
Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted @@ -479,6 +479,11 @@ Implemented Off-Nominal planning: down USS
Off-Nominal planning: down USS with equal priority conflicts not permitted + + DSS0100,2 + Implemented + ASTM SCD DSS: Availability Arbitration + DSS0200 Implemented