Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Shastick committed Mar 15, 2024
1 parent 8cbf0e9 commit 18ecd71
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,16 @@ Verify that the version of the subscription returned by every DSS is as expected

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.

#### 🛑 Subscription can be mutated on secondary DSS check

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:

**[astm.f3548.v21.DSS0210,1b](../../../../../requirements/astm/f3548/v21.md)**, if the `manager` of the subscription fails to be taken into account (either because the primary DSS did not propagated it, or because the secondary failed to consider it);
**[astm.f3548.v21.DSS0005,5](../../../../../requirements/astm/f3548/v21.md)**, if the secondary DSS fails to properly implement the API to mutate subscriptions.

#### [Update subscription](../fragments/sub/crud/update.md)

Confirm that the subscription can be mutated on a secondary DSS.
Confirm that the secondary DSS handles the update properly.

#### [Subscription is synchronized](../fragments/sub/sync.md)

Expand Down Expand Up @@ -156,7 +163,7 @@ Verify that the version of the subscription returned by the DSS is as expected

Attempt to query and search for the deleted subscription in various ways

#### 🛑 Secondary DSS should not return the deleted subscription check
#### 🛑 DSS should not return the deleted subscription check

If a DSS returns a subscription that was previously successfully deleted from the primary DSS,
either one of the primary DSS or the DSS that returned the subscription is in violation of **[astm.f3548.v21.DSS0210,1a](../../../../../requirements/astm/f3548/v21.md)**.
Expand All @@ -177,15 +184,9 @@ Verify that the subscription returned by the DSS via the deletion is properly fo

Verify that the version of the subscription returned by the DSS is as expected

#### 🛑 Secondary DSS should not return the deleted subscription check
#### 🛑 DSS should not return the deleted subscription check

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

#### 🛑 Primary DSS should not return the deleted subscription check

If the primary DSS returns a subscription that was previously successfully deleted from a secondary DSS,
either one of the secondary or primary DSS is in violation of **[astm.f3548.v21.DSS0210,1a](../../../../../requirements/astm/f3548/v21.md)**.


## [Cleanup](../clean_workspace.md)
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ def _ensure_no_active_subs_exist(self):
def _step_create_subscriptions(self):
# Create the 'main' test subscription:
main_sub = self._create_sub_with_params(self._sub_params)
if main_sub is None:
return

self._current_subscription = main_sub

Expand All @@ -230,14 +228,12 @@ def _step_create_subscriptions(self):
params = self._sub_params.copy()
params.sub_id = sub_id
extra_sub = self._create_sub_with_params(params)
if extra_sub is None:
return
self._subs_for_deletion[sub_id] = extra_sub
self._subs_for_deletion_params[sub_id] = params

def _create_sub_with_params(
self, creation_params: SubscriptionParams
) -> Optional[Subscription]:
) -> Subscription:

