diff --git a/galaxy_ng/tests/integration/api/test_container_delete.py b/galaxy_ng/tests/integration/api/test_container_delete.py index df96631fc3..50a26bc3f7 100644 --- a/galaxy_ng/tests/integration/api/test_container_delete.py +++ b/galaxy_ng/tests/integration/api/test_container_delete.py @@ -1,5 +1,4 @@ import subprocess -from urllib.parse import urlparse import pytest @@ -19,22 +18,20 @@ def test_delete_ee_and_content(ansible_config, galaxy_client): config = ansible_config("admin") container_engine = config["container_engine"] - url = config['url'] - parsed_url = urlparse(url) - cont_reg = parsed_url.netloc + container_registry = config["container_registry"] # Pull alpine image - pull_and_tag_test_image(container_engine, cont_reg) + pull_and_tag_test_image(container_engine, container_registry) # Login to local registry with tls verify disabled cmd = [container_engine, "login", "-u", f"{config['username']}", "-p", - f"{config['password']}", f"{config['url'].split(parsed_url.path)[0]}"] + f"{config['password']}", container_registry] if container_engine == 'podman': cmd.append("--tls-verify=false") subprocess.check_call(cmd) # Push image to local registry - cmd = [container_engine, "push", f"{cont_reg}/alpine:latest"] + cmd = [container_engine, "push", f"{container_registry}/alpine:latest"] if container_engine == 'podman': cmd.append("--tls-verify=false") subprocess.check_call(cmd) @@ -86,28 +83,27 @@ def test_shared_content_is_not_deleted(ansible_config, galaxy_client): gc = galaxy_client("admin") config = ansible_config("admin") container_engine = config["container_engine"] - url = config['url'] - parsed_url = urlparse(url) - cont_reg = parsed_url.netloc + container_registry = config["container_registry"] # Pull alpine image - image = pull_and_tag_test_image(container_engine, cont_reg, "alpine1:latest") + image = pull_and_tag_test_image(container_engine, container_registry, "alpine1:latest") # Login to local registry with tls verify disabled cmd = [container_engine, "login", "-u", f"{config['username']}", "-p", - f"{config['password']}", f"{config['url'].split(parsed_url.path)[0]}"] + f"{config['password']}", container_registry] if container_engine == 'podman': cmd.append("--tls-verify=false") subprocess.check_call(cmd) # Push image to local registry - cmd = [container_engine, "push", f"{cont_reg}/alpine1:latest"] + cmd = [container_engine, "push", f"{container_registry}/alpine1:latest"] if container_engine == 'podman': cmd.append("--tls-verify=false") subprocess.check_call(cmd) # Copy 'alpine1' and rename to 'alpine2' - subprocess.check_call([container_engine, "tag", image, f"{cont_reg}/alpine2:latest"]) - cmd = [container_engine, "push", f"{cont_reg}/alpine2:latest"] + subprocess.check_call([container_engine, "tag", image, + f"{container_registry}/alpine2:latest"]) + cmd = [container_engine, "push", f"{container_registry}/alpine2:latest"] if container_engine == 'podman': cmd.append("--tls-verify=false") subprocess.check_call(cmd) diff --git a/galaxy_ng/tests/integration/api/test_container_push_update.py b/galaxy_ng/tests/integration/api/test_container_push_update.py index 7a52ec42e5..0f7bc9155a 100644 --- a/galaxy_ng/tests/integration/api/test_container_push_update.py +++ b/galaxy_ng/tests/integration/api/test_container_push_update.py @@ -3,7 +3,6 @@ See: https://issues.redhat.com/browse/AAH-2327 """ import subprocess -from urllib.parse import urlparse import pytest @@ -25,21 +24,19 @@ def test_can_update_container_push(ansible_config, require_auth, galaxy_client): config = ansible_config("admin") container_engine = config["container_engine"] - url = config['url'] - parsed_url = urlparse(url) - cont_reg = parsed_url.netloc + container_registry = config["container_registry"] # Pull alpine image - pull_and_tag_test_image(container_engine, cont_reg) + pull_and_tag_test_image(container_engine, container_registry) # Login to local registry with tls verify disabled cmd = [container_engine, "login", "-u", f"{config['username']}", "-p", - f"{config['password']}", f"{config['url'].split(parsed_url.path)[0]}"] + f"{config['password']}", container_registry] if container_engine == "podman": cmd.append("--tls-verify=false") subprocess.check_call(cmd) # Push image to local registry - cmd = [container_engine, "push", f"{cont_reg}/alpine:latest"] + cmd = [container_engine, "push", f"{container_registry}/alpine:latest"] if container_engine == "podman": cmd.append("--tls-verify=false") subprocess.check_call(cmd) diff --git a/galaxy_ng/tests/integration/api/test_namespace_management.py b/galaxy_ng/tests/integration/api/test_namespace_management.py index e98682e3b3..e50754dd0c 100644 --- a/galaxy_ng/tests/integration/api/test_namespace_management.py +++ b/galaxy_ng/tests/integration/api/test_namespace_management.py @@ -11,7 +11,7 @@ from galaxykit.repositories import search_collection from galaxykit.users import get_me -from ..utils.iqe_utils import is_stage_environment +from ..utils.iqe_utils import is_stage_environment, fix_prefix_workaround from ..utils.repo_management_utils import upload_new_artifact from ..utils.tasks import wait_for_all_tasks_gk, wait_for_namespace_tasks_gk from ..utils.tools import generate_random_string @@ -186,6 +186,9 @@ def test_namespace_edit_logo(galaxy_client): # fields that should NOT change for field in ["pulp_href", "name", "company", "email", "description", "resources", "links"]: # FIXME + if field == "pulp_href": + updated_again_namespace[field] = ( + fix_prefix_workaround(updated_again_namespace[field])) assert my_namespace[field] == updated_again_namespace[field] # fields that changed diff --git a/galaxy_ng/tests/integration/utils/tasks.py b/galaxy_ng/tests/integration/utils/tasks.py index 3adfefbc03..af6f8834df 100644 --- a/galaxy_ng/tests/integration/utils/tasks.py +++ b/galaxy_ng/tests/integration/utils/tasks.py @@ -81,7 +81,10 @@ def wait_for_task_ui_client(gc, task): if counter >= 60: raise Exception('Task is taking too long') ds = gc.get(f"pulp/api/v3/tasks/{task_id}/") - state = ds.json()['state'] + try: + state = ds.json()['state'] + except AttributeError: + state = ds['state'] if state == 'completed': break time.sleep(SLEEP_SECONDS_POLLING)