Skip to content

[uss_qualifier] oir_simple: accepted oir can be detached from explicit subscription #805

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ it is in violation of **[astm.f3548.v21.DSS0005,1](../../../../requirements/astm

### [OIR is attached to expected subscription test step](./fragments/oir/oir_has_expected_subscription.md)

## Remove explicit subscription from OIR test case

Checks that an OIR in the ACCEPTED state that is attached to an explicit subscription can be mutated in order to not be attached to any subscription.

### [Remove explicit subscription from OIR test step](./fragments/oir/crud/update_query.md)

### [OIR is not attached to any subscription test step](./fragments/oir/oir_has_no_subscription.md)

## Cleanup

### [Cleanup OIRs test step](./clean_workspace_op_intents.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,50 @@ def run(self, context: ExecutionContext):
self._step_update_oir_with_sufficient_explicit_sub(is_replacement=False)
self._step_oir_has_correct_subscription(expected_sub_id=self._extra_sub_id)
self.end_test_case()

self.begin_test_case("Remove explicit subscription from OIR")
self._step_remove_subscription_from_oir()
self._step_oir_has_correct_subscription(expected_sub_id=None)
self.end_test_case()

self.end_test_scenario()

def _step_remove_subscription_from_oir(self):
self.begin_test_step("Remove explicit subscription from OIR")
oir_update_params = self._planning_area.get_new_operational_intent_ref_params(
key=[],
state=OperationalIntentState.Accepted,
uss_base_url=self._planning_area.get_base_url(),
time_start=self._current_oir.time_start.value.datetime,
time_end=self._current_oir.time_end.value.datetime,
subscription_id=None,
)
with self.check(
"Mutate operational intent reference query succeeds",
self._pid,
) as check:
try:
mutated_oir, _, q = self._dss.put_op_intent(
extents=oir_update_params.extents,
key=oir_update_params.key,
state=oir_update_params.state,
base_url=oir_update_params.uss_base_url,
oi_id=self._oir_id,
subscription_id=None,
ovn=self._current_oir.ovn,
force_no_implicit_subscription=True,
)
self.record_query(q)
self._current_oir = mutated_oir
except QueryError as qe:
self.record_queries(qe.queries)
check.record_failed(
summary="Removal of explicit subscription from OIR failed",
details=f"Was expecting an HTTP 200 response for a mutation with valid parameters, but got {qe.cause_status_code} instead. {qe.msg}",
query_timestamps=qe.query_timestamps,
)
self.end_test_step()

def _step_create_explicit_sub(self):
self._sub_params = self._planning_area.get_new_subscription_params(
subscription_id=self._sub_id,
Expand Down
Loading