Skip to content

Commit

Permalink
Remove area clearing from individual scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminPelletier committed Nov 9, 2023
1 parent 1eacb0b commit 145e438
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 297 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Notably the following requirements:

- **[astm.f3548.v21.SCD0035](../../../../requirements/astm/f3548/v21.md)**

This scenario assumes that the area used in the scenario is already clear of any pre-existing flights (using, for instance, PrepareFlightPlanners scenario).

## Resources
### flight_intents
FlightIntentsResource provides the two V-shaped flight intents.
Expand All @@ -25,19 +27,6 @@ FlightPlannerResource that will be used for the USS being tested for its data va
### dss
DSSInstanceResource that provides access to a DSS instance where flight creation/sharing can be verified.

## Setup test case
### Check for flight planning readiness test step
Both USSs are queried for their readiness to ensure this test can proceed.

#### Flight planning USS not ready check
If either USS does not respond appropriately to the endpoint queried to determine readiness, this check will fail and the USS will have failed to meet **[astm.f3548.v21.GEN0310](../../../../requirements/astm/f3548/v21.md)** as the USS does not support the InterUSS implementation of that requirement.

### Area clearing test step
Both USSs are requested to remove all flights from the area under test.

#### Area cleared successfully check
**[interuss.automated_testing.flight_planning.ClearArea](../../../../requirements/interuss/automated_testing/flight_planning.md)**

## Successfully plan flight near an existing flight test case

### [Control_uss plans flight 2 test step](../../../flight_planning/plan_flight_intent.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Notably the following requirements:
- **[astm.f3548.v21.OPIN0040](../../../../requirements/astm/f3548/v21.md)**
- **[astm.f3548.v21.GEN0500](../../../../requirements/astm/f3548/v21.md)**

It assumes that the area used in the scenario is already clear of any pre-existing flights (using, for instance, PrepareFlightPlanners scenario).

## Resources
### flight_intents
FlightIntentsResource that provides the following flight intents:
Expand All @@ -27,19 +29,6 @@ FlightPlannerResource that will be tested for its validation of operational inte
### dss
DSSInstanceResource that provides access to a DSS instance where flight creation/sharing can be verified.

## Setup test case
### Check for flight planning readiness test step
Both USSs are queried for their readiness to ensure this test can proceed.

#### Flight planning USS not ready check
If the USS does not respond appropriately to the endpoint queried to determine readiness, this check will fail and the USS will have failed to meet **[astm.f3548.v21.GEN0310](../../../../requirements/astm/f3548/v21.md)** as the USS does not support the InterUSS implementation of that requirement.

### Area clearing test step
The tested USS is requested to remove all flights from the area under test.

#### Area cleared successfully check
**[interuss.automated_testing.flight_planning.ClearArea](../../../../requirements/interuss/automated_testing/flight_planning.md)**

## Attempt to plan invalid flight intents test case
### Attempt to plan flight intent too far ahead of time test step
The user flight intent that the test driver attempts to plan has a reference time that is more than
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import arrow

from monitoring.monitorlib.geotemporal import Volume4DCollection
from monitoring.uss_qualifier.common_data_definitions import Severity
from monitoring.uss_qualifier.suites.suite import ExecutionContext
from uas_standards.astm.f3548.v21.api import OperationalIntentState
from uas_standards.astm.f3548.v21.constants import OiMaxPlanHorizonDays
Expand All @@ -25,10 +24,8 @@
)
from monitoring.uss_qualifier.scenarios.scenario import TestScenario
from monitoring.uss_qualifier.scenarios.flight_planning.test_steps import (
clear_area,
plan_flight_intent,
cleanup_flights,
activate_flight_intent,
submit_flight_intent,
delete_flight_intent,
)
Expand Down Expand Up @@ -149,11 +146,6 @@ def run(self, context: ExecutionContext):
f"{self.tested_uss.config.participant_id}",
)

self.begin_test_case("Setup")
if not self._setup():
return
self.end_test_case()

