From 5d80a82efe3b00514436635d1a95f6cc225c4e97 Mon Sep 17 00:00:00 2001 From: vijaysawant Date: Fri, 13 Dec 2024 17:37:24 +0530 Subject: [PATCH 1/2] added wait for tasks for repo creation --- tests/foreman/api/test_docker.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/foreman/api/test_docker.py b/tests/foreman/api/test_docker.py index 3e1f9ae270a..3a24c2d58fb 100644 --- a/tests/foreman/api/test_docker.py +++ b/tests/foreman/api/test_docker.py @@ -53,7 +53,15 @@ def _create_repository(module_target_sat, product, name=None, upstream_name=None @pytest.fixture def repo(module_product, module_target_sat): """Create a single repository.""" - return _create_repository(module_target_sat, module_product) + repo = _create_repository(module_target_sat, module_product) + module_target_sat.wait_for_tasks( + search_query='Actions::Katello::Repository::MetadataGenerate' + f' and resource_id = {repo.id}' + ' and resource_type = Katello::Repository', + max_tries=6, + search_rate=10, + ) + return repo @pytest.fixture From 7adee81b892968881602e7e780c2bbb8ca9df83a Mon Sep 17 00:00:00 2001 From: vijaysawant Date: Tue, 24 Dec 2024 20:58:40 +0530 Subject: [PATCH 2/2] update ak with cv and env to get rid out of error --- tests/foreman/api/test_docker.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/foreman/api/test_docker.py b/tests/foreman/api/test_docker.py index 3a24c2d58fb..72f1ad514b3 100644 --- a/tests/foreman/api/test_docker.py +++ b/tests/foreman/api/test_docker.py @@ -545,8 +545,8 @@ def test_positive_remove_docker_repo_cv( content_view=content_view, environment=module_lce, organization=module_org ).create() assert ak.content_view.id == content_view.id - ak.content_view = None - assert ak.update(['content_view']).content_view is None + ak.content_view_environments = None + assert ak.update(['content_view_environments']).content_view is None @pytest.mark.tier2 def test_positive_add_docker_repo_ccv( @@ -610,8 +610,8 @@ def test_positive_remove_docker_repo_ccv( content_view=comp_content_view, environment=module_lce, organization=module_org ).create() assert ak.content_view.id == comp_content_view.id - ak.content_view = None - assert ak.update(['content_view']).content_view is None + ak.content_view_environments = None + assert ak.update(['content_view_environments']).content_view is None class TestPodman: