diff --git a/monitoring/prober/scd/resources/op_400_version1.json b/monitoring/prober/scd/resources/op_400_version1.json deleted file mode 100644 index d12de6b5be..0000000000 --- a/monitoring/prober/scd/resources/op_400_version1.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "extents": [ - { - "volume": { - "outline_circle": { - "center": { - "lng": -118.456, - "lat": 34.123 - }, - "radius": { - "value": 300.183, - "units": "M" - } - }, - "outline_polygon": { - "vertices": [ - { - "lng": 9.980582850817164, - "lat": 9.98038769564864 - }, - { - "lng": 9.980390688694534, - "lat": 9.980585843863055 - }, - { - "lng": 10.019861937948736, - "lat": 10.02005709311726 - }, - { - "lng": 10.020054117178084, - "lat": 10.01985896200956 - } - ] - }, - "altitude_lower": { - "value": -12.191999609856008, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 18.287999414784014, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "2019-06-30T15:58:00.00Z", - "format": "RFC3339" - }, - "time_end": { - "value": "2030-06-30T16:02:00.00Z", - "format": "RFC3339" - } - } - ], - "old_version": 1, - "key": [], - "state": "Activated", - "uss_base_url": "https://localhost:8080", - "new_subscription": { - "uss_base_url": "https://localhost:8080", - "notify_for_constraints": false - } -} diff --git a/monitoring/prober/scd/resources/op_area_too_large_put.json b/monitoring/prober/scd/resources/op_area_too_large_put.json deleted file mode 100644 index b14f22b198..0000000000 --- a/monitoring/prober/scd/resources/op_area_too_large_put.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "extents": [ - { - "volume": { - "outline_polygon": { - "vertices": [ - { - "lng": 9.980582850817164, - "lat": 9.98038769564864 - }, - { - "lng": 9.980390688694534, - "lat": 9.980585843863055 - }, - { - "lng": 110.019861937948736, - "lat": 10.02005709311726 - }, - { - "lng": 10.020054117178084, - "lat": 10.01985896200956 - }, - { - "lng": 9.980582850817164, - "lat": 9.98038769564864 - } - ] - }, - "altitude_lower": { - "value": -12.191999609856008, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 18.287999414784014, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "2019-06-30T15:58:00.00Z", - "format": "RFC3339" - }, - "time_end": { - "value": "2030-06-30T16:02:00.00Z", - "format": "RFC3339" - } - } - ], - "old_version": 0, - "key": [], - "state": "Ended", - "uss_base_url": "https://localhost:8080", - "new_subscription": { - "uss_base_url": "https://localhost:8080", - "notify_for_constraints": false - } -} diff --git a/monitoring/prober/scd/resources/op_bad_lat_lon_range.json b/monitoring/prober/scd/resources/op_bad_lat_lon_range.json deleted file mode 100644 index b3d1b7a8b0..0000000000 --- a/monitoring/prober/scd/resources/op_bad_lat_lon_range.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "extents": [ - { - "volume": { - "outlinePolygon": { - "vertices": [ - { - "lng": 9.980582850817164, - "lat": 9.98038769564864 - }, - { - "lng": 9.980390688694534, - "lat": 9.980585843863055 - }, - { - "lng": 10.019861937948736, - "lat": 110.02005709311726 - }, - { - "lng": 10.020054117178084, - "lat": 10.01985896200956 - }, - { - "lng": 9.980582850817164, - "lat": 9.98038769564864 - } - ] - }, - "altitudeLower": { - "value": -12.191999609856008, - "reference": "W84", - "units": "M" - }, - "altitudeUpper": { - "value": 18.287999414784014, - "reference": "W84", - "units": "M" - } - }, - "timeStart": { - "value": "2019-06-30T15:58:00.00Z", - "format": "RFC3339" - }, - "timeEnd": { - "value": "2030-06-30T16:02:00.00Z", - "format": "RFC3339" - } - } - ], - "oldVersion": 0, - "key": [], - "state": "Ended", - "ussBaseUrl": "https://localhost:8080", - "new_subscription": { - "uss_base_url": "https://localhost:8080", - "notify_for_constraints": false - } -} diff --git a/monitoring/prober/scd/resources/op_bad_time_format.json b/monitoring/prober/scd/resources/op_bad_time_format.json deleted file mode 100644 index 52cdb3f641..0000000000 --- a/monitoring/prober/scd/resources/op_bad_time_format.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "extents": [ - { - "volume": { - "outlinePolygon": { - "vertices": [ - { - "lng": 9.980582850817164, - "lat": 9.98038769564864 - }, - { - "lng": 9.980390688694534, - "lat": 9.980585843863055 - }, - { - "lng": 10.019861937948736, - "lat": 10.02005709311726 - }, - { - "lng": 10.020054117178084, - "lat": 10.01985896200956 - }, - { - "lng": 9.980582850817164, - "lat": 9.98038769564864 - } - ] - }, - "altitudeLower": { - "value": -12.191999609856008, - "reference": "W84", - "units": "M" - }, - "altitudeUpper": { - "value": 18.287999414784014, - "reference": "W84", - "units": "M" - } - }, - "timeStart": { - "value": "2019-06-30T15:58:00.00Z", - "format": "RFC3339" - }, - "timeEnd": { - "value": "2030-06-30T16:02:00.00Z", - "format": "RFC3330" - } - } - ], - "oldVersion": 0, - "key": [], - "state": "Ended", - "ussBaseUrl": "https://localhost:8080", - "new_subscription": { - "uss_base_url": "https://localhost:8080", - "notify_for_constraints": false - } -} diff --git a/monitoring/prober/scd/resources/op_bad_volume.json b/monitoring/prober/scd/resources/op_bad_volume.json deleted file mode 100644 index 45ba33435d..0000000000 --- a/monitoring/prober/scd/resources/op_bad_volume.json +++ /dev/null @@ -1,231 +0,0 @@ -{ - "extents": [ - { - "volume": { - "outline_circle": { - "center": { - "lng": -117.1035655786647, - "lat": 32.59415886402617 - }, - "radius": { - "value": 300.183, - "units": "M" - } - }, - "outline_polygon": { - "vertices": [ - { - "lng": -117.1035655786647, - "lat": 32.59415886402617 - }, - { - "lng": -117.1038398819344, - "lat": 32.59415886402617 - }, - { - "lng": -117.1038398819344, - "lat": 32.64920727813973 - }, - { - "lng": -117.1035655786647, - "lat": 32.64920727813973 - } - ] - }, - "altitude_lower": { - "value": -7.827263749527558, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 114.09273234903256, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "2020-06-09T16:58:00.00Z", - "format": "RFC3339" - }, - "time_end": { - "value": "2020-06-10T17:02:00.00Z", - "format": "RFC3339" - } - }, - { - "volume": { - "outline_polygon": { - "vertices": [ - { - "lng": -117.07235209637365, - "lat": 32.629403155814224 - }, - { - "lng": -117.07227677467183, - "lat": 32.62913940035541 - }, - { - "lng": -117.15071909262814, - "lat": 32.61019036953776 - }, - { - "lng": -117.15079458449262, - "lat": 32.61045408389095 - } - ] - }, - "altitude_lower": { - "value": 98.85273283671255, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 114.09273234903256, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "1969-12-31T15:58:00.00Z", - "format": "RFC3339" - }, - "time_end": { - "value": "1969-12-31T16:02:00.00Z", - "format": "RFC3339" - } - }, - { - "volume": { - "outline_polygon": { - "vertices": [ - { - "lng": -117.09038826289287, - "lat": 32.63060966167485 - }, - { - "lng": -117.09026347832622, - "lat": 32.630365389882776 - }, - { - "lng": -117.15717622635013, - "lat": 32.60141106631151 - }, - { - "lng": -117.15730113575759, - "lat": 32.601655284082824 - } - ] - }, - "altitude_lower": { - "value": 98.85273283671255, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 114.09273234903256, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "2020-06-09T16:58:00.00Z", - "format": "RFC3339" - }, - "time_end": { - "value": "2020-06-09T17:02:00.00Z", - "format": "RFC3339" - } - }, - { - "volume": { - "outline_polygon": { - "vertices": [ - { - "lng": -117.1102585196023, - "lat": 32.63712150700819 - }, - { - "lng": -117.11003035210928, - "lat": 32.636969253183054 - }, - { - "lng": -117.15104910529122, - "lat": 32.58489223521358 - }, - { - "lng": -117.15127729146461, - "lat": 32.5850444653223 - } - ] - }, - "altitude_lower": { - "value": -7.827263749527558, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 114.09273234903256, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "2020-06-11T16:58:00.00Z", - "format": "RFC3339" - }, - "time_end": { - "value": "2020-06-12T17:02:00.00Z", - "format": "RFC3339" - } - }, - { - "volume": { - "outline_polygon": { - "vertices": [ - { - "lng": -117.13297510795468, - "lat": 32.58037888894311 - }, - { - "lng": -117.13324941122436, - "lat": 32.58037888894311 - }, - { - "lng": -117.13324941122436, - "lat": 32.635427303056666 - }, - { - "lng": -117.13297510795468, - "lat": 32.635427303056666 - } - ] - }, - "altitude_lower": { - "value": -20.01926335938357, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 7.412735762792458, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "2020-06-12T16:58:00.00Z", - "format": "RFC3339" - }, - "time_end": { - "value": "2030-06-13T17:02:00.00Z", - "format": "RFC3339" - } - } - ], - "key": [], - "state": "Accepted", - "uss_base_url": "https://localhost:8080", - "new_subscription": { - "uss_base_url": "https://localhost:8080", - "notify_for_constraints": true - } -} diff --git a/monitoring/prober/scd/resources/op_end_time_past.json b/monitoring/prober/scd/resources/op_end_time_past.json deleted file mode 100644 index c9dfff7df7..0000000000 --- a/monitoring/prober/scd/resources/op_end_time_past.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "extents": [ - { - "volume": { - "outlinePolygon": { - "vertices": [ - { - "lng": 9.980582850817164, - "lat": 9.98038769564864 - }, - { - "lng": 9.980390688694534, - "lat": 9.980585843863055 - }, - { - "lng": 10.019861937948736, - "lat": 10.02005709311726 - }, - { - "lng": 10.020054117178084, - "lat": 10.01985896200956 - }, - { - "lng": 9.980582850817164, - "lat": 9.98038769564864 - } - ] - }, - "altitudeLower": { - "value": -12.191999609856008, - "reference": "W84", - "units": "M" - }, - "altitudeUpper": { - "value": 18.287999414784014, - "reference": "W84", - "units": "M" - } - }, - "timeStart": { - "value": "2020-06-30T15:58:00.00Z", - "format": "RFC3339" - }, - "timeEnd": { - "value": "2019-06-30T16:02:00.00Z", - "format": "RFC3339" - } - } - ], - "oldVersion": 0, - "key": [], - "state": "Accepted", - "ussBaseUrl": "https://localhost:8080", - "new_subscription": { - "uss_base_url": "https://localhost:8080", - "notify_for_constraints": false - } -} diff --git a/monitoring/prober/scd/resources/op_uss_base_url_non_tls.json b/monitoring/prober/scd/resources/op_uss_base_url_non_tls.json deleted file mode 100644 index 2faf5aec6b..0000000000 --- a/monitoring/prober/scd/resources/op_uss_base_url_non_tls.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "extents": [ - { - "volume": { - "outlinePolygon": { - "vertices": [ - { - "lng": 9.980582850817164, - "lat": 9.98038769564864 - }, - { - "lng": 9.980390688694534, - "lat": 9.980585843863055 - }, - { - "lng": 10.019861937948736, - "lat": 10.02005709311726 - }, - { - "lng": 10.020054117178084, - "lat": 10.01985896200956 - }, - { - "lng": 9.980582850817164, - "lat": 9.98038769564864 - } - ] - }, - "altitudeLower": { - "value": -12.191999609856008, - "reference": "W84", - "units": "M" - }, - "altitudeUpper": { - "value": 18.287999414784014, - "reference": "W84", - "units": "M" - } - }, - "timeStart": { - "value": "2020-06-30T15:58:00.00Z", - "format": "RFC3339" - }, - "timeEnd": { - "value": "2030-06-30T16:02:00.00Z", - "format": "RFC3339" - } - } - ], - "oldVersion": 0, - "key": [], - "state": "Accepted", - "uss_base_url": "http://localhost:8080", - "new_subscription": { - "uss_base_url": "https://localhost:8080", - "notify_for_constraints": false - } -} diff --git a/monitoring/prober/scd/test_operation_references_error_cases.py b/monitoring/prober/scd/test_operation_references_error_cases.py index 8b6dbaeae7..3ae2efabfd 100644 --- a/monitoring/prober/scd/test_operation_references_error_cases.py +++ b/monitoring/prober/scd/test_operation_references_error_cases.py @@ -64,15 +64,6 @@ def test_op_ref_incorrect_altitude_ref(scd_api, scd_session): assert resp.status_code == 400, resp.content -@for_api_versions(scd.API_0_3_17) -@default_scope(SCOPE_SC) -def test_op_uss_base_url_non_tls(ids, scd_api, scd_session): - with open("./scd/resources/op_uss_base_url_non_tls.json") as f: - req = json.load(f) - resp = scd_session.put(f"/operational_intent_references/{ids(OP_TYPE)}", json=req) - assert resp.status_code == 400, resp.content - - @for_api_versions(scd.API_0_3_17) @default_scope(SCOPE_SC) def test_op_bad_subscription_id(ids, scd_api, scd_session): @@ -101,15 +92,6 @@ def test_op_new_and_existing_subscription(ids, scd_api, scd_session): assert resp.status_code == 400, resp.content -@for_api_versions(scd.API_0_3_17) -@default_scope(SCOPE_SC) -def test_op_end_time_past(ids, scd_api, scd_session): - with open("./scd/resources/op_end_time_past.json") as f: - req = json.load(f) - resp = scd_session.put(f"/operational_intent_references/{ids(OP_TYPE)}", json=req) - assert resp.status_code == 400, resp.content - - @for_api_versions(scd.API_0_3_17) @default_scope(SCOPE_SC) def test_op_already_exists(ids, scd_api, scd_session): @@ -131,51 +113,6 @@ def test_op_already_exists(ids, scd_api, scd_session): assert resp.status_code == 404, resp.content -@for_api_versions(scd.API_0_3_17) -@default_scope(SCOPE_SC) -def test_op_400_version1(ids, scd_api, scd_session): - with open("./scd/resources/op_400_version1.json") as f: - req = json.load(f) - resp = scd_session.put(f"/operational_intent_references/{ids(OP_TYPE)}", json=req) - assert resp.status_code == 400, resp.content - - -@for_api_versions(scd.API_0_3_17) -@default_scope(SCOPE_SC) -def test_op_bad_lat_lon_range(ids, scd_api, scd_session): - with open("./scd/resources/op_bad_lat_lon_range.json") as f: - req = json.load(f) - resp = scd_session.put(f"/operational_intent_references/{ids(OP_TYPE)}", json=req) - assert resp.status_code == 400, resp.content - - -@for_api_versions(scd.API_0_3_17) -@default_scope(SCOPE_SC) -def test_op_area_too_large_put(ids, scd_api, scd_session): - with open("./scd/resources/op_area_too_large_put.json") as f: - req = json.load(f) - resp = scd_session.put(f"/operational_intent_references/{ids(OP_TYPE)}", json=req) - assert resp.status_code == 400, resp.content - - -@for_api_versions(scd.API_0_3_17) -@default_scope(SCOPE_SC) -def test_op_bad_time_format(ids, scd_api, scd_session): - with open("./scd/resources/op_bad_time_format.json") as f: - req = json.load(f) - resp = scd_session.put(f"/operational_intent_references/{ids(OP_TYPE)}", json=req) - assert resp.status_code == 400, resp.content - - -@for_api_versions(scd.API_0_3_17) -@default_scope(SCOPE_SC) -def test_op_bad_volume(ids, scd_api, scd_session): - with open("./scd/resources/op_bad_volume.json") as f: - req = json.load(f) - resp = scd_session.put(f"/operational_intent_references/{ids(OP_TYPE)}", json=req) - assert resp.status_code == 400, resp.content - - @for_api_versions(scd.API_0_3_17) @default_scope(SCOPE_SC) def test_op_repeated_requests(ids, scd_api, scd_session): @@ -200,15 +137,6 @@ def test_op_repeated_requests(ids, scd_api, scd_session): assert resp.status_code == 200, resp.content -@for_api_versions(scd.API_0_3_17) -@default_scope(SCOPE_SC) -def test_op_invalid_id(scd_api, scd_session): - with open("./scd/resources/op_request_1.json") as f: - req = json.load(f) - resp = scd_session.put("/operational_intent_references/not_uuid_format", json=req) - assert resp.status_code == 400, resp.content - - @for_api_versions(scd.API_0_3_17) @default_scope(SCOPE_SC) def test_missing_conflicted_operation(ids, scd_api, scd_session): diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/op_intent_ref_validation.md b/monitoring/uss_qualifier/scenarios/astm/utm/dss/op_intent_ref_validation.md index 3134a40be6..bd03e81816 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/dss/op_intent_ref_validation.md +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/op_intent_ref_validation.md @@ -22,12 +22,31 @@ Ensures that a DSS properly validates the parameters of requests related to oper [`PlanningAreaResource`](../../../../resources/planning_area.py) describes the 3D volume in which operational intent references will be created. +### problematically_big_area + +[`VolumeResource`](../../../../resources/volume.py) describing an area too big to be accepted by the DSS. + ## Setup test case ### [Cleanup OIRs test step](./clean_workspace_op_intents.md) ## Creation validation test case +### Attempt creation with invalid parameters test step + +This step attempts to create operational intent references with invalid parameters. + +#### ⚠️ Invalid ID is rejected check + +If the DSS does not reject with a 400 the creation of an operational intent reference with an ID that is not a valid UUID, +it is in violation of the OpenAPI specification referenced by **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**. + +#### 🛑 Operational intent reference removed check + +If an operational intent reference was wrongly created by one of the previous attempts, it is removed. +If it cannot be deleted when providing the proper ID and OVN, the DSS implementation is in violation of +**[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**. + ### Attempt creation with invalid extents test step This step attempts to create operational intent references with invalid extents. @@ -57,6 +76,27 @@ it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm If the DSS does not reject with a 400 the creation of an operational intent reference for which the extents start after they end, it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**. +#### ⚠️ Extents with invalid time format are rejected check + +If the DSS does not reject with a 400 the creation of an operational intent reference for which the extents use a time format other than `RFC3339`, +it is in violation of the OpenAPI specification referenced by **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**. + +#### ⚠️ Extents with invalid coordinates are rejected check + +If the DSS does not reject with a 400 the creation of an operational intent reference for which the extents contain a vertex with a latitude outside of the valid range, +it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**. + +#### ⚠️ Extents with a too large area are rejected check + +If the DSS does not reject with a 400 or a 413 the creation of an operational intent reference for which the extents cover an area too large, +it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**. + +#### ⚠️ Extents with both circle and polygon outlines are rejected check + +If the DSS does not reject with a 400 the creation of an operational intent reference for which the extents define both a circle and a polygon outline, +it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm/f3548/v21.md)**. + + #### 🛑 Operational intent reference removed check If an operational intent reference was wrongly created by one of the previous attempts, it is removed. diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/op_intent_ref_validation.py b/monitoring/uss_qualifier/scenarios/astm/utm/dss/op_intent_ref_validation.py index 03ac614c32..8295046c45 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/dss/op_intent_ref_validation.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/op_intent_ref_validation.py @@ -1,4 +1,5 @@ import json +from copy import deepcopy from datetime import datetime, timedelta from typing import Any @@ -12,6 +13,7 @@ from uas_standards.astm.f3548.v21.constants import Scope from monitoring.monitorlib.fetch import QueryType, query_and_describe +from monitoring.monitorlib.geo import Circle, Polygon from monitoring.monitorlib.ids import register_resource_type from monitoring.uss_qualifier.resources import PlanningAreaResource from monitoring.uss_qualifier.resources.astm.f3548.v21.dss import ( @@ -20,6 +22,7 @@ ) from monitoring.uss_qualifier.resources.communications import ClientIdentityResource from monitoring.uss_qualifier.resources.interuss.id_generator import IDGeneratorResource +from monitoring.uss_qualifier.resources.volume import VolumeResource from monitoring.uss_qualifier.scenarios.astm.utm.dss import test_step_fragments from monitoring.uss_qualifier.scenarios.scenario import TestScenario from monitoring.uss_qualifier.suites.suite import ExecutionContext @@ -37,6 +40,7 @@ def __init__( id_generator: IDGeneratorResource, client_identity: ClientIdentityResource, planning_area: PlanningAreaResource, + problematically_big_area: VolumeResource, ): super().__init__() self._dss = dss.get_instance( @@ -48,6 +52,7 @@ def __init__( self._oir_id = id_generator.id_factory.make_id(self.OIR_TYPE) self._expected_manager = client_identity.subject() self._planning_area = planning_area + self._problematically_big_area = problematically_big_area def run(self, context: ExecutionContext): self.begin_test_scenario(context) @@ -59,6 +64,9 @@ def run(self, context: ExecutionContext): self.end_test_case() self.begin_test_case("Creation validation") + self.begin_test_step("Attempt creation with invalid parameters") + self._attempt_creation_with_invalid_parameters() + self.end_test_step() self.begin_test_step("Attempt creation with invalid extents") self._attempt_creation_with_invalid_extents() self.end_test_step() @@ -80,12 +88,18 @@ def _valid_params( ) return json.loads(json.dumps(params)) - def _attempt_invalid_creation(self, check_name: str, params: dict[str, Any]): + def _attempt_invalid_creation( + self, + check_name: str, + params: dict[str, Any], + oir_id: str | None = None, + expected_codes: tuple[int, ...] = (400,), + ): op = OPERATIONS[OperationID.CreateOperationalIntentReference] q = query_and_describe( self._dss.client, op.verb, - op.path.format(entityid=self._oir_id), + op.path.format(entityid=oir_id or self._oir_id), QueryType.F3548v21DSSCreateOperationalIntentReference, self._dss.participant_id, scope=Scope.StrategicCoordination, @@ -93,9 +107,9 @@ def _attempt_invalid_creation(self, check_name: str, params: dict[str, Any]): ) self.record_query(q) with self.check(check_name, self._pid) as check: - if q.status_code != 400: + if q.status_code not in expected_codes: check.record_failed( - summary=f"Expected 400, got {q.status_code}", + summary=f"Expected {' or '.join(str(c) for c in expected_codes)}, got {q.status_code}", query_timestamps=[q.request.timestamp], ) if q.status_code == 201: @@ -105,6 +119,11 @@ def _attempt_invalid_creation(self, check_name: str, params: dict[str, Any]): if oir.ovn: test_step_fragments.remove_op_intent(self, self._dss, oir.id, oir.ovn) + def _attempt_creation_with_invalid_parameters(self): + self._attempt_invalid_creation( + "Invalid ID is rejected", self._valid_params(), oir_id="not_uuid_format" + ) + def _attempt_creation_with_invalid_extents(self): params = self._valid_params() params["extents"] = params["extents"][0] @@ -139,6 +158,48 @@ def _attempt_creation_with_invalid_extents(self): "Extents starting after they end are rejected", params ) + params = self._valid_params() + params["extents"][0]["time_end"]["format"] = "RFC3330" + self._attempt_invalid_creation( + "Extents with invalid time format are rejected", params + ) + + planning_area_polygon = Polygon.from_latlng_coords( + self._planning_area.resolved_volume4d_with_times( + None, None + ).volume.s2_vertices() + ) + + params = self._valid_params() + polygon = deepcopy(planning_area_polygon) + polygon.vertices[0].lat = 110 + params["extents"][0]["volume"].pop("outline_circle", None) + params["extents"][0]["volume"]["outline_polygon"] = polygon + self._attempt_invalid_creation( + "Extents with invalid coordinates are rejected", params + ) + + params = self._valid_params() + params["extents"][0]["volume"].pop("outline_circle", None) + params["extents"][0]["volume"]["outline_polygon"] = Polygon( + vertices=self._problematically_big_area.specification.vertices() + ) + self._attempt_invalid_creation( + "Extents with a too large area are rejected", + params, + expected_codes=(400, 413), + ) + + params = self._valid_params() + vertex = planning_area_polygon.vertices[0] + params["extents"][0]["volume"]["outline_polygon"] = planning_area_polygon + params["extents"][0]["volume"]["outline_circle"] = Circle.from_meters( + vertex.lat, vertex.lng, 300 + ) + self._attempt_invalid_creation( + "Extents with both circle and polygon outlines are rejected", params + ) + def _clean_all_oirs(self): vol = self._planning_area.resolved_volume4d_with_times(None, None) test_step_fragments.cleanup_active_oirs( diff --git a/monitoring/uss_qualifier/suites/astm/utm/dss_probing.yaml b/monitoring/uss_qualifier/suites/astm/utm/dss_probing.yaml index d1cd862a4c..84e86b31be 100644 --- a/monitoring/uss_qualifier/suites/astm/utm/dss_probing.yaml +++ b/monitoring/uss_qualifier/suites/astm/utm/dss_probing.yaml @@ -38,6 +38,7 @@ actions: id_generator: id_generator client_identity: utm_client_identity planning_area: planning_area + problematically_big_area: problematically_big_area - test_scenario: scenario_type: scenarios.astm.utm.dss.CRSimple resources: