Skip to content

Commit

Permalink
[uss_qualifier] DSS0210,A2-7-2,4 initial subscription <-> OIR interac…
Browse files Browse the repository at this point in the history
…tions scenario: oir creation (1/n) (#582)

* DSS0210 prepare sub interactions scenario: oir creation

* PR feedback; cosmetic changes

---------

Co-authored-by: Mickaël Misbach <[email protected]>
  • Loading branch information
Shastick and mickmis authored Mar 25, 2024
1 parent dce6c8a commit fefcc5f
Show file tree
Hide file tree
Showing 21 changed files with 522 additions and 46 deletions.
2 changes: 1 addition & 1 deletion monitoring/prober/infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def wrapper_default_scope(*args, **kwargs):
resource_type_code_descriptions: Dict[ResourceType, str] = {}


# Next code: 386
# Next code: 389
def register_resource_type(code: int, description: str) -> ResourceType:
"""Register that the specified code refers to the described resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ v1:
utm_client_identity: utm_client_identity
planning_area: planning_area
problematically_big_area: problematically_big_area
utm_client_identity: utm_client_identity

# This block defines all the resources available in the resource pool.
# Presumably all resources defined below would be used either
Expand Down
10 changes: 9 additions & 1 deletion monitoring/uss_qualifier/resources/astm/f3548/v21/dss.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
VehicleTelemetry,
ExchangeRecord,
ErrorReport,
AirspaceConflictResponse,
)
from uas_standards.astm.f3548.v21.constants import Scope

Expand Down Expand Up @@ -302,9 +303,16 @@ def put_op_intent(
):
result = query.parse_json_result(ChangeOperationalIntentReferenceResponse)
return result.operational_intent_reference, result.subscribers, query
elif query.status_code == 409:
result = query.parse_json_result(AirspaceConflictResponse)
raise QueryError(
f"Received code 409 when attempting to {'create' if create else 'update'} operational intent with ID {oi_uuid}; error message: `{result.message}`; missing operational intent IDs: {[oi.id for oi in result.missing_operational_intents]}",
query,
)
else:
err_msg = query.error_message if query.error_message is not None else ""
raise QueryError(
f"Received code {query.status_code} when attempting to {'create' if create else 'update'} operational intent with ID {oi_uuid}{f'; error message: `{query.error_message}`' if query.error_message is not None else ''}",
f"Received code {query.status_code} when attempting to {'create' if create else 'update'} operational intent with ID {oi_uuid}; error message: `{err_msg}`",
query,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
from .dss_interoperability import DSSInteroperability
from .report import Report
from .op_intent_ref_key_validation import OIRKeyValidation
from .subscription_interactions import SubscriptionInteractions
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Create operational intent reference test step fragment

This test step fragment validates that operational intent references can be created
This test step fragment validates that:
- a query to create an operational intent reference with valid parameters succeeds
- the response to the query conforms to the OpenAPI specification
- the content of the response reflects the created operational intent reference

## 🛑 Create operational intent reference query succeeds check
## [Query Success](./create_query.md)

As per **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**, the DSS API must allow callers to create an operational intent reference with either one or both of the
start and end time missing, provided all the required parameters are valid.
Check query succeeds

## [Response Format](./create_format.md)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Create operational intent reference test step fragment

This test step fragment validates that a query to create an operational intent reference with valid parameters succeeds

## 🛑 Create operational intent reference query succeeds check

As per **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**, the DSS API must allow callers to create an operational intent reference with either one or both of the
start and end time missing, provided all the required parameters are valid.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

This test step fragment validates that subscriptions can be created.

## 🛑 Create subscription query succeeds check
## [Query Success](./create_query.md)

As per **[astm.f3548.v21.DSS0005,5](../../../../../../../requirements/astm/f3548/v21.md)**, the DSS API must allow callers to create a subscription with either one or both of the
start and end time missing, provided all the required parameters are valid.
Check query succeeds

## 🛑 Create subscription response format conforms to spec check

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Create subscription test step fragment

This test step fragment validates that a query to create a subscription with valid parameters succeeds.

## 🛑 Create subscription query succeeds check

As per **[astm.f3548.v21.DSS0005,5](../../../../../../../requirements/astm/f3548/v21.md)**, the DSS API must allow callers to create a subscription with either one or both of the
start and end time missing, provided all the required parameters are valid.
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# ASTM SCD DSS: Subscription and entity interaction test scenario

## Overview

Create and mutate subscriptions as well as entities, and verify that the DSS handles notifications and expiry correctly.

## Resources

### dss

[`DSSInstanceResource`](../../../../resources/astm/f3548/v21/dss.py) to be tested in this scenario.

### other_instances

[`DSSInstancesResource`](../../../../resources/astm/f3548/v21/dss.py) pointing to the DSS instances used to confirm that entities are properly propagated.

### id_generator

[`IDGeneratorResource`](../../../../resources/interuss/id_generator.py) providing the Subscription IDs for this scenario.

### planning_area

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

### utm_client_identity

[`ClientIdentityResource`](../../../../resources/communications/client_identity.py) provides the identity that will be used to interact with the DSS.

## Setup test case

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

This step ensures that no subscriptions and OIRs with the known test IDs exists in the DSS deployment.

## OIR creation triggers relevant notifications test case

This test case verifies that newly created OIRs will receive the relevant subscriptions to notify from the DSS instance,
regardless of which instance was used to create the entity.

### [Create first background subscription test step](./fragments/sub/crud/create_query.md)

Sets up the first subscription that cover the planning area from 'now' to 20 minutes in the future, and which will be used as part of the interaction tests.

### [Create second background subscription test step](./fragments/sub/crud/create_query.md)

Sets up the second subscription that cover the planning area from 20 minutes after the first starts and that lasts for 1 hour, and which will be used as part of the interaction tests.

### Create an OIR at every DSS in sequence test step

This test step will create an operational intent reference and assorted subscription at every DSS, in sequence, each time verifying that the DSS
requires notifications for any previously established subscription that intersects with the newly created OIR.

Note that this step is run once for each involved DSS (that is, once for the primary DSS and once for every secondary DSS)

#### [Create OIR](./fragments/oir/crud/create_query.md)

Check that the OIR creation query succeeds

#### 🛑 DSS response contains the expected background subscription check

The response from a DSS to a valid OIR creation request is expected to contain any relevant subscription for the OIR's extents.
This includes one of the subscriptions created earlier, as it is designed to intersect with the OIRs being created.

If the DSS omits the intersecting subscription, it fails to implement **[astm.f3548.v21.DSS0210,A2-7-2,4b](../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 DSS does not return non-intersecting background subscription check

The response from a DSS to a valid OIR creation request is expected to contain any relevant subscription for the OIR's extents.
This should exclude one of subscriptions created earlier, as it is designed to not intersect with the OIRs being created.

If the DSS includes the non-intersecting subscription, it fails to implement **[astm.f3548.v21.DSS0210,A2-7-2,4b](../../../../requirements/astm/f3548/v21.md)**.

#### 🛑 DSS returns the implicit subscriptions from intersecting OIRs check

The response from a DSS to a valid OIR creation request is expected to contain any relevant subscription for the OIR's extents.
This includes any implicit subscription previously created on the DSS as part of a previously created OIR.

If the DSS omits any of the implicit subscriptions belonging to an OIR previously created on another DSS (which are designed to all intersect),
any of the DSSes at which an earlier OIR was created, or the DSS at which the current OIR has been created,
are in violation of **[astm.f3548.v21.DSS0210,A2-7-2,4b](../../../../requirements/astm/f3548/v21.md)**.

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

0 comments on commit fefcc5f

Please sign in to comment.