Skip to content

Commit

Permalink
DSS0210,2 sync entity references
Browse files Browse the repository at this point in the history
PR comment integration
  • Loading branch information
Shastick committed Mar 14, 2024
1 parent 1fc3c30 commit c4be07f
Show file tree
Hide file tree
Showing 25 changed files with 880 additions and 44 deletions.
10 changes: 10 additions & 0 deletions monitoring/monitorlib/schema_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ 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"
)


_openapi_content_cache: Dict[str, dict] = {}

Expand Down
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: 380
# Next code: 382
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 @@ -24,6 +24,7 @@ v1:
dss_instances: dss_instances
mock_uss: mock_uss
second_utm_auth: second_utm_auth
utm_client_identity: utm_client_identity
planning_area: planning_area
problematically_big_area: problematically_big_area

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ v1:
dss_instances: scd_dss_instances
id_generator: id_generator
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ImplicitSubscriptionParameters,
)

from monitoring.monitorlib.geo import make_latlng_rect, Volume3D
from monitoring.monitorlib.geo import LatLngPoint, make_latlng_rect, Volume3D, Polygon
from monitoring.monitorlib.geotemporal import Volume4D
from monitoring.monitorlib.temporal import Time
from monitoring.uss_qualifier.resources.astm.f3548.v21.subscription_params import (
Expand Down Expand Up @@ -74,9 +74,11 @@ def get_new_operational_intent_ref_params(
) -> PutOperationalIntentReferenceParameters:
"""
Builds a PutOperationalIntentReferenceParameters object that can be used against the DSS OIR API.
The extents contained in these parameters contain a single 4DVolume, which may not be entirely realistic,
but is sufficient in situations where the content of the OIR is irrelevant as long as it is valid, such
as for testing authentication or parameter validation.
Note that this method allows building inconsistent parameters.
"""
return PutOperationalIntentReferenceParameters(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ This page describes the content of a common test step that ensures a clean works

## 🛑 Operational intent references can be queried by ID check

If an existing operational intent reference cannot directly be queried by its ID, the DSS implementation is in violation of
**[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**.
If an existing operational intent reference cannot directly be queried by its ID, or if for a non-existing one the DSS replies with a status code different than 404,
the DSS implementation is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Operational intent references can be searched for check

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from .subscription_synchronization import SubscriptionSynchronization
from .op_intent_ref_synchronization import OIRSynchronization
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# ASTM SCD DSS: Operational Intent Reference Synchronization test scenario

## Overview

Verifies that all CRUD operations on operational intent references performed on a given DSS instance
are properly propagated to every other DSS instance participating in the deployment.

## Resources

### dss

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

### 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 ID for this scenario.

### planning_area

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

### client_identity

[`ClientIdentityResource`](../../../../../resources/communications/client_identity.py) to be used for this scenario.

## Setup test case

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

This step ensures that no subscription with the known test ID exists in the DSS.

## OIR synchronization test case

This test case creates an operational intent reference on the main DSS, and verifies that it is properly synchronized to the other DSS instances.

It then goes on to mutate and delete it, each time confirming that all other DSSes return the expected results.

### Create OIR validation test step

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

Verify that an operational intent reference can be created on the primary DSS.

#### [OIR Content is correct](../fragments/oir/validate/correctness.md)

Verify that the operational intent reference returned by the DSS under test is properly formatted and contains the expected content.

### Query newly created OIR test step

Query the created operational intent at every DSS provided in `dss_instances`.

#### 🛑 Operational intent reference returned by a secondary DSS is valid and correct check

When queried for an operational intent reference that was created via another DSS, a DSS instance is expected to provide a valid operational intent reference.

If it does not, it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.

#### [OIR is synchronized](../fragments/oir/sync.md)

Confirm that the operational intent reference that was just created is properly synchronized across all DSS instances.

#### [Get OIR](../fragments/oir/crud/read.md)

Confirms that each DSS provides access to the created operational intent reference,

#### [OIR Content is correct](../fragments/oir/validate/correctness.md)

Verify that the operational intent reference returned by every DSS is correctly formatted and corresponds to what was created earlier.

#### [OIR Versions are correct](../fragments/oir/validate/non_mutated.md)

Verify that the operational intent reference's version fields are as expected.

### Mutate OIR test step

This test step mutates the previously created operational intent reference to verify that the DSS reacts properly: notably, it checks that the operational intent reference version is updated,
including for changes that are not directly visible, such as changing the operational intent reference's footprint.

#### [Update OIR](../fragments/oir/crud/update.md)

Confirm that the operational intent reference can be mutated.

#### [Validate OIR](../fragments/oir/validate/correctness.md)

Verify that the operational intent reference returned by the DSS is properly formatted and contains the correct content.

#### [OIR Versions are correct](../fragments/oir/validate/mutated.md)

Verify that the operational intent reference's version fields have been updated.

### Query updated OIR test step

Query the updated operational intent reference at every DSS provided in `dss_instances`.

#### 🛑 Operational intent reference returned by a secondary DSS is valid and correct check

When queried for an operational intent reference that was mutated via another DSS, a DSS instance is expected to provide a valid operational intent reference.

If it does not, it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.

#### [OIR is synchronized](../fragments/oir/sync.md)

Confirm that the operational intent reference that was just mutated is properly synchronized across all DSS instances.

#### [Get OIR](../fragments/oir/crud/read.md)

Confirms that the operational intent reference that was just mutated can be retrieved from any DSS.

#### [Validate OIR](../fragments/oir/validate/correctness.md)

Verify that the operational intent reference returned by every DSS is correctly formatted and corresponds to what was mutated earlier.

#### [OIR Versions are correct](../fragments/oir/validate/non_mutated.md)

Verify that the operational intent reference's version fields are as expected.

### Delete OIR test step

Attempt to delete the operational intent reference in various ways and ensure that the DSS reacts properly.

This also checks that the operational intent reference data returned by a successful deletion is correct.

#### [Delete OIR](../fragments/oir/crud/delete.md)

Confirms that an operational intent reference can be deleted.

#### [Validate OIR](../fragments/oir/validate/correctness.md)

Verify that the operational intent reference returned by the DSS via the deletion is properly formatted and contains the correct content.

#### [OIR Versions are correct](../fragments/oir/validate/non_mutated.md)

Verify that the operational intent reference's version fields are as expected.

### Query deleted OIR test step

Attempt to query and search for the deleted operational intent reference in various ways

#### 🛑 Secondary DSS should not return the deleted operational intent reference check

If a DSS returns an operational intent reference that was previously successfully deleted from the primary DSS,
either one of the primary DSS or the DSS that returned the operational intent reference is in violation of **[astm.f3548.v21.DSS0210,2a](../../../../../requirements/astm/f3548/v21.md)**.

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

0 comments on commit c4be07f

Please sign in to comment.