forked from interuss/dss
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[uss_qualifier] Add skeleton for UFT message signing test (interuss#873)
* Add skeleton for UFT message signing test * Add missing Resources sections to scenario documentation * Make mock_uss flight planner more explicit * Add planner combination selector, clean up action generator resources
- Loading branch information
1 parent
32a2f14
commit fb41083
Showing
17 changed files
with
437 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
monitoring/uss_qualifier/configurations/dev/faa/uft/local_message_signing.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
resources: | ||
resource_declarations: | ||
"$ref": ../../resources.yaml#/common | ||
flight_planners: | ||
resource_type: resources.flight_planning.FlightPlannersResource | ||
dependencies: | ||
auth_adapter: utm_auth | ||
specification: | ||
flight_planners: | ||
- participant_id: uss1 | ||
injection_base_url: http://host.docker.internal:8074/scdsc | ||
- participant_id: uss2 | ||
injection_base_url: http://host.docker.internal:8074/scdsc | ||
- participant_id: mock_uss | ||
injection_base_url: http://host.docker.internal:8074/scdsc | ||
combination_selector: | ||
resource_type: resources.flight_planning.FlightPlannerCombinationSelectorResource | ||
specification: | ||
must_include: | ||
- mock_uss | ||
maximum_roles: | ||
mock_uss: 1 | ||
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://host.docker.internal:8082 | ||
mock_uss: | ||
resource_type: resources.interuss.MockUSSResource | ||
dependencies: | ||
auth_adapter: utm_auth | ||
specification: | ||
participant_id: mock_uss | ||
mock_uss_base_url: http://host.docker.internal:8074 | ||
|
||
test_suite: | ||
suite_type: suites.faa.uft.message_signing | ||
resources: | ||
mock_uss: mock_uss | ||
flight_planners: flight_planners | ||
combination_selector: combination_selector | ||
conflicting_flights: conflicting_flights | ||
priority_preemption_flights: priority_preemption_flights | ||
dss: dss |
5 changes: 4 additions & 1 deletion
5
monitoring/uss_qualifier/resources/flight_planning/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
from .flight_planners import FlightPlannersResource | ||
from .flight_planners import ( | ||
FlightPlannersResource, | ||
FlightPlannerCombinationSelectorResource, | ||
) | ||
from .flight_intents_resource import FlightIntentsResource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .mock_uss import MockUSSResource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import arrow | ||
|
||
from implicitdict import ImplicitDict | ||
from monitoring.monitorlib import fetch | ||
from monitoring.monitorlib.infrastructure import AuthAdapter, UTMClientSession | ||
from monitoring.monitorlib.scd_automated_testing.scd_injection_api import ( | ||
SCOPE_SCD_QUALIFIER_INJECT, | ||
) | ||
from monitoring.uss_qualifier.reports.report import ParticipantID | ||
from monitoring.uss_qualifier.resources.communications import AuthAdapterResource | ||
from monitoring.uss_qualifier.resources.resource import Resource | ||
|
||
|
||
class MockUSSClient(object): | ||
"""Means to communicate with an InterUSS mock_uss instance""" | ||
|
||
def __init__( | ||
self, | ||
participant_id: str, | ||
base_url: str, | ||
auth_adapter: AuthAdapter, | ||
): | ||
self.session = UTMClientSession(base_url, auth_adapter) | ||
self.participant_id = participant_id | ||
|
||
def get_status(self) -> fetch.Query: | ||
initiated_at = arrow.utcnow().datetime | ||
resp = self.session.get("/scdsc/v1/status", scope=SCOPE_SCD_QUALIFIER_INJECT) | ||
return fetch.describe_query(resp, initiated_at) | ||
|
||
# TODO: Add other methods to interact with the mock USS in other ways (like starting/stopping message signing data collection) | ||
|
||
|
||
class MockUSSSpecification(ImplicitDict): | ||
mock_uss_base_url: str | ||
"""The base URL for the mock USS. | ||
If the mock USS had scdsc enabled, for instance, then these URLs would be | ||
valid: | ||
* <mock_uss_base_url>/mock/scd/uss/v1/reports | ||
* <mock_uss_base_url>/scdsc/v1/status | ||
""" | ||
|
||
participant_id: ParticipantID | ||
"""Test participant responsible for this mock USS.""" | ||
|
||
|
||
class MockUSSResource(Resource[MockUSSSpecification]): | ||
mock_uss: MockUSSClient | ||
|
||
def __init__( | ||
self, | ||
specification: MockUSSSpecification, | ||
auth_adapter: AuthAdapterResource, | ||
): | ||
self.mock_uss = MockUSSClient( | ||
specification.participant_id, | ||
specification.mock_uss_base_url, | ||
auth_adapter.adapter, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .message_signing_start import StartMessageSigningReport | ||
from .message_signing_finalize import FinalizeMessageSigningReport |
17 changes: 17 additions & 0 deletions
17
monitoring/uss_qualifier/scenarios/faa/uft/message_signing_finalize.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Finalize message signing test scenario | ||
|
||
This test scenario instructs a mock USS to finalize a message signing report from captured data. | ||
|
||
## Resources | ||
|
||
### mock_uss | ||
|
||
The means to communicate with the mock USS that has been collecting message signing data. | ||
|
||
## Finalize message signing test case | ||
|
||
### Signal mock USS test step | ||
|
||
#### Successful finalization check | ||
|
||
If the mock USS doesn't finalize the message signing report successfully, this check will fail. |
40 changes: 40 additions & 0 deletions
40
monitoring/uss_qualifier/scenarios/faa/uft/message_signing_finalize.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from monitoring.uss_qualifier.common_data_definitions import Severity | ||
from monitoring.uss_qualifier.resources.interuss.mock_uss import ( | ||
MockUSSResource, | ||
MockUSSClient, | ||
) | ||
from monitoring.uss_qualifier.scenarios.scenario import TestScenario | ||
|
||
|
||
class FinalizeMessageSigningReport(TestScenario): | ||
_mock_uss: MockUSSClient | ||
|
||
def __init__(self, mock_uss: MockUSSResource): | ||
super().__init__() | ||
self._mock_uss = mock_uss.mock_uss | ||
|
||
def run(self): | ||
self.begin_test_scenario() | ||
|
||
self.begin_test_case("Finalize message signing") | ||
|
||
self.begin_test_step("Signal mock USS") | ||
|
||
# TODO: Add call to mock USS to finalize message signing report | ||
with self.check( | ||
"Successful finalization", participants=[self._mock_uss.participant_id] | ||
) as check: | ||
if False: # TODO: Insert appropriate check | ||
check.record_failed( | ||
summary="Failed to finalize message signing report", | ||
details="TODO", | ||
severity=Severity.High, | ||
query_timestamps=[], | ||
) | ||
return | ||
|
||
self.end_test_step() # Signal mock USS | ||
|
||
self.end_test_case() # Start message signing | ||
|
||
self.end_test_scenario() |
27 changes: 27 additions & 0 deletions
27
monitoring/uss_qualifier/scenarios/faa/uft/message_signing_start.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Start message signing test scenario | ||
|
||
This test scenario instructs a mock USS to begin capturing message signing data. | ||
|
||
## Resources | ||
|
||
### mock_uss | ||
|
||
The means to communicate with the mock USS that will collect message signing data. | ||
|
||
## Start message signing test case | ||
|
||
### Check mock USS readiness test step | ||
|
||
#### Status ok check | ||
|
||
If the mock USS doesn't respond properly to a request for its status, this check will fail. | ||
|
||
#### Ready check | ||
|
||
If the mock USS doesn't indicate Ready for its scd functionality, this check will fail. | ||
|
||
### Signal mock USS test step | ||
|
||
#### Successful start check | ||
|
||
If the mock USS doesn't start capturing message signing data successfully, this check will fail. |
Oops, something went wrong.