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
80 changes: 0 additions & 80 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -21683,93 +21683,13 @@
"lineCount": 1
}
},
{
"code": "reportPossiblyUnboundVariable",
"range": {
"startColumn": 11,
"endColumn": 31,
"lineCount": 1
}
},
{
"code": "reportInvalidTypeVarUse",
"range": {
"startColumn": 14,
"endColumn": 30,
"lineCount": 1
}
},
{
"code": "reportPossiblyUnboundVariable",
"range": {
"startColumn": 11,
"endColumn": 31,
"lineCount": 1
}
},
{
"code": "reportInvalidTypeVarUse",
"range": {
"startColumn": 14,
"endColumn": 30,
"lineCount": 1
}
},
{
"code": "reportOptionalMemberAccess",
"range": {
"startColumn": 59,
"endColumn": 70,
"lineCount": 1
}
},
{
"code": "reportOptionalMemberAccess",
"range": {
"startColumn": 47,
"endColumn": 54,
"lineCount": 1
}
},
{
"code": "reportPossiblyUnboundVariable",
"range": {
"startColumn": 15,
"endColumn": 24,
"lineCount": 1
}
},
{
"code": "reportOptionalMemberAccess",
"range": {
"startColumn": 59,
"endColumn": 70,
"lineCount": 1
}
},
{
"code": "reportOptionalMemberAccess",
"range": {
"startColumn": 47,
"endColumn": 54,
"lineCount": 1
}
},
{
"code": "reportReturnType",
"range": {
"startColumn": 11,
"endColumn": 20,
"lineCount": 1
}
},
{
"code": "reportPossiblyUnboundVariable",
"range": {
"startColumn": 11,
"endColumn": 20,
"lineCount": 1
}
}
],
"./monitoring/uss_qualifier/scenarios/astm/utm/versioning/evaluate_system_versions.py": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# USS Availability Sync test step fragment

## 🛑USS Availability is consistent across every DSS instance check
## 🛑 USS Availability is consistent across every DSS instance check

If the reported availability for a USS is not consistent, across a set of DSS instances, with the value that was previously read or set on an arbitrary DSS instance,
either the DSS through which the value was set or the one through which the values was retrieved is failing to meet at least one of these requirements:
Expand All @@ -11,7 +11,7 @@ either the DSS through which the value was set or the one through which the valu

As a consequence, the DSS also fails to meet **[astm.f3548.v21.DSS0210,A2-7-2,6](../../../../../../requirements/astm/f3548/v21.md)** and **[astm.f3548.v21.DSS0020](../../../../../../requirements/astm/f3548/v21.md)**.

## 🛑USS Availability version is consistent across every DSS instance check
## 🛑 USS Availability version is consistent across every DSS instance check

If the reported availability version for a USS is not consistent, across a set of DSS instances, with the value that was previously read or set on an arbitrary DSS instance,
either the DSS through which the value was set or the one through which the values was retrieved is failing to meet at least one of these requirements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This fragment contains the steps for the USS Availability synchronization scenario
where we confirm that a USS availability can be correctly read from a DSS instance

## 🛑USS Availability can be updated check
## 🛑 USS Availability can be updated check

If, when presented with a valid query to update the availability state of a USS, a DSS
responds with anything else than a 200 OK response, it is in violation of the OpenAPI specification referenced by **[astm.f3548.v21.DSS0100,1](../../../../../../requirements/astm/f3548/v21.md)**.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Make report to DSS test step fragment
This step makes a report to the DSS.

See `make_dss_report` in [test_steps.py](test_steps.py).
See `make_dss_report` in [test_steps_fragments.py](../../test_step_fragments.py).

## 🛑 DSS report successfully submitted check
If the submission of the report to the DSS does not succeed, this check will fail per **[astm.f3548.v21.DSS0100,2](../../../requirements/astm/f3548/v21.md)**.
If the submission of the report to the DSS does not succeed, this check will fail per **[astm.f3548.v21.DSS0100,2](../../../../../../requirements/astm/f3548/v21.md)**.

## ⚠️ DSS returned a valid report ID check
If the ID returned by the DSS is not present or is empty, this check will fail per **[astm.f3548.v21.DSS0100,2](../../../requirements/astm/f3548/v21.md)**.
If the ID returned by the DSS is not present or is empty, this check will fail per **[astm.f3548.v21.DSS0100,2](../../../../../../requirements/astm/f3548/v21.md)**.
2 changes: 1 addition & 1 deletion monitoring/uss_qualifier/scenarios/astm/utm/dss/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ A dummy `getOperationalIntentReference` query is made to a non-existent DSS in o

### Make valid DSS report test step

