Skip to content

Commit

Permalink
DSS0210,2e check OIR extent is synced
Browse files Browse the repository at this point in the history
  • Loading branch information
Shastick committed Mar 12, 2024
1 parent 04c18e6 commit f191f75
Showing 10 changed files with 153 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -20,6 +20,11 @@ If the DSS fails to let us search in the area for which the OIR was created, it

If the existing operational intent reference is not returned in a search that covers the area it was created for, the DSS is not properly implementing **[astm.f3548.v21.DSS0005,2](../../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Search operational intent reference response is correct check

A successful operational intent reference search query is expected to return a well-defined body, the content of which includes the created operational intent reference.
If the format and content of the response are not conforming, or don't contain the expected data, the DSS is failing to implement **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Search operational intent reference response format conforms to spec check

The response to a successful operational intent reference search query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21.
Original file line number Diff line number Diff line change
@@ -22,6 +22,12 @@ either one of the instances at which the operational intent reference was create
If the operational intent reference returned by a DSS to which the operational intent reference was synchronized to does not contain the correct state,
either one of the instances at which the operational intent reference was created or the one that was queried, may be failing to implement **[astm.f3548.v21.DSS0210,2d](../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Propagated operational intent reference keeps its 4DVolume check

If the propagated operational intent can searched for and retrieved from a secondary DSS for a time and area that are different than
the ones for which it was created, either one of the instances at which the operational intent reference was created or the one that was queried
are failing to properly implement **[astm.f3548.v21.DSS0210,2e](../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Propagated operational intent reference contains the correct start time check

If the operational intent reference returned by a DSS to which the operational intent reference was synchronized to does not contain the correct start time,
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime, timedelta
from typing import List, Optional
from typing import List, Optional, Tuple

import loguru
from implicitdict import StringBasedDateTime
@@ -12,8 +12,10 @@
)
from uas_standards.astm.f3548.v21.constants import Scope

from monitoring.monitorlib import fetch
from monitoring.monitorlib.fetch import QueryError
from monitoring.monitorlib.geotemporal import Volume4D
from monitoring.monitorlib.temporal import Time
from monitoring.prober.infrastructure import register_resource_type
from monitoring.uss_qualifier.resources.astm.f3548.v21 import PlanningAreaResource
from monitoring.uss_qualifier.resources.astm.f3548.v21.dss import (
@@ -101,7 +103,6 @@ def __init__(

# Build a ready-to-use 4D volume with no specified time for searching
# the currently active OIRs
# TODO OIR search will be added in an upcomming PR
self._planning_area_volume4d = Volume4D(
volume=self._planning_area.volume,
)
@@ -136,6 +137,7 @@ def run(self, context: ExecutionContext):

self.begin_test_step("Query newly created OIR")
self._query_secondaries_and_compare(self._oir_params)
self._search_secondaries_and_compare(self._oir_params)
self.end_test_step()

self.begin_test_step("Mutate OIR")
@@ -144,6 +146,7 @@ def run(self, context: ExecutionContext):

self.begin_test_step("Query updated OIR")
self._query_secondaries_and_compare(self._oir_params)
self._search_secondaries_and_compare(self._oir_params)
self.end_test_step()

self.begin_test_step("Delete OIR")
@@ -236,6 +239,106 @@ def _query_secondaries_and_compare(
),
)

def _search_secondaries_and_compare(
self, expected_oir_params: PutOperationalIntentReferenceParameters
):
for secondary_dss in self._dss_read_instances:
self._validate_area_with_search(
secondary_dss=secondary_dss,
expected_oir_params=expected_oir_params,
involved_participants=list(
{self._primary_pid, secondary_dss.participant_id}
),
)

def _validate_area_with_search(
self,
secondary_dss: DSSInstance,
expected_oir_params: PutOperationalIntentReferenceParameters,
involved_participants: List[str],
):
"""Check that the secondaries take the OIR volume into account."""
# Search for currently active ones in the planning area:
# we expect to find our OIR
oirs, q = self._search_oirs(secondary_dss, self._planning_area_volume4d)
oir_by_id = {oir.id: oir for oir in oirs}

with self.check(
"Propagated operational intent reference keeps its 4DVolume",
involved_participants,
) as check:
if self._oir_id not in oir_by_id:
check.record_failed(
summary="Propagated OIR not found",
details="OIR was not found in the secondary DSS when searched for its expected geo-temporal extent",
)

# While we're at it: check the entire search response format and validate the content of the OIR
with self.check(
"Search operational intent reference response is correct",
involved_participants,
) as check:
OIRValidator(
main_check=check,
scenario=self,
expected_manager=self._expected_manager,
participant_id=[secondary_dss.participant_id],
oir_params=expected_oir_params,
).validate_searched_oir(
expected_oir_id=self._oir_id,
search_response=q,
expected_ovn=self._current_oir.ovn,
expected_version=self._current_oir.version,
)

# Now search for an extent that does not contain the OIR:
# Same geographical area but time bounds come after the current OIR
oir_not_included = Volume4D(
volume=self._planning_area.volume,
time_start=Time(expected_oir_params.extents[-1].time_end.value),
time_end=Time(
expected_oir_params.extents[-1].time_end.value.datetime
+ timedelta(minutes=10)
),
)

oirs, q = self._search_oirs(secondary_dss, oir_not_included.to_f3548v21())
oir_by_id = {oir.id: oir for oir in oirs}

with self.check(
"Propagated operational intent reference keeps its 4DVolume",
involved_participants,
) as check:
if self._oir_id not in oir_by_id:
check.record_failed(
summary="Propagated OIR not found",
details="OIR was not found in the secondary DSS when searched for its expected geo-temporal extent",
)

# TODO repeat the check for another volume that shares the time bounds but has another geographical area

def _search_oirs(
self, secondary_dss: DSSInstance, volume: Volume4D
) -> Tuple[List[OperationalIntentReference], fetch.Query]:
"""Check that the secondaries take the OIR volume into account."""
# Search for currently active ones in the planning area
with self.check(
"Successful operational intent reference search query",
[secondary_dss.participant_id],
) as check:
try:
oirs, q = secondary_dss.find_op_intent(volume)
self.record_query(q)
return oirs, q
except QueryError as qe:
self.record_queries(qe.queries)
check.record_failed(
summary="Failed to search for operational intent references",
details=f"Failed to query operational intent references: got response code {qe.last_status_code}: {qe.msg}",
query_timestamps=qe.query_timestamps,
)
return [], qe.queries[-1]

def _validate_oir_from_secondary(
self,
secondary_dss: DSSInstance,
Original file line number Diff line number Diff line change
@@ -421,7 +421,7 @@ def validate_searched_oir(
QueryOperationalIntentReferenceResponse
)

by_id = {oir: oir.id for oir in resp_parsed.operational_intent_references}
by_id = {oir.id: oir for oir in resp_parsed.operational_intent_references}

with self._scenario.check(
"Created operational intent reference is in search results", self._pid
7 changes: 6 additions & 1 deletion monitoring/uss_qualifier/suites/astm/utm/dss_probing.md
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
<th><a href="../../README.md#checked-in">Checked in</a></th>
</tr>
<tr>
<td rowspan="20" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="21" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0005,1</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_simple.md">ASTM SCD DSS: Subscription Simple</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_validation.md">ASTM SCD DSS: Subscription Validation</a></td>
@@ -107,6 +107,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,2e</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,2f</a></td>
<td>Implemented</td>
7 changes: 6 additions & 1 deletion monitoring/uss_qualifier/suites/astm/utm/f3548_21.md
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
<th><a href="../../README.md#checked-in">Checked in</a></th>
</tr>
<tr>
<td rowspan="46" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="47" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0005,1</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/prep_planners.md">ASTM F3548 flight planners preparation</a><br><a href="../../../scenarios/astm/utm/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_simple.md">ASTM SCD DSS: Subscription Simple</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_validation.md">ASTM SCD DSS: Subscription Validation</a><br><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>
@@ -125,6 +125,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,2e</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,2f</a></td>
<td>Implemented</td>
7 changes: 6 additions & 1 deletion monitoring/uss_qualifier/suites/faa/uft/message_signing.md
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
<th><a href="../../README.md#checked-in">Checked in</a></th>
</tr>
<tr>
<td rowspan="46" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="47" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0005,1</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/prep_planners.md">ASTM F3548 flight planners preparation</a><br><a href="../../../scenarios/astm/utm/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_simple.md">ASTM SCD DSS: Subscription Simple</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_validation.md">ASTM SCD DSS: Subscription Validation</a><br><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>
@@ -108,6 +108,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,2e</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,2f</a></td>
<td>Implemented</td>
7 changes: 6 additions & 1 deletion monitoring/uss_qualifier/suites/interuss/dss/all_tests.md
Original file line number Diff line number Diff line change
@@ -408,7 +408,7 @@
<td><a href="../../../scenarios/astm/netrid/v22a/dss/heavy_traffic_concurrent.md">ASTM NetRID DSS: Concurrent Requests</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/isa_expiry.md">ASTM NetRID DSS: ISA Expiry</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/isa_subscription_interactions.md">ASTM NetRID DSS: ISA Subscription Interactions</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/isa_simple.md">ASTM NetRID DSS: Simple ISA</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/isa_validation.md">ASTM NetRID DSS: Submitted ISA Validations</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/subscription_simple.md">ASTM NetRID DSS: Subscription Simple</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/subscription_validation.md">ASTM NetRID DSS: Subscription Validation</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/token_validation.md">ASTM NetRID DSS: Token Validation</a></td>
</tr>
<tr>
<td rowspan="20" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="21" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0005,1</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_simple.md">ASTM SCD DSS: Subscription Simple</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_validation.md">ASTM SCD DSS: Subscription Validation</a></td>
@@ -493,6 +493,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,2e</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,2f</a></td>
<td>Implemented</td>
7 changes: 6 additions & 1 deletion monitoring/uss_qualifier/suites/uspace/flight_auth.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
<th><a href="../README.md#checked-in">Checked in</a></th>
</tr>
<tr>
<td rowspan="46" style="vertical-align:top;"><a href="../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="47" style="vertical-align:top;"><a href="../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td><a href="../../requirements/astm/f3548/v21.md">DSS0005,1</a></td>
<td>Implemented</td>
<td><a href="../../scenarios/astm/utm/prep_planners.md">ASTM F3548 flight planners preparation</a><br><a href="../../scenarios/astm/utm/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a><br><a href="../../scenarios/astm/utm/dss/subscription_simple.md">ASTM SCD DSS: Subscription Simple</a><br><a href="../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a><br><a href="../../scenarios/astm/utm/dss/subscription_validation.md">ASTM SCD DSS: Subscription Validation</a><br><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>
@@ -109,6 +109,11 @@
<td>Implemented</td>
<td><a href="../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a></td>
</tr>
<tr>
<td><a href="../../requirements/astm/f3548/v21.md">DSS0210,2e</a></td>
<td>Implemented</td>
<td><a href="../../scenarios/astm/utm/dss/synchronization/op_intent_ref_synchronization.md">ASTM SCD DSS: Operational Intent Reference Synchronization</a></td>
</tr>
<tr>
<td><a href="../../requirements/astm/f3548/v21.md">DSS0210,2f</a></td>
<td>Implemented</td>
Loading
Oops, something went wrong.

0 comments on commit f191f75

Please sign in to comment.