diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/fragments/cr/crud/delete.md b/monitoring/uss_qualifier/scenarios/astm/utm/dss/fragments/cr/crud/delete.md new file mode 100644 index 0000000000..c10fe271b9 --- /dev/null +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/fragments/cr/crud/delete.md @@ -0,0 +1,20 @@ +# Delete constraint reference test step fragment + +This test step fragment validates that constraint references can be deleted + +## 🛑 Delete constraint reference query succeeds check + +A query to delete a constraint reference, by its owner and when the correct OVN is provided, should succeed, otherwise the DSS is in violation of **[astm.f3548.v21.DSS0005,3](../../../../../../../requirements/astm/f3548/v21.md)**. + +## 🛑 Delete constraint reference response format conforms to spec check + +The response to a successful constraint reference deletion query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21. + +If it does not, the DSS is failing to implement **[astm.f3548.v21.DSS0005,3](../../../../../../../requirements/astm/f3548/v21.md)**. + +## 🛑 Delete constraint reference response content is correct check + +A successful constraint reference deletion query is expected to return a body, the content of which reflects the constraint reference at the moment of deletion. +If the content of the response does not correspond to what was requested, the DSS is failing to implement **[astm.f3548.v21.DSS0005,3](../../../../../../../requirements/astm/f3548/v21.md)**. + +This check will usually be performing a series of sub-checks from the [validate](../validate) fragments. diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/synchronization/constraint_ref_synchronization.md b/monitoring/uss_qualifier/scenarios/astm/utm/dss/synchronization/constraint_ref_synchronization.md index ef1e2b1081..acd8ef23e1 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/dss/synchronization/constraint_ref_synchronization.md +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/synchronization/constraint_ref_synchronization.md @@ -162,4 +162,46 @@ Confirm that the constraint reference that was just updated is properly synchron #### [CR version is correct](../fragments/cr/validate/non_mutated.md) +### Delete CR test step + +Attempt to delete the constraint reference in various ways and ensure that the DSS reacts properly. + +This also checks that the constraint reference data returned by a successful deletion is correct. + +#### [Delete CR](../fragments/cr/crud/delete.md) + +Confirm that an constraint reference can be deleted. + +#### [Validate CR](../fragments/cr/validate/correctness.md) + +Verify that the constraint reference returned by the DSS via the deletion is properly formatted and contains the correct content. + +#### [CR Versions are correct](../fragments/cr/validate/non_mutated.md) + +Verify that the constraint reference's version fields are as expected. + +### Query deleted CR test step + +Attempt to query and search for the deleted constraint reference in various ways + +#### [Get CR query](../fragments/cr/crud/read_correct.md) + +Check that read query succeeds. + +#### 🛑 Deleted CR cannot be retrieved from all DSS instances check + +If a DSS returns an constraint reference that was previously successfully deleted from the primary DSS, +either one of the primary DSS or the DSS that returned the constraint reference is in violation of **[astm.f3548.v21.DSS0210,2a](../../../../../requirements/astm/f3548/v21.md)**, **[astm.f3548.v21.DSS0210,A2-7-2,3b](../../../../../requirements/astm/f3548/v21.md)**, +**[astm.f3548.v21.DSS0215](../../../../../requirements/astm/f3548/v21.md)** and **[astm.f3548.v21.DSS0020](../../../../../requirements/astm/f3548/v21.md)**. + +#### [Search CR](../fragments/cr/crud/search_query.md) + +Check that search query succeeds. + +#### 🛑 Deleted CR cannot be searched for from all DSS instances check + +If a DSS returns an constraint reference that was previously successfully deleted from the primary DSS, +either one of the primary DSS or the DSS that returned the constraint reference is in violation of **[astm.f3548.v21.DSS0210,2a](../../../../../requirements/astm/f3548/v21.md)**, **[astm.f3548.v21.DSS0210,A2-7-2,3a](../../../../../requirements/astm/f3548/v21.md)**, +**[astm.f3548.v21.DSS0215](../../../../../requirements/astm/f3548/v21.md)** and **[astm.f3548.v21.DSS0020](../../../../../requirements/astm/f3548/v21.md)**. + ## [Cleanup](../clean_workspace.md) diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/synchronization/constraint_ref_synchronization.py b/monitoring/uss_qualifier/scenarios/astm/utm/dss/synchronization/constraint_ref_synchronization.py index 98dc5d5e37..5b6548656e 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/dss/synchronization/constraint_ref_synchronization.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/synchronization/constraint_ref_synchronization.py @@ -157,7 +157,13 @@ def run(self, context: ExecutionContext): ) self.end_test_step() - # Other steps to follow in subsequent PRs + self.begin_test_step("Delete CR") + self._test_delete_sub() + self.end_test_step() + + self.begin_test_step("Query deleted CR") + self._test_get_deleted_cr() + self.end_test_step() self.end_test_case() self.end_test_scenario() @@ -488,6 +494,103 @@ def _test_mutate_oir_shift_time(self): self._current_cr = cr + def _test_delete_sub(self): + with self.check( + "Delete constraint reference query succeeds", [self._primary_pid] + ) as check: + try: + oir, subs, q = self._dss.delete_constraint_ref( + self._cr_id, self._current_cr.ovn + ) + self.record_query(q) + except QueryError as qe: + self.record_queries(qe.queries) + check.record_failed( + summary="Constraint reference deletion on primary DSS failed", + details=qe.msg, + query_timestamps=qe.query_timestamps, + ) + + with self.check( + "Delete constraint reference response content is correct", + [self._primary_pid], + ) as check: + ConstraintReferenceValidator( + main_check=check, + scenario=self, + expected_manager=self._expected_manager, + participant_id=[self._primary_pid], + cr_params=self._cr_params, + ).validate_deleted_cr( + expected_cr_id=self._cr_id, + deleted_cr=q, + expected_ovn=self._current_cr.ovn, + expected_version=self._current_cr.version, + ) + + self._current_cr = None + + def _test_get_deleted_cr(self): + for secondary_dss in self._secondary_dss_instances: + self._confirm_secondary_has_no_oir(secondary_dss) + + def _confirm_secondary_has_no_oir(self, secondary_dss: DSSInstance): + with self.check( + "Get constraint reference by ID", + secondary_dss.participant_id, + ) as check: + try: + oir, q = secondary_dss.get_constraint_ref(self._cr_id) + self.record_query(q) + except QueryError as qe: + q = qe.cause + self.record_query(q) + if q.status_code != 404: + check.record_failed( + summary="GET for constraint reference failed", + details=f"Query for constraint reference failed: {qe.msg}", + query_timestamps=qe.query_timestamps, + ) + + with self.check( + "Deleted CR cannot be retrieved from all DSS instances", + [self._primary_pid, secondary_dss.participant_id], + ) as check: + if q.status_code != 404: + check.record_failed( + summary="Secondary DSS still has the deleted constraint reference", + details=f"Expected 404, received {q.status_code}", + query_timestamps=[q.request.timestamp], + ) + + with self.check( + "Successful constraint reference search query", + [secondary_dss.participant_id], + ) as check: + try: + crs, q = secondary_dss.find_constraint_ref(self._planning_area_volume4d) + self.record_query(q) + except QueryError as qe: + self.record_queries(qe.queries) + check.record_failed( + summary="Failed to search for constraint references", + details=f"Failed to query constraint references: got response code {qe.cause_status_code}: {qe.msg}", + query_timestamps=qe.query_timestamps, + ) + + constraint_ref_ids = set([cr.id for cr in crs]) + with self.check( + "Deleted CR cannot be searched for from all DSS instances", + [self._primary_pid, secondary_dss.participant_id], + ) as check: + # TODO fix same bug in OIR sync scenario + if self._cr_id in constraint_ref_ids: + check.record_failed( + summary="Secondary DSS still has the deleted constraint reference", + details=f"CR {self._cr_id} was found in the secondary DSS when searched for its expected geo-temporal extent", + query_timestamps=[q.request.timestamp], + ) + def cleanup(self): self.begin_cleanup() self._ensure_clean_workspace_step() diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/validators/cr_validator.py b/monitoring/uss_qualifier/scenarios/astm/utm/dss/validators/cr_validator.py index 9c44aabdee..2bb72aa192 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/dss/validators/cr_validator.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/validators/cr_validator.py @@ -28,7 +28,7 @@ class ConstraintReferenceValidator: """ - Wraps the validation logic for an constraint reference that was returned by a DSS + Wraps the validation logic for a constraint reference that was returned by a DSS It will compare the provided CR with the parameters specified at its creation. """ @@ -464,3 +464,39 @@ def validate_searched_cr_format( ) if errors: fail_with_schema_errors(check, errors, t_dss) + + def validate_deleted_cr( + self, + expected_cr_id: EntityID, + deleted_cr: fetch.Query, + expected_ovn: str, + expected_version: int, + ) -> None: + + t_dss = deleted_cr.request.timestamp + + # Validate the response schema + with self._scenario.check( + "Delete constraint reference response format conforms to spec", + self._pid, + ) as check: + errors = schema_validation.validate( + F3548_21.OpenAPIPath, + F3548_21.ChangeConstraintReferenceResponse, + deleted_cr.response.json, + ) + if errors: + fail_with_schema_errors(check, errors, t_dss) + + cr_resp = deleted_cr.parse_json_result(ChangeConstraintReferenceResponse) + + # Validate the CR itself + self._validate_cr( + expected_entity_id=expected_cr_id, + dss_cr=cr_resp.constraint_reference, + t_dss=t_dss, + previous_ovn=None, + expected_ovn=expected_ovn, + previous_version=None, + expected_version=expected_version, + ) diff --git a/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md b/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md index 5aa73f8d62..d16ee7284f 100644 --- a/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md +++ b/monitoring/uss_qualifier/suites/astm/utm/dss_probing.md @@ -218,12 +218,12 @@ DSS0210,A2-7-2,3a Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,3b Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,4a diff --git a/monitoring/uss_qualifier/suites/astm/utm/f3548_21.md b/monitoring/uss_qualifier/suites/astm/utm/f3548_21.md index 9b85defcf4..1b3189bf54 100644 --- a/monitoring/uss_qualifier/suites/astm/utm/f3548_21.md +++ b/monitoring/uss_qualifier/suites/astm/utm/f3548_21.md @@ -224,12 +224,12 @@ DSS0210,A2-7-2,3a Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,3b Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,4a diff --git a/monitoring/uss_qualifier/suites/faa/uft/message_signing.md b/monitoring/uss_qualifier/suites/faa/uft/message_signing.md index c4a954c18a..6eb2c3d2cd 100644 --- a/monitoring/uss_qualifier/suites/faa/uft/message_signing.md +++ b/monitoring/uss_qualifier/suites/faa/uft/message_signing.md @@ -206,12 +206,12 @@ DSS0210,A2-7-2,3a Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,3b Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,4a diff --git a/monitoring/uss_qualifier/suites/interuss/dss/all_tests.md b/monitoring/uss_qualifier/suites/interuss/dss/all_tests.md index 7edc98cc4b..08098a1f13 100644 --- a/monitoring/uss_qualifier/suites/interuss/dss/all_tests.md +++ b/monitoring/uss_qualifier/suites/interuss/dss/all_tests.md @@ -596,12 +596,12 @@ DSS0210,A2-7-2,3a Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,3b Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,4a diff --git a/monitoring/uss_qualifier/suites/uspace/flight_auth.md b/monitoring/uss_qualifier/suites/uspace/flight_auth.md index feb3128c48..93b38dff07 100644 --- a/monitoring/uss_qualifier/suites/uspace/flight_auth.md +++ b/monitoring/uss_qualifier/suites/uspace/flight_auth.md @@ -207,12 +207,12 @@ DSS0210,A2-7-2,3a Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,3b Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,4a diff --git a/monitoring/uss_qualifier/suites/uspace/required_services.md b/monitoring/uss_qualifier/suites/uspace/required_services.md index e770066cfa..5b64cfb31f 100644 --- a/monitoring/uss_qualifier/suites/uspace/required_services.md +++ b/monitoring/uss_qualifier/suites/uspace/required_services.md @@ -642,12 +642,12 @@ DSS0210,A2-7-2,3a Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,3b Implemented - ASTM SCD DSS: Operational Intent Reference Synchronization + ASTM SCD DSS: Constraint Reference Synchronization
ASTM SCD DSS: Operational Intent Reference Synchronization DSS0210,A2-7-2,4a