Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Shastick committed Mar 20, 2024
1 parent 870918f commit e539259
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 37 deletions.
2 changes: 1 addition & 1 deletion monitoring/prober/infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def wrapper_default_scope(*args, **kwargs):
resource_type_code_descriptions: Dict[ResourceType, str] = {}


# Next code: 383
# Next code: 381
def register_resource_type(code: int, description: str) -> ResourceType:
"""Register that the specified code refers to the described resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../require
If the DSS does not allow the creation of an operational intent when valid credentials are presented,
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.

#### [Create response format](../fragments/oir/crud/create_format.md)

Check response format of a creation request.

#### 🛑 Get operational intent reference with missing credentials check

If the DSS under test allows the fetching of an operational intent without any credentials being presented,
Expand Down Expand Up @@ -255,6 +259,10 @@ it is in violation of **[astm.f3548.v21.DSS0210,A2-7-2,7](../../../../../require
If the DSS does not allow the mutation of an operational intent when valid credentials are presented,
it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../../requirements/astm/f3548/v21.md)**.

#### [Mutate response format](../fragments/oir/crud/update_format.md)

Check response format of a mutation.

#### 🛑 Delete operational intent reference with missing credentials check

If the DSS under test allows the deletion of an operational intent without any credentials being presented,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AuthenticationValidation(TestScenario):
"""

SUB_TYPE = register_resource_type(
382, "Subscription, Operational Entity Id, Constraint"
380, "Subscription, Operational Entity Id, Constraint"
)

# Reuse the same ID for every type of entity.
Expand Down Expand Up @@ -213,7 +213,7 @@ def _ensure_test_entities_dont_exist(self):
query = qe.queries[0]
check.record_failed(
summary=f"Could not query OIR {self._test_id}",
details=f"When attempting to query OIR {self._test_id} from the DSS, received {query.response.status_code}: {qe.msg}",
details=f"When attempting to query OIR {self._test_id} from the DSS, received {query.response.status_code}: {qe}",
query_timestamps=[query.request.timestamp],
)

Expand All @@ -231,7 +231,6 @@ def _ensure_test_entities_dont_exist(self):
details=f"When attempting to remove op intent reference {self._test_id} from the DSS, received {query.status_code}: {qe.msg}",
query_timestamps=[query.request.timestamp],
)
self._dss.delete_op_intent(oir.id, oir.ovn)

test_step_fragments.cleanup_sub(self, self._dss, self._test_id)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _verify_oir_creation(self):
) as check:
if no_scope_q.status_code != 401:
check.record_failed(
summary=f"Expected 403, got {no_scope_q.status_code}",
summary=f"Expected 401, got {no_scope_q.status_code}",
query_timestamps=[no_scope_q.request.timestamp],
)
self._sanity_check_oir_not_created(check, no_scope_q)
Expand Down Expand Up @@ -171,9 +171,19 @@ def _verify_oir_creation(self):
query_timestamps=[valid_q.request.timestamp],
)

oir_resp = ImplicitDict.parse(
valid_q.response.json, ChangeOperationalIntentReferenceResponse
)
with self._scenario.check(
"Create operational intent reference response format conforms to spec"
) as check:
try:
oir_resp = ImplicitDict.parse(
valid_q.response.json, ChangeOperationalIntentReferenceResponse
)
except ValueError as e:
check.record_failed(
summary="Could not parse the response body",
details=f"Failed to parse the response body as a ChangeOperationalIntentReferenceResponse: {e}",
query_timestamps=[valid_q.request.timestamp],
)

# Save the current OIR
self._current_oir = oir_resp.operational_intent_reference
Expand Down Expand Up @@ -220,7 +230,7 @@ def _verify_oir_get(self):
) as check:
if query_missing_scope.status_code != 401:
check.record_failed(
summary=f"Expected 403, got {query_missing_scope.status_code}",
summary=f"Expected 401, got {query_missing_scope.status_code}",
query_timestamps=[query_missing_scope.request.timestamp],
)

Expand Down Expand Up @@ -332,13 +342,24 @@ def _verify_oir_mutation(self):
if valid_q.status_code != 200:
check.record_failed(
summary=f"Expected 200, got {valid_q.status_code}",
details=f"Mutation is expected to have succeeded, but got status {valid_q.status_code} with body {valid_q.response.json} instead",
details=f"Mutation is expected to have succeeded, but got status {valid_q.status_code} with error {valid_q.error_message} instead",
query_timestamps=[valid_q.request.timestamp],
)

with self._scenario.check(
"Mutate operational intent reference response format conforms to spec"
) as check:
try:
parsed_oir = ImplicitDict.parse(
valid_q.response.json, ChangeOperationalIntentReferenceResponse
)
except ValueError as e:
check.record_failed(
summary="Could not parse the response body",
details=f"Failed to parse the response body as a ChangeOperationalIntentReferenceResponse: {e}",
query_timestamps=[valid_q.request.timestamp],
)

