Skip to content

Commit

Permalink
[uss_qualifier / flight planning] Add modify flight intent test steps (
Browse files Browse the repository at this point in the history
…#50)

* [uss_qualifier / flight planning] Add modify flight intents steps

* align with error handling update
  • Loading branch information
mickmis authored Feb 23, 2023
1 parent 9043b73 commit 0755eb5
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Modify activated flight test step

This page describes the content of a common test case where a valid user flight intent in activated state should be
successfully modified by a flight planner. See `modify_activated_flight_intent` in [test_steps.py](test_steps.py).

## Successful modification check

All flight intent data provided is correct and valid and free of conflict in space and time, therefore it should have
been modified by the USS per **interuss.automated_testing.flight_planning.ExpectedBehavior**.
If the USS fails to modify the flight, wrongly indicates a conflict, or wrongly indicates the activated state of the
flight, this check will fail.

## Failure check

All flight intent data provided was complete and correct. It should have been processed successfully, allowing the USS
to reject or accept the flight. If the USS indicates that the injection attempt failed, this check will fail per
**[interuss.automated_testing.flight_planning.ExpectedBehavior](../../requirements/interuss/automated_testing/flight_planning.md)**.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Modify planned flight test step

This page describes the content of a common test case where a valid user flight intent in planned state should be
successfully modified by a flight planner. See `modify_planned_flight_intent` in [test_steps.py](test_steps.py).

## Successful modification check

All flight intent data provided is correct and valid and free of conflict in space and time, therefore it should have
been modified by the USS per **interuss.automated_testing.flight_planning.ExpectedBehavior**.
If the USS fails to modify the flight, wrongly indicates a conflict, or wrongly indicates the planned state of the
flight, this check will fail.

## Failure check

All flight intent data provided was complete and correct. It should have been processed successfully, allowing the USS
to reject or accept the flight. If the USS indicates that the injection attempt failed, this check will fail per
**[interuss.automated_testing.flight_planning.ExpectedBehavior](../../requirements/interuss/automated_testing/flight_planning.md)**.
52 changes: 52 additions & 0 deletions monitoring/uss_qualifier/scenarios/flight_planning/test_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,58 @@ def activate_valid_flight_intent(
)[0]


def modify_planned_flight_intent(
scenario: TestScenarioType,
test_step: str,
flight_planner: FlightPlanner,
flight_id: str,
flight_intent: InjectFlightRequest,
) -> InjectFlightResponse:
"""Modify a planned flight intent that should result in success.
This function implements the test step described in
modify_planned_flight_intent.md.
Returns: The injection response.
"""
return submit_flight_intent(
scenario,
test_step,
"Successful modification",
{InjectFlightResult.Planned},
{InjectFlightResult.Failed: "Failure"},
flight_planner,
flight_intent,
flight_id,
)[0]


def modify_activated_flight_intent(
scenario: TestScenarioType,
test_step: str,
flight_planner: FlightPlanner,
flight_id: str,
flight_intent: InjectFlightRequest,
) -> InjectFlightResponse:
"""Modify an activated flight intent that should result in success.
This function implements the test step described in
modify_activated_flight_intent.md.
Returns: The injection response.
"""
return submit_flight_intent(
scenario,
test_step,
"Successful modification",
{InjectFlightResult.ReadyToFly},
{InjectFlightResult.Failed: "Failure"},
flight_planner,
flight_intent,
flight_id,
)[0]


def submit_flight_intent(
scenario: TestScenarioType,
test_step: str,
Expand Down

0 comments on commit 0755eb5

Please sign in to comment.