Skip to content

Commit

Permalink
[uss_qualifier] new constraint ref validator, based on the OIR validator
Browse files Browse the repository at this point in the history
  • Loading branch information
Shastick committed May 22, 2024
1 parent b28484e commit 6fd2b9c
Show file tree
Hide file tree
Showing 5 changed files with 580 additions and 0 deletions.
8 changes: 8 additions & 0 deletions monitoring/monitorlib/schema_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ class F3548_21(str, Enum):
)
AirspaceConflictResponse = "components.schemas.AirspaceConflictResponse"

ChangeConstraintReferenceResponse = (
"components.schemas.ChangeConstraintReferenceResponse"
)
GetConstraintReferenceResponse = "components.schemas.GetConstraintReferenceResponse"
QueryConstraintReferenceResponse = (
"components.schemas.QueryConstraintReferenceResponse"
)


_openapi_content_cache: Dict[str, dict] = {}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Validate the content of a constraint reference test step fragment

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

Fields that require different handling based on if the constraint reference was mutated or not are covered in
the [validate mutated constraint reference](mutated.md) and [validate non-mutated constraint reference](non_mutated.md) fragments, respectively.

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

## ⚠️ Returned constraint reference ID is correct check

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

## ⚠️ Returned constraint reference has a manager check

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

## ⚠️ Returned constraint reference manager is correct check

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

## ⚠️ Returned constraint reference has an USS base URL check

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

## ⚠️ Returned constraint reference base URL is correct check

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

## ⚠️ Returned constraint reference has a start time check

If the returned constraint reference has no start time defined, **[astm.f3548.v21.DSS0005,3](../../../../../../../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,3](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Returned constraint reference has an end time check

constraint 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,3](../../../../../../../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,3](../../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ Returned constraint reference has a version check

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

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

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

## ⚠️ Mutated constraint reference version is updated check

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

## ⚠️ Mutated constraint reference OVN is updated check

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

This test step fragment attempts to validate a single constraint 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 [cr_validator.py](../../../validators/cr_validator.py) class.

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

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

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

If the OVN of the constraint reference is updated without there having been any mutation of the constraint reference, the DSS is in violation of **[astm.f3548.v21.DSS0005,3](../../../../../../../requirements/astm/f3548/v21.md)**.
Loading

0 comments on commit 6fd2b9c

Please sign in to comment.