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

Fix legacy errata upgrade scenario tests #17183

Open
wants to merge 1 commit into
base: master
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
5 changes: 4 additions & 1 deletion robottelo/host_helpers/satellite_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import random
import re

from fauxfactory import gen_string
import requests
from wait_for import TimedOutError, wait_for

Expand Down Expand Up @@ -184,15 +185,17 @@ def is_sca_mode_enabled(self, org_id):
"""
return self.api.Organization(id=org_id).read().simple_content_access

def publish_content_view(self, org, repo_list, name):
def publish_content_view(self, org, repo_list, name=None):
"""This method publishes the content view for a given organization and repository list.

:param str org: The name of the organization to which the content view belongs
:param list or str repo_list: A list of repositories or a single repository
:param str name: Name of the Content View to create. Defaults to random string.

:return: A dictionary containing the details of the published content view.
"""
repo = repo_list if isinstance(repo_list, list) else [repo_list]
name = name or gen_string('alpha')
content_view = self.api.ContentView(organization=org, repository=repo, name=name).create()
content_view.publish()
return content_view.read()
Expand Down
4 changes: 3 additions & 1 deletion tests/upgrades/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ def test_pre_scenario_generate_errata_for_client(
}
)

@pytest.mark.parametrize('pre_upgrade_data', ['rhel7', 'rhel8', 'rhel9'], indirect=True)
@pytest.mark.parametrize(
'pre_upgrade_data', ['rhel7-ipv4', 'rhel8-ipv4', 'rhel9-ipv4'], indirect=True
)
@pytest.mark.post_upgrade(depend_on=test_pre_scenario_generate_errata_for_client)
def test_post_scenario_errata_count_installation(self, target_sat, pre_upgrade_data):
"""Post-upgrade scenario that applies errata on the RHEL client that was set up
Expand Down
4 changes: 3 additions & 1 deletion tests/upgrades/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,9 @@ def test_pre_simple_content_access_only(
}
)

@pytest.mark.parametrize('pre_upgrade_data', ['rhel7', 'rhel8', 'rhel9'], indirect=True)
@pytest.mark.parametrize(
'pre_upgrade_data', ['rhel7-ipv4', 'rhel8-ipv4', 'rhel9-ipv4'], indirect=True
)
@pytest.mark.post_upgrade(depend_on=test_pre_simple_content_access_only)
def test_post_simple_content_access_only(self, target_sat, pre_upgrade_data):
"""Check that both the custom repository and the red hat repository are enabled
Expand Down
4 changes: 3 additions & 1 deletion tests/upgrades/test_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ def test_pre_subscription_scenario_auto_attach(
}
)

@pytest.mark.parametrize('pre_upgrade_data', ['rhel7', 'rhel8', 'rhel9'], indirect=True)
@pytest.mark.parametrize(
'pre_upgrade_data', ['rhel7-ipv4', 'rhel8-ipv4', 'rhel9-ipv4'], indirect=True
)
@pytest.mark.post_upgrade(depend_on=test_pre_subscription_scenario_auto_attach)
@pytest.mark.manifester
def test_post_subscription_scenario_auto_attach(self, request, target_sat, pre_upgrade_data):
Expand Down
Loading