diff --git a/monitoring/uss_qualifier/configurations/dev/f3548_self_contained.yaml b/monitoring/uss_qualifier/configurations/dev/f3548_self_contained.yaml index 3501b3ab48..7776f466b3 100644 --- a/monitoring/uss_qualifier/configurations/dev/f3548_self_contained.yaml +++ b/monitoring/uss_qualifier/configurations/dev/f3548_self_contained.yaml @@ -52,21 +52,24 @@ v1: resource_type: resources.flight_planning.FlightIntentsResource specification: planning_time: '0:05:00' - file_source: file://./test_data/che/flight_intents/conflicting_flights.json + file: + path: file://./test_data/che/flight_intents/conflicting_flights.json # Details of priority-preemption flights (used in nominal planning priority scenario) priority_preemption_flights: resource_type: resources.flight_planning.FlightIntentsResource specification: planning_time: '0:05:00' - file_source: test_data.che.flight_intents.priority_preemption + file: + path: test_data.che.flight_intents.priority_preemption # Details of flights with invalid operational intents (used in flight intent validation scenario) invalid_flight_intents: resource_type: resources.flight_planning.FlightIntentsResource specification: planning_time: '0:05:00' - file_source: test_data.che.flight_intents.invalid_flight_intents + file: + path: test_data.che.flight_intents.invalid_flight_intents # Location of DSS instance that can be used to verify flight planning outcomes dss: diff --git a/monitoring/uss_qualifier/configurations/dev/faa/uft/f3548.yaml b/monitoring/uss_qualifier/configurations/dev/faa/uft/f3548.yaml deleted file mode 100644 index 9a55cab656..0000000000 --- a/monitoring/uss_qualifier/configurations/dev/faa/uft/f3548.yaml +++ /dev/null @@ -1,17 +0,0 @@ -v1: - test_run: - resources: - resource_declarations: - "$ref": ../../resources.yaml#/f3548_kentland - action: - test_suite: - suite_type: suites.astm.utm.f3548_21 - resources: - flight_planners: flight_planners - conflicting_flights: conflicting_flights - priority_preemption_flights: priority_preemption_flights - dss: dss - artifacts: - tested_roles: - report_path: output/tested_roles_f3548 - "$ref": ../../artifacts.yaml#/relative diff --git a/monitoring/uss_qualifier/configurations/dev/faa/uft/local_message_signing.yaml b/monitoring/uss_qualifier/configurations/dev/faa/uft/local_message_signing.yaml index 84510a893a..7eaf59a31d 100644 --- a/monitoring/uss_qualifier/configurations/dev/faa/uft/local_message_signing.yaml +++ b/monitoring/uss_qualifier/configurations/dev/faa/uft/local_message_signing.yaml @@ -2,7 +2,7 @@ v1: test_run: resources: resource_declarations: - "$ref": ../../resources.yaml#/common + "$ref": ../../library/resources.yaml#/common flight_planners: resource_type: resources.flight_planning.FlightPlannersResource dependencies: @@ -26,12 +26,14 @@ v1: resource_type: resources.flight_planning.FlightIntentsResource specification: planning_time: '0:05:00' - file_source: file://./test_data/che/flight_intents/conflicting_flights.json + file: + path: file://./test_data/che/flight_intents/conflicting_flights.json priority_preemption_flights: resource_type: resources.flight_planning.FlightIntentsResource specification: planning_time: '0:05:00' - file_source: test_data.che.flight_intents.priority_preemption + file: + path: test_data.che.flight_intents.priority_preemption dss: resource_type: resources.astm.f3548.v21.DSSInstanceResource dependencies: @@ -61,5 +63,3 @@ v1: artifacts: report: report_path: output/report.json - graph: - gv_path: output/report.gv diff --git a/monitoring/uss_qualifier/configurations/dev/faa/uft/uft.yaml b/monitoring/uss_qualifier/configurations/dev/faa/uft/uft.yaml deleted file mode 100644 index 3fd2584212..0000000000 --- a/monitoring/uss_qualifier/configurations/dev/faa/uft/uft.yaml +++ /dev/null @@ -1,133 +0,0 @@ -v1: - test_run: - resources: - resource_declarations: - # ===== Common resources ===== - utm_auth: - resource_type: resources.communications.AuthAdapterResource - specification: - environment_variable_containing_auth_spec: AUTH_SPEC - - # ===== F3548 resources ===== - flight_planners: - resource_type: resources.flight_planning.FlightPlannersResource - dependencies: - auth_adapter: utm_auth - specification: - flight_planners: - # uss1 is the mock_uss directly exposing scdsc functionality - - participant_id: uss8074 - injection_base_url: http://host.docker.internal:8074/scdsc - # uss2 uses atproxy, with requests being fulfilled by mock_uss with atproxy_client functionality enabled - - participant_id: uss8075 - injection_base_url: http://host.docker.internal:8075/scd - scd_dss: - resource_type: resources.astm.f3548.v21.DSSInstanceResource - dependencies: - auth_adapter: utm_auth - specification: - participant_id: uss8082 - base_url: http://host.docker.internal:8082 - conflicting_flights: - resource_type: resources.flight_planning.FlightIntentsResource - specification: - planning_time: '0:05:00' - file_source: file://./test_data/usa/kentland/flight_intents/conflicting_flights.yaml - priority_preemption_flights: - resource_type: resources.flight_planning.FlightIntentsResource - specification: - planning_time: '0:05:00' - file_source: test_data.usa.kentland.flight_intents.priority_preemption - - # ===== NetRID resources ===== - flights_data: - resource_type: resources.netrid.FlightDataResource - specification: - kml_source: - kml_location: file://./test_data/usa/kentland/rid.kml - service_providers: - resource_type: resources.netrid.NetRIDServiceProviders - dependencies: - auth_adapter: utm_auth - specification: - service_providers: - - participant_id: uss8071 - injection_base_url: http://host.docker.internal:8071/ridsp/injection - observers: - resource_type: resources.netrid.NetRIDObserversResource - dependencies: - auth_adapter: utm_auth - specification: - observers: - - participant_id: uss8073 - observation_base_url: http://host.docker.internal:8073/riddp/observation - evaluation_configuration: - resource_type: resources.netrid.EvaluationConfigurationResource - specification: { } - rid_dss_pool: - resource_type: resources.astm.f3411.DSSInstancesResource - dependencies: - auth_adapter: utm_auth - specification: - dss_instances: - - participant_id: uss8082 - rid_version: F3411-19 - base_url: http://host.docker.internal:8082 - has_private_address: true - - action: - test_suite: - resources: # Resources provided to suite from resource pool (UFT suite resource name: pool resource name) - # SCD - flight_planners: flight_planners - conflicting_flights: conflicting_flights - priority_preemption_flights: priority_preemption_flights - scd_dss: scd_dss - - # NetRID - flights_data: flights_data - service_providers: service_providers - observers: observers - evaluation_configuration: evaluation_configuration - rid_dss_pool: rid_dss_pool - - suite_definition: # In-configuration definition of what tests to run - name: UFT automated test suite - resources: # Resources needed by suite - # SCD - flight_planners: resources.flight_planning.FlightPlannersResource - scd_dss: resources.astm.f3548.v21.DSSInstanceResource - conflicting_flights: resources.flight_planning.FlightIntentsResource - priority_preemption_flights: resources.flight_planning.FlightIntentsResource - nominal_planning_selector: resources.flight_planning.FlightPlannerCombinationSelectorResource? - priority_planning_selector: resources.flight_planning.FlightPlannerCombinationSelectorResource? - - # NetRID - flights_data: resources.netrid.FlightDataResource - service_providers: resources.netrid.NetRIDServiceProviders - observers: resources.netrid.NetRIDObserversResource - evaluation_configuration: resources.netrid.EvaluationConfigurationResource - rid_dss_pool: resources.astm.f3411.DSSInstancesResource? - actions: - - test_suite: - suite_type: suites.astm.utm.f3548_21 - resources: # Resources needed by F3548-21 suite (F3548 suite resource name: UFT suite resource name) - conflicting_flights: conflicting_flights - priority_preemption_flights: priority_preemption_flights - flight_planners: flight_planners - dss: scd_dss - on_failure: Continue - - test_scenario: - scenario_type: scenarios.astm.netrid.NominalBehavior - resources: # Resources needed by RID Nominal Behavior scenario (RID scenario resource name: UFT suite resource name) - flights_data: flights_data - service_providers: service_providers - observers: observers - evaluation_configuration: evaluation_configuration - dss_pool: rid_dss_pool - on_failure: Continue - - artifacts: - tested_roles: - report_path: output/tested_roles_uft - "$ref": ../../artifacts.yaml#/relative diff --git a/monitoring/uss_qualifier/configurations/dev/library/resources.yaml b/monitoring/uss_qualifier/configurations/dev/library/resources.yaml index 641325b1d3..d6ea2a32e6 100644 --- a/monitoring/uss_qualifier/configurations/dev/library/resources.yaml +++ b/monitoring/uss_qualifier/configurations/dev/library/resources.yaml @@ -62,8 +62,6 @@ net_rid: - lat: -23 lng: 132 - - net_rid_sims: adjacent_circular_flights_data: $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json @@ -80,7 +78,8 @@ net_rid_sims: resource_type: resources.netrid.FlightDataResource specification: kml_source: - kml_location: file://./test_data/usa/netrid/dcdemo.kml + kml_file: + path: file://./test_data/usa/netrid/dcdemo.kml kml_storage_config: $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json resource_type: resources.netrid.FlightDataStorageResource @@ -91,7 +90,8 @@ net_rid_sims: resource_type: resources.netrid.FlightDataResource specification: kml_source: - kml_location: file://./test_data/usa/kentland/rid.kml + kml_file: + path: file://./test_data/usa/kentland/rid.kml flight_auth: $ref: '#/f3548_che' @@ -100,7 +100,8 @@ flight_auth: resource_type: resources.flight_planning.FlightIntentsResource specification: planning_time: '0:05:00' - file_source: file://./test_data/che/flight_intents/invalid_flight_auths.json + file: + path: file://./test_data/che/flight_intents/invalid_flight_auths.json che_flight_intents: conflicting_flights: @@ -108,19 +109,24 @@ che_flight_intents: resource_type: resources.flight_planning.FlightIntentsResource specification: planning_time: '0:05:00' - file_source: file://./test_data/che/flight_intents/conflicting_flights.json + file: + path: file://./test_data/che/flight_intents/conflicting_flights.json priority_preemption_flights: $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json resource_type: resources.flight_planning.FlightIntentsResource specification: planning_time: '0:05:00' - file_source: test_data.che.flight_intents.priority_preemption + file: + path: test_data.che.flight_intents.priority_preemption + # Note that this hash_sha512 field can be safely deleted if the content changes + hash_sha512: 432ea57009b6a41b3af43cb9431a0627a487eac0a04511fbccd85d9fcac193b11976ad2dbc07d9efa41ceaf7a9338b39064ede6eeb5755be3966d2e17e7d555a invalid_flight_intents: - $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json - resource_type: resources.flight_planning.FlightIntentsResource - specification: - planning_time: '0:05:00' - file_source: test_data.che.flight_intents.invalid_flight_intents + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.flight_planning.FlightIntentsResource + specification: + planning_time: '0:05:00' + file: + path: test_data.che.flight_intents.invalid_flight_intents kentland_flight_intents: conflicting_flights: @@ -128,19 +134,22 @@ kentland_flight_intents: resource_type: resources.flight_planning.FlightIntentsResource specification: planning_time: '0:05:00' - file_source: file://./test_data/usa/kentland/flight_intents/conflicting_flights.yaml + file: + path: file://./test_data/usa/kentland/flight_intents/conflicting_flights.yaml priority_preemption_flights: $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json resource_type: resources.flight_planning.FlightIntentsResource specification: planning_time: '0:05:00' - file_source: test_data.usa.kentland.flight_intents.priority_preemption + file: + path: test_data.usa.kentland.flight_intents.priority_preemption invalid_flight_intents: $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json resource_type: resources.flight_planning.FlightIntentsResource specification: planning_time: '0:05:00' - file_source: test_data.usa.kentland.flight_intents.invalid_flight_intents + file: + path: test_data.usa.kentland.flight_intents.invalid_flight_intents f3548_che: allOf: diff --git a/monitoring/uss_qualifier/configurations/dev/non_docker/environment.yaml b/monitoring/uss_qualifier/configurations/dev/non_docker/environment.yaml new file mode 100644 index 0000000000..ed8667e072 --- /dev/null +++ b/monitoring/uss_qualifier/configurations/dev/non_docker/environment.yaml @@ -0,0 +1,179 @@ +# The resources in this file describe the system/environment under test and should not change the test being run. + +non_baseline_inputs: + $ref: '../library/environment.yaml#/non_baseline_inputs' + +common: + $ref: '../library/environment.yaml#/common' + +net_rid: + netrid_service_providers_v19: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.netrid.NetRIDServiceProviders + dependencies: + auth_adapter: utm_auth + specification: + service_providers: + - participant_id: uss2 + injection_base_url: http://localhost:8071/ridsp/injection + local_debug: true + netrid_service_providers_v22a: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.netrid.NetRIDServiceProviders + dependencies: + auth_adapter: utm_auth + specification: + service_providers: + - participant_id: uss1 + injection_base_url: http://localhost:8081/ridsp/injection + local_debug: true + netrid_observers_v19: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.netrid.NetRIDObserversResource + dependencies: + auth_adapter: utm_auth + specification: + observers: + - participant_id: uss3 + observation_base_url: http://localhost:8073/riddp/observation + local_debug: true + netrid_observers_v22a: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.netrid.NetRIDObserversResource + dependencies: + auth_adapter: utm_auth + specification: + observers: + - participant_id: uss1 + observation_base_url: http://localhost:8083/riddp/observation + local_debug: true + netrid_dss_instances_v19: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.astm.f3411.DSSInstancesResource + dependencies: + auth_adapter: utm_auth + specification: + dss_instances: + - participant_id: uss1 + rid_version: F3411-19 + base_url: http://localhost:8082 + has_private_address: true + - participant_id: uss2 + rid_version: F3411-19 + base_url: http://localhost:8082 + has_private_address: true + netrid_dss_instances_v22a: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.astm.f3411.DSSInstancesResource + dependencies: + auth_adapter: utm_auth + specification: + dss_instances: + - participant_id: uss1 + rid_version: F3411-22a + base_url: http://localhost:8082/rid/v2 + has_private_address: true + - participant_id: uss2 + rid_version: F3411-22a + base_url: http://localhost:8082/rid/v2 + has_private_address: true + netrid_dss_instance_v19: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.astm.f3411.DSSInstanceResource + dependencies: + auth_adapter: utm_auth + specification: + participant_id: uss1 + rid_version: F3411-19 + base_url: http://localhost:8082 + has_private_address: true + netrid_dss_instance_v22a: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.astm.f3411.DSSInstanceResource + dependencies: + auth_adapter: utm_auth + specification: + participant_id: uss1 + rid_version: F3411-22a + base_url: http://localhost:8082/rid/v2 + has_private_address: true + +f3548: + flight_planners: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.flight_planning.FlightPlannersResource + dependencies: + auth_adapter: utm_auth + specification: + flight_planners: + # uss1 is the mock_uss directly exposing scdsc functionality + - participant_id: uss1 + injection_base_url: http://localhost:8074/scdsc + local_debug: true + + # The atproxy has been disabled since it is suspected to be responsible of issue #28. Replaced by another simple mock_uss + # # uss2 uses atproxy, with requests being fulfilled by mock_uss with atproxy_client functionality enabled + # - participant_id: uss2 + # injection_base_url: http://host.docker.internal:8075/scd + + # uss2 is the mock_uss directly exposing scdsc functionality + - participant_id: uss2 + injection_base_url: http://localhost:8094/scdsc + local_debug: true + scd_dss: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.astm.f3548.v21.DSSInstanceResource + dependencies: + auth_adapter: utm_auth + specification: + participant_id: uss1 + base_url: http://localhost:8082 + has_private_address: true + scd_dss_instances: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.astm.f3548.v21.DSSInstancesResource + dependencies: + auth_adapter: utm_auth + specification: + dss_instances: + - participant_id: uss1 + base_url: http://localhost:8082 + has_private_address: true + - participant_id: uss2 + base_url: http://localhost:8082 + has_private_address: true + +f3548_single_scenario: + uss1: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.flight_planning.FlightPlannerResource + dependencies: + auth_adapter: utm_auth + specification: + flight_planner: + participant_id: uss1 + injection_base_url: http://localhost:8074/scdsc + local_debug: true + uss2: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.flight_planning.FlightPlannerResource + dependencies: + auth_adapter: utm_auth + specification: + flight_planner: + participant_id: uss2 + injection_base_url: http://localhost:8094/scdsc + local_debug: true + +mock_uss_instances: + mock_uss_instances_scdsc: + $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json + resource_type: resources.interuss.mock_uss.client.MockUSSsResource + dependencies: + auth_adapter: utm_auth + specification: + instances: + - mock_uss_base_url: http://localhost:8074 + participant_id: uss1 + - mock_uss_base_url: http://localhost:8094 + participant_id: uss2 diff --git a/monitoring/uss_qualifier/configurations/dev/non_docker/local_test.json b/monitoring/uss_qualifier/configurations/dev/non_docker/local_test.json deleted file mode 100644 index 93461544bd..0000000000 --- a/monitoring/uss_qualifier/configurations/dev/non_docker/local_test.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "v1": { - "test_run": { - "resources": { - "resource_declarations": { - "$ref": "resources.yaml#/all" - } - }, - "action": { - "test_suite": { - "suite_type": "suites.dev.local_test", - "resources": { - "adjacent_circular_flights_data": "adjacent_circular_flights_data", - "adjacent_circular_storage_config": "adjacent_circular_storage_config", - "kml_flights_data": "kml_flights_data", - "kml_storage_config": "kml_storage_config", - "service_providers": "netrid_service_providers_v22a", - "observers": "netrid_observers_v22a", - "evaluation_configuration": "netrid_observation_evaluation_configuration", - "flight_planners": "flight_planners", - "conflicting_flights": "conflicting_flights", - "priority_preemption_flights": "priority_preemption_flights", - "invalid_flight_auth_flights": "invalid_flight_auth_flights", - "dss": "dss", - "netrid_dss_instances_v22a": "netrid_dss_instances_v22a" - } - } - } - }, - "artifacts": { - "tested_roles": { - "report_path": "output/tested_requirements.html", - "roles": [ - { - "name": "Strategic Coordination role", - "requirement_set": "astm.f3548.v21.scd", - "participants": [ - "uss1", - "uss2" - ] - }, - { - "name": "Service Provider role", - "requirement_set": "astm.f3411.v22a.service_provider", - "participants": [ - "uss1" - ] - }, - { - "name": "Display Provider role", - "requirement_set": "astm.f3411.v22a.service_provider", - "participants": [ - "uss2" - ] - } - ] - }, - "$ref": "../artifacts.yaml#/relative" - } - } -} diff --git a/monitoring/uss_qualifier/configurations/dev/non_docker/resources.yaml b/monitoring/uss_qualifier/configurations/dev/non_docker/resources.yaml deleted file mode 100644 index 7d26ffd46d..0000000000 --- a/monitoring/uss_qualifier/configurations/dev/non_docker/resources.yaml +++ /dev/null @@ -1,137 +0,0 @@ -all: - allOf: - - $ref: '#/uspace' - - $ref: '#/net_rid_sims' - -uspace: - allOf: - - $ref: '#/net_rid' - - $ref: '#/flight_auth' - -net_rid: - $ref: '#/common' - netrid_service_providers_v19: - resource_type: resources.netrid.NetRIDServiceProviders - dependencies: - auth_adapter: utm_auth - specification: - service_providers: - - participant_id: uss1 - injection_base_url: http://localhost:8071/ridsp/injection - netrid_service_providers_v22a: - resource_type: resources.netrid.NetRIDServiceProviders - dependencies: - auth_adapter: utm_auth - specification: - service_providers: - - participant_id: uss1 - injection_base_url: http://localhost:8081/ridsp/injection - netrid_observers_v19: - resource_type: resources.netrid.NetRIDObserversResource - dependencies: - auth_adapter: utm_auth - specification: - observers: - - participant_id: uss2 - observation_base_url: http://localhost:8073/riddp/observation - netrid_observers_v22a: - resource_type: resources.netrid.NetRIDObserversResource - dependencies: - auth_adapter: utm_auth - specification: - observers: - - participant_id: uss2 - observation_base_url: http://localhost:8083/riddp/observation - netrid_observation_evaluation_configuration: - resource_type: resources.netrid.EvaluationConfigurationResource - specification: {} - netrid_dss_instances_v19: - resource_type: resources.astm.f3411.DSSInstancesResource - dependencies: - auth_adapter: utm_auth - specification: - dss_instances: - - participant_id: uss1 - rid_version: F3411-19 - base_url: http://localhost:8082 - has_private_address: true - - participant_id: uss2 - rid_version: F3411-19 - base_url: http://localhost:8082 - has_private_address: true - netrid_dss_instances_v22a: - resource_type: resources.astm.f3411.DSSInstancesResource - dependencies: - auth_adapter: utm_auth - specification: - dss_instances: - - participant_id: uss1 - rid_version: F3411-22a - base_url: http://localhost:8082/rid/v2/ - has_private_address: true - - participant_id: uss2 - rid_version: F3411-22a - base_url: http://localhost:8082/rid/v2/ - has_private_address: true -net_rid_sims: - adjacent_circular_flights_data: - resource_type: resources.netrid.FlightDataResource - specification: - adjacent_circular_flights_simulation_source: {} - adjacent_circular_storage_config: - resource_type: resources.netrid.FlightDataStorageResource - specification: - flight_record_collection_path: "./output/test_data.che.netrid.circular_flights.json" - kml_flights_data: - resource_type: resources.netrid.FlightDataResource - specification: - kml_source: - kml_location: file://./test_data/usa/netrid/dcdemo.kml - kml_storage_config: - resource_type: resources.netrid.FlightDataStorageResource - specification: - flight_record_collection_path: "./output/test_data.usa.netrid.dcdemo_flights.json" - -flight_auth: - $ref: '#/f3548' - invalid_flight_auth_flights: - resource_type: resources.flight_planning.FlightIntentsResource - specification: - planning_time: '0:05:00' - file_source: file://./test_data/che/flight_intents/invalid_flight_auths.json - -f3548: - $ref: '#/common' - flight_planners: - resource_type: resources.flight_planning.FlightPlannersResource - dependencies: - auth_adapter: utm_auth - specification: - flight_planners: - - participant_id: uss1 - injection_base_url: http://localhost:8074/scdsc - - participant_id: uss2 - injection_base_url: http://localhost:8074/scdsc - conflicting_flights: - resource_type: resources.flight_planning.FlightIntentsResource - specification: - planning_time: '0:05:00' - file_source: file://./test_data/che/flight_intents/conflicting_flights.json - priority_preemption_flights: - resource_type: resources.flight_planning.FlightIntentsResource - specification: - planning_time: '0:05:00' - file_source: test_data.che.flight_intents.priority_preemption - dss: - resource_type: resources.astm.f3548.v21.DSSInstanceResource - dependencies: - auth_adapter: utm_auth - specification: - participant_id: uss1 - base_url: http://localhost:8082 - -common: - utm_auth: - resource_type: resources.communications.AuthAdapterResource - specification: - environment_variable_containing_auth_spec: AUTH_SPEC diff --git a/monitoring/uss_qualifier/main.py b/monitoring/uss_qualifier/main.py index 99645fdbaf..900ca905f6 100644 --- a/monitoring/uss_qualifier/main.py +++ b/monitoring/uss_qualifier/main.py @@ -12,7 +12,6 @@ from monitoring.monitorlib.dicts import remove_elements from monitoring.monitorlib.versioning import get_code_version, get_commit_hash from monitoring.uss_qualifier.configurations.configuration import ( - TestConfiguration, USSQualifierConfiguration, ArtifactsConfiguration, ReportConfiguration, @@ -76,13 +75,15 @@ def parseArgs() -> argparse.Namespace: return parser.parse_args() -def execute_test_run( - config: TestConfiguration, whole_config: USSQualifierConfiguration -): +def execute_test_run(whole_config: USSQualifierConfiguration): + config = whole_config.v1.test_run codebase_version = get_code_version() commit_hash = get_commit_hash() - # Compute signatures of inputs + logger.info("Instantiating resources") + resources = create_resources(config.resources.resource_declarations) + + logger.info("Computing signatures of inputs") if config.non_baseline_inputs: baseline, environment = remove_elements( whole_config, config.non_baseline_inputs @@ -97,8 +98,9 @@ def execute_test_run( ) environment_signature = compute_signature(environment) - resources = create_resources(config.resources.resource_declarations) + logger.info("Instantiating top-level test suite action") action = TestSuiteAction(config.action, resources) + logger.info("Running top-level test suite action") report = action.run() if report.successful(): logger.info("Final result: SUCCESS") @@ -166,7 +168,8 @@ def run_config( do_not_save_report = False if config.test_run: - report = execute_test_run(config.test_run, whole_config) + logger.info("Executing test run") + report = execute_test_run(whole_config) elif config.artifacts and config.artifacts.report: with open(config.artifacts.report.report_path, "r") as f: report = ImplicitDict.parse(json.load(f), TestRunReport) diff --git a/monitoring/uss_qualifier/reports/sequence_view.py b/monitoring/uss_qualifier/reports/sequence_view.py index 44c88a627d..c4dfaa2abc 100644 --- a/monitoring/uss_qualifier/reports/sequence_view.py +++ b/monitoring/uss_qualifier/reports/sequence_view.py @@ -292,18 +292,22 @@ def append_notes(new_notes): scenario_participants[query.server_id] = p for failed_check in step.failed_checks: query_events = [] - for query_timestamp in failed_check.query_report_timestamps: - found = False - for e in all_events: - if ( - e.type == EventType.Query - and e.query.request.initiated_at == query_timestamp - ): - query_events.append(e) - found = True - break - if not found: - query_events.append(query_timestamp) + if ( + "query_report_timestamps" in failed_check + and failed_check.query_report_timestamps + ): + for query_timestamp in failed_check.query_report_timestamps: + found = False + for e in all_events: + if ( + e.type == EventType.Query + and e.query.request.initiated_at == query_timestamp + ): + query_events.append(e) + found = True + break + if not found: + query_events.append(query_timestamp) events.append( Event(failed_check=failed_check, query_events=query_events) ) diff --git a/monitoring/uss_qualifier/resources/README.md b/monitoring/uss_qualifier/resources/README.md index fa328ed022..620e4d85af 100644 --- a/monitoring/uss_qualifier/resources/README.md +++ b/monitoring/uss_qualifier/resources/README.md @@ -16,6 +16,8 @@ A resource provider to a test scenario is an instance of a particular kind of re A new resource type is simply a Python subclass of [the abstract `Resource` class](resource.py). It should be placed in the appropriate sub-module of the [`resources` module](.). A requirement for any resource type is that the resource type must be constructable from 1) a specification for the resource and 2) any required dependencies (which must also be resources). +Note that resources which use content from external (not included in the configuration itself) files should specify an [ExternalFile](./files.py) in their specification and use the loading routines in [files.py](files.py). + ## Using resources in a test scenario A test scenario requiring a resource should declare a named dependency on a resource of a particular type. For example, the ASTM NetRID Nominal Behavior test scenario may declare that it has a `service_providers` dependency which must be satisfied with a `netrid.NetRIDServiceProviders` resource type. The test scenario's configuration must specify the resource from the global resource pool (by specifying the globally-unique ID of the resource) that should be used to satisfy the test scenario's `service_providers` dependency. @@ -24,9 +26,8 @@ A test scenario requiring a resource should declare a named dependency on a reso Resources for a given test configuration are all declared in a single global resource collection, and then the resources generated from that collection are placed in a single global resource pool. A resource from that pool may be referenced using its globally-unique (within the test configuration) identifier. To declare a resource, a [`ResourceDeclaration`](resource.py) must be added to the test configuration's [`ResourceCollection`](resource.py). - -2. A particular instance of test resource must have a globally unique name. +1. A particular instance of test resource must have a name that is unique in the full pool of resources in the test configuration. * Example: `netrid.service_providers`, which would provide access to the RID injection API for each ASTM NetRID Service Provider under test. * Example: `netrid.flight_data.nominal_flights`, which would provide flight data for nominal flights which could be injected into Service Providers under test. -3. Every type of test resource must define a "resource specification", which is a serializable data type that fully defines how to create an instance of that resource type. -4. Every type of test resource must define how to create an instance of the test resource from an instance of the resource specification. +2. Every type of test resource must define a "resource specification", which is a serializable data type that fully defines how to create an instance of that resource type. +3. Every type of test resource must define how to create an instance of the test resource from an instance of the resource specification. diff --git a/monitoring/uss_qualifier/resources/files.py b/monitoring/uss_qualifier/resources/files.py new file mode 100644 index 0000000000..18b9a09a2d --- /dev/null +++ b/monitoring/uss_qualifier/resources/files.py @@ -0,0 +1,60 @@ +import hashlib +import json +from typing import Optional + +from implicitdict import ImplicitDict +from monitoring.uss_qualifier import fileio +from monitoring.uss_qualifier.fileio import FileReference + + +class ExternalFile(ImplicitDict): + path: FileReference + """Location of the external file.""" + + hash_sha512: Optional[str] + """SHA-512 hash of the external file. + + If specified, the external file's content will be verified to have this hash or else produce an error. + + If not specified, will be populated with the hash of the external file at the time of execution.""" + + def verify_or_set_hash(self, content: str) -> None: + hash_sha512 = hashlib.sha512(content.encode("utf-8")).hexdigest() + if "hash_sha512" in self and self.hash_sha512: + if hash_sha512 != self.hash_sha512: + raise ValueError( + f"Provided SHA-512 hash for external file at {self.path} is {self.hash_sha512}, but this does not match the hash computed for the content of that file which is {hash_sha512}" + ) + else: + self.hash_sha512 = hash_sha512 + + +def load_content(file: ExternalFile) -> str: + """Load string content from the specified file and check or mutate hashes according to loaded content. + + Note that if file's hashes are not provided, file will be mutated to set the hashes according to the loaded content. + + Args: + file: File to load and hash(es) to assert or mutate. + + Returns: Content of external file. + """ + content = fileio.load_content(file.path) + file.verify_or_set_hash(content) + return content + + +def load_dict(file: ExternalFile) -> dict: + """Load dict content from the specified file and check or mutate hashes according to loaded content. + + Note that if file's hashes are not provided, file will be mutated to set the hashes according to the loaded content. + + Args: + file: File to load and hash(es) to assert or mutate. + + Returns: Python dict with the content loaded from the file (and referenced files, if applicable). + """ + result = fileio.load_dict_with_references(file.path) + content = json.dumps(result) + file.verify_or_set_hash(content) + return result diff --git a/monitoring/uss_qualifier/resources/flight_planning/flight_intent.py b/monitoring/uss_qualifier/resources/flight_planning/flight_intent.py index 60662336d7..cf04dcf550 100644 --- a/monitoring/uss_qualifier/resources/flight_planning/flight_intent.py +++ b/monitoring/uss_qualifier/resources/flight_planning/flight_intent.py @@ -3,6 +3,7 @@ from implicitdict import ImplicitDict, StringBasedDateTime, StringBasedTimeDelta from monitoring.uss_qualifier.fileio import FileReference +from monitoring.uss_qualifier.resources.files import ExternalFile from uas_standards.interuss.automated_testing.scd.v1.api import InjectFlightRequest @@ -51,5 +52,5 @@ class FlightIntentsSpecification(ImplicitDict): planning_time: StringBasedTimeDelta """Time delta between the time uss_qualifier initiates this FlightInjectionAttempt and when a timestamp within the test_injection equal to reference_time occurs""" - file_source: FileReference + file: ExternalFile """Location of file to load""" diff --git a/monitoring/uss_qualifier/resources/flight_planning/flight_intents_resource.py b/monitoring/uss_qualifier/resources/flight_planning/flight_intents_resource.py index 0295088542..8655334f99 100644 --- a/monitoring/uss_qualifier/resources/flight_planning/flight_intents_resource.py +++ b/monitoring/uss_qualifier/resources/flight_planning/flight_intents_resource.py @@ -5,7 +5,7 @@ import arrow from implicitdict import ImplicitDict, StringBasedDateTime -from monitoring.uss_qualifier.fileio import load_dict_with_references +from monitoring.uss_qualifier.resources.files import load_dict from monitoring.uss_qualifier.resources.overrides import apply_overrides from monitoring.uss_qualifier.resources.resource import Resource from monitoring.uss_qualifier.resources.flight_planning.flight_intent import ( @@ -22,7 +22,7 @@ class FlightIntentsResource(Resource[FlightIntentsSpecification]): def __init__(self, specification: FlightIntentsSpecification): self._intent_collection = ImplicitDict.parse( - load_dict_with_references(specification.file_source), FlightIntentCollection + load_dict(specification.file), FlightIntentCollection ) self._planning_time = specification.planning_time.timedelta diff --git a/monitoring/uss_qualifier/resources/netrid/flight_data.py b/monitoring/uss_qualifier/resources/netrid/flight_data.py index a132a01be9..18ef966aff 100644 --- a/monitoring/uss_qualifier/resources/netrid/flight_data.py +++ b/monitoring/uss_qualifier/resources/netrid/flight_data.py @@ -2,7 +2,7 @@ from implicitdict import ImplicitDict, StringBasedDateTime, StringBasedTimeDelta -from monitoring.uss_qualifier.fileio import FileReference +from monitoring.uss_qualifier.resources.files import ExternalFile from uas_standards.astm.f3411.v19.api import RIDAircraftState, RIDFlightDetails @@ -24,11 +24,6 @@ class FlightRecordCollection(ImplicitDict): flights: List[FullFlightRecord] -class FlightDataJSONFileConfiguration(ImplicitDict): - path: str - """Path to a file containing a JSON representation of an instance of FlightRecordCollection. This may be a local file or a web URL.""" - - class AdjacentCircularFlightsSimulatorConfiguration(ImplicitDict): reference_time: StringBasedDateTime = StringBasedDateTime("2022-01-01T00:00:00Z") """The reference time relative to which flight data should be generated. @@ -73,7 +68,7 @@ class FlightDataKMLFileConfiguration(ImplicitDict): random_seed: Optional[int] = 12345 """Pseudorandom seed that should be used, or specify None to use default Random.""" - kml_location: FileReference + kml_file: ExternalFile """Location of KML describing a FlightRecordCollection.""" @@ -81,7 +76,7 @@ class FlightDataSpecification(ImplicitDict): flight_start_delay: StringBasedTimeDelta = StringBasedTimeDelta("15s") """Amount of time between starting the test and commencement of flights""" - record_source: Optional[FileReference] + record_source: Optional[ExternalFile] """When this field is populated, flight record data will be loaded directly from this file""" kml_source: Optional[FlightDataKMLFileConfiguration] diff --git a/monitoring/uss_qualifier/resources/netrid/flight_data_resources.py b/monitoring/uss_qualifier/resources/netrid/flight_data_resources.py index 9802125847..48d8627ddc 100644 --- a/monitoring/uss_qualifier/resources/netrid/flight_data_resources.py +++ b/monitoring/uss_qualifier/resources/netrid/flight_data_resources.py @@ -4,6 +4,7 @@ import arrow from implicitdict import ImplicitDict, StringBasedDateTime +from monitoring.uss_qualifier.resources.files import load_dict, load_content from uas_standards.interuss.automated_testing.rid.v1.injection import ( TestFlightDetails, RIDAircraftState, @@ -12,7 +13,6 @@ from monitoring.monitorlib.rid_automated_testing.injection_api import ( TestFlight, ) -from monitoring.uss_qualifier.fileio import load_dict_with_references, load_content from monitoring.uss_qualifier.resources.resource import Resource from monitoring.uss_qualifier.resources.netrid.flight_data import ( FlightDataSpecification, @@ -33,7 +33,7 @@ class FlightDataResource(Resource[FlightDataSpecification]): def __init__(self, specification: FlightDataSpecification): if "record_source" in specification: self.flight_collection = ImplicitDict.parse( - load_dict_with_references(specification.record_source), + load_dict(specification.record_source), FlightRecordCollection, ) elif "adjacent_circular_flights_simulation_source" in specification: @@ -41,7 +41,7 @@ def __init__(self, specification: FlightDataSpecification): specification.adjacent_circular_flights_simulation_source ) elif "kml_source" in specification: - kml_content = load_content(specification.kml_source.kml_location) + kml_content = load_content(specification.kml_source.kml_file) self.flight_collection = get_flight_records( kml_content, specification.kml_source.reference_time.datetime, diff --git a/monitoring/uss_qualifier/resources/resource.py b/monitoring/uss_qualifier/resources/resource.py index 04821ba23e..eaa86d4f63 100644 --- a/monitoring/uss_qualifier/resources/resource.py +++ b/monitoring/uss_qualifier/resources/resource.py @@ -1,5 +1,4 @@ from abc import ABC, abstractmethod -import json from typing import get_type_hints, Dict, Generic, Tuple, TypeVar, Type from implicitdict import ImplicitDict @@ -50,6 +49,16 @@ def __init__(self, msg: str, missing_resource_name: str): def create_resources( resource_declarations: Dict[ResourceID, ResourceDeclaration] ) -> Dict[ResourceID, ResourceType]: + """Instantiate all resources from the provided declarations. + + Note that some declarations, such as resources whose specifications contain ExternalFiles, may be mutated while the + resource is loaded. + + Args: + resource_declarations: Mapping between resource ID and declaration for that resource. + + Returns: Mapping between resource ID and an instance of that declared resource. + """ resource_pool: Dict[ResourceID, ResourceType] = {} resources_created = 1 @@ -148,9 +157,11 @@ def _make_resource( ) constructor_args[arg_name] = resource_pool[pool_source] if specification_type is not None: - constructor_args["specification"] = ImplicitDict.parse( + specification = ImplicitDict.parse( declaration.specification, specification_type ) + declaration.specification = specification + constructor_args["specification"] = specification return resource_type(**constructor_args) diff --git a/monitoring/uss_qualifier/run_locally.sh b/monitoring/uss_qualifier/run_locally.sh index a03a8bec35..b171bb2d4d 100755 --- a/monitoring/uss_qualifier/run_locally.sh +++ b/monitoring/uss_qualifier/run_locally.sh @@ -63,6 +63,7 @@ start_time=$(date +%Y-%m-%dT%H:%M:%S) docker run ${docker_args} --name uss_qualifier \ --rm \ --network interop_ecosystem_network \ + --add-host=host.docker.internal:host-gateway \ -u "$(id -u):$(id -g)" \ -e PYTHONBUFFERED=1 \ -e AUTH_SPEC=${AUTH_SPEC} \ @@ -86,4 +87,3 @@ for REPORT in ${reports_generated[@]}; do exit 1 fi done -