-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[uss_qualifier] Add PrepareFlightPlanners scenario (#331)
* Add PrepareFlightPlanners scenarios * Fix hygiene * Fix check links
- Loading branch information
1 parent
ceb1916
commit cf21826
Showing
18 changed files
with
453 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
monitoring/uss_qualifier/scenarios/astm/utm/prep_planners.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# ASTM F3548 flight planners preparation test scenario | ||
|
||
## Description | ||
|
||
This scenario prepares flight planner systems for execution of controlled test scenarios by checking planner systems' readiness and having them remove any existing flights that may already be in the test area. | ||
|
||
## Resources | ||
|
||
### flight_planners | ||
|
||
FlightPlannersResource listing all USSs undergoing planning tests so that they can be checked for readiness and instructed to remove any existing flights from the area in this scenario. | ||
|
||
### dss | ||
|
||
DSSInstanceResource to check for lingering operational intents after the area has been cleared. | ||
|
||
### flight_intents | ||
|
||
FlightIntentsResource containing flight intents that will be used in subsequent tests, so all planners should be instructed to clear any area involved with any of these intents of flights it manages. | ||
|
||
### flight_intents2 | ||
|
||
(Optional) If more than one FlightIntentsResource will be used in subsequent tests, additional intents may be specified with this resource. | ||
|
||
### flight_intents3 | ||
|
||
(Optional) If more than one FlightIntentsResource will be used in subsequent tests, additional intents may be specified with this resource. | ||
|
||
### flight_intents4 | ||
|
||
(Optional) If more than one FlightIntentsResource will be used in subsequent tests, additional intents may be specified with this resource. | ||
|
||
## Preparation test case | ||
|
||
### Check for flight planning readiness test step | ||
|
||
All USSs are queried for their readiness to ensure later tests can proceed. | ||
|
||
#### ⚠️ Valid response to readiness query check | ||
|
||
**[interuss.automated_testing.flight_planning.ImplementAPI](../../../requirements/interuss/automated_testing/flight_planning.md)** | ||
|
||
#### ⚠️ Flight planning USS ready check | ||
|
||
This readiness indicates the USS's ability to inject test data, so if this check fails, not only has the USS not met **[interuss.automated_testing.flight_planning.Readiness](../../../requirements/interuss/automated_testing/flight_planning.md)**, but it also does not meet **[astm.f3548.v21.GEN0310](../../../requirements/astm/f3548/v21.md)**. | ||
|
||
### Area clearing test step | ||
|
||
All USSs are requested to remove all flights from the area under test. | ||
|
||
#### ⚠️ Valid response to clearing query check | ||
|
||
**[interuss.automated_testing.flight_planning.ImplementAPI](../../../requirements/interuss/automated_testing/flight_planning.md)** | ||
|
||
#### ⚠️ Area cleared successfully check | ||
|
||
**[interuss.automated_testing.flight_planning.ClearArea](../../../requirements/interuss/automated_testing/flight_planning.md)** | ||
|
||
### Clear area validation test step | ||
|
||
uss_qualifier verifies with the DSS that there are no operational intents remaining in the area | ||
|
||
#### 🛑 DSS responses check | ||
|
||
**[astm.f3548.v21.DSS0005](../../../requirements/astm/f3548/v21.md)** | ||
|
||
#### 🛑 Area is clear check | ||
|
||
If operational intents remain in the 4D area(s) following the preceding area clearing, then the current state of the test environment is not suitable to conduct tests so this check will fail. |
88 changes: 88 additions & 0 deletions
88
monitoring/uss_qualifier/scenarios/astm/utm/prep_planners.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
from typing import Optional | ||
|
||
from monitoring.uss_qualifier.common_data_definitions import Severity | ||
from monitoring.uss_qualifier.resources.astm.f3548.v21 import DSSInstanceResource | ||
from monitoring.uss_qualifier.resources.astm.f3548.v21.dss import DSSInstance | ||
from monitoring.uss_qualifier.resources.flight_planning import ( | ||
FlightPlannersResource, | ||
FlightIntentsResource, | ||
) | ||
from monitoring.uss_qualifier.scenarios.flight_planning.prep_planners import ( | ||
PrepareFlightPlanners as GenericPrepareFlightPlanners, | ||
) | ||
|
||
|
||
class PrepareFlightPlanners(GenericPrepareFlightPlanners): | ||
dss: DSSInstance | ||
|
||
def __init__( | ||
self, | ||
flight_planners: FlightPlannersResource, | ||
dss: DSSInstanceResource, | ||
flight_intents: FlightIntentsResource, | ||
flight_intents2: Optional[FlightIntentsResource] = None, | ||
flight_intents3: Optional[FlightIntentsResource] = None, | ||
flight_intents4: Optional[FlightIntentsResource] = None, | ||
): | ||
super(PrepareFlightPlanners, self).__init__( | ||
flight_planners, | ||
flight_intents, | ||
flight_intents2, | ||
flight_intents3, | ||
flight_intents4, | ||
) | ||
self.dss = dss.dss | ||
|
||
def run(self, context): | ||
self.begin_test_scenario(context) | ||
self.begin_test_case("Preparation") | ||
|
||
self.begin_test_step("Check for flight planning readiness") | ||
self._check_readiness() | ||
self.end_test_step() | ||
|
||
self.begin_test_step("Area clearing") | ||
self._clear_area() | ||
self.end_test_step() | ||
|
||
self.begin_test_step("Clear area validation") | ||
self._validate_clear_area() | ||
self.end_test_step() | ||
|
||
self.end_test_case() | ||
self.end_test_scenario() | ||
|
||
def _validate_clear_area(self): | ||
for area in self.areas: | ||
with self.check("DSS responses", [self.dss.participant_id]) as check: | ||
try: | ||
op_intents, query = self.dss.find_op_intent(area.to_f3548v21()) | ||
except ValueError as e: | ||
check.record_failed( | ||
summary="Error parsing DSS response", | ||
details=str(e), | ||
severity=Severity.High, | ||
) | ||
self.record_query(query) | ||
if op_intents is None: | ||
check.record_failed( | ||
summary="Error querying DSS for operational intents", | ||
details="See query", | ||
severity=Severity.High, | ||
query_timestamps=[query.request.timestamp], | ||
) | ||
with self.check("Area is clear") as check: | ||
if op_intents: | ||
summary = f"{len(op_intents)} operational intent{'s' if len(op_intents) > 1 else ''} found in cleared area" | ||
details = ( | ||
"The following operational intents were observed even after clearing the area:\n" | ||
+ "\n".join( | ||
f"* {oi.id} managed by {oi.manager}" for oi in op_intents | ||
) | ||
) | ||
check.record_failed( | ||
summary=summary, | ||
details=details, | ||
severity=Severity.High, | ||
query_timestamps=[query.request.timestamp], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .record_planners import RecordPlanners | ||
from .prep_planners import PrepareFlightPlanners |
53 changes: 53 additions & 0 deletions
53
monitoring/uss_qualifier/scenarios/flight_planning/prep_planners.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Generic flight planners preparation test scenario | ||
|
||
## Description | ||
|
||
This scenario prepares flight planner systems for execution of controlled test scenarios by checking planner systems' readiness and having them remove any existing flights that may already be in the test area. | ||
|
||
## Resources | ||
|
||
### flight_planners | ||
|
||
FlightPlannersResource listing all USSs undergoing planning tests so that they can be checked for readiness and instructed to remove any existing flights from the area in this scenario. | ||
|
||
### flight_intents | ||
|
||
FlightIntentsResource containing flight intents that will be used in subsequent tests, so all planners should be instructed to clear any area involved with any of these intents of flights it manages. | ||
|
||
### flight_intents2 | ||
|
||
(Optional) If more than one FlightIntentsResource will be used in subsequent tests, additional intents may be specified with this resource. | ||
|
||
### flight_intents3 | ||
|
||
(Optional) If more than one FlightIntentsResource will be used in subsequent tests, additional intents may be specified with this resource. | ||
|
||
### flight_intents4 | ||
|
||
(Optional) If more than one FlightIntentsResource will be used in subsequent tests, additional intents may be specified with this resource. | ||
|
||
## Preparation test case | ||
|
||
### Check for flight planning readiness test step | ||
|
||
All USSs are queried for their readiness to ensure later tests can proceed. | ||
|
||
#### ⚠️ Valid response to readiness query check | ||
|
||
**[interuss.automated_testing.flight_planning.ImplementAPI](../../requirements/interuss/automated_testing/flight_planning.md)** | ||
|
||
#### ⚠️ Flight planning USS ready check | ||
|
||
**[interuss.automated_testing.flight_planning.Readiness](../../requirements/interuss/automated_testing/flight_planning.md)** | ||
|
||
### Area clearing test step | ||
|
||
All USSs are requested to remove all flights from the area under test. | ||
|
||
#### ⚠️ Valid response to clearing query check | ||
|
||
**[interuss.automated_testing.flight_planning.ImplementAPI](../../requirements/interuss/automated_testing/flight_planning.md)** | ||
|
||
#### ⚠️ Area cleared successfully check | ||
|
||
**[interuss.automated_testing.flight_planning.ClearArea](../../requirements/interuss/automated_testing/flight_planning.md)** |
Oops, something went wrong.