Skip to content

Commit

Permalink
DSS0210 prepare sub interactions scenario: oir creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Shastick committed Mar 22, 2024
1 parent 964db9f commit 454724d
Show file tree
Hide file tree
Showing 23 changed files with 519 additions and 45 deletions.
3 changes: 1 addition & 2 deletions monitoring/prober/infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ def wrapper_default_scope(*args, **kwargs):
ResourceType = int
resource_type_code_descriptions: Dict[ResourceType, str] = {}


# Next code: 385
# Next code: 388
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 @@ -27,6 +27,7 @@ v1:
second_utm_auth: second_utm_auth
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ v1:
id_generator: id_generator
utm_client_identity: utm_client_identity
second_utm_auth: second_utm_auth
utm_client_identity: utm_client_identity
planning_area: che_planning_area
problematically_big_area: che_problematically_big_area
execution:
Expand Down
9 changes: 8 additions & 1 deletion monitoring/uss_qualifier/resources/astm/f3548/v21/dss.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,15 @@ def put_op_intent(
result = query.parse_json_result(ChangeOperationalIntentReferenceResponse)
return result.operational_intent_reference, result.subscribers, query
else:
err_msg = query.error_message if query.error_message is not None else ""
if (
query.status_code == 409
and "missing_operational_intents" in query.response.json
):
err_msg += f" (missing_operational_intents: {query.response.json['missing_operational_intents']})"

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,80 @@
# 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 background subscriptions test step](./fragments/sub/crud/create_query.md)

Sets up two subscriptions that cover the planning area at different times, 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)**.

More specifically, they are breaking the above requirement by failing one or both of the following requirements:

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

0 comments on commit 454724d

Please sign in to comment.