diff --git a/monitoring/monitorlib/clients/flight_planning/client_v1.py b/monitoring/monitorlib/clients/flight_planning/client_v1.py index e7c99c9c65..2eb3451e5c 100644 --- a/monitoring/monitorlib/clients/flight_planning/client_v1.py +++ b/monitoring/monitorlib/clients/flight_planning/client_v1.py @@ -1,12 +1,14 @@ import uuid from typing import Optional + from implicitdict import ImplicitDict +from uas_standards.interuss.automated_testing.flight_planning.v1 import api +from uas_standards.interuss.automated_testing.flight_planning.v1.constants import Scope + from monitoring.monitorlib.clients.flight_planning.client import ( FlightPlannerClient, ) -from monitoring.monitorlib.clients.flight_planning.test_preparation import ( - TestPreparationActivityResponse, -) +from monitoring.monitorlib.clients.flight_planning.client import PlanningActivityError from monitoring.monitorlib.clients.flight_planning.flight_info import ( FlightInfo, FlightID, @@ -15,17 +17,17 @@ from monitoring.monitorlib.clients.flight_planning.planning import ( PlanningActivityResponse, ) -from monitoring.monitorlib.fetch import query_and_describe, QueryType -from monitoring.monitorlib.geotemporal import Volume4D -from monitoring.monitorlib.infrastructure import UTMClientSession -from monitoring.uss_qualifier.configurations.configuration import ParticipantID -from monitoring.monitorlib.clients.flight_planning.client import PlanningActivityError from monitoring.monitorlib.clients.flight_planning.planning import ( PlanningActivityResult, FlightPlanStatus, ) -from uas_standards.interuss.automated_testing.flight_planning.v1 import api -from uas_standards.interuss.automated_testing.flight_planning.v1.constants import Scope +from monitoring.monitorlib.clients.flight_planning.test_preparation import ( + TestPreparationActivityResponse, +) +from monitoring.monitorlib.fetch import query_and_describe, QueryType +from monitoring.monitorlib.geotemporal import Volume4D +from monitoring.monitorlib.infrastructure import UTMClientSession +from monitoring.uss_qualifier.configurations.configuration import ParticipantID class V1FlightPlannerClient(FlightPlannerClient): @@ -91,6 +93,7 @@ def _inject( queries=[query], activity_result=resp.planning_result, flight_plan_status=resp.flight_plan_status, + includes_advisories=resp.includes_advisories, ) return response diff --git a/monitoring/uss_qualifier/resources/flight_planning/flight_planner.py b/monitoring/uss_qualifier/resources/flight_planning/flight_planner.py index 0b28f7cf79..08ce4214ba 100644 --- a/monitoring/uss_qualifier/resources/flight_planning/flight_planner.py +++ b/monitoring/uss_qualifier/resources/flight_planning/flight_planner.py @@ -24,6 +24,7 @@ from monitoring.monitorlib.clients.flight_planning.planning import ( PlanningActivityResult, FlightPlanStatus, + AdvisoryInclusion, ) from monitoring.monitorlib.fetch import QueryError, Query from monitoring.monitorlib.geotemporal import Volume4D, Volume4DCollection @@ -122,7 +123,7 @@ def request_flight( self, request: InjectFlightRequest, flight_id: Optional[str] = None, - ) -> Tuple[InjectFlightResponse, fetch.Query, str]: + ) -> Tuple[InjectFlightResponse, fetch.Query, str, Optional[AdvisoryInclusion]]: usage_states = { OperationalIntentState.Accepted: AirspaceUsageState.Planned, OperationalIntentState.Activated: AirspaceUsageState.InUse, @@ -210,7 +211,7 @@ def request_flight( operational_intent_id="", ) - return response, resp.queries[0], flight_id + return response, resp.queries[0], flight_id, resp.includes_advisories def cleanup_flight( self, flight_id: str diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.py b/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.py index aaa242d3c9..00cf79ee84 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.py @@ -196,7 +196,7 @@ def _validate_ended_cancellation(self): "Validate flight intent shared correctly", self._intents_extent, ) as planned_validator: - _, flight_id = plan_flight_intent( + _, flight_id, _ = plan_flight_intent( self, "Plan flight intent", self.tested_uss, @@ -210,7 +210,7 @@ def _validate_ended_cancellation(self): cancelled_validator.expect_not_shared() def _validate_precision_intersection(self): - _, _ = plan_flight_intent( + _, _, _ = plan_flight_intent( self, "Plan control flight intent", self.tested_uss, diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.py b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.py index 4e24bbabbb..3c93e1497a 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.py @@ -214,7 +214,7 @@ def _attempt_plan_flight_conflict(self) -> OperationalIntentReference: "Validate Flight 2 sharing", self._intents_extent, ) as validator: - _, self.flight2_id = plan_flight_intent( + _, self.flight2_id, _ = plan_flight_intent( self, "Plan Flight 2", self.control_uss, @@ -283,7 +283,7 @@ def _attempt_modify_planned_flight_conflict( "Validate Flight 1c sharing", self._intents_extent, ) as validator: - _, self.flight1_id = plan_flight_intent( + _, self.flight1_id, _ = plan_flight_intent( self, "Plan Flight 1c", self.tested_uss, @@ -386,7 +386,7 @@ def _modify_activated_flight_preexisting_conflict( "Validate Flight 2m sharing", self._intents_extent, ) as validator: - _, self.flight2_id = plan_flight_intent( + _, self.flight2_id, _ = plan_flight_intent( self, "Plan Flight 2m", self.control_uss, @@ -403,7 +403,7 @@ def _modify_activated_flight_preexisting_conflict( flight_2_oi_ref, ) as validator: self.begin_test_step("Declare Flight 2 non-conforming") - resp_flight_2, _ = submit_flight_intent( + resp_flight_2, _, _ = submit_flight_intent( self, "Successful transition to non-conforming state", { @@ -435,7 +435,7 @@ def _modify_activated_flight_preexisting_conflict( self.begin_test_step( "Attempt to modify activated Flight 1 in conflict with nonconforming Flight 2" ) - resp_flight_1, _ = submit_flight_intent( + resp_flight_1, _, _ = submit_flight_intent( self, "Successful modification or rejection", { diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.py b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.py index 32fd8e6ad6..bbb7e5cabd 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.py @@ -214,7 +214,7 @@ def _attempt_plan_flight_conflict(self): "Validate Flight 2 sharing", self._intents_extent, ) as validator: - resp_flight_2, self.flight2_id = plan_flight_intent( + resp_flight_2, self.flight2_id, _ = plan_flight_intent( self, "Plan Flight 2", self.control_uss, @@ -252,7 +252,7 @@ def _attempt_modify_planned_flight_conflict( "Validate Flight 1 sharing", self._intents_extent, ) as validator: - resp_flight_1, self.flight1_id = plan_flight_intent( + resp_flight_1, self.flight1_id, _ = plan_flight_intent( self, "Plan Flight 1", self.tested_uss, @@ -267,7 +267,7 @@ def _attempt_modify_planned_flight_conflict( "Validate Flight 2 sharing", self._intents_extent, ) as validator: - resp_flight_2, self.flight2_id = plan_flight_intent( + resp_flight_2, self.flight2_id, _ = plan_flight_intent( self, "Plan Flight 2", self.control_uss, @@ -352,7 +352,7 @@ def _modify_activated_flight_conflict_preexisting( "Validate Flight 2 sharing", self._intents_extent, ) as validator: - _, self.flight2_id = plan_flight_intent( + _, self.flight2_id, _ = plan_flight_intent( self, "Plan Flight 2", self.control_uss, diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/notifications_to_operator/__init__.py b/monitoring/uss_qualifier/scenarios/astm/utm/notifications_to_operator/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/off_nominal_planning/down_uss.py b/monitoring/uss_qualifier/scenarios/astm/utm/off_nominal_planning/down_uss.py index 647f4f4be4..8aa7daf264 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/off_nominal_planning/down_uss.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/off_nominal_planning/down_uss.py @@ -229,7 +229,7 @@ def _plan_flight_conflict_planned(self): self._intents_extent, ) as validator: self.begin_test_step("Tested USS attempts to plan Flight 1") - resp, flight_id = submit_flight_intent( + resp, flight_id, _ = submit_flight_intent( self, "Successful planning", { diff --git a/monitoring/uss_qualifier/scenarios/flight_planning/prioritization_test_steps.py b/monitoring/uss_qualifier/scenarios/flight_planning/prioritization_test_steps.py index 52f2357930..799bf20493 100644 --- a/monitoring/uss_qualifier/scenarios/flight_planning/prioritization_test_steps.py +++ b/monitoring/uss_qualifier/scenarios/flight_planning/prioritization_test_steps.py @@ -35,7 +35,7 @@ def plan_priority_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Incorrectly planned", { @@ -70,7 +70,7 @@ def modify_planned_priority_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Incorrectly modified", { @@ -106,7 +106,7 @@ def activate_priority_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Incorrectly activated", { @@ -142,7 +142,7 @@ def modify_activated_priority_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Incorrectly modified", { @@ -177,7 +177,7 @@ def plan_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Incorrectly planned", { @@ -212,7 +212,7 @@ def modify_planned_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Incorrectly modified", { @@ -248,7 +248,7 @@ def activate_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Incorrectly activated", { @@ -284,7 +284,7 @@ def modify_activated_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Incorrectly modified", { @@ -321,7 +321,7 @@ def plan_permitted_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, flight_id = submit_flight_intent( + resp, flight_id, _ = submit_flight_intent( scenario, "Successful planning", {InjectFlightResponseResult.Planned}, @@ -353,7 +353,7 @@ def modify_planned_permitted_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Successful modification", {InjectFlightResponseResult.Planned}, @@ -386,7 +386,7 @@ def activate_permitted_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Successful activation", {InjectFlightResponseResult.ReadyToFly}, @@ -419,7 +419,7 @@ def modify_activated_permitted_conflict_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Successful modification", {InjectFlightResponseResult.ReadyToFly}, diff --git a/monitoring/uss_qualifier/scenarios/flight_planning/test_steps.py b/monitoring/uss_qualifier/scenarios/flight_planning/test_steps.py index 08d3f40976..ba899fbd3e 100644 --- a/monitoring/uss_qualifier/scenarios/flight_planning/test_steps.py +++ b/monitoring/uss_qualifier/scenarios/flight_planning/test_steps.py @@ -5,6 +5,7 @@ PlanningActivityResponse, PlanningActivityResult, FlightPlanStatus, + AdvisoryInclusion, ) from monitoring.monitorlib.clients.flight_planning.client_v1 import ( @@ -51,7 +52,7 @@ def plan_flight_intent( test_step: str, flight_planner: FlightPlanner, flight_intent: InjectFlightRequest, -) -> Tuple[InjectFlightResponse, Optional[str]]: +) -> Tuple[InjectFlightResponse, Optional[str], Optional[AdvisoryInclusion]]: """Plan a flight intent that should result in success. Note: This method is deprecated in favor of plan_flight @@ -67,7 +68,7 @@ def plan_flight_intent( ) scenario.begin_test_step(test_step) - resp, flight_id = submit_flight_intent( + resp, flight_id, advisories = submit_flight_intent( scenario, "Successful planning", {InjectFlightResponseResult.Planned}, @@ -77,7 +78,7 @@ def plan_flight_intent( ) scenario.end_test_step() - return resp, flight_id + return resp, flight_id, advisories def activate_flight_intent( @@ -99,7 +100,7 @@ def activate_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Successful activation", {InjectFlightResponseResult.ReadyToFly}, @@ -132,7 +133,7 @@ def modify_planned_flight_intent( ) scenario.begin_test_step(test_step) - resp, _ = submit_flight_intent( + resp, _, _ = submit_flight_intent( scenario, "Successful modification", {InjectFlightResponseResult.Planned}, @@ -168,7 +169,7 @@ def modify_activated_flight_intent( scenario.begin_test_step(test_step) if preexisting_conflict: - resp, flight_id = submit_flight_intent( + resp, flight_id, _ = submit_flight_intent( scenario, "Successful modification", { @@ -208,7 +209,7 @@ def modify_activated_flight_intent( ) else: - resp, flight_id = submit_flight_intent( + resp, flight_id, _ = submit_flight_intent( scenario, "Successful modification", {InjectFlightResponseResult.ReadyToFly}, @@ -230,7 +231,7 @@ def submit_flight_intent( flight_planner: FlightPlanner, flight_intent: InjectFlightRequest, flight_id: Optional[str] = None, -) -> Tuple[InjectFlightResponse, Optional[str]]: +) -> Tuple[InjectFlightResponse, Optional[str], Optional[AdvisoryInclusion]]: """Submit a flight intent with an expected result. Note: This method is deprecated in favor of submit_flight @@ -250,7 +251,7 @@ def submit_flight_intent( with scenario.check(success_check, [flight_planner.participant_id]) as check: try: - resp, query, flight_id = flight_planner.request_flight( + resp, query, flight_id, advisories = flight_planner.request_flight( flight_intent, flight_id ) except QueryError as e: @@ -280,7 +281,8 @@ def submit_flight_intent( for failed_result, failed_check_name in failed_checks.items(): with scenario.check( - failed_check_name, [flight_planner.participant_id] + failed_check_name, + [flight_planner.participant_id], ) as check: if resp.result == failed_result: check.record_failed( @@ -290,7 +292,7 @@ def submit_flight_intent( query_timestamps=[query.request.timestamp], ) - return resp, flight_id + return resp, flight_id, advisories def delete_flight_intent( diff --git a/monitoring/uss_qualifier/scenarios/uspace/flight_auth/validation.py b/monitoring/uss_qualifier/scenarios/uspace/flight_auth/validation.py index 4a20805057..3d192b3755 100644 --- a/monitoring/uss_qualifier/scenarios/uspace/flight_auth/validation.py +++ b/monitoring/uss_qualifier/scenarios/uspace/flight_auth/validation.py @@ -133,7 +133,7 @@ def _attempt_invalid_flights(self) -> bool: return True def _plan_valid_flight(self) -> bool: - resp, _ = plan_flight_intent( + resp, _, _ = plan_flight_intent( self, "Plan valid flight intent", self.ussp,