Skip to content

Commit

Permalink
minor param renames
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedmik committed Jan 2, 2024
1 parent 1903313 commit e2af7b1
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions tests/foreman/cli/test_satellitesync.py
Original file line number Diff line number Diff line change
Expand Up @@ -2079,47 +2079,50 @@ def function_downstream_org(module_downstream_sat, function_sca_manifest):


def _set_downstream_org(
dwn_sat,
up_sat,
dwn_org,
up_org='Default_Organization',
downstream_sat,
upstream_sat,
downstream_org,
upstream_org='Default_Organization',
username=settings.server.admin_username,
password=settings.server.admin_password,
lce_label=None,
cv_label=None,
):
"""Configures Downstream organization to sync from particular Upstream organization.
:param dwn_sat: Downstream Satellite instance.
:param up_sat: Upstream Satellite instance.
:param dwn_org: Downstream organization to be configured.
:param up_org: Upstream organization to sync CDN content from, default: Default_Organization
:param downstream_sat: Downstream Satellite instance.
:param upstream_sat: Upstream Satellite instance.
:param downstream_org: Downstream organization to be configured.
:param upstream_org: Upstream organization to sync CDN content from,
default: Default_Organization
:param username: Username for authentication, default: admin username from settings.
:param password: Password for authentication, default: admin password from settings.
:param lce_label: Upstream Lifecycle Environment, default: Library
:param cv_label: Upstream Content View Label, default: Default_Organization_View.
:return: True if succeeded.
"""
# Create Content Credentials with Upstream Satellite's katello-server-ca.crt.
crt_file = f'{up_sat.hostname}.crt'
dwn_sat.execute(f'curl -o {crt_file} http://{up_sat.hostname}/pub/katello-server-ca.crt')
cc = dwn_sat.cli.ContentCredential.create(
crt_file = f'{upstream_sat.hostname}.crt'
downstream_sat.execute(
f'curl -o {crt_file} http://{upstream_sat.hostname}/pub/katello-server-ca.crt'
)
cc = downstream_sat.cli.ContentCredential.create(
{
'name': up_sat.hostname,
'organization-id': dwn_org.id,
'name': upstream_sat.hostname,
'organization-id': downstream_org.id,
'path': crt_file,
'content-type': 'cert',
}
)
# Set the CDN configuration to Network Sync.
res = dwn_sat.cli.Org.configure_cdn(
res = downstream_sat.cli.Org.configure_cdn(
{
'id': dwn_org.id,
'id': downstream_org.id,
'type': 'network_sync',
'url': f'https://{up_sat.hostname}/',
'url': f'https://{upstream_sat.hostname}/',
'username': username,
'password': password,
'upstream-organization-label': up_org.label,
'upstream-organization-label': upstream_org.label,
'upstream-lifecycle-environment-label': lce_label,
'upstream-content-view-label': cv_label,
'ssl-ca-credential-id': cc['id'],
Expand Down Expand Up @@ -2170,10 +2173,10 @@ def test_positive_network_sync_rh_repo(
"""
assert _set_downstream_org(
module_downstream_sat,
target_sat,
function_downstream_org,
function_sca_manifest_org,
downstream_sat=module_downstream_sat,
upstream_sat=target_sat,
downstream_org=function_downstream_org,
upstream_org=function_sca_manifest_org,
), 'Downstream org configuration failed'

# Enable and sync the repository.
Expand Down

0 comments on commit e2af7b1

Please sign in to comment.