# TODO migrate to the try/except pattern for queries
newly_created = self._dss.upsert_subscription(
Expand All @@ -255,7 +251,6 @@ def _create_sub_with_params(
details=f"Subscription creation failed with status code {newly_created.status_code}",
query_timestamps=[newly_created.request.timestamp],
)
return None

with self.check(
"Create subscription response is correct", [self._primary_pid]
Expand Down Expand Up @@ -555,14 +550,22 @@ def _compare_upsert_resp_with_params(
)

def _mutate_subscription_with_dss(
self, dss_instance: DSSInstance, new_params: SubscriptionParams
) -> bool:
self,
dss_instance: DSSInstance,
new_params: SubscriptionParams,
is_primary: bool,
):
"""
Mutate the subscription on the given DSS instance using the given parameters.
Also updates the internal state of the scenario to reflect the new subscription.
Returns True if the subscription was successfully mutated, False otherwise.
"""
with self.check("Subscription can be mutated", [self._primary_pid]) as check:
check = (
"Subscription can be mutated"
if is_primary
else "Subscription can be mutated on secondary DSS"
)
with self.check(check, [self._primary_pid]) as check:
mutated_sub_response = dss_instance.upsert_subscription(
version=self._current_subscription.version,
**new_params,
Expand All @@ -574,7 +577,6 @@ def _mutate_subscription_with_dss(
details=f"Subscription mutation failed with status code {mutated_sub_response.status_code}",
query_timestamps=[mutated_sub_response.request.timestamp],
)
return False

# Check that what we get back is valid and corresponds to what we want to create
self._compare_upsert_resp_with_params(
Expand All @@ -584,27 +586,25 @@ def _mutate_subscription_with_dss(
self._current_subscription = mutated_sub_response.subscription
# Update the parameters we used for that subscription
self._sub_params = new_params
return True

def _step_mutate_subscriptions_broadcast_shift_time(self):
"""Mutate the subscription on the primary DSS by adding 10 seconds to its start and end times"""

sp = self._sub_params
new_params = shift_time_params(sp, timedelta(seconds=10))
self._mutate_subscription_with_dss(self._dss, new_params)
self._mutate_subscription_with_dss(self._dss, new_params, is_primary=True)

def _step_mutate_subscriptions_secondaries_shift_time(self):
"""Mutate the subscription on every secondary DSS by adding 10 seconds to its start and end times,
then checking on every DSS that the response is valid and corresponds to the expected parameters."""

for secondary_dss in self._dss_read_instances:
# Mutate the subscription on the secondary DSS
if not self._mutate_subscription_with_dss(
self._mutate_subscription_with_dss(
secondary_dss,
shift_time_params(self._sub_params, timedelta(seconds=10)),
):
# If the mutation failed but the scenario has not terminated, we end this step here.
return
is_primary=False,
)
# Check that the mutation was propagated to every DSS:
self._query_secondaries_and_compare(self._sub_params)

Expand Down Expand Up @@ -674,29 +674,42 @@ def _step_delete_subscriptions_on_secondaries(self):
# If the deletion failed but the scenario has not terminated, we end this step here.
return
# Check that the primary knows about the deletion:
self._confirm_dss_has_no_sub(self._dss, sub_id, is_primary=True)
self._confirm_dss_has_no_sub(
self._dss, sub_id, secondary_dss.participant_id
)
# Check that the deletion was propagated to every DSS:
self._confirm_no_secondary_has_sub(sub_id)
self._confirm_no_secondary_has_sub(sub_id, secondary_dss.participant_id)

def _step_get_deleted_sub(self):
self._confirm_no_secondary_has_sub(self._sub_id)
self._confirm_no_secondary_has_sub(self._sub_id, self._dss.participant_id)

def _confirm_no_secondary_has_sub(self, sub_id: str):
def _confirm_no_secondary_has_sub(
self, sub_id: str, deleted_on_participant_id: str
):
"""Confirm that no secondary DSS has the subscription.
deleted_on_participant_id specifies the participant_id of the DSS where the subscription was deleted."""
for secondary_dss in self._dss_read_instances:
self._confirm_dss_has_no_sub(secondary_dss, sub_id, is_primary=False)
self._confirm_dss_has_no_sub(
secondary_dss, sub_id, deleted_on_participant_id
)

def _confirm_dss_has_no_sub(
self, dss_instance: DSSInstance, sub_id: str, is_primary: bool = False
self,
dss_instance: DSSInstance,
sub_id: str,
other_participant_id: Optional[str],
):
check_name = (
"Primary DSS should not return the deleted subscription"
if is_primary
else "Secondary DSS should not return the deleted subscription"
"""Confirm that a DSS has no subscription.
other_participant_id may be specified if a failed check may be caused by it."""
participants = (
[dss_instance.participant_id, other_participant_id]
if other_participant_id
else None
)
fetched_sub = dss_instance.get_subscription(sub_id)
with self.check(
check_name,
[dss_instance.participant_id],
"DSS should not return the deleted subscription",
participants,
) as check:
if fetched_sub.status_code != 404:
check.record_failed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def cleanup_sub(
if existing_sub.status_code not in [200, 404]:
check.record_failed(
summary=f"Could not query subscription {sub_id}",
details=f"When attempting to query subscription {sub_id} from the DSS, received {existing_sub.status_code}: {existing_sub.json_result}",
details=f"When attempting to query subscription {sub_id} from the DSS, received {existing_sub.status_code}: {existing_sub.error_message}",
query_timestamps=[existing_sub.request.timestamp],
)

Expand Down
7 changes: 6 additions & 1 deletion monitoring/uss_qualifier/suites/astm/utm/dss_probing.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<th><a href="../../README.md#checked-in">Checked in</a></th>
</tr>
<tr>
<td rowspan="16" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="17" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0005,1</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/subscription_simple.md">ASTM SCD DSS: Subscription Simple</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_validation.md">ASTM SCD DSS: Subscription Validation</a></td>
Expand Down Expand Up @@ -56,6 +56,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,1b</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,1c</a></td>
<td>Implemented</td>
Expand Down
7 changes: 6 additions & 1 deletion monitoring/uss_qualifier/suites/astm/utm/f3548_21.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<th><a href="../../README.md#checked-in">Checked in</a></th>
</tr>
<tr>
<td rowspan="42" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="43" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0005,1</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/prep_planners.md">ASTM F3548 flight planners preparation</a><br><a href="../../../scenarios/astm/utm/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/subscription_simple.md">ASTM SCD DSS: Subscription Simple</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_validation.md">ASTM SCD DSS: Subscription Validation</a><br><a href="../../../scenarios/astm/utm/off_nominal_planning/down_uss.md">Off-Nominal planning: down USS</a><br><a href="../../../scenarios/astm/utm/off_nominal_planning/down_uss_equal_priority_not_permitted.md">Off-Nominal planning: down USS with equal priority conflicts not permitted</a></td>
Expand Down Expand Up @@ -75,6 +75,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,1b</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,1c</a></td>
<td>Implemented</td>
Expand Down
7 changes: 6 additions & 1 deletion monitoring/uss_qualifier/suites/faa/uft/message_signing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<th><a href="../../README.md#checked-in">Checked in</a></th>
</tr>
<tr>
<td rowspan="42" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="43" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0005,1</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/prep_planners.md">ASTM F3548 flight planners preparation</a><br><a href="../../../scenarios/astm/utm/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/subscription_simple.md">ASTM SCD DSS: Subscription Simple</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_validation.md">ASTM SCD DSS: Subscription Validation</a><br><a href="../../../scenarios/astm/utm/off_nominal_planning/down_uss.md">Off-Nominal planning: down USS</a><br><a href="../../../scenarios/astm/utm/off_nominal_planning/down_uss_equal_priority_not_permitted.md">Off-Nominal planning: down USS with equal priority conflicts not permitted</a></td>
Expand Down Expand Up @@ -58,6 +58,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,1b</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,1c</a></td>
<td>Implemented</td>
Expand Down
7 changes: 6 additions & 1 deletion monitoring/uss_qualifier/suites/interuss/dss/all_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
<td><a href="../../../scenarios/astm/netrid/v22a/dss/heavy_traffic_concurrent.md">ASTM NetRID DSS: Concurrent Requests</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/isa_expiry.md">ASTM NetRID DSS: ISA Expiry</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/isa_subscription_interactions.md">ASTM NetRID DSS: ISA Subscription Interactions</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/isa_simple.md">ASTM NetRID DSS: Simple ISA</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/isa_validation.md">ASTM NetRID DSS: Submitted ISA Validations</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/subscription_simple.md">ASTM NetRID DSS: Subscription Simple</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/subscription_validation.md">ASTM NetRID DSS: Subscription Validation</a><br><a href="../../../scenarios/astm/netrid/v22a/dss/token_validation.md">ASTM NetRID DSS: Token Validation</a></td>
</tr>
<tr>
<td rowspan="16" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="17" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0005,1</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/subscription_simple.md">ASTM SCD DSS: Subscription Simple</a><br><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a><br><a href="../../../scenarios/astm/utm/dss/subscription_validation.md">ASTM SCD DSS: Subscription Validation</a></td>
Expand Down Expand Up @@ -443,6 +443,11 @@
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,1b</a></td>
<td>Implemented</td>
<td><a href="../../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../../requirements/astm/f3548/v21.md">DSS0210,1c</a></td>
<td>Implemented</td>
Expand Down
7 changes: 6 additions & 1 deletion monitoring/uss_qualifier/suites/uspace/flight_auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<th><a href="../README.md#checked-in">Checked in</a></th>
</tr>
<tr>
<td rowspan="42" style="vertical-align:top;"><a href="../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="43" style="vertical-align:top;"><a href="../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td><a href="../../requirements/astm/f3548/v21.md">DSS0005,1</a></td>
<td>Implemented</td>
<td><a href="../../scenarios/astm/utm/prep_planners.md">ASTM F3548 flight planners preparation</a><br><a href="../../scenarios/astm/utm/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../scenarios/astm/utm/dss/subscription_simple.md">ASTM SCD DSS: Subscription Simple</a><br><a href="../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a><br><a href="../../scenarios/astm/utm/dss/subscription_validation.md">ASTM SCD DSS: Subscription Validation</a><br><a href="../../scenarios/astm/utm/off_nominal_planning/down_uss.md">Off-Nominal planning: down USS</a><br><a href="../../scenarios/astm/utm/off_nominal_planning/down_uss_equal_priority_not_permitted.md">Off-Nominal planning: down USS with equal priority conflicts not permitted</a></td>
Expand Down Expand Up @@ -59,6 +59,11 @@
<td>Implemented</td>
<td><a href="../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../requirements/astm/f3548/v21.md">DSS0210,1b</a></td>
<td>Implemented</td>
<td><a href="../../scenarios/astm/utm/dss/synchronization/subscription_synchronization.md">ASTM SCD DSS: Subscription Synchronization</a></td>
</tr>
<tr>
<td><a href="../../requirements/astm/f3548/v21.md">DSS0210,1c</a></td>
<td>Implemented</td>
Expand Down
Loading

0 comments on commit 18ecd71

Please sign in to comment.