Skip to content

Commit

Permalink
Address several review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedmik committed Feb 19, 2025
1 parent c57a12d commit 11e3c22
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion tests/foreman/api/test_capsulecontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ def test_flatpak_endpoint(self, target_sat, module_capsule_configured, endpoint)
1. HTTP 200
"""
ep = FLATPAK_ENDPOINTS[endpoint].format(module_capsule_configured.hostname)
rq = requests.get(ep, verify=False)
rq = requests.get(ep, verify=settings.server.verify_ca)
assert rq.ok, f'Expected 200 but got {rq.status_code} from {endpoint} registry index'

@pytest.mark.e2e
Expand Down
6 changes: 3 additions & 3 deletions tests/foreman/cli/test_capsulecontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,11 +883,11 @@ def test_sync_consume_flatpak_repo_via_library(
'job-template': 'Flatpak - Set up remote on host',
'inputs': (
f'Remote Name={remote_name}, '
f'Flatpak registry URL=https://{caps.hostname}/pulpcore_registry/, '
f'Flatpak registry URL={settings.server.scheme}://{caps.hostname}/pulpcore_registry/, '
f'Username={settings.server.admin_username}, '
f'Password={settings.server.admin_password}'
),
'search-query': f"name ~ {host.hostname}",
'search-query': f"name = {host.hostname}",
}
)
res = module_target_sat.cli.JobInvocation.info({'id': job.id})
Expand All @@ -907,7 +907,7 @@ def test_sync_consume_flatpak_repo_via_library(
'organization': function_org.name,
'job-template': 'Flatpak - Install application on host',
'inputs': f'Flatpak remote name={remote_name}, Application name={app_name}',
'search-query': f"name ~ {host.hostname}",
'search-query': f"name = {host.hostname}",
}
)
res = module_target_sat.cli.JobInvocation.info({'id': job.id})
Expand Down
21 changes: 9 additions & 12 deletions tests/foreman/cli/test_flatpak.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ def function_user(target_sat, function_role, function_org):
def function_host_cleanup(target_sat, module_flatpak_contenthost):
"""Cleans up the flatpak contenthost so it can be re-registered with different org"""
module_flatpak_contenthost.unregister()
host = target_sat.api.Host().search(
query={'search': f'name={module_flatpak_contenthost.hostname}'}
)
if len(host) > 0:
target_sat.api.Host(id=host[0].id).delete()
if nh := module_flatpak_contenthost.nailgun_host:
nh.delete()


def test_CRUD_and_sync_flatpak_remote_with_permissions(
Expand Down Expand Up @@ -224,7 +221,7 @@ def test_flatpak_endpoint(target_sat, endpoint):
1. HTTP 200
"""
ep = FLATPAK_ENDPOINTS[endpoint].format(target_sat.hostname)
rq = requests.get(ep, verify=False)
rq = requests.get(ep, verify=settings.server.verify_ca)
assert rq.ok, f'Expected 200 but got {rq.status_code} from {endpoint} registry index'


Expand Down Expand Up @@ -318,11 +315,11 @@ def test_sync_consume_flatpak_repo_via_library(
'job-template': 'Flatpak - Set up remote on host',
'inputs': (
f'Remote Name={remote_name}, '
f'Flatpak registry URL=https://{sat.hostname}/pulpcore_registry/, '
f'Flatpak registry URL={settings.server.scheme}://{sat.hostname}/pulpcore_registry/, '
f'Username={settings.server.admin_username}, '
f'Password={settings.server.admin_password}'
),
'search-query': f"name ~ {host.hostname}",
'search-query': f"name = {host.hostname}",
}
)
res = module_target_sat.cli.JobInvocation.info({'id': job.id})
Expand All @@ -341,7 +338,7 @@ def test_sync_consume_flatpak_repo_via_library(
'organization': function_org.name,
'job-template': 'Flatpak - Install application on host',
'inputs': f'Flatpak remote name={remote_name}, Application name={app_name}',
'search-query': f"name ~ {host.hostname}",
'search-query': f"name = {host.hostname}",
}
)
res = module_target_sat.cli.JobInvocation.info({'id': job.id})
Expand Down Expand Up @@ -459,11 +456,11 @@ def test_sync_consume_flatpak_repo_via_cv(
'job-template': 'Flatpak - Set up remote on host',
'inputs': (
f'Remote Name={remote_name}, '
f'Flatpak registry URL=https://{sat.hostname}/, '
f'Flatpak registry URL={settings.server.scheme}://{sat.hostname}/, '
f'Username={settings.server.admin_username}, '
f'Password={settings.server.admin_password}'
),
'search-query': f"name ~ {host.hostname}",
'search-query': f"name = {host.hostname}",
}
)
res = module_target_sat.cli.JobInvocation.info({'id': job.id})
Expand All @@ -481,7 +478,7 @@ def test_sync_consume_flatpak_repo_via_cv(
opts = {
'organization': function_org.name,
'job-template': 'Flatpak - Install application on host',
'search-query': f"name ~ {host.hostname}",
'search-query': f"name = {host.hostname}",
}
cv1_app = 'Inkscape'
job = module_target_sat.cli_factory.job_invocation(
Expand Down
6 changes: 3 additions & 3 deletions tests/foreman/cli/test_satellitesync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1537,11 +1537,11 @@ def test_postive_export_import_cv_with_mixed_content_repos(
'job-template': 'Flatpak - Set up remote on host',
'inputs': (
f'Remote Name={remote_name}, '
f'Flatpak registry URL=https://{module_import_sat.hostname}/pulpcore_registry/, '
f'Flatpak registry URL={settings.server.scheme}://{module_import_sat.hostname}/pulpcore_registry/, '
f'Username={settings.server.admin_username}, '
f'Password={settings.server.admin_password}'
),
'search-query': f"name ~ {module_flatpak_contenthost.hostname}",
'search-query': f"name = {module_flatpak_contenthost.hostname}",
}
)
res = module_import_sat.cli.JobInvocation.info({'id': job.id})
Expand All @@ -1564,7 +1564,7 @@ def test_postive_export_import_cv_with_mixed_content_repos(
'organization': function_import_org_at_isat.name,
'job-template': 'Flatpak - Install application on host',
'inputs': f'Flatpak remote name={remote_name}, Application name={app_name}',
'search-query': f"name ~ {module_flatpak_contenthost.hostname}",
'search-query': f"name = {module_flatpak_contenthost.hostname}",
}
)
res = module_import_sat.cli.JobInvocation.info({'id': job.id})
Expand Down

0 comments on commit 11e3c22

Please sign in to comment.