Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uss_qualifier] DSS0030 port simple subscription test scenario #295

Merged
merged 2 commits into from
Oct 31, 2023
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
11 changes: 11 additions & 0 deletions monitoring/monitorlib/fetch/rid.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,17 @@ def notification_index(self) -> int:
f"Cannot retrieve notification_index using RID version {self.rid_version}"
)

@property
def owner(self) -> str:
if self.rid_version == RIDVersion.f3411_19:
return self.v19_value.owner
elif self.rid_version == RIDVersion.f3411_22a:
return self.v22a_value.owner
else:
raise NotImplementedError(
f"Cannot retrieve owner using RID version {self.rid_version}"
)


class RIDQuery(ImplicitDict):
v19_query: Optional[Query] = None
Expand Down
2 changes: 1 addition & 1 deletion monitoring/prober/infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def wrapper_default_scope(*args, **kwargs):
resource_type_code_descriptions: Dict[ResourceType, str] = {}


# Next code: 371
# Next code: 372
def register_resource_type(code: int, description: str) -> ResourceType:
"""Register that the specified code refers to the described resource.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ While neither ASTM F3411-19 nor F3411-22a explicitly require DSS implementations

* <tt>GetISA</tt>: The DSS implementation under test must implement the ability to retrieve an Identification Service Area by ID in accordance with the API specified in Annex A4 of the respective standard.
* <tt>SearchISAs</tt>: The DSS implementation under test must implement the ability to search for Identification Service Areas meeting the specified criteria in accordance with the API specified in Annex A4 of the respective standard.
* <tt>SubscriptionInitialNotificationIndex</tt>: The DSS implementation under test must set the `notification_index` at 0 for any newly created subscription.
* <tt>SubscriptionVersionFormat</tt>: The DSS implementation under test must use a string of 10 or more lower-cased alphanumeric characters for the `version` field of a subscription.
21 changes: 19 additions & 2 deletions monitoring/uss_qualifier/resources/netrid/service_area.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import datetime
from typing import List
from typing import List, Dict, Any

from implicitdict import ImplicitDict, StringBasedDateTime
from monitoring.monitorlib.geo import LatLngPoint

from monitoring.monitorlib.geo import LatLngPoint
from monitoring.uss_qualifier.resources.resource import Resource


Expand Down Expand Up @@ -45,6 +45,23 @@ def shifted_time_end(
dt = new_reference_time - self.reference_time.datetime
return self.time_end.datetime + dt

def get_new_subscription_params(
self, sub_id: str, start_time: datetime.datetime, duration: datetime.timedelta
) -> Dict[str, Any]:
"""
Builds a dict of parameters that can be used to create a subscription, using this ISA's parameters
and the passed start time and duration
"""
return dict(
sub_id=sub_id,
area_vertices=[vertex.as_s2sphere() for vertex in self.footprint],
alt_lo=self.altitude_min,
alt_hi=self.altitude_max,
start_time=start_time,
end_time=start_time + duration,
uss_base_url=self.base_url,
)


class ServiceAreaResource(Resource[ServiceAreaSpecification]):
specification: ServiceAreaSpecification
Expand Down
Loading
Loading