Skip to content

Commit

Permalink
Remove the MultiCV hack since it's become available (#16893)
Browse files Browse the repository at this point in the history
* Remove the MultiCV hack since it's become available

* Remove assertion for multi-cv settings exposion
  • Loading branch information
vsedmik authored Nov 21, 2024
1 parent b577e31 commit b24d3d4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
1 change: 0 additions & 1 deletion pytest_fixtures/component/contentview.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def module_cv_repo(module_org, module_repository, module_lce, module_target_sat)
@pytest.fixture(scope='session')
def session_multicv_sat(session_satellite_host):
"""Satellite with multi-CV enabled"""
session_satellite_host.enable_multicv_setting()
session_satellite_host.update_setting('allow_multiple_content_views', 'True')
return session_satellite_host

Expand Down
17 changes: 0 additions & 17 deletions robottelo/host_helpers/satellite_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,6 @@ def enable_puppet_satellite(self):
assert 'Success!' in result.stdout
return self

def enable_multicv_setting(self):
"""Makes multi-CV setting available in the downstream Satellite"""
if len(
self.api.Setting().search(query={'search': 'name={"allow_multiple_content_views"}'})
):
return # Setting is already exposed
cfg_file = 'upstream_only_settings.rb'
cfg_path = self.execute(f'find /usr/share/gems/gems/ -name {cfg_file}').stdout.strip()
assert cfg_file in cfg_path, 'Config file not found'
self.execute(
f'sed -i "s/allow_multiple_content_views/#allow_multiple_content_views/g" {cfg_path}'
)
self.cli.Service.restart()
assert len(
self.api.Setting().search(query={'search': f'name={"allow_multiple_content_views"}'})
), 'Multi-CV enablement failed'


class ContentInfo:
"""Miscellaneous content helper methods"""
Expand Down
9 changes: 2 additions & 7 deletions tests/foreman/cli/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -2064,9 +2064,8 @@ def test_negative_multi_cv_registration(
:steps:
1. Register a host with global reg, just to get the sub-man config and certs right
2. Unregister the host
3. Verify that allow_multiple_content_views setting is not exposed
4. Attempt to register the host with subscription-manager, passing multiple environments
5. Confirm that registration fails
3. Attempt to register the host with subscription-manager, passing multiple environments
4. Confirm that registration fails
:expectedresults: allow_multiple_content_views setting is not exposed, and defaults to false.
So registration fails because multiple environments are not allowed.
Expand All @@ -2089,10 +2088,6 @@ def test_negative_multi_cv_registration(
unregister_result = rhel_contenthost.unregister()
assert unregister_result.status == 0

# Verify that allow_multiple_content_views setting is not exposed
with pytest.raises(CLIReturnCodeError):
target_sat.cli.Settings.info({'name': 'allow_multiple_content_views'})

env_names = f"{module_lce_library.name}/{module_published_cv.name},{module_lce.name}/{module_promoted_cv.name}"

# Register the host with subscription-manager, passing multiple environments
Expand Down

0 comments on commit b24d3d4

Please sign in to comment.