self.begin_test_case("Attempt to plan invalid flight intents")
self._attempt_invalid()
self.end_test_case()
Expand All @@ -168,38 +160,6 @@ def run(self, context: ExecutionContext):

self.end_test_scenario()

def _setup(self) -> bool:
self.begin_test_step("Check for flight planning readiness")

error, query = self.tested_uss.get_readiness()
self.record_query(query)
with self.check(
"Flight planning USS not ready", [self.tested_uss.participant_id]
) as check:
if error:
check.record_failed(
"Error determining readiness",
Severity.High,
"Error: " + error,
query_timestamps=[query.request.timestamp],
)

self.end_test_step()

clear_area(
self,
"Area clearing",
[
self.valid_flight,
self.valid_activated,
self.invalid_too_far_away,
self.valid_conflict_tiny_overlap,
],
[self.tested_uss],
)

return True

def _attempt_invalid(self):
with OpIntentValidator(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ It involves a tested USS and a control USS through which conflicting flights are

This scenario skips execution and completes successfully at the setup case if a resource containing equal priority flight intents where conflicts are not allow is not provided, such as if a jurisdiction does not have any priority levels at which conflicts are not allowed.

It assumes that the area used in the scenario is already clear of any pre-existing flights (using, for instance, PrepareFlightPlanners scenario).

## Resources
### flight_intents
If the jurisdiction in which these tests are being conducted does not have a priority level at which conflicts are not allowed, the FlightIntentsResource must be None to prevent the
Expand Down Expand Up @@ -90,20 +92,6 @@ CMSA role in order to transition some flight intents to the `Nonconforming` stat
DSSInstanceResource that provides access to a DSS instance where flight creation/sharing can be verified.


## Setup test case
### Check for flight planning readiness test step
Both USSs are queried for their readiness to ensure this test can proceed.

#### 🛑 Flight planning USS not ready check
If either USS does not respond appropriately to the endpoint queried to determine readiness, this check will fail and the USS will have failed to meet **[astm.f3548.v21.GEN0310](../../../../../requirements/astm/f3548/v21.md)** as the USS does not support the InterUSS implementation of that requirement.

### Area clearing test step
Both USSs are requested to remove all flights from the area under test.

#### 🛑 Area cleared successfully check
**[interuss.automated_testing.flight_planning.ClearArea](../../../../../requirements/interuss/automated_testing/flight_planning.md)**


## Attempt to plan flight into conflict test case
![Test case summary illustration](assets/attempt_to_plan_flight_into_conflict.svg)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
OperationalIntentReference,
)
from monitoring.monitorlib.geotemporal import Volume4DCollection
from monitoring.uss_qualifier.common_data_definitions import Severity
from uas_standards.astm.f3548.v21.api import OperationalIntentState

from monitoring.uss_qualifier.resources.astm.f3548.v21 import DSSInstanceResource
Expand Down Expand Up @@ -38,7 +37,6 @@
ScenarioCannotContinueError,
)
from monitoring.uss_qualifier.scenarios.flight_planning.test_steps import (
clear_area,
plan_flight_intent,
cleanup_flights,
activate_flight_intent,
Expand Down Expand Up @@ -227,11 +225,6 @@ def run(self, context: ExecutionContext):
f"{self.control_uss.config.participant_id}",
)

self.begin_test_case("Setup")
if not self._setup():
return
self.end_test_case()

self.begin_test_case("Attempt to plan flight into conflict")
flight_2_oi_ref = self._attempt_plan_flight_conflict()
self.end_test_case()
Expand All @@ -258,43 +251,6 @@ def run(self, context: ExecutionContext):

self.end_test_scenario()

def _setup(self) -> bool:
self.begin_test_step("Check for flight planning readiness")

for uss in (self.tested_uss, self.control_uss):
error, query = uss.get_readiness()
self.record_query(query)
with self.check(
"Flight planning USS not ready", [uss.participant_id]
) as check:
if error:
check.record_failed(
"Error determining readiness",
Severity.High,
"Error: " + error,
query_timestamps=[query.request.timestamp],
)

self.end_test_step()