parsed_oir = ImplicitDict.parse(
valid_q.response.json, ChangeOperationalIntentReferenceResponse
)
self._current_oir = parsed_oir.operational_intent_reference

def _verify_oir_deletion(self):
Expand Down Expand Up @@ -455,7 +476,7 @@ def _verify_oir_search(self):
) as check:
if no_scope_q.status_code != 401:
check.record_failed(
summary=f"Expected 403, got {no_scope_q.status_code}",
summary=f"Expected 401, got {no_scope_q.status_code}",
query_timestamps=[no_scope_q.request.timestamp],
)

Expand Down Expand Up @@ -493,11 +514,8 @@ def _sanity_check_oir_not_created(
_, sanity_check = self._dss.get_op_intent_reference(self._test_id)
self._scenario.record_query(sanity_check)
except QueryError as qe:
for q in qe.queries:
self._scenario.record_query(q)
if qe.queries[0].response.status_code == 404:
pass # All is good
else:
self._scenario.record_queries(qe.queries)
if qe.queries[0].response.status_code != 404:
check.record_failed(
summary="OIR was created by an unauthorized request.",
details="The Operational Intent Reference should not have been created, as the creation attempt was not authenticated.",
Expand All @@ -523,17 +541,17 @@ def _sanity_check_oir_not_updated(
):
check.record_failed(
summary="OIR was updated by an unauthorized request.",
details="The Operational Intent Reference should not have been updated, as the update attempt was not authenticated.",
details=f"The Operational Intent Reference with id {self._test_id} should not have been updated, as the update attempt was not authenticated.",
query_timestamps=[
creation_q.request.timestamp,
sanity_check.request.timestamp,
],
)
except QueryError as qe:
for q in qe.queries:
self._scenario.record_query(q)
self._scenario.record_queries(qe.queries)
check.record_failed(
summary="Could not fetch OIR to confirm it has not been mutated",
details=f"The Operational Intent Reference with id {self._test_id} could not be fetched to confirm it has not been mutated: {qe}",
query_timestamps=[
creation_q.request.timestamp,
qe.queries[0].request.timestamp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ This test step fragment validates that operational intent references can be crea
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 format conforms to spec check
## [Response Format](./create_format.md)

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)**.
Check response format

## 🛑 Create operational intent reference response content is correct check

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Update operational intent reference response format test step fragment

This test step fragment validates that an operational intent references creation returns a body in the correct format.

## 🛑 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
Expand Up @@ -6,11 +6,9 @@ This test step fragment validates that operational intent references can be upda

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 format conforms to spec check
## [Response Format](./update_format.md)

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)**.
Check response format

## 🛑 Mutate operational intent reference response content is correct check

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Update operational intent reference response format test step fragment

This test step fragment validates that updates to operational intent references return a body in the correct format.

## 🛑 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
Expand Up @@ -65,7 +65,7 @@ def cleanup_sub(
if deleted_sub.status_code != 200:
check.record_failed(
summary=f"Could not delete subscription {sub_id}",
details=f"When attempting to delete subscription {sub_id} from the DSS, received {deleted_sub.status_code} with body {deleted_sub.response.json}",
details=f"When attempting to delete subscription {sub_id} from the DSS, received {deleted_sub.status_code} with body {deleted_sub.error_message}",
query_timestamps=[deleted_sub.request.timestamp],
)

Expand Down
2 changes: 1 addition & 1 deletion monitoring/uss_qualifier/suites/astm/utm/dss_probing.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<th><a href="../../README.md#checked-in">Checked in</a></th>
</tr>
<tr>
<td rowspan="20" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="21" 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/dss/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/authentication/authentication_validation.md">ASTM SCD DSS: Interfaces authentication</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
2 changes: 1 addition & 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="46" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="47" 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/dss/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/authentication/authentication_validation.md">ASTM SCD DSS: Interfaces authentication</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
2 changes: 1 addition & 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="46" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="47" 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/dss/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/authentication/authentication_validation.md">ASTM SCD DSS: Interfaces authentication</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
2 changes: 1 addition & 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="20" style="vertical-align:top;"><a href="../../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="21" 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/dss/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../../scenarios/astm/utm/dss/authentication/authentication_validation.md">ASTM SCD DSS: Interfaces authentication</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
2 changes: 1 addition & 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="46" style="vertical-align:top;"><a href="../../requirements/astm/f3548/v21.md">astm<br>.f3548<br>.v21</a></td>
<td rowspan="47" 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/dss/op_intent_ref_access_control.md">ASTM F3548-21 UTM DSS Operational Intent Reference Access Control</a><br><a href="../../scenarios/astm/utm/dss/authentication/authentication_validation.md">ASTM SCD DSS: Interfaces authentication</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
Loading

0 comments on commit e539259

Please sign in to comment.