-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[uss_qualifier] Verify area is clear before nominal planning equal pr…
…iority (#593) Verify area is clear before nominal planning equal priority
- Loading branch information
1 parent
179d780
commit bc3fb8b
Showing
10 changed files
with
103 additions
and
72 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
monitoring/uss_qualifier/scenarios/astm/utm/clear_area_validation.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,13 @@ | ||
# Clear area validation test step fragment | ||
|
||
uss_qualifier verifies with the DSS that there are no operational intents remaining in the area. | ||
|
||
## 🛑 DSS responses check | ||
|
||
If the DSS fails to reply to a query concerning operational intent references in a given area, or fails to allow the deletion of | ||
an operational intent from its own creator, it is in violation of **[astm.f3548.v21.DSS0005,1](../../../requirements/astm/f3548/v21.md)** | ||
or **[astm.f3548.v21.DSS0005,2](../../../requirements/astm/f3548/v21.md)**, and this check will fail. | ||
|
||
## 🛑 Area is clear of op intents check | ||
|
||
If operational intents exist in the 4D area(s) that should be clear, then the current state of the test environment is not suitable to conduct tests so this check will fail. |
52 changes: 52 additions & 0 deletions
52
monitoring/uss_qualifier/scenarios/astm/utm/clear_area_validation.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,52 @@ | ||
from typing import List | ||
|
||
from monitoring.monitorlib.fetch import QueryError | ||
from monitoring.monitorlib.geotemporal import Volume4D | ||
from monitoring.uss_qualifier.resources.astm.f3548.v21.dss import DSSInstance | ||
from monitoring.uss_qualifier.scenarios.scenario import TestScenario | ||
from uas_standards.astm.f3548.v21.api import OperationalIntentReference | ||
|
||
|
||
def validate_clear_area( | ||
scenario: TestScenario, | ||
dss: DSSInstance, | ||
areas: List[Volume4D], | ||
ignore_self: bool, | ||
) -> List[OperationalIntentReference]: | ||
found_intents = [] | ||
for area in areas: | ||
with scenario.check("DSS responses", [dss.participant_id]) as check: | ||
try: | ||
op_intents, query = dss.find_op_intent(area.to_f3548v21()) | ||
scenario.record_query(query) | ||
except QueryError as e: | ||
scenario.record_queries(e.queries) | ||
query = e.queries[0] | ||
check.record_failed( | ||
summary="Error querying DSS for operational intents", | ||
details=f"See query; {e}", | ||
query_timestamps=[query.request.timestamp], | ||
) | ||
found_intents.extend(op_intents) | ||
|
||
with scenario.check("Area is clear of op intents") as check: | ||
if ignore_self: | ||
uss_qualifier_sub = dss.client.auth_adapter.get_sub() | ||
op_intents = [ | ||
oi for oi in op_intents if oi.manager != uss_qualifier_sub | ||
] | ||
if op_intents: | ||
summary = f"{len(op_intents)} operational intent{'s' if len(op_intents) > 1 else ''} found in test area" | ||
details = ( | ||
"The following operational intents were observed even though the area was expected to be clear:\n" | ||
+ "\n".join( | ||
f"* {oi.id} managed by {oi.manager}" for oi in op_intents | ||
) | ||
) | ||
check.record_failed( | ||
summary=summary, | ||
details=details, | ||
query_timestamps=[query.request.timestamp], | ||
) | ||
|
||
return found_intents |
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
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
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
Oops, something went wrong.