clear_area(
self,
"Area clearing",
[
self.flight_1_planned_vol_A,
self.flight_1_activated_vol_A,
self.flight_1_activated_vol_A_extended,
self.flight_1_planned_vol_B,
self.flight_1_activated_vol_B,
self.flight_2_equal_prio_planned_vol_B,
self.flight_2_equal_prio_activated_vol_B,
self.flight_2_equal_prio_nonconforming_vol_A,
],
[self.tested_uss, self.control_uss],
)

return True

def _attempt_plan_flight_conflict(self) -> OperationalIntentReference:
with OpIntentValidator(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ exists a conflict with a higher priority flight:

It involves a tested USS and a control USS through which conflicting flights are injected.

It assumes that the area used in the scenario is already clear of any pre-existing flights (using, for instance, PrepareFlightPlanners scenario).

## Resources
### flight_intents
FlightIntentsResource that provides the following flight intents:
Expand Down Expand Up @@ -86,21 +88,6 @@ FlightPlannerResource that will manage conflicting flight 2.
### dss
DSSInstanceResource that provides access to a DSS instance where flight creation/sharing can be verified.

## Setup test case

### Check for flight planning readiness test step
Both USSs are queried for their readiness to ensure this test can proceed.

#### Flight planning USS not ready check
If either USS does not respond appropriately to the endpoint queried to determine readiness, this check will fail and the USS will have failed to meet **[astm.f3548.v21.GEN0310](../../../../../requirements/astm/f3548/v21.md)** as the USS does not support the InterUSS implementation of that requirement.

### Area clearing test step
Both USSs are requested to remove all flights from the area under test.

#### Area cleared successfully check
**[interuss.automated_testing.flight_planning.ClearArea](../../../../../requirements/interuss/automated_testing/flight_planning.md)**


## Attempt to plan flight in conflict test case
![Test case summary illustration](assets/attempt_to_plan_flight_into_conflict.svg)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
)

from monitoring.monitorlib.geotemporal import Volume4DCollection
from monitoring.uss_qualifier.common_data_definitions import Severity
from uas_standards.astm.f3548.v21.api import OperationalIntentState
from uas_standards.interuss.automated_testing.scd.v1.api import (
InjectFlightResponseResult,
Expand Down Expand Up @@ -39,7 +38,6 @@
)
from monitoring.uss_qualifier.scenarios.scenario import TestScenario
from monitoring.uss_qualifier.scenarios.flight_planning.test_steps import (
clear_area,
plan_flight_intent,
cleanup_flights,
activate_flight_intent,
Expand Down Expand Up @@ -206,11 +204,6 @@ def run(self, context: ExecutionContext):
f"{self.control_uss.config.participant_id}",
)

self.begin_test_case("Setup")
if not self._setup():
return
self.end_test_case()

self.begin_test_case("Attempt to plan flight in conflict")
self._attempt_plan_flight_conflict()
self.end_test_case()
Expand All @@ -236,43 +229,6 @@ def run(self, context: ExecutionContext):

self.end_test_scenario()

def _setup(self) -> bool:
self.begin_test_step("Check for flight planning readiness")

for uss in (self.tested_uss, self.control_uss):
error, query = uss.get_readiness()
self.record_query(query)
with self.check(
"Flight planning USS not ready", [uss.participant_id]
) as check:
if error:
check.record_failed(
"Error determining readiness",
Severity.High,
"Error: " + error,
query_timestamps=[query.request.timestamp],
)

self.end_test_step()

clear_area(
self,
"Area clearing",
[
self.flight_1_planned_vol_A,
self.flight_1_planned_vol_A_extended,
self.flight_1_activated_vol_A,
self.flight_1_activated_vol_A_extended,
self.flight_1_activated_vol_B,
self.flight_2_planned_vol_A,
self.flight_2_activated_vol_A,
self.flight_2_activated_vol_B,
],
[self.tested_uss, self.control_uss],
)

return True

def _attempt_plan_flight_conflict(self):
with OpIntentValidator(
self,
Expand Down
Loading

0 comments on commit 145e438

Please sign in to comment.