Skip to content

Commit

Permalink
[uss_qualifier] fragments for dss0210 op-intent ref. synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
Shastick committed Mar 12, 2024
1 parent 91dffe2 commit ee96b43
Show file tree
Hide file tree
Showing 10 changed files with 732 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Create operational intent reference test step fragment

This test step fragment validates that operational intent references can be created

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

## 🛑 Create operational intent reference response is correct check

A successful operational intent reference creation query is expected to return a well-defined body, the content of which reflects the created operational intent reference.
If the format and content of the response are not conforming, the DSS is failing to implement **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Create operational intent reference response format conforms to spec check

The response to a successful operational intent reference creation query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21.

If it does not, the DSS is failing to implement **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Delete operational intent reference test step fragment

This test step fragment validates that operational intent references can be deleted

## 🛑 Delete operational intent reference query succeeds check

A query to delete an operational intent reference, by its owner and when the correct OVN is provided, should succeed, otherwise the DSS is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Delete operational intent reference response is correct check

A successful operational intent reference deletion query is expected to return a well-defined body, the content of which reflects the operational intent reference at the moment of deletion.
If the format and content of the response are not conforming, the DSS is failing to implement **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Delete operational intent reference response format conforms to spec check

The response to a successful operational intent reference deletion query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21.

If it does not, the DSS is failing to implement **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Read operational intent reference test step fragment

This test step fragment validates that operational intent references can be read

## 🛑 Get operational intent reference by ID check

If an operational intent reference cannot be queried using its ID, the DSS is failing to meet **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Get operational intent reference response format conforms to spec check

The response to a successful get operational intent reference query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21.

If it does not, the DSS is failing to implement **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Successful operational intent reference search query check

If the DSS fails to let us search in the area for which the OIR was created, it is failing to meet **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Created operational intent reference is in search results check

