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 21, 2024
1 parent d961914 commit 47d173a
Show file tree
Hide file tree
Showing 16 changed files with 498 additions and 39 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: 381
# Next code: 385
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 @@ -26,6 +26,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
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 @@ -4,3 +4,4 @@
from .op_intent_ref_access_control import OpIntentReferenceAccessControl
from .dss_interoperability import DSSInteroperability
from .report import Report
from .subscription_interactions import SubscriptionInteractions
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# 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

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.
## [Query Success](./create_query.md)

## [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
@@ -0,0 +1,75 @@
# 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.

## 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.

## Subscription interactions test case

Test case that ensures that interactions between subscriptions and entities are correctly handled by a deployment of multiple DSS instances.

### [Setup background subscriptions test step](./fragments/sub/crud/create.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,4](../../../../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,4](../../../../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,4](../../../../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 47d173a

Please sign in to comment.