Skip to content

Commit

Permalink
[uss_qualifier/scenarios/netrid/dss/isa_simple] specify check severit…
Browse files Browse the repository at this point in the history
…y in test scenario documentation only (contrib #404)
  • Loading branch information
the-glu committed Jan 14, 2025
1 parent 891455c commit 9a84926
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from monitoring.monitorlib.fetch import rid as fetch
from monitoring.monitorlib.mutate import rid as mutate
from monitoring.prober.infrastructure import register_resource_type
from monitoring.uss_qualifier.common_data_definitions import Severity
from monitoring.uss_qualifier.resources.astm.f3411.dss import DSSInstanceResource
from monitoring.uss_qualifier.resources.interuss.id_generator import IDGeneratorResource
from monitoring.uss_qualifier.resources.netrid.service_area import ServiceAreaResource
Expand Down Expand Up @@ -87,8 +86,7 @@ def _delete_isa_if_exists(self):
if not fetched.success and fetched.status_code != 404:
check.record_failed(
"ISA information could not be retrieved",
Severity.High,
f"{self._dss.participant_id} DSS instance returned {fetched.status_code} when queried for ISA {self._isa_id}",
details=f"{self._dss.participant_id} DSS instance returned {fetched.status_code} when queried for ISA {self._isa_id}",
query_timestamps=[fetched.query.request.timestamp],
)

Expand All @@ -109,8 +107,7 @@ def _delete_isa_if_exists(self):
if not deleted.dss_query.success:
check.record_failed(
"Could not delete pre-existing ISA",
Severity.High,
f"Attempting to delete ISA {self._isa_id} from the {self._dss.participant_id} DSS returned error {deleted.dss_query.status_code}",
details=f"Attempting to delete ISA {self._isa_id} from the {self._dss.participant_id} DSS returned error {deleted.dss_query.status_code}",
query_timestamps=[deleted.dss_query.query.request.timestamp],
)
for subscriber_url, notification in deleted.notifications.items():
Expand All @@ -127,8 +124,7 @@ def _delete_isa_if_exists(self):
if not notification.success:
check.record_failed(
"Could not notify ISA subscriber",
Severity.Medium,
f"Attempting to notify subscriber for ISA {self._isa_id} at {subscriber_url} resulted in {notification.status_code}",
details=f"Attempting to notify subscriber for ISA {self._isa_id} at {subscriber_url} resulted in {notification.status_code}",
query_timestamps=[notification.query.request.timestamp],
)

Expand All @@ -149,8 +145,7 @@ def _get_isa_by_id_step(self):
):
check.record_failed(
"DSS returned ISA with incorrect version",
Severity.High,
f"DSS should have returned an ISA with the version {self._isa_version}, but instead the ISA returned had the version {fetched.isa.version}",
details=f"DSS should have returned an ISA with the version {self._isa_version}, but instead the ISA returned had the version {fetched.isa.version}",
query_timestamps=[fetched.query.request.timestamp],
)

