Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DSS0210 OIR Awareness (key must be correct)
Browse files Browse the repository at this point in the history
Shastick committed Mar 21, 2024
1 parent c1a198d commit 2ca081e
Showing 19 changed files with 680 additions and 33 deletions.
11 changes: 11 additions & 0 deletions monitoring/monitorlib/schema_validation.py
Original file line number Diff line number Diff line change
@@ -59,6 +59,17 @@ class F3548_21(str, Enum):
QuerySubscriptionsResponse = "components.schemas.QuerySubscriptionsResponse"
DeleteSubscriptionResponse = "components.schemas.DeleteSubscriptionResponse"

ChangeOperationalIntentReferenceResponse = (
"components.schemas.ChangeOperationalIntentReferenceResponse"
)
GetOperationalIntentReferenceResponse = (
"components.schemas.GetOperationalIntentReferenceResponse"
)
QueryOperationalIntentReferenceResponse = (
"components.schemas.QueryOperationalIntentReferenceResponse"
)
AirspaceConflictResponse = "components.schemas.AirspaceConflictResponse"


_openapi_content_cache: Dict[str, dict] = {}

2 changes: 1 addition & 1 deletion monitoring/prober/infrastructure.py
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ def wrapper_default_scope(*args, **kwargs):
resource_type_code_descriptions: Dict[ResourceType, str] = {}


# Next code: 381
# Next code: 385
def register_resource_type(code: int, description: str) -> ResourceType:
"""Register that the specified code refers to the described resource.
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ v1:
# Mapping of <resource name in test suite> to <resource name in resource pool>
resources:
id_generator: id_generator
utm_client_identity: utm_client_identity
test_env_version_providers: test_env_version_providers
prod_env_version_providers: prod_env_version_providers
flight_planners: flight_planners
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@ v1:
dss: scd_dss
dss_instances: scd_dss_instances
id_generator: id_generator
utm_client_identity: utm_client_identity
second_utm_auth: second_utm_auth
planning_area: che_planning_area
problematically_big_area: che_problematically_big_area
Original file line number Diff line number Diff line change
@@ -4,3 +4,4 @@
from .op_intent_ref_access_control import OpIntentReferenceAccessControl
from .dss_interoperability import DSSInteroperability
from .report import Report
from .op_intent_ref_key_validation import OIRKeyValidation
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# ASTM SCD DSS: Operational Intent Reference Key Validation test scenario

## Overview

Verifies that a DSS requires from a client creating or updating operational intent references that they
provide all OVNs for all currently relevant entities.

## Resources

### dss

[`DSSInstanceResource`](../../../../resources/astm/f3548/v21/dss.py) the DSS instance through which entities are created, modified and deleted.

### id_generator

[`IDGeneratorResource`](../../../../resources/interuss/id_generator.py) providing the base entity ID for this scenario.

### client_identity

[`ClientIdentityResource`](../../../../resources/communications/client_identity.py) the client identity that will be used to create and update operational intent references.

### planning_area

[`PlanningAreaResource`](../../../../resources/astm/f3548/v21/planning_area.py) describes the 3D volume in which operational intent references will be created.

## Setup test case

### [Ensure clean workspace test step](./clean_workspace.md)

This step ensures that no entities with the known test IDs exists in the DSS.

## Key Validation test case

This test case will create multiple operational intent references and verify that the `key` field
of the parameters to create or update an operational intent reference is properly validated.

That is: the DSS should require that the client provides the OVNs for each entity that is in the vicinity,
both geographically and temporally, of the client's operational intent reference.

### Create non-overlapping OIRs test step

This first test step creates two operational intent references that do not overlap in time, and
should therefore both not require any entry in the `key` field.

#### 🛑 First operational intent reference in area creation query succeeds check

With no potentially conflicting entity present, the DSS is expected to allow the creation of an operational intent without
the client specifying any OVN in the `key` field.

If the DSS rejects a well-formed request to create the operational intent reference, it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Second, non-overlapping operational intent reference creation succeeds check

With a single existing OIR in the area that is not overlapping in time, the DSS is expected to allow the creation of an operational intent without
the client specifying any OVN in the `key` field.

If the DSS rejects a well-formed request to create the operational intent reference, it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**.

### Attempt creation of overlapping OIRs test step

This test step will attempt to create various operational intent references that intersect with either one or both of the previously created ones,
and expect the DSS to require the relevant OVNs to be provided in the `key` field.

Note that this step will optionally validate the response body for `HTTP 409` error responses from the DSS when these contain the expected `missing_operational_intents` field.

At the end of this step, the DSS is expected to have accepted the creation of 3 operational intent references,
with one of them overlapping with the two others.

#### 🛑 Create operational intent reference with missing OVN fails check

If the DSS allows the creation of an operational intent reference that is missing the required OVNs for other entities that exist in its geo-temporal vicinity,
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)** and **[astm.f3548.v21.DSS0210,A2-7-2,2a](../../../../requirements/astm/f3548/v21.md)**

#### 🛑 Failure response due to conflict has proper format check

The DSS is expected to return a `HTTP 409` error response when the creation of an operational intent reference fails due to a conflict.
This response is expected to conform to the OpenAPI spec that is part of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**.

Should this not be the case, then the DSS is in violation of the aforementioned requirement.

#### 🛑 Failure response due to conflict contains conflicting OIRs check

If the DSS returns a `HTTP 409` error response due to a conflict, and the response body contains a `missing_operational_intents` field,
this field is expected to contain the conflicting OVNs.

If the field exists but does not contain the conflicting OVNs, then the DSS is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 Create operational intent reference with proper OVNs succeeds check

If the DSS prevents the creation of an operational intent reference that is providing all required OVNs for other entities that exist in its geo-temporal vicinity,
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**.

### Attempt mutation of operational intent reference with overlaps test step

This test step will attempt to mutate an existing operational intent reference so that it overlaps with other, already existing ones.

The expectation is that the DSS will require the OVNs of any operational intent that would overlap with the result of the mutation to be provided in the `key` field.

#### 🛑 Mutate operational intent reference with missing OVN fails check

If the DSS allows the mutation of an operational intent reference that is missing the required OVNs for other entities that exist in its geo-temporal vicinity,
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)** and **[astm.f3548.v21.DSS0210,A2-7-2,2b](../../../../requirements/astm/f3548/v21.md)**

#### 🛑 Failure response due to conflict has proper format check

The DSS is expected to return a `HTTP 409` error response when the creation of an operational intent reference fails due to a conflict.
This response is expected to conform to the OpenAPI spec that is part of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**.

Should this not be the case, then the DSS is in violation of the aforementioned requirement.

#### 🛑 Failure response due to conflict contains conflicting OIRs check

If the DSS returns a `HTTP 409` error response due to a conflict, and the response body contains a `missing_operational_intents` field,
this field is expected to contain the conflicting OVNs.

If the field exists but does not contain the conflicting OVNs, then the DSS is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**.


## [Cleanup](./clean_workspace.md)
Loading

0 comments on commit 2ca081e

Please sign in to comment.