If the existing operational intent reference is not returned in a search that covers the area it was created for, the DSS is not properly implementing **[astm.f3548.v21.DSS0005,2](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Search operational intent reference response format conforms to spec check

The response to a successful operational intent reference search query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21.

If it does not, the DSS is failing to implement **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Update operational intent reference test step fragment

This test step fragment validates that operational intent references can be updated.

## 🛑 Mutate 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 mutate an operational intent reference.

## 🛑 Mutate operational intent reference response is correct check

A successful operational intent reference mutation query is expected to return a well-defined body, the content of which reflects the updated operational intent reference.
If the format and content of the response are not conforming, the DSS is failing to implement **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Mutate operational intent reference response format conforms to spec check

The response to a successful operational intent reference mutation query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21.

If it does not, the DSS is failing to implement **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Synchronize operational intent reference test step fragment

This test step fragment validates that operational intent references are properly synchronized across a set of DSS instances.

## 🛑 Operational intent reference can be found at every DSS check

If the previously created or mutated operational intent reference cannot be found at a DSS, either one of the instances at which the operational intent reference was created or the one that was queried,
may be failing to implement **[astm.f3548.v21.DSS0210,2a](../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Propagated operational intent reference contains the correct manager check

If the operational intent reference returned by a DSS to which the operational intent reference was synchronized to does not contain the correct manager,
either one of the instances at which the operational intent reference was created or the one that was queried, may be failing to implement **[astm.f3548.v21.DSS0210,2b](../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Propagated operational intent reference contains the correct USS base URL check

If the operational intent reference returned by a DSS to which the operational intent reference was synchronized to does not contain the correct USS base URL,
either one of the instances at which the operational intent reference was created or the one that was queried, may be failing to implement **[astm.f3548.v21.DSS0210,2c](../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Propagated operational intent reference contains the correct state check

If the operational intent reference returned by a DSS to which the operational intent reference was synchronized to does not contain the correct state,
either one of the instances at which the operational intent reference was created or the one that was queried, may be failing to implement **[astm.f3548.v21.DSS0210,2d](../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Propagated operational intent reference contains the correct start time check

If the operational intent reference returned by a DSS to which the operational intent reference was synchronized to does not contain the correct start time,
either one of the instances at which the operational intent reference was created or the one that was queried, may be failing to implement **[astm.f3548.v21.DSS0210,2f](../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑 Propagated operational intent reference contains the correct end time check

If the operational intent reference returned by a DSS to which the operational intent reference was synchronized to does not contain the correct end time,
either one of the instances at which the operational intent reference was created or the one that was queried, may be failing to implement **[astm.f3548.v21.DSS0210,2f](../../../../../../requirements/astm/f3548/v21.md)**.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Validate the content of an operational intent reference test step fragment

This test step fragment attempts to validate the content of a single operational intent reference returned by the DSS.

Fields that require different handling based on if the operational intent reference was mutated or not are covered

The code for these checks lives in the [oir_validator.py](../../../validators/oir_validator.py) class.

## ⚠️ Returned operational intent reference ID is correct check

If the returned operational intent reference ID does not correspond to the one specified in the creation parameters,
**[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)** is not respected.

## ⚠️ Returned operational intent reference has a manager check

If the returned operational intent reference has no manager defined, **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)** is not respected.

## ⚠️ Returned operational intent reference manager is correct check

The returned manager must correspond to the identity of the client that created the operational intent at the DSS,
otherwise the DSS is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Returned operational intent reference state is correct check

The returned state must be the same as the provided one, otherwise the DSS is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Returned operational intent reference has an USS base URL check

If the returned operational intent reference has no USS base URL defined, **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)** is not respected.

## ⚠️ Returned operational intent reference base URL is correct check

The returned USS base URL must be prefixed with the USS base URL that was provided at operational intent reference creation, otherwise the DSS is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Returned operational intent reference has a start time check

If the returned operational intent reference has no start time defined, **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)** is not respected.

## ⚠️ Returned start time is correct check

The returned start time must be the same as the provided one, otherwise the DSS is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Returned operational intent reference has an end time check

Operational intent references need a defined end time in order to limit their duration: if the DSS omits to set the end time, it will be in violation of **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Returned end time is correct check

The returned end time must be the same as the provided one, otherwise the DSS is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Returned operational intent reference has a version check

If the returned operational intent reference has no version defined, **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)** is not respected.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Validate mutated operational intent reference test step fragment

This test step fragment attempts to validate a single operational intent reference returned by the DSS,
usually after it has been mutated.

The code for these checks lives in the [oir_validator.py](../../../validators/oir_validator.py) class.

## ⚠️ Mutated operational intent reference version is updated check

Following a mutation, the DSS needs to update the operational intent reference version, otherwise it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Mutated operational intent reference OVN is updated check

Following a mutation, the DSS needs to update the operational intent reference OVN, otherwise it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Validate non-mutated operational intent reference test step fragment

This test step fragment attempts to validate a single operational intent reference returned by the DSS,
usually after it has been created or to confirm it has not been mutated by an action.

The code for these checks lives in the [oir_validator.py](../../../validators/oir_validator.py) class.

## ⚠️ Non-mutated operational intent reference keeps the same version check

If the version of the operational intent reference is updated without there having been any mutation of the operational intent reference, the DSS is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Non-mutated operational intent reference keeps the same OVN check

If the OVN of the operational intent reference is updated without there having been any mutation of the operational intent reference, the DSS is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../../../requirements/astm/f3548/v21.md)**.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import loguru

from monitoring.monitorlib.fetch import QueryError
from monitoring.monitorlib.mutate.scd import MutatedSubscription
from monitoring.monitorlib import fetch
from monitoring.uss_qualifier.resources.astm.f3548.v21.dss import DSSInstance
Expand Down Expand Up @@ -92,3 +93,28 @@ def cleanup_active_subs(

for sub_id in query.subscriptions.keys():
cleanup_sub(scenario, dss, sub_id)


def cleanup_active_oirs(
scenario: TestScenarioType,
dss: DSSInstance,
volume: Volume4D,
manager_identity: str,
) -> None:
with scenario.check(
"Operational intent references can be searched for", [dss.participant_id]
) as check:
try:
oirs, query = dss.find_op_intent(volume)
except QueryError as qe:
scenario.record_queries(qe.queries)
check.record_failed(
summary="Failed to query operational intent references",
details=f"Failed to query operational intent references: got response code {qe.queries[0].status_code}",
query_timestamps=[qe.queries[0].request.timestamp],
)
return

for oir in oirs:
if oir.manager == manager_identity:
remove_op_intent(scenario, dss, oir.id, oir.ovn)
Loading

0 comments on commit ee96b43

Please sign in to comment.