#### [Make report to DSS](../make_dss_report.md)
#### [Make report to DSS](./fragments/report/report.md)
7 changes: 5 additions & 2 deletions monitoring/uss_qualifier/scenarios/astm/utm/dss/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
from monitoring.monitorlib.fetch import QueryType, query_and_describe
from monitoring.monitorlib.testing import make_fake_url
from monitoring.uss_qualifier.resources.astm.f3548.v21.dss import DSSInstanceResource
from monitoring.uss_qualifier.scenarios.astm.utm.test_steps import make_dss_report
from monitoring.uss_qualifier.scenarios.astm.utm.dss.test_step_fragments import (
make_dss_report,
)
from monitoring.uss_qualifier.scenarios.scenario import (
TestScenario,
)
Expand Down Expand Up @@ -58,5 +60,6 @@ def gen_record() -> ExchangeRecord:
self.begin_test_step("Make valid DSS report")
dummy_record = gen_record()
report_id = make_dss_report(self, self._dss, dummy_record)
self.record_note(f"{self._dss.participant_id}/report_id", report_id)
if report_id:
self.record_note(f"{self._dss.participant_id}/report_id", report_id)
self.end_test_step()
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
DSSInstancesResource,
)
from monitoring.uss_qualifier.resources.communications import ClientIdentityResource
from monitoring.uss_qualifier.scenarios.astm.utm.dss.test_step_fragments import (
get_uss_availability,
set_uss_availability,
)
from monitoring.uss_qualifier.scenarios.scenario import TestScenario
from monitoring.uss_qualifier.suites.suite import ExecutionContext

Expand Down Expand Up @@ -145,55 +149,31 @@ def _step_unknown_uss_reported_as_unknown(self):
)

def _step_update_to_unknown(self):
with self.check(
"USS Availability can be updated", self._dss.participant_id
) as check:
try:
self._current_version, q = self._dss.set_uss_availability(
self._uss_id, UssAvailabilityState.Unknown, self._current_version
)
self.record_query(q)
except QueryError as qe:
self.record_queries(qe.queries)
check.record_failed(
summary="Failed to set USS availability to Unknown",
details=qe.msg,
query_timestamps=qe.query_timestamps,
)
self._current_version = set_uss_availability(
self,
self._dss,
self._uss_id,
UssAvailabilityState.Unknown,
self._current_version,
)

def _step_update_to_down(self):
with self.check(
"USS Availability can be updated", self._dss.participant_id
) as check:
try:
self._current_version, q = self._dss.set_uss_availability(
self._uss_id, UssAvailabilityState.Down, self._current_version
)
self.record_query(q)
except QueryError as qe:
self.record_queries(qe.queries)
check.record_failed(
summary="Failed to set USS availability to Down",
details=qe.msg,
query_timestamps=qe.query_timestamps,
)
self._current_version = set_uss_availability(
self,
self._dss,
self._uss_id,
UssAvailabilityState.Down,
self._current_version,
)

def _step_update_to_normal(self):
with self.check(
"USS Availability can be updated", self._dss.participant_id
) as check:
try:
self._current_version, q = self._dss.set_uss_availability(
self._uss_id, UssAvailabilityState.Normal, self._current_version
)
self.record_query(q)
except QueryError as qe:
self.record_queries(qe.queries)
check.record_failed(
summary="Failed to set USS availability to Normal",
details=qe.msg,
query_timestamps=qe.query_timestamps,
)
self._current_version = set_uss_availability(
self,
self._dss,
self._uss_id,
UssAvailabilityState.Normal,
self._current_version,
)

def _ensure_test_uss_availability_unknown(self, check_consistency: bool = True):
"""
Expand All @@ -202,27 +182,13 @@ def _ensure_test_uss_availability_unknown(self, check_consistency: bool = True):
We want to both start and end this scenario with this state.
"""

with self.check(
"USS Availability can be requested", self._dss.participant_id
) as check:
try:
availability, q = self._dss.get_uss_availability(
self._uss_id, Scope.AvailabilityArbitration
)
self.record_query(q)
except QueryError as qe:
self.record_queries(qe.queries)
check.record_failed(
summary="Failed to get USS availability",
details=qe.msg,
query_timestamps=qe.query_timestamps,
)
return

self._current_version = availability.version
availability, version = get_uss_availability(
self, self._dss, self._uss_id, Scope.AvailabilityArbitration
)
self._current_version = version

# If the state is not currently unknown, we set it to unknown
if availability.status.availability != UssAvailabilityState.Unknown:
if availability != UssAvailabilityState.Unknown:
with self.check("USS Availability can be set to Unknown") as check:
try:
self._current_version, q = self._dss.set_uss_availability(
Expand Down Expand Up @@ -254,40 +220,27 @@ def _query_and_expect_on_secondary(
expected_availability: UssAvailabilityState,
expected_version: str,
):
with self.check(
"USS Availability can be requested", dss.participant_id
) as check:
try:
availability, q = dss.get_uss_availability(
uss_id, Scope.StrategicCoordination
)
self.record_query(q)
except QueryError as qe:
self.record_queries(qe.queries)
check.record_failed(
summary="Failed to get USS availability",
details=qe.msg,
query_timestamps=qe.query_timestamps,
)
return
availability, version = get_uss_availability(
self, dss, uss_id, Scope.StrategicCoordination
)

with self.check(
"USS Availability is consistent across every DSS instance", participants
) as check:
if availability.status.availability != expected_availability:
if availability != expected_availability:
check.record_failed(
summary="USS availability not as expected on secondary DSS",
details=f"Expected {expected_availability}, got {availability.status.availability}",
details=f"Expected {expected_availability}, got {availability}",
)

with self.check(
"USS Availability version is consistent across every DSS instance",
participants,
) as check:
if availability.version != expected_version:
if version != expected_version:
check.record_failed(
summary="USS availability version not as expected on secondary DSS",
details=f"Expected {expected_version}, got {availability.version}",
details=f"Expected {expected_version}, got {version}",
)

def _query_and_expect_on_secondaries(
Expand Down
Loading
Loading