Skip to content

Commit

Permalink
assign multi cv env to ak (#17286)
Browse files Browse the repository at this point in the history
* assign multi cv env to ak

* worked on review comments

* Update tests/foreman/cli/test_activationkey.py

Co-authored-by: Jeremy Lenz <[email protected]>

---------

Co-authored-by: Jeremy Lenz <[email protected]>
  • Loading branch information
vijaysawant and jeremylenz authored Jan 9, 2025
1 parent 57a4ee0 commit 9a633c4
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions tests/foreman/cli/test_activationkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,53 @@ def test_positive_invalid_release_version(module_sca_manifest_org, module_target


# -------------------------- MULTI-CV SCENARIOS -------------------------
def test_positive_create_ak_with_multi_cv_envs(session_multicv_sat, session_multicv_org):
"""Verify that multiple content view environments can be assigned during activation key creation
:id: 263a6c90-88bf-4888-b1b9-172751a609f3
:steps:
1. Create two lifecycle environments and two content views, publish/promote to respective lce
2. Create an activation key with created content view environments
:expectedresults: AK created successfully with multiple content view environments
:CaseImportance: Medium
:Verifies: SAT-12474
"""
# Create two lifecycle environments
lces_list = [
session_multicv_sat.api.LifecycleEnvironment(organization=session_multicv_org).create()
for i in range(2)
]
lce1, lce2 = lces_list
# Create two content views
cvs_list = [
session_multicv_sat.api.ContentView(organization=session_multicv_org).create()
for i in range(2)
]
for i in range(2):
cvs_list[i].publish()
cvs_list[i] = cvs_list[i].read()
cvs_list[i].version[0].promote(data={'environment_ids': lces_list[i].id})
cv1, cv2 = cvs_list

# Create an activation key with created content view environments
ak_name = gen_string('alpha')
cv_envs = f'{lce1.name}/{cv1.name},{lce2.name}/{cv2.name}'
ak = session_multicv_sat.cli.ActivationKey.create(
{
'organization-id': session_multicv_org.id,
'content-view-environments': cv_envs,
'name': ak_name,
}
)
assert ak['name'] == ak_name
assert ak['multi-content-view-environment'] == 'yes'
assert ak['content-view-environment-labels'] == cv_envs


def test_positive_multi_cv_info(
session_multicv_sat, session_multicv_org, session_multicv_default_ak
):
Expand Down

0 comments on commit 9a633c4

Please sign in to comment.