Expand Down Expand Up @@ -230,7 +225,6 @@ def _search_earliest_incl_step():
if self._isa_id not in isas.isas.keys():
check.record_failed(
f"ISAs search did not return expected ISA {self._isa_id}",
severity=Severity.High,
details=f"Search in area {self._isa_area} from time {earliest} returned ISAs {isas.isas.keys()}",
query_timestamps=[isas.dss_query.query.request.timestamp],
)
Expand Down Expand Up @@ -258,7 +252,6 @@ def _search_earliest_excl_step():
if self._isa_id in isas.isas.keys():
check.record_failed(
f"ISAs search returned unexpected ISA {self._isa_id}",
severity=Severity.High,
details=f"Search in area {self._isa_area} from time {earliest} returned ISAs {isas.isas.keys()}",
query_timestamps=[isas.dss_query.query.request.timestamp],
)
Expand Down Expand Up @@ -286,7 +279,6 @@ def _search_latest_incl_step():
if self._isa_id not in isas.isas.keys():
check.record_failed(
f"ISAs search did not return expected ISA {self._isa_id}",
severity=Severity.High,
details=f"Search in area {self._isa_area} to time {latest} returned ISAs {isas.isas.keys()}",
query_timestamps=[isas.dss_query.query.request.timestamp],
)
Expand Down Expand Up @@ -314,7 +306,6 @@ def _search_latest_excl_step():
if self._isa_id in isas.isas.keys():
check.record_failed(
f"ISAs search returned unexpected ISA {self._isa_id}",
severity=Severity.High,
details=f"Search in area {self._isa_area} to time {latest} returned ISAs {isas.isas.keys()}",
query_timestamps=[isas.dss_query.query.request.timestamp],
)
Expand All @@ -340,7 +331,6 @@ def _search_area_only_step():
if self._isa_id not in isas.isas.keys():
check.record_failed(
f"ISAs search did not return expected ISA {self._isa_id}",
severity=Severity.High,
details=f"Search in area {self._isa_area} returned ISAs {isas.isas.keys()}",
query_timestamps=[isas.dss_query.query.request.timestamp],
)
Expand Down Expand Up @@ -483,7 +473,6 @@ def _search_isa_step():
if self._isa_id in isas.isas.keys():
check.record_failed(
f"ISAs search returned deleted ISA {self._isa_id}",
severity=Severity.High,
details=f"Search in area {self._isa_area} returned ISAs {isas.isas.keys()}",
query_timestamps=[isas.dss_query.query.request.timestamp],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ def put_isa(
if mutated_isa.dss_query.query.status_code == 201:
sub_check.record_failed(
summary=f"PUT ISA returned technically-incorrect 201",
severity=Severity.Low,
details="DSS should return 200 from PUT ISA, but instead returned the reasonable-but-technically-incorrect code 201",
query_timestamps=[t_dss],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ part of the test.

This step attempts to query the configured DSS with the ISA provided as a resource.

#### ISA created check
#### 🛑ISA created check

If the ISA cannot be created, the PUT DSS endpoint in **[astm.f3411.v19.DSS0030,a](../../../../../requirements/astm/f3411/v19.md)** is likely not implemented correctly.

### Get ISA by ID test step

This step attempts to retrieve the previously created ISA from the DSS.

#### Successful ISA query check
#### 🛑Successful ISA query check

If the ISA cannot be queried, the GET ISA DSS endpoint in **[interuss.f3411.dss_endpoints.GetISA](../../../../../requirements/interuss/f3411/dss_endpoints.md)** is likely not implemented correctly.

The DSS returns the ID of the ISA in the response body. If this ID does not match the ID in the resource path, **[interuss.f3411.dss_endpoints.GetISA](../../../../../requirements/interuss/f3411/dss_endpoints.md)** was not implemented correctly and this check will fail.

#### ISA version match check
#### 🛑ISA version match check

The DSS returns the version of the ISA in the response body. If this version does not match the version that was returned after creation, and that no modification of the ISA occurred in the meantime, **[interuss.f3411.dss_endpoints.GetISA](../../../../../requirements/interuss/f3411/dss_endpoints.md)** was not implemented correctly and this check will fail.

Expand All @@ -60,105 +60,105 @@ The DSS returns the version of the ISA in the response body. If this version do

This step attempts to update the configured DSS with the ISA provided as a resource, with a slightly different end time.

#### ISA updated check
#### 🛑ISA updated check

If the ISA cannot be updated, the PUT DSS endpoint in **[astm.f3411.v19.DSS0030,a](../../../../../requirements/astm/f3411/v19.md)** is likely not implemented correctly.

### Get ISA by ID test step

This step attempts to retrieve at the DSS the ISA just updated.

#### Successful ISA query check
#### 🛑Successful ISA query check

If the ISA cannot be queried, the GET ISA DSS endpoint in **[interuss.f3411.dss_endpoints.GetISA](../../../../../requirements/interuss/f3411/dss_endpoints.md)** is likely not implemented correctly.

The DSS returns the ID of the ISA in the response body. If this ID does not match the ID in the resource path, **[interuss.f3411.dss_endpoints.GetISA](../../../../../requirements/interuss/f3411/dss_endpoints.md)** was not implemented correctly and this check will fail.

#### ISA version match check
#### 🛑ISA version match check

The DSS returns the version of the ISA in the response body. If this version does not match the version that was returned after update, and that no modification of the ISA occurred in the meantime, **[interuss.f3411.dss_endpoints.GetISA](../../../../../requirements/interuss/f3411/dss_endpoints.md)** was not implemented correctly and this check will fail.

### [Search by earliest time (included) test step](test_steps/search_isas.md)

This step attempts an ISA search at the DSS with the area of the ISA resource and an earliest time that overlaps with the resource ISA.

#### Successful ISAs search check
#### 🛑Successful ISAs search check

The ISA search parameters are valid, as such the search should be successful. If the request is not successful, this check will fail per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

#### ISA returned by search check
#### 🛑ISA returned by search check

The ISA search parameters cover the resource ISA, as such the resource ISA that exists at the DSS should be returned by the search. If it is not returned, this check will fail.

### [Search by earliest time (excluded) test step](test_steps/search_isas.md)

This step attempts an ISA search at the DSS with the area of the ISA resource and an earliest time that does not overlap with the resource ISA.

#### Successful ISAs search check
#### 🛑Successful ISAs search check

The ISA search parameters are valid, as such the search should be successful. If the request is not successful, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

#### ISA not returned by search check
#### 🛑ISA not returned by search check

The ISA search are parameter cover the resource ISA but the earliest time does not, as such the resource ISA that exists at the DSS should not be returned by the search. If it is returned, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

### [Search by latest time (included) test step](test_steps/search_isas.md)

This step attempts an ISA search at the DSS with the area of the ISA resource and a latest time that overlaps with the resource ISA.

#### Successful ISAs search check
#### 🛑Successful ISAs search check

The ISA search parameters are valid, as such the search should be successful. If the request is not successful, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

#### ISA returned by search check
#### 🛑ISA returned by search check

The ISA search parameters cover the resource ISA, as such the resource ISA that exists at the DSS should be returned by the search. If it is not returned, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

### [Search by latest time (excluded) test step](test_steps/search_isas.md)

This step attempts an ISA search at the DSS with the area of the ISA resource and a latest time that does not overlap with the resource ISA.

#### Successful ISAs search check
#### 🛑Successful ISAs search check

The ISA search parameters are valid, as such the search should be successful. If the request is not successful, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

#### ISA not returned by search check
#### 🛑ISA not returned by search check

The ISA search are parameter cover the resource ISA but the latest time does not, as such the resource ISA that exists at the DSS should not be returned by the search. If it is returned, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

### [Search by area only test step](test_steps/search_isas.md)

This step attempts an ISA search at the DSS with only the area of the ISA resource.

#### Successful ISAs search check
#### 🛑Successful ISAs search check

The ISA search parameters are valid, as such the search should be successful. If the request is not successful, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

#### ISA returned by search check
#### 🛑ISA returned by search check

The ISA search parameters cover the resource ISA, as such the resource ISA that exists at the DSS should be returned by the search. If it is not returned, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

### Search with invalid params test step

This step attempts an ISA search at the DSS with an empty search area.

#### Search request rejected check
#### 🛑Search request rejected check

The search request contained invalid parameters (empty search area), as such the DSS should reject it with a 400 HTTP code. If the DSS responds successfully to this request, or if it rejected with an incorrect HTTP code, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

### Search by huge area test step

This step attempts an ISA search at the DSS with a too large search area.

#### Search request rejected check
#### 🛑Search request rejected check

The search request contained invalid parameters (too large search area), as such the DSS should reject it with a 413 HTTP code. If the DSS responds successfully to this request, or if it rejected with an incorrect HTTP code, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

### Search ISA with loop test step

This step attempts an ISA search at the DSS with a polygon defining the area that forms a loop.

#### Search request rejected check
#### 🛑Search request rejected check

The search request contained invalid parameters (area polygon is a loop, which is not allowed), as such the DSS should reject it with a 400 HTTP code. If the DSS responds successfully to this request, or if it rejected with an incorrect HTTP code, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

Expand All @@ -168,58 +168,58 @@ The search request contained invalid parameters (area polygon is a loop, which i

This step attempts an ISA deletion with a wrong version.

#### Delete request rejected check
#### 🛑Delete request rejected check

The deletion request contained invalid parameters (wrong version), as such the DSS should reject it with a 409 HTTP code. If the DSS responds successfully to this request, or if it rejected with an incorrect HTTP code, this check will fail as per **[astm.f3411.v19.DSS0030,b](../../../../../requirements/astm/f3411/v19.md)**.

### Delete with empty version test step

This step attempts an ISA deletion with an empty version.

#### Delete request rejected check
#### 🛑Delete request rejected check

The deletion request contained invalid parameters (empty version), as such the DSS should reject it with a 400 HTTP code. If the DSS responds successfully to this request, or if it rejected with an incorrect HTTP code, this check will fail as per **[astm.f3411.v19.DSS0030,b](../../../../../requirements/astm/f3411/v19.md)**.

### [Delete ISA test step](test_steps/delete_isa.md)

This step attempts an ISA deletion at the DSS.

#### ISA deleted check
#### 🛑ISA deleted check

If the ISA cannot be deleted, the PUT DSS endpoint in **[astm.f3411.v19.DSS0030,b](../../../../../requirements/astm/f3411/v19.md)** is likely not implemented correctly.

### Get deleted ISA by ID test step

This step attempts to retrieve at the DSS the ISA just deleted.

#### ISA not found check
#### 🛑ISA not found check

The ISA fetch request was about a deleted ISA, as such the DSS should reject it with a 404 HTTP code. If the DSS responds successfully to this request, or if it rejected with an incorrect HTTP code, this check will fail as per **[interuss.f3411.dss_endpoints.GetISA](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

### [Search ISA test step](test_steps/search_isas.md)

This step attempts an ISA search at the DSS with only the area of the ISA resource. Since it has just been deleted, the ISA should not be returned.

#### Successful ISAs search check
#### 🛑Successful ISAs search check

The ISA search parameters are valid, as such the search should be successful. If the request is not successful, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

#### ISA not returned by search check
#### 🛑ISA not returned by search check

The ISA search are parameter cover the resource ISA, but it has been previously deleted, as such the ISA should not be returned by the search. If it is returned, this check will fail as per **[interuss.f3411.dss_endpoints.SearchISAs](../../../../../requirements/interuss/f3411/dss_endpoints.md)**.

## Cleanup

The cleanup phase of this test scenario attempts to remove the ISA if the test ended prematurely.

### Successful ISA query check
### 🛑Successful ISA query check

**[interuss.f3411.dss_endpoints.GetISA](../../../../../requirements/interuss/f3411/dss_endpoints.md)** requires the implementation of the DSS endpoint enabling retrieval of information about a specific ISA; if the individual ISA cannot be retrieved and the error isn't a 404, then this requirement isn't met.

### Removed pre-existing ISA check
### 🛑Removed pre-existing ISA check

If an ISA with the intended ID is still present in the DSS, it needs to be removed before exiting the test. If that ISA cannot be deleted, then the **[astm.f3411.v19.DSS0030,b](../../../../../requirements/astm/f3411/v19.md)** requirement to implement the ISA deletion endpoint might not be met.

### Notified subscriber check
### ⚠️Notified subscriber check

When an ISA is deleted, subscribers must be notified. If a subscriber cannot be notified, that subscriber USS did not correctly implement "POST Identification Service Area" in **[astm.f3411.v19.NET0730](../../../../../requirements/astm/f3411/v19.md)**.
Loading

0 comments on commit 9a84926

Please sign in to comment.