Skip to content

Commit 7fc4ecf

Browse files
committed
latest PR comments
1 parent 2b453cb commit 7fc4ecf

File tree

3 files changed

+57
-29
lines changed

3 files changed

+57
-29
lines changed

monitoring/prober/infrastructure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def wrapper_default_scope(*args, **kwargs):
100100
resource_type_code_descriptions: Dict[ResourceType, str] = {}
101101

102102

103-
# Next code: 381
103+
# Next code: 382
104104
def register_resource_type(code: int, description: str) -> ResourceType:
105105
"""Register that the specified code refers to the described resource.
106106

monitoring/uss_qualifier/scenarios/astm/utm/dss/synchronization/subscription_synchronization.md

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,18 @@ For the purpose of this scenario, the `second_utm_auth` resource must provide ac
4848

4949
##### Separate subscription
5050

51-
Note that the subscription (or 'sub' claim, not to be confused with an SCD DSS subscription) of the token that will be obtained for this resource
51+
Note that the subject (or 'sub' claim) of the token that will be obtained for this resource
5252
MUST be different from the one of the `dss` resources mentioned above:
5353
this will be verified at runtime, and the depending checks will not be run if this is not the case.
5454

5555
## Setup test case
5656

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

59-
This step ensures that no subscription with the known test ID exists in the DSS.
59+
This step ensures that no subscriptions with the known test IDs exists in the DSS.
60+
61+
This includes the main test subscription used in this test, as well as the extra subscription
62+
used for testing the `manager` field sync, if the test is configured to test for it.
6063

6164
## Subscription Synchronization test case
6265

@@ -140,6 +143,8 @@ Verify that the version of the subscription returned by every DSS is as expected
140143

141144
This test step attempts to mutate the subscription on every secondary DSS instance (that is, instances through which the subscription has not been created) to confirm that such mutations are properly propagated to every DSS.
142145

146+
Note that this step is repeated for every secondary DSS instance.
147+
143148
#### 🛑 Subscription can be mutated on secondary DSS check
144149

145150
If the secondary DSS does not allow the subscription to be mutated, either the secondary DSS or the primary DSS are in violation of one or both of the following requirements:
@@ -157,6 +162,20 @@ If it does not, it might be in violation of **[astm.f3548.v21.DSS0005,5](../../.
157162

158163
Confirm that the secondary DSS handles the update properly.
159164

165+
#### [Validate subscription](../fragments/sub/validate/correctness.md)
166+
167+
Verify that the subscription returned by the DSS is properly formatted and contains the correct content.
168+
169+
#### [Validate version is updated by mutation](../fragments/sub/validate/mutated.md)
170+
171+
Verify that the version of the subscription is updated after the mutation on the secondary.
172+
173+
### Verify mutation on all secondaries test step
174+
175+
This step verifies that the mutation of the subscription on a secondary instance, from the previous step, is properly propagated to every other DSS.
176+
177+
Note that this step is repeated for every secondary DSS instance.
178+
160179
#### [Subscription is synchronized](../fragments/sub/sync.md)
161180

162181
Confirm that the subscription that was just mutated is properly synchronized across all DSS instances.
@@ -169,32 +188,30 @@ Confirms that the subscription that was just mutated can be retrieved from any D
169188

170189
Verify that the subscription returned by the DSS is properly formatted and contains the correct content.
171190

172-
#### [Validate version is updated by mutation](../fragments/sub/validate/mutated.md)
191+
#### [Validate version is as expected when read](../fragments/sub/validate/non_mutated.md)
173192

174-
### Verify manager synchronization test step
193+
Verify that when we are reading the subscription without mutating it, the version is as expected.
175194

176-
Checks that the manager of a subscription is properly synchronized across all DSS instances.
195+
### Create subscription with different credentials test step
177196

178-
This is done by means of using a separate set of credentials to create a subscription on the primary DSS,
179-
and then verifying that the main credentials are not able to mutate this subscription via one of the secondary DSS instances
197+
If the second set of credentials is provided, this test step will create a subscription using these credentials,
198+
in order to prepare the next step that checks manager synchronization.
180199

181200
#### [Create subscription](../fragments/sub/crud/create.md)
182201

183-
Verify that a subscription can be created on the primary DSS.
184-
185-
#### 🛑 Subscription deletion with different non-managing credentials on secondary DSS fails check
202+
Verify that a subscription can be created on the primary DSS using the separate set of credentials.
186203

187-
If the subscription can be deleted by a client which did not create it, via a DSS instance to which the subscription was synced
188-
following its creation on the primary DSS, either one of the primary DSS or the DSS that accepted the deletion failed to properly broadcast, respectively take into account, the manage of the subscription,
189-
and therefore violates **[astm.f3548.v21.DSS0210,1b](../../../../../requirements/astm/f3548/v21.md)**.
204+
### Verify manager synchronization test step
190205

191-
### Delete subscription test step
206+
If the second set of credentials is provided, checks that the manager of a subscription is properly synchronized across all DSS instances.
192207

193-
Verify that the version of the subscription returned by the DSS the subscription was mutated through has been updated.
208+
This is done by verifying that the main credentials are not able to delete the subscription via any of the secondary DSS instances.
194209

195-
#### [Validate new version is synced](../fragments/sub/validate/non_mutated.md)
210+
#### ⚠️ Subscription deletion with different non-managing credentials on secondary DSS fails check
196211

197-
Verify that the new version of the subscription has been propagated.
212+
If the subscription can be deleted by a client which did not create it, via a DSS instance to which the subscription was synced
213+
following its creation on the primary DSS, either one of the primary DSS or the DSS that accepted the deletion failed to properly broadcast, respectively take into account, the manage of the subscription,
214+
and therefore violates **[astm.f3548.v21.DSS0210,1b](../../../../../requirements/astm/f3548/v21.md)**.
198215

199216
### Delete subscription on primary test step
200217

@@ -256,3 +273,8 @@ either one of the primary DSS or the DSS that returned the subscription is in vi
256273
As a result, the DSS pool under test is failing to meet **[astm.f3548.v21.DSS0020](../../../../../requirements/astm/f3548/v21.md)**.
257274

258275
## [Cleanup](../clean_workspace.md)
276+
277+
This step ensures that no subscriptions with the known test IDs exists in the DSS.
278+
279+
This includes the main test subscription used in this test, as well as the extra subscription
280+
used for testing the `manager` field sync, if the test is configured to test for it.

monitoring/uss_qualifier/scenarios/astm/utm/dss/synchronization/subscription_synchronization.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ class SubscriptionSynchronization(TestScenario):
4646
"""
4747

