Skip to content

Commit 69e3adf

Browse files
authored
[uss_qualifier] create a SubscriptionValidator for scd subscriptions (#490)
subscription_validator
1 parent c991243 commit 69e3adf

File tree

5 files changed

+683
-107
lines changed

5 files changed

+683
-107
lines changed

monitoring/monitorlib/schema_validation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ class F3548_21(str, Enum):
5353
GetOperationalIntentDetailsResponse = (
5454
"components.schemas.GetOperationalIntentDetailsResponse"
5555
)
56+
PutSubscriptionResponse = "components.schemas.PutSubscriptionResponse"
57+
GetSubscriptionResponse = "components.schemas.GetSubscriptionResponse"
58+
QuerySubscriptionsResponse = "components.schemas.QuerySubscriptionsResponse"
59+
DeleteSubscriptionResponse = "components.schemas.DeleteSubscriptionResponse"
5660

5761

5862
_openapi_content_cache: Dict[str, dict] = {}

monitoring/uss_qualifier/scenarios/astm/utm/dss/subscription_simple.md

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,20 @@ This test step creates multiple subscriptions with different combinations of the
3838

3939
All subscriptions are left on the DSS when this step ends, as they are expected to be present for the subsequent step.
4040

41-
#### 🛑 Create subscription check
41+
#### 🛑 Create subscription query succeeds check
4242

43-
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
44-
start and end time missing, provided all the required parameters are valid.
43+
If the query to create a subscription with valid parameters is not successful, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
4544

46-
#### 🛑 Response to subscription creation contains a subscription check
45+
#### 🛑 Create subscription response is correct check
4746

48-
As per **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**, upon creation of a subscription,
49-
the newly created subscription must be part of its response.
47+
A successful subscription creation query is expected to return a well-defined body, the content of which reflects the created subscription.
48+
If the format and content of the response are not conforming, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
49+
50+
#### ⚠️ Create subscription response format conforms to spec check
51+
52+
The response to a successful subscription creation query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21.
53+
54+
If it does not, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
5055

5156
#### [Validate subscription](./validate_subscription.md)
5257

@@ -56,13 +61,35 @@ Verify that the subscription returned by the DSS after its creation is properly
5661

5762
Query and search for the created subscription in various ways
5863

59-
#### 🛑 Get Subscription by ID check
64+
#### 🛑 Get subscription query succeeds check
6065

61-
If the freshly created subscription cannot be queried using its ID, the DSS is failing to meet **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
66+
If the query to get an existing subscription fails, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
6267

63-
#### 🛑 Search for all subscriptions in planning area check
68+
#### 🛑 Get subscription response is correct check
6469

65-
If the DSS fails to let us search in the area for which the subscription was just created, it is failing to meet **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
70+
A successful get subscription query is expected to return a well-defined body, the content of which reflects the created subscription.
71+
If the format and content of the response are not conforming, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
72+
73+
#### ⚠️ Get subscription response format conforms to spec check
74+
75+
The response to a successful get subscription query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21.
76+
77+
If it does not, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
78+
79+
#### 🛑 Search for all subscriptions in planning area query succeeds check
80+
81+
If the search query for the area for which the subscription was just created fails, it is failing to meet **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
82+
83+
#### 🛑 Search for all subscriptions in planning area response is correct check
84+
85+
A successful search query is expected to return a well-defined body, the content of which reflects the created subscription as well as any other subscription in the area.
86+
If the format and content of the response are not conforming, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
87+
88+
#### ⚠️ Search subscriptions response format conforms to spec check
89+
90+
The response to a successful subscription search query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21.
91+
92+
If it does not, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
6693

6794
#### 🛑 Created Subscription is in search results check
6895

@@ -81,14 +108,20 @@ Verify that the subscription returned by the DSS via the search is correctly for
81108
This test step mutates the previously created subscription to verify that the DSS reacts properly: notably, it checks that the subscription version is updated,
82109
including for changes that are not directly visible, such as changing the subscription's footprint.
83110

84-
#### 🛑 Subscription can be mutated check
111+
#### 🛑 Mutate subscription query succeeds check
112+
113+
If the query to mutate a subscription with valid parameters is not successful, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
85114

86-
If a subscription cannot be modified with a valid set of parameters, the DSS is failing to meet **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
115+
#### 🛑 Mutate subscription response is correct check
87116

88-
#### 🛑 Response to subscription mutation contains a subscription check
117+
A successful subscription mutation query is expected to return a well-defined body, the content of which reflects the newly defined subscription.
118+
If the format and content of the response are not conforming, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
89119

90-
As per **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**, upon creation of a subscription,
91-
the newly created subscription must be part of its response.
120+
#### ⚠️ Mutate subscription response format conforms to spec check
121+
122+
The response to a successful subscription mutation query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21.
123+
124+
If it does not, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
92125

93126
#### [Validate subscription](./validate_subscription.md)
94127

@@ -108,6 +141,21 @@ An attempt to delete a subscription without providing a version should fail, oth
108141

109142
An attempt to delete a subscription while providing an incorrect version should fail, otherwise the DSS is in violation of **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
110143

144+
#### 🛑 Delete subscription query succeeds check
145+
146+
If the query to delete an existing subscription fails, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
147+
148+
#### 🛑 Delete subscription response is correct check
149+
150+
A successful delete subscription query is expected to return a well-defined body, the content of which reflects the content of the subscription before deletion.
151+
If the format and content of the response are not conforming, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
152+
153+
#### ⚠️ Delete subscription response format conforms to spec check
154+
155+
The response to a successful delete subscription query is expected to conform to the format defined by the OpenAPI specification under the `A3.1` Annex of ASTM F3548−21.
156+
157+
If it does not, the DSS is failing to implement **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
158+
111159
#### 🛑 Subscription can be deleted check
112160

113161
An attempt to delete a subscription when the correct version is provided should succeed, otherwise the DSS is in violation of **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
@@ -124,7 +172,7 @@ Attempt to query and search for the deleted subscription in various ways
124172

125173
If the DSS provides a successful reply to a direct query for the deleted subscription, it is in violation of **[astm.f3548.v21.DSS0005,5](../../../../requirements/astm/f3548/v21.md)**.
126174

127-
#### 🛑 Search for all subscriptions in planning area check
175+
#### 🛑 Search for all subscriptions in planning area query succeeds check
128176

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

0 commit comments

Comments
 (0)