diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/get_op_data_validation.md b/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/get_op_data_validation.md index d51eea4240..06a170f29c 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/get_op_data_validation.md +++ b/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/get_op_data_validation.md @@ -40,7 +40,9 @@ In order to run this test scenario, we need tested_uss to trigger GET operationa But, if there is a subscription by tested_uss, that would trigger notification of flight 2 to tested_uss. Some USSes will not make a GET request to control_uss for flight 2 details, while planning a nearby flight, if they got a notification for flight2. Hence, if a USS didn't make a GET request, we will only fail it if didn't get -a notification, or else, a precondition for the test will not be met. +a notification, or else, a precondition for the test will not be met. Some USSes might make a GET request despite getting +a notification, but as it would not be clear whether invalid information through notification or GET request was used for planning, +the test will be not be continued. ### [Tested_uss plans flight 1 test step](../../../flight_planning/plan_flight_intent.md) The test driver attempts to plan flight 1 via the tested USS. It checks if any conflicts with flight 2 @@ -76,7 +78,9 @@ In order to run this test scenario, we need tested_uss to trigger GET operationa But, if there is a subscription by tested_uss, that would trigger notification of flight 2 to tested_uss. Some USSes will not make a GET request to control_uss for flight 2 details, while planning a nearby flight, if they got a notification for flight2. Hence, if a USS didn't make a GET request, we will only fail it if didn't get -a notification, or else, a precondition for the test will not be met. +a notification, or else, a precondition for the test will not be met. Some USSes might make a GET request despite getting +a notification, but as it would not be clear whether invalid information through notification or GET request was used for planning, +the test will be not be continued. ### [Tested_uss attempts to plan flight 1, expect failure test step](test_steps/plan_flight_intent_expect_failed.md) The test driver attempts to plan the flight 1 via the tested_uss. It checks if any conflicts with flight 2 diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/get_op_data_validation.py b/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/get_op_data_validation.py index 3619c6f102..83ce996f6e 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/get_op_data_validation.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/get_op_data_validation.py @@ -196,20 +196,21 @@ def _tested_uss_plans_deconflicted_flight_near_existing_flight( flight_1, ) - get_requested, already_notified = expect_get_requests_to_mock_uss( - self, - self.control_uss, - planning_time, - self.control_uss.base_url, - flight_2_oi_ref.id, - self.tested_uss_client.participant_id, - tested_uss_notified, - "Validate flight2 GET interaction", - ) - - if get_requested == False and already_notified == True: + if tested_uss_notified: + expect_get_requests_to_mock_uss( + self, + self.control_uss, + planning_time, + self.control_uss.base_url, + flight_2_oi_ref.id, + self.tested_uss_client.participant_id, + "Validate flight2 GET interaction", + ) + else: msg = ( - f"GET request was not made by tested_uss, as it was notified of flight2, due to an existing subscription. " + f"Tested_uss was notified of flight2, due to an existing subscription. Hence, not checking for the GET requests." + f"Whether a GET request is made or not, it would be unclear clear if tested_uss used the information from notification or GET request for planning." + f"As this test is for checking GET requests validation, we cannot continue the test." f"See documentation of test step - Check for notification to tested_uss due to subscription in flight 2 area" ) raise ScenarioCannotContinueError(msg) @@ -298,19 +299,23 @@ def _tested_uss_unable_to_plan_flight_near_invalid_shared_existing_flight( ) validator.expect_not_shared() - get_requested, already_notified = expect_get_requests_to_mock_uss( - self, - self.control_uss, - planning_time, - self.control_uss.base_url, - flight_2_oi_ref.id, - self.tested_uss_client.participant_id, - tested_uss_notified, - "Validate flight 2 GET interaction", - ) - - if get_requested == False and already_notified == True: - msg = f"GET request was not made by tested_uss, as it was notified of flight2, due to an exisitng subscription." + if tested_uss_notified: + expect_get_requests_to_mock_uss( + self, + self.control_uss, + planning_time, + self.control_uss.base_url, + flight_2_oi_ref.id, + self.tested_uss_client.participant_id, + "Validate flight 2 GET interaction", + ) + else: + msg = ( + f"Tested_uss was notified of flight2, due to an existing subscription. Hence, not checking for the GET requests." + f"Whether a GET request is made or not, it would be unclear clear if tested_uss used the information from notification or GET request for planning." + f"As this test is for checking GET requests validation, we cannot continue the test." + f"See documentation of test step - Check for notification to tested_uss due to subscription in flight 2 area" + ) raise ScenarioCannotContinueError(msg) expect_no_interuss_post_interactions( diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/test_steps/expected_interactions_test_steps.py b/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/test_steps/expected_interactions_test_steps.py index 7d5c12d6bd..a676ed9198 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/test_steps/expected_interactions_test_steps.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/data_exchange_validation/test_steps/expected_interactions_test_steps.py @@ -107,22 +107,15 @@ def expect_get_requests_to_mock_uss( mock_uss_base_url: str, id: str, participant_id: str, - already_notified_other_uss: bool, test_step: str, -) -> Tuple[bool, bool]: +): """ This step checks a GET request was made to mock_uss for an existing entity, from time 'st' to now Args: mock_uss_base_url: url of the mock_uss that is managing the entity id: entity id participant_id: id of the participant responsible to send GET request - already_notified_other_uss: If True, then a subscription existed that caused mock_uss to send notification - Returns: - get_requested: bool, already_notified_other_uss: bool - [False, True] when GET request not made due to a notification already sent by mock_uss - [True, True|False] when GET request made - [False, False] other uss failed to make a GET request """ scenario.begin_test_step(test_step) interactions, query = _get_interuss_interactions_with_check(scenario, mock_uss, st) @@ -135,8 +128,6 @@ def expect_get_requests_to_mock_uss( get_requested = True break if not get_requested: - if already_notified_other_uss: - return get_requested, already_notified_other_uss with scenario.check("Expect GET request", [participant_id]) as check: check.record_failed( summary=f"No GET request received at {mock_uss_base_url} for {id} ", @@ -145,7 +136,6 @@ def expect_get_requests_to_mock_uss( query_timestamps=[query.request.timestamp], ) scenario.end_test_step() - return get_requested, already_notified_other_uss def _get_interuss_interactions_with_check( @@ -202,10 +192,6 @@ def is_uss_interaction(interaction: Interaction, excl_sub: str) -> bool: for interaction in all_interactions: if is_uss_interaction(interaction, exclude_sub): interuss_interactions.append(interaction) - logger.debug( - f"Interuss interaction reported : {interaction.query.request.method} {interaction.query.request.url} " - f"with response {interaction.query.response.status_code}" - ) return interuss_interactions, query