From 6e804fa7bbdd1e89ec49f719fe3eb49636f305b4 Mon Sep 17 00:00:00 2001 From: David Moore <109112035+damoore044@users.noreply.github.com> Date: Thu, 16 Nov 2023 14:37:14 -0500 Subject: [PATCH] Stream fix for e2e api http_proxy failure (#13064) * Stream fix for e2e http_proxy failure * Lastest prt failure, now seeing same issue with rh_repo * Repo discovery fix --- tests/foreman/api/test_http_proxy.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/foreman/api/test_http_proxy.py b/tests/foreman/api/test_http_proxy.py index 0b4446069bb..1e6da4dfcf6 100644 --- a/tests/foreman/api/test_http_proxy.py +++ b/tests/foreman/api/test_http_proxy.py @@ -69,6 +69,7 @@ def test_positive_end_to_end(setup_http_proxy, module_target_sat, module_manifes reposet=constants.REPOSET['rhae2'], releasever=None, ) + module_target_sat.api.Repository(id=rh_repo_id).sync() rh_repo = module_target_sat.api.Repository( id=rh_repo_id, http_proxy_policy=http_proxy_policy, @@ -96,12 +97,13 @@ def test_positive_end_to_end(setup_http_proxy, module_target_sat, module_manifes # Use global_default_http_proxy repo_options['http_proxy_policy'] = 'global_default_http_proxy' repo_2 = module_target_sat.api.Repository(**repo_options).create() + repo_2.sync() assert repo_2.http_proxy_policy == 'global_default_http_proxy' # Update to selected_http_proxy repo_2.http_proxy_policy = 'none' repo_2.update(['http_proxy_policy']) - assert repo_2.http_proxy_policy == 'none' + assert repo_2.read().http_proxy_policy == 'none' # test scenario for yum type repo discovery. repo_name = 'fakerepo01' @@ -116,16 +118,16 @@ def test_positive_end_to_end(setup_http_proxy, module_target_sat, module_manifes assert yum_repo['output'][0] == f'{settings.repos.repo_discovery.url}/{repo_name}/' # test scenario for docker type repo discovery. - yum_repo = module_target_sat.api.Organization(id=module_manifest_org.id).repo_discover( + docker_repo = module_target_sat.api.Organization(id=module_manifest_org.id).repo_discover( data={ "id": module_manifest_org.id, "url": 'quay.io', "content_type": "docker", - "search": 'quay/busybox', + "search": 'foreman/foreman', } ) - assert len(yum_repo['output']) >= 1 - assert 'quay/busybox' in yum_repo['output'] + assert len(docker_repo['output']) > 0 + assert docker_repo['result'] == 'success' @pytest.mark.upgrade