Skip to content

Commit

Permalink
[Cherrypick]Prepare for sca web ui 6.15.z (#13407)
Browse files Browse the repository at this point in the history
* Adding tests for web ui

* Adding host test for sca only

* Prepare for sca only deprecation

* updating to satellite 6.16
  • Loading branch information
ColeHiggins2 authored Jan 9, 2024
1 parent 951375f commit ab5fabe
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/foreman/ui/test_activationkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,3 +1228,22 @@ def test_positive_ak_with_custom_product_on_rhel6(session, rhel6_contenthost, ta
ak = session.activationkey.read(ak.name, widget_names='content_hosts')
assert len(ak['content_hosts']['table']) == 1
assert ak['content_hosts']['table'][0]['Name'] == rhel6_contenthost.hostname


def test_positive_prepare_for_sca_only_ak(target_sat, function_entitlement_manifest_org):
"""Verify that the ActivationKey details page notifies users that Simple Content Access
will be required for all organizations in Satellite 6.16
:id: 417a8331-3c66-473f-938c-bbf01deb6031
:expectedresults: The ActivationKey page notifies users that Simple Content Access will
be required for all organizations in Satellite 6.16
"""
ak = target_sat.api.ActivationKey(organization=function_entitlement_manifest_org).create()
with target_sat.ui_session() as session:
session.organization.select(function_entitlement_manifest_org.name)
ak = session.activationkey.read(ak.name)
assert (
'This organization is not using Simple Content Access. Entitlement-based subscription '
'management is deprecated and will be removed in Satellite 6.16.' in ak['sca_alert']
)
42 changes: 42 additions & 0 deletions tests/foreman/ui/test_contenthost.py
Original file line number Diff line number Diff line change
Expand Up @@ -1871,3 +1871,45 @@ def test_search_for_virt_who_hypervisors(session, default_location):
# Search with hypervisor=false gives the correct result.
content_hosts = [host['Name'] for host in session.contenthost.search('hypervisor = false')]
assert hypervisor_display_name not in content_hosts


@pytest.mark.rhel_ver_match('[^6]')
def test_positive_prepare_for_sca_only_content_host(
session,
function_entitlement_manifest_org,
default_location,
rhel_contenthost,
target_sat,
):
"""Verify that the Content Host page notifies users that Entitlement-based subscription
management is deprecated and will be removed in Satellite 6.16
:id: 1a725675-2cf5-4f84-a755-c25f19ef5fd1
:expectedresults: The Content Host page notifies users that Entitlement-based subscription
management is deprecated and will be removed in Satellite 6.16
"""
lce = target_sat.api.LifecycleEnvironment(
organization=function_entitlement_manifest_org
).create()
cv = target_sat.api.ContentView(
organization=function_entitlement_manifest_org, environment=[lce]
).create()
cv.publish()
cvv = cv.read().version[0].read()
cvv.promote(data={'environment_ids': lce.id, 'force': False})
ak = target_sat.api.ActivationKey(
organization=function_entitlement_manifest_org, content_view=cv, environment=lce
).create()
rhel_contenthost.register(
function_entitlement_manifest_org, default_location, ak.name, target_sat
)
with session:
session.organization.select(function_entitlement_manifest_org.name)
session.location.select(default_location.name)
host_details = session.contenthost.read(rhel_contenthost.hostname, widget_names='details')
assert (
'This organization is not using Simple Content Access. Entitlement-based subscription '
'management is deprecated and will be removed in Satellite 6.16.'
in host_details['details']['sca_alert']
)
20 changes: 20 additions & 0 deletions tests/foreman/ui/test_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,3 +384,23 @@ def test_positive_prepare_for_sca_only_deprecation(target_sat):
)
results = target_sat.execute('tail -100 /var/log/foreman/production.log').stdout
assert 'Simple Content Access will be required for all organizations in Katello 4.12' in results


def test_positive_prepare_for_sca_only_organization(target_sat, function_entitlement_manifest_org):
"""Verify that the organization details page notifies users that Simple Content Access
will be required for all organizations in Satellite 6.16
:id: 3a6a848b-3c16-4dbb-8f52-5ea57a9a97ef
:expectedresults: The Organization details page notifies users that Simple Content Access will
be required for all organizations in Satellite 6.16
"""
with target_sat.ui_session() as session:
session.organization.select(function_entitlement_manifest_org.name)
sca_alert = session.organization.read(
function_entitlement_manifest_org.name, widget_names='primary'
)
assert (
'Simple Content Access will be required for all organizations in Satellite 6.16.'
in sca_alert['primary']['sca_alert']
)
18 changes: 18 additions & 0 deletions tests/foreman/ui/test_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,3 +551,21 @@ def test_positive_candlepin_events_processed_by_STOMP(
response = entities.Ping().search_json()['services']['candlepin_events']
assert response['status'] == 'ok'
assert '0 Failed' in response['message']


def test_positive_prepare_for_sca_only_subscription(target_sat, function_entitlement_manifest_org):
"""Verify that the Subcsription page notifies users that Simple Content Access
will be required for all organizations in Satellite 6.16
:id: cb6fdfdd-04ee-4acb-9460-c78556cef11e
:expectedresults: The Subscription page notifies users that Simple Content Access will
be required for all organizations in Satellite 6.16
"""
with target_sat.ui_session() as session:
session.organization.select(function_entitlement_manifest_org.name)
sca_alert = session.subscription.sca_alert()
assert (
'This organization is not using Simple Content Access. Entitlement-based subscription '
'management is deprecated and will be removed in Satellite 6.16.' in sca_alert
)

0 comments on commit ab5fabe

Please sign in to comment.