Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from monitoring.monitorlib.fetch.rid import ISA, FetchedISA, FetchedISAs
from monitoring.monitorlib.mutate.rid import ChangedISA
from monitoring.monitorlib.rid import RIDVersion
from monitoring.uss_qualifier.common_data_definitions import Severity
from monitoring.uss_qualifier.scenarios.scenario import (
GenericTestScenario,
PendingCheck,
Expand Down Expand Up @@ -43,7 +42,6 @@ def __init__(
def _fail_sub_check(
self, _sub_check: PendingCheck, _summary: str, _details: str, t_dss: datetime
) -> None:
"""Fails with Medium severity the sub_check and with High severity the main check."""

_sub_check.record_failed(
summary=_summary,
Expand All @@ -53,7 +51,6 @@ def _fail_sub_check(

self._main_check.record_failed(
summary=f"ISA request succeeded, but the DSS response is not valid: {_summary}",
severity=Severity.High,
details=_details,
query_timestamps=[t_dss],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from monitoring.monitorlib.mutate.rid import ChangedSubscription
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 @@ -203,8 +202,7 @@ def _check_properly_truncated(
else:
check.record_failed(
"Created record subscription has not been properly truncated to 24 hours",
Severity.Medium,
f"{self._dss.participant_id} DSS instance has returned a non-properly truncated subscription "
details=f"{self._dss.participant_id} DSS instance has returned a non-properly truncated subscription "
f"(duration: {duration}) "
f"when the expectation was either to fail or to truncate at 24 hours.",
query_timestamps=[changed.query.request.timestamp],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
)
from monitoring.monitorlib.rid import RIDVersion
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 @@ -105,8 +104,7 @@ def _wrong_auth_put(self):
if put_wrong_scope.dss_query.success:
check.record_failed(
"Read scope can create ISA",
Severity.High,
f"Attempting to create ISA {self._isa_id} with read scope returned {put_wrong_scope.dss_query.status_code}",
details=f"Attempting to create ISA {self._isa_id} with read scope returned {put_wrong_scope.dss_query.status_code}",
query_timestamps=[
put_wrong_scope.dss_query.query.request.timestamp
],
Expand All @@ -125,8 +123,7 @@ def _wrong_auth_put(self):
if put_no_token.dss_query.success:
check.record_failed(
"Could create an ISA without a token",
Severity.High,
f"Attempting to create ISA {self._isa_id} with no token returned {put_no_token.dss_query.status_code}",
details=f"Attempting to create ISA {self._isa_id} with no token returned {put_no_token.dss_query.status_code}",
query_timestamps=[put_no_token.dss_query.query.request.timestamp],
)

Expand All @@ -143,8 +140,7 @@ def _wrong_auth_put(self):
if put_fake_token.dss_query.success:
check.record_failed(
"Could create an ISA with a fake token",
Severity.High,
f"Attempting to create ISA {self._isa_id} with a fake token returned {put_fake_token.dss_query.status_code}",
details=f"Attempting to create ISA {self._isa_id} with a fake token returned {put_fake_token.dss_query.status_code}",
query_timestamps=[put_fake_token.dss_query.query.request.timestamp],
)

Expand Down Expand Up @@ -175,8 +171,7 @@ def _wrong_auth_get(self):
if get_no_token.success:
check.record_failed(
"Could read an ISA without a token",
Severity.High,
f"Attempting to read ISA {self._isa_id} with no token returned {get_no_token.status_code}",
details=f"Attempting to read ISA {self._isa_id} with no token returned {get_no_token.status_code}",
query_timestamps=[get_no_token.query.request.timestamp],
)

Expand All @@ -188,8 +183,7 @@ def _wrong_auth_get(self):
if get_fake_token.success:
check.record_failed(
"Could read an ISA with a fake token",
Severity.High,
f"Attempting to read ISA {self._isa_id} with a fake token returned {get_fake_token.status_code}",
details=f"Attempting to read ISA {self._isa_id} with a fake token returned {get_fake_token.status_code}",
query_timestamps=[get_fake_token.query.request.timestamp],
)

Expand All @@ -206,8 +200,7 @@ def _wrong_auth_mutate(self):
if mutate_wrong_scope.dss_query.success:
check.record_failed(
"Read scope can mutate an ISA",
Severity.High,
f"Attempting to create ISA {self._isa_id} with read scope returned {mutate_wrong_scope.dss_query.status_code}",
details=f"Attempting to create ISA {self._isa_id} with read scope returned {mutate_wrong_scope.dss_query.status_code}",
query_timestamps=[
mutate_wrong_scope.dss_query.query.request.timestamp
],
Expand All @@ -225,8 +218,7 @@ def _wrong_auth_mutate(self):
if mutate_no_token.dss_query.success:
check.record_failed(
"Could mutate an ISA without a token",
Severity.High,
f"Attempting to create ISA {self._isa_id} with no token returned {mutate_no_token.dss_query.status_code}",
details=f"Attempting to create ISA {self._isa_id} with no token returned {mutate_no_token.dss_query.status_code}",
query_timestamps=[
mutate_no_token.dss_query.query.request.timestamp
],
Expand All @@ -244,8 +236,7 @@ def _wrong_auth_mutate(self):
if mutate_fake_token.dss_query.success:
check.record_failed(
"Could mutate an ISA with a fake token",
Severity.High,
f"Attempting to create ISA {self._isa_id} with a fake token returned {mutate_fake_token.dss_query.status_code}",
details=f"Attempting to create ISA {self._isa_id} with a fake token returned {mutate_fake_token.dss_query.status_code}",
query_timestamps=[
mutate_fake_token.dss_query.query.request.timestamp
],
Expand All @@ -262,8 +253,7 @@ def _wrong_auth_delete(self):
if del_wrong_scope.dss_query.success:
check.record_failed(
"Read scope can delete an ISA",
Severity.High,
f"Attempting to delete ISA {self._isa_id} with read scope returned {del_wrong_scope.dss_query.status_code}",
details=f"Attempting to delete ISA {self._isa_id} with read scope returned {del_wrong_scope.dss_query.status_code}",
query_timestamps=[
del_wrong_scope.dss_query.query.request.timestamp
],
Expand All @@ -284,8 +274,7 @@ def _wrong_auth_delete(self):
if del_no_token.dss_query.success:
check.record_failed(
"Could mutate an ISA without a token",
Severity.High,
f"Attempting to create ISA {self._isa_id} with no token returned {del_no_token.dss_query.status_code}",
details=f"Attempting to create ISA {self._isa_id} with no token returned {del_no_token.dss_query.status_code}",
query_timestamps=[del_no_token.dss_query.query.request.timestamp],
)

Expand All @@ -304,8 +293,7 @@ def _wrong_auth_delete(self):
if del_fake_token.dss_query.success:
check.record_failed(
"Could delete an ISA with a fake token",
Severity.High,
f"Attempting to create ISA {self._isa_id} with a fake token returned {del_fake_token.dss_query.status_code}",
details=f"Attempting to create ISA {self._isa_id} with a fake token returned {del_fake_token.dss_query.status_code}",
query_timestamps=[del_fake_token.dss_query.query.request.timestamp],
)

Expand All @@ -325,8 +313,7 @@ def _wrong_auth_search(self):
if not search_ok.success:
check.record_failed(
"Search request failed although a valid token was used",
Severity.High,
f"Attempting to search ISAs with a valid token returned failure code: {search_ok.query.status_code}",
details=f"Attempting to search ISAs with a valid token returned failure code: {search_ok.query.status_code}",
query_timestamps=[search_ok.query.request.timestamp],
)

Expand All @@ -345,8 +332,7 @@ def _wrong_auth_search(self):
if search_wrong_token.success:
check.record_failed(
"Search endpoint returned successfully without a token",
Severity.High,
f"Attempting to search ISAs with invalid token returned successful query: {search_wrong_token.query.status_code}",
details=f"Attempting to search ISAs with invalid token returned successful query: {search_wrong_token.query.status_code}",
query_timestamps=[search_wrong_token.query.request.timestamp],
)

Expand All @@ -365,8 +351,7 @@ def _wrong_auth_search(self):
if search_no_token.success:
check.record_failed(
"Search endpoint returned successfully without a token",
Severity.High,
f"Attempting to search ISAs with no token returned successful query: {search_no_token.query.status_code}",
details=f"Attempting to search ISAs with no token returned successful query: {search_no_token.query.status_code}",
query_timestamps=[search_no_token.query.request.timestamp],
)

Expand All @@ -379,8 +364,7 @@ def _delete_isa(self):
if not del_isa_ok.dss_query.success:
check.record_failed(
"Could not delete ISA with valid credentials",
Severity.High,
f"Attempting to delete ISA {self._isa_id} returned {del_isa_ok.dss_query.status_code}",
details=f"Attempting to delete ISA {self._isa_id} returned {del_isa_ok.dss_query.status_code}",
query_timestamps=[del_isa_ok.dss_query.query.request.timestamp],
)

Expand All @@ -398,8 +382,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 @@ -420,8 +403,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],
)
self._verify_notifications(deleted.notifications)
Expand All @@ -437,8 +419,7 @@ def _verify_notifications(self, notifications: Dict[str, ISAChangeNotification])
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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from monitoring.monitorlib.infrastructure import UTMClientSession
from monitoring.monitorlib.mutate import rid as mutate
from monitoring.monitorlib.rid import RIDVersion
from monitoring.uss_qualifier.common_data_definitions import Severity
from monitoring.uss_qualifier.scenarios.scenario import GenericTestScenario


Expand Down Expand Up @@ -41,8 +40,7 @@ def delete_isa_if_exists(
if not fetched.success and fetched.status_code != 404:
check.record_failed(
"ISA information could not be retrieved",
Severity.High,
f"{participant_id} DSS instance returned {fetched.status_code} when queried for ISA {isa_id}",
details=f"{participant_id} DSS instance returned {fetched.status_code} when queried for ISA {isa_id}",
query_timestamps=[fetched.query.request.timestamp],
)

Expand All @@ -61,8 +59,7 @@ def delete_isa_if_exists(
if not deleted.dss_query.success:
check.record_failed(
"Could not delete pre-existing ISA",
Severity.High,
f"Attempting to delete ISA {isa_id} from the {participant_id} DSS returned error {deleted.dss_query.status_code}",
details=f"Attempting to delete ISA {isa_id} from the {participant_id} DSS returned error {deleted.dss_query.status_code}",
query_timestamps=[deleted.dss_query.query.request.timestamp],
)

Expand All @@ -82,7 +79,6 @@ def delete_isa_if_exists(
if not notification.success:
check.record_failed(
"Could not notify ISA subscriber",
Severity.Medium,
f"Attempting to notify subscriber for ISA {isa_id} at {subscriber_url} resulted in {notification.status_code}",
details=f"Attempting to notify subscriber for ISA {isa_id} at {subscriber_url} resulted in {notification.status_code}",
query_timestamps=[notification.query.request.timestamp],
)
Loading
Loading