4848
SUB_TYPE = register_resource_type(379, "Subscription")
49-
ACL_SUB_TYPE = register_resource_type(380, "Subscription with different credentials")
49+
ACL_SUB_TYPE = register_resource_type(
50+
381, "Subscription with different credentials"
51+
)
5052

5153
_dss: DSSInstance
5254

@@ -174,28 +176,28 @@ def run(self, context: ExecutionContext):
174176
return
175177

176178
self.begin_test_scenario(context)
177-
self._setup_case()
179+
self._step_setup_case()
178180
self.begin_test_case("Subscription Synchronization")
179181

180182
self.begin_test_step("Create subscription validation")
181183
self._step_create_subscriptions()
182184
self.end_test_step()
183185

184186
self.begin_test_step("Query newly created subscription")
185-
self._query_secondaries_and_compare(self._sub_params)
187+
self._step_query_secondaries_and_compare(self._sub_params)
186188
self.end_test_step()
187189

188190
self.begin_test_step("Mutate subscription broadcast")
189191
self._step_mutate_subscriptions_broadcast_shift_time()
190192
self.end_test_step()
191193

192194
self.begin_test_step("Query updated subscription")
193-
self._query_secondaries_and_compare(self._sub_params)
195+
self._step_query_secondaries_and_compare(self._sub_params)
194196
self.end_test_step()
195197

196198
if self._dss_separate_creds:
197199
self.begin_test_step("Create subscription with different credentials")
198-
200+
self._step_create_sub_separate_creds()
199201
self.end_test_step()
200202
self.begin_test_step("Verify manager synchronization")
201203
self._step_test_delete_sub_with_separate_creds()
@@ -206,9 +208,7 @@ def run(self, context: ExecutionContext):
206208
"Skipping manager synchronization check: no extra credentials provided",
207209
)
208210

209-
self.begin_test_step("Mutate subscription on secondaries")
210211
self._step_mutate_subscriptions_secondaries_shift_time()
211-
self.end_test_step()
212212

213213
self.begin_test_step("Delete subscription on primary")
214214
self._step_delete_sub()
@@ -225,7 +225,7 @@ def run(self, context: ExecutionContext):
225225
self.end_test_case()
226226
self.end_test_scenario()
227227

228-
def _setup_case(self):
228+
def _step_setup_case(self):
229229
self.begin_test_case("Setup")
230230
# Multiple runs of the scenario seem to rely on the same instance of it:
231231
# thus we need to reset the state of the scenario before running it.
@@ -304,7 +304,9 @@ def _create_sub_with_params(
304304

305305
return newly_created.subscription
306306

307-
def _query_secondaries_and_compare(self, expected_sub_params: SubscriptionParams):
307+
def _step_query_secondaries_and_compare(
308+
self, expected_sub_params: SubscriptionParams
309+
):
308310
for secondary_dss in self._dss_read_instances:
309311
self._validate_get_sub_from_secondary(
310312
secondary_dss=secondary_dss,
@@ -663,7 +665,7 @@ def _step_test_delete_sub_with_separate_creds(self):
663665
check.record_failed(
664666
"Subscription deletion with main credentials did not fail",
665667
details=f"Subscription deletion with main credentials did not fail with the expected "
666-
f"status code of 403; instead returned {deleted_sub.status_code}",
668+
f"status code of 403; instead returned {deleted_sub.status_code}",
667669
query_timestamps=[deleted_sub.request.timestamp],
668670
)
669671

@@ -691,13 +693,17 @@ def _step_mutate_subscriptions_secondaries_shift_time(self):
691693

692694
for secondary_dss in self._dss_read_instances:
693695
# Mutate the subscription on the secondary DSS
696+
self.begin_test_step("Mutate subscription on secondaries")
694697
self._mutate_subscription_with_dss(
695698
secondary_dss,
696699
self._sub_params.shift_time(timedelta(seconds=10)),
697700
is_primary=False,
698701
)
702+
self.end_test_step()
703+
self.begin_test_step("Verify mutation on all secondaries")
699704
# Check that the mutation was propagated to every DSS:
700-
self._query_secondaries_and_compare(self._sub_params)
705+
self._step_query_secondaries_and_compare(self._sub_params)
706+
self.end_test_step()
701707

702708
def _delete_sub_from_dss(
703709
self,

0 commit comments

Comments
 (0)