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

[6.15.z] Fix some long failing subscription tests #16940

Merged
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
5 changes: 4 additions & 1 deletion tests/foreman/api/test_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,10 @@ def test_sca_end_to_end(
content_view.publish()
assert len(content_view.repository) == 2
host = rhel_contenthost.nailgun_host
host.content_facet_attributes = {'content_view_id': content_view.id}
host.content_facet_attributes = {
'content_view_id': content_view.id,
'lifecycle_environment_id': module_ak.environment.id,
}
host.update(['content_facet_attributes'])
rhel_contenthost.run('subscription-manager repos --enable *')
repos = rhel_contenthost.run('subscription-manager refresh && yum repolist')
Expand Down
16 changes: 8 additions & 8 deletions tests/foreman/ui/test_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
pytestmark = [pytest.mark.run_in_one_thread, pytest.mark.skip_if_not_set('fake_manifest')]


@pytest.fixture(scope='module')
def golden_ticket_host_setup(function_entitlement_manifest_org, module_target_sat):
org = function_entitlement_manifest_org
@pytest.fixture
def golden_ticket_host_setup(function_sca_manifest_org, module_target_sat):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway we can get away from this name and switch it to something named more after SCA?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good point @chris1984. I just guess we would want to make the change in master first and back-propagate it to streams. The downside might be discontinuity in test results history, but that's probably not so important for a long failing test.

org = function_sca_manifest_org
rh_repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid(
basearch='x86_64',
org_id=org.id,
Expand Down Expand Up @@ -474,12 +474,12 @@ def test_positive_subscription_status_disabled_golden_ticket(
result = rhel_contenthost.register(org, None, ak.name, target_sat)
assert result.status == 0, f'Failed to register host: {result.stderr}'
assert rhel_contenthost.subscribed
with session:
with target_sat.ui_session() as session:
session.organization.select(org_name=org.name)
host = session.contenthost.read(rhel_contenthost.hostname, widget_names='details')[
'details'
]['subscription_status']
assert 'Simple Content Access' in host
read_host_subs_status = session.contenthost.read_legacy_ui(
rhel_contenthost.hostname, widget_names='details'
)['details']['subscription_status']
assert 'Simple Content Access' in read_host_subs_status


@pytest.mark.tier2
Expand Down