Skip to content

Commit

Permalink
Merge remote-tracking branch 'interuss/main' into docs/scd-scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminPelletier committed Sep 29, 2023
2 parents 1f79d4c + baf3629 commit bef6134
Show file tree
Hide file tree
Showing 11 changed files with 733 additions and 520 deletions.
2 changes: 1 addition & 1 deletion monitoring/monitorlib/geotemporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def time_start(self) -> Optional[Time]:
@property
def time_end(self) -> Optional[Time]:
return (
Time(value=min(v.time_end.datetime for v in self.volumes))
Time(value=max(v.time_end.datetime for v in self.volumes))
if all("time_end" in v and v.time_end for v in self.volumes)
else None
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class InjectFlightResponse(ImplicitDict):

result: InjectFlightResult
notes: Optional[str]
operational_intent_id: Optional[str]


class DeleteFlightResult(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ to reject or accept the flight. If the USS indicates that the injection attempt
### [Plan valid flight intent test step](../../../flight_planning/plan_flight_intent.md)
The valid flight intent should be successfully planned by the flight planner.

### [Validate flight sharing test step](../validate_shared_operational_intent.md)

### Attempt to modify planned flight with an off-nominal volume test step
The user flight intent that the test driver attempts to modify has an off-nominal volume and is in the `Accepted` state.
As such, the modification attempt should be rejected.
Expand All @@ -95,6 +97,8 @@ Validate that the planned flight intent was not modified with an off-nominal vol
### [Activate valid flight intent test step](../../../flight_planning/activate_flight_intent.md)
The valid flight intent should be successfully activated by the flight planner.

### [Validate flight sharing test step](../validate_shared_operational_intent.md)

### Attempt to modify activated flight with an off-nominal volume test step
The user flight intent that the test driver attempts to modify has an off-nominal volume and is in the `Activated` state.
As such, the modification attempt should be rejected.
Expand Down Expand Up @@ -125,6 +129,10 @@ Validate that the flight intent was shared correctly and is discoverable.
The flight intent should be successfully transition to Ended state by the flight planner.

### Validate flight intent is non-discoverable test step

#### DSS responses check
**[astm.f3548.v21.DSS0005](../../../../requirements/astm/f3548/v21.md)**

#### Operational intent not shared check
If the operational intent is still discoverable after it was transitioned to Ended,
this check will fail per **[astm.f3548.v21.OPIN0040](../../../../requirements/astm/f3548/v21.md)**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
FlightPlannerResource,
)
from monitoring.uss_qualifier.scenarios.astm.utm.test_steps import (
validate_shared_operational_intent,
ValidateNotSharedOperationalIntent,
OpIntentValidator,
)
from monitoring.uss_qualifier.scenarios.scenario import TestScenario
from monitoring.uss_qualifier.scenarios.flight_planning.test_steps import (
Expand Down Expand Up @@ -61,6 +60,15 @@ def __init__(
self.dss = dss.dss

flight_intents = flight_intents.get_flight_intents()

extents = []
for intent in flight_intents.values():
extents.extend(intent.request.operational_intent.volumes)
extents.extend(intent.request.operational_intent.off_nominal_volumes)
self._intents_extent = Volume4DCollection.from_f3548v21(
extents
).bounding_volume.to_f3548v21()

try:
(
self.valid_flight,
Expand Down Expand Up @@ -210,14 +218,14 @@ def _setup(self) -> bool:
return True

def _attempt_invalid(self):
with ValidateNotSharedOperationalIntent(
with OpIntentValidator(
self,
self.tested_uss,
self.dss,
"Validate flight intent too far ahead of time not planned",
self.invalid_too_far_away.request,
):
resp, _ = submit_flight_intent(
self._intents_extent,
) as validator:
submit_flight_intent(
self,
"Attempt to plan flight intent too far ahead of time",
"Incorrectly planned",
Expand All @@ -226,16 +234,17 @@ def _attempt_invalid(self):
self.tested_uss,
self.invalid_too_far_away.request,
)
validator.expect_not_shared()

def _attempt_invalid_offnominal(self):
with ValidateNotSharedOperationalIntent(
with OpIntentValidator(
self,
self.tested_uss,
self.dss,
"Validate flight intent with an off-nominal volume not planned",
self.invalid_accepted_offnominal.request,
):
resp, _ = submit_flight_intent(
self._intents_extent,
) as validator:
submit_flight_intent(
self,
"Attempt to plan flight with an off-nominal volume",
"Incorrectly planned",
Expand All @@ -244,84 +253,115 @@ def _attempt_invalid_offnominal(self):
self.tested_uss,
self.invalid_accepted_offnominal.request,
)
validator.expect_not_shared()

resp, valid_flight_id = plan_flight_intent(
self, "Plan valid flight intent", self.tested_uss, self.valid_flight.request
)
valid_flight_op_intent_id = resp.operational_intent_id

resp, _ = submit_flight_intent(
with OpIntentValidator(
self,
"Attempt to modify planned flight with an off-nominal volume",
"Incorrectly modified",
{InjectFlightResult.Rejected},
{InjectFlightResult.Failed: "Failure"},
self.tested_uss,
self.invalid_accepted_offnominal.request,
)
validate_shared_operational_intent(
self.dss,
"Validate flight sharing",
self._intents_extent,
) as validator:
_, valid_flight_id = plan_flight_intent(
self,
"Plan valid flight intent",
self.tested_uss,
self.valid_flight.request,
)
valid_flight_op_intent_ref = validator.expect_shared(
self.valid_flight.request
)

with OpIntentValidator(
self,
self.tested_uss,
self.dss,
"Validate planned flight not modified",
self.valid_flight.request,
valid_flight_op_intent_id,
)
self._intents_extent,
valid_flight_op_intent_ref,
) as validator:
submit_flight_intent(
self,
"Attempt to modify planned flight with an off-nominal volume",
"Incorrectly modified",
{InjectFlightResult.Rejected},
{InjectFlightResult.Failed: "Failure"},
self.tested_uss,
self.invalid_accepted_offnominal.request,
)
valid_flight_op_intent_ref = validator.expect_shared(
self.valid_flight.request
)

resp = activate_flight_intent(
with OpIntentValidator(
self,
"Activate valid flight intent",
self.tested_uss,
self.valid_activated.request,
valid_flight_id,
)
valid_flight_op_intent_id = resp.operational_intent_id
self.dss,
"Validate flight sharing",
self._intents_extent,
valid_flight_op_intent_ref,
) as validator:
activate_flight_intent(
self,
"Activate valid flight intent",
self.tested_uss,
self.valid_activated.request,
valid_flight_id,
)
valid_flight_op_intent_ref = validator.expect_shared(
self.valid_activated.request
)

resp, _ = submit_flight_intent(
self,
"Attempt to modify activated flight with an off-nominal volume",
"Incorrectly modified",
{InjectFlightResult.Rejected},
{InjectFlightResult.Failed: "Failure"},
self.tested_uss,
self.invalid_activated_offnominal.request,
)
validate_shared_operational_intent(
with OpIntentValidator(
self,
self.tested_uss,
self.dss,
"Validate activated flight not modified",
self.valid_activated.request,
valid_flight_op_intent_id,
)
self._intents_extent,
valid_flight_op_intent_ref,
) as validator:
submit_flight_intent(
self,
"Attempt to modify activated flight with an off-nominal volume",
"Incorrectly modified",
{InjectFlightResult.Rejected},
{InjectFlightResult.Failed: "Failure"},
self.tested_uss,
self.invalid_activated_offnominal.request,
)
validator.expect_shared(self.valid_flight.request)

_ = delete_flight_intent(
self, "Delete valid flight intent", self.tested_uss, valid_flight_id
)

def _validate_ended_cancellation(self):
with ValidateNotSharedOperationalIntent(
with OpIntentValidator(
self,
self.tested_uss,
self.dss,
"Validate flight intent is non-discoverable",
self.valid_flight.request,
):
resp, flight_id = plan_flight_intent(
self, "Plan flight intent", self.tested_uss, self.valid_flight.request
)
validate_shared_operational_intent(
self._intents_extent,
) as cancelled_validator:
with OpIntentValidator(
self,
self.tested_uss,
self.dss,
"Validate flight intent shared correctly",
self.valid_flight.request,
resp.operational_intent_id,
)
self._intents_extent,
) as planned_validator:
_, flight_id = plan_flight_intent(
self,
"Plan flight intent",
self.tested_uss,
self.valid_flight.request,
)
planned_validator.expect_shared(self.valid_flight.request)

_ = delete_flight_intent(
self, "Cancel flight intent", self.tested_uss, flight_id
)
cancelled_validator.expect_not_shared()

def _validate_precision_intersection(self):
_, _ = plan_flight_intent(
Expand All @@ -331,14 +371,14 @@ def _validate_precision_intersection(self):
self.valid_flight.request,
)

with ValidateNotSharedOperationalIntent(
with OpIntentValidator(
self,
self.tested_uss,
self.dss,
"Validate conflicting flight not planned",
self.valid_conflict_tiny_overlap.request,
):
resp, _ = submit_flight_intent(
self._intents_extent,
) as validator:
submit_flight_intent(
self,
"Attempt to plan flight conflicting by a tiny overlap",
"Incorrectly planned",
Expand All @@ -347,6 +387,7 @@ def _validate_precision_intersection(self):
self.tested_uss,
self.valid_conflict_tiny_overlap.request,
)
validator.expect_not_shared()

def cleanup(self):
self.begin_cleanup()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ Both USSs are requested to remove all flights from the area under test.
### [Plan flight 2 test step](../../../../flight_planning/plan_flight_intent.md)
Flight 2 on time range B should be successfully planned by the control USS.

### [Validate flight 2 sharing test step](../../validate_shared_operational_intent.md)

### [Activate flight 2 test step](../../../../flight_planning/activate_flight_intent.md)
Flight 2 on time range B should be successfully activated by the control USS.

Expand Down
Loading

0 comments on commit bef6134

Please sign in to comment.