Skip to content

Commit

Permalink
Remove Satellite object from the fuction call (#9795)
Browse files Browse the repository at this point in the history
* Remove Satellite object from the fuction call

* Remove Sat object from all  func calls
  • Loading branch information
ogajduse authored Jul 19, 2022
1 parent bedf7fb commit e748a2d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion tests/foreman/api/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def test_errata_installation_with_swidtags(
}
)
module_repos_collection_with_manifest.setup_virtual_machine(
rhel8_contenthost, target_sat, install_katello_agent=False
rhel8_contenthost, install_katello_agent=False
)

# install older module stream
Expand Down
4 changes: 1 addition & 3 deletions tests/foreman/destructive/test_contenthost.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ def test_content_access_after_stopped_foreman(target_sat, rhel7_contenthost):
],
)
repos_collection.setup_content(org.id, lce.id, upload_manifest=False)
repos_collection.setup_virtual_machine(
rhel7_contenthost, target_sat, install_katello_agent=False
)
repos_collection.setup_virtual_machine(rhel7_contenthost, install_katello_agent=False)
result = rhel7_contenthost.execute(f'yum -y install {FAKE_1_CUSTOM_PACKAGE}')
assert result.status == 0
assert target_sat.cli.Service.stop(options={'only': 'foreman'}).status == 0
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/ui/test_activationkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_positive_end_to_end_register(session, repos_collection, rhel7_contentho
repos_collection.setup_content(org.id, lce.id, upload_manifest=True)
ak_name = repos_collection.setup_content_data['activation_key']['name']

repos_collection.setup_virtual_machine(rhel7_contenthost, target_sat)
repos_collection.setup_virtual_machine(rhel7_contenthost)
with session:
session.organization.select(org.name)
chost = session.contenthost.read(rhel7_contenthost.hostname, widget_names='details')
Expand Down
4 changes: 2 additions & 2 deletions tests/foreman/ui/test_contenthost.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def module_org():
@pytest.fixture
def vm(module_repos_collection_with_manifest, rhel7_contenthost, target_sat):
"""Virtual machine registered in satellite"""
module_repos_collection_with_manifest.setup_virtual_machine(rhel7_contenthost, target_sat)
module_repos_collection_with_manifest.setup_virtual_machine(rhel7_contenthost)
rhel7_contenthost.add_rex_key(target_sat)
yield rhel7_contenthost

Expand All @@ -77,7 +77,7 @@ def vm(module_repos_collection_with_manifest, rhel7_contenthost, target_sat):
def vm_module_streams(module_repos_collection_with_manifest, rhel8_contenthost, target_sat):
"""Virtual machine registered in satellite without katello-agent installed"""
module_repos_collection_with_manifest.setup_virtual_machine(
rhel8_contenthost, target_sat, install_katello_agent=False
rhel8_contenthost, install_katello_agent=False
)
rhel8_contenthost.add_rex_key(satellite=target_sat)
yield rhel8_contenthost
Expand Down
4 changes: 2 additions & 2 deletions tests/foreman/ui/test_contentview.py
Original file line number Diff line number Diff line change
Expand Up @@ -2631,7 +2631,7 @@ def test_positive_subscribe_system_with_custom_content(
org = entities.Organization().create()
lce = entities.LifecycleEnvironment(organization=org).create()
repos_collection.setup_content(org.id, lce.id, upload_manifest=True)
repos_collection.setup_virtual_machine(rhel7_contenthost, target_sat)
repos_collection.setup_virtual_machine(rhel7_contenthost)
assert rhel7_contenthost.subscribed
with session:
session.organization.select(org.name)
Expand Down Expand Up @@ -2936,7 +2936,7 @@ def test_positive_composite_child_inc_update(session, rhel7_contenthost, target_
entities.ActivationKey(
id=content_data['activation_key']['id'], content_view=composite_cv
).update(['content_view'])
repos_collection.setup_virtual_machine(rhel7_contenthost, target_sat)
repos_collection.setup_virtual_machine(rhel7_contenthost)
result = rhel7_contenthost.run(f'yum -y install {FAKE_1_CUSTOM_PACKAGE}')
assert result.status == 0
with session:
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/ui/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def test_positive_user_access_with_host_filter(
assert len(session.dashboard.read('LatestErrata')['erratas']) == 0
repos_collection.setup_content(org.id, lce.id, upload_manifest=True)
repos_collection.setup_virtual_machine(
rhel7_contenthost, target_sat, location_title=module_location.name
rhel7_contenthost, location_title=module_location.name
)
result = rhel7_contenthost.run(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}')
assert result.status == 0
Expand Down
14 changes: 7 additions & 7 deletions tests/foreman/ui/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def erratatype_vm(module_repos_collection_with_setup, target_sat):
with Broker(
nick=module_repos_collection_with_setup.distro, host_classes={'host': ContentHost}
) as client:
module_repos_collection_with_setup.setup_virtual_machine(client, target_sat)
module_repos_collection_with_setup.setup_virtual_machine(client)
yield client


Expand All @@ -144,7 +144,7 @@ def errata_status_installable():
@pytest.fixture(scope='function')
def vm(module_repos_collection_with_setup, rhel7_contenthost, target_sat):
"""Virtual machine registered in satellite"""
module_repos_collection_with_setup.setup_virtual_machine(rhel7_contenthost, target_sat)
module_repos_collection_with_setup.setup_virtual_machine(rhel7_contenthost)
rhel7_contenthost.add_rex_key(satellite=target_sat)
yield rhel7_contenthost

Expand Down Expand Up @@ -289,7 +289,7 @@ def test_content_host_errata_page_pagination(session, org, lce, target_sat):
with Broker(nick=repos_collection.distro, host_classes={'host': ContentHost}) as client:
client.add_rex_key(satellite=target_sat)
# Add repo and install packages that need errata
repos_collection.setup_virtual_machine(client, target_sat)
repos_collection.setup_virtual_machine(client)
assert _install_client_package(client, pkgs)
with session:
# Go to content host's Errata tab and read the page's pagination widgets
Expand Down Expand Up @@ -460,7 +460,7 @@ def test_positive_apply_for_all_hosts(
) as clients:
for client in clients:
module_repos_collection_with_setup.setup_virtual_machine(
client, target_sat, install_katello_agent=False
client, install_katello_agent=False
)
client.add_rex_key(satellite=target_sat)
assert _install_client_package(client, FAKE_1_CUSTOM_PACKAGE)
Expand Down Expand Up @@ -559,7 +559,7 @@ def test_positive_filter_by_environment(
) as clients:
for client in clients:
module_repos_collection_with_setup.setup_virtual_machine(
client, target_sat, install_katello_agent=False
client, install_katello_agent=False
)
assert _install_client_package(client, FAKE_1_CUSTOM_PACKAGE, errata_applicability=True)
# Promote the latest content view version to a new lifecycle environment
Expand Down Expand Up @@ -925,7 +925,7 @@ def test_positive_filtered_errata_status_installable_param(
)
repos_collection.setup_content(org.id, lce.id, upload_manifest=True)
with Broker(nick=repos_collection.distro, host_classes={'host': ContentHost}) as client:
repos_collection.setup_virtual_machine(client, target_sat)
repos_collection.setup_virtual_machine(client)
assert _install_client_package(client, FAKE_1_CUSTOM_PACKAGE, errata_applicability=True)
# Adding content view filter and content view filter rule to exclude errata for the
# installed package.
Expand Down Expand Up @@ -1028,7 +1028,7 @@ def test_content_host_errata_search_commands(
nick=module_repos_collection_with_setup.distro, host_classes={'host': ContentHost}, _count=2
) as clients:
for client in clients:
module_repos_collection_with_setup.setup_virtual_machine(client, target_sat)
module_repos_collection_with_setup.setup_virtual_machine(client)
# Install pkg walrus-0.71-1.noarch to create need for RHSA on client 1
assert _install_client_package(
clients[0], FAKE_1_CUSTOM_PACKAGE, errata_applicability=False
Expand Down
6 changes: 2 additions & 4 deletions tests/foreman/ui/test_hostcollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ def vm_content_hosts(smart_proxy_location, module_repos_collection, module_targe
distro = module_repos_collection.distro
with Broker(nick=distro, host_classes={'host': ContentHost}, _count=2) as clients:
for client in clients:
module_repos_collection.setup_virtual_machine(
client, module_target_sat, install_katello_agent=False
)
module_repos_collection.setup_virtual_machine(client, install_katello_agent=False)
client.add_rex_key(satellite=module_target_sat)
update_vm_host_location(client, smart_proxy_location.id)
yield clients
Expand All @@ -83,7 +81,7 @@ def vm_content_hosts_module_stream(
with Broker(nick=distro, host_classes={'host': ContentHost}, _count=2) as clients:
for client in clients:
module_repos_collection_with_manifest.setup_virtual_machine(
client, module_target_sat, install_katello_agent=False
client, install_katello_agent=False
)
client.add_rex_key(satellite=module_target_sat)
update_vm_host_location(client, smart_proxy_location.id)
Expand Down

0 comments on commit e748a2d

Please sign in to comment.