From 6048188ce9933273d3669913ecaaa965d3b2b360 Mon Sep 17 00:00:00 2001 From: Satellite QE <115476073+Satellite-QE@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:58:10 -0500 Subject: [PATCH] [6.15.z] Fixes for CV Tests (#13403) Fixes for CV Tests (cherry picked from commit 72a30834f1732a68c45d76b67b42013e89a66819) Co-authored-by: Sam Bible --- tests/foreman/api/test_contentview.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/foreman/api/test_contentview.py b/tests/foreman/api/test_contentview.py index f2015bd11cf..602f397846e 100644 --- a/tests/foreman/api/test_contentview.py +++ b/tests/foreman/api/test_contentview.py @@ -138,8 +138,8 @@ def test_positive_subscribe_host( }, organization=module_org.id, ).create() - assert host.content_facet_attributes['content_view_id'] == class_cv.id - assert host.content_facet_attributes['lifecycle_environment_id'] == module_lce.id + assert host.content_facet_attributes['content_view']['id'] == class_cv.id + assert host.content_facet_attributes['lifecycle_environment']['id'] == module_lce.id assert class_cv.read().content_host_count == 1 @pytest.mark.tier2 @@ -491,7 +491,9 @@ def test_positive_publish_composite_multiple_content_multiple( composite=True, organization=module_org, ).create() - self.add_content_views_to_composite(composite_cv, module_org, random.randint(2, 3)) + self.add_content_views_to_composite( + module_target_sat, composite_cv, module_org, random.randint(2, 3) + ) for i in range(random.randint(2, 3)): composite_cv.publish() @@ -613,7 +615,9 @@ def test_positive_promote_composite_multiple_content_once( composite=True, organization=module_org, ).create() - self.add_content_views_to_composite(composite_cv, module_org, random.randint(2, 3)) + self.add_content_views_to_composite( + module_target_sat, composite_cv, module_org, random.randint(2, 3) + ) composite_cv.publish() composite_cv.read().version[0].promote(data={'environment_ids': module_lce.id}) composite_cv = composite_cv.read() @@ -642,7 +646,9 @@ def test_positive_promote_composite_multiple_content_multiple( composite=True, organization=module_org, ).create() - self.add_content_views_to_composite(composite_cv, module_org, random.randint(2, 3)) + self.add_content_views_to_composite( + module_target_sat, composite_cv, module_org, random.randint(2, 3) + ) composite_cv.publish() composite_cv = composite_cv.read() @@ -754,7 +760,9 @@ def test_composite_content_view_with_same_repos(self, module_org, target_sat): for content_view, package in [(content_view_1, 'camel'), (content_view_2, 'cow')]: content_view.repository = [repo] content_view.update(['repository']) - content_view_info = apply_package_filter(content_view, repo, package, inclusion=False) + content_view_info = apply_package_filter( + content_view, repo, package, target_sat, inclusion=False + ) assert content_view_info.package_count == 35 # create composite content view with these two published content views @@ -803,7 +811,7 @@ def test_ccv_audit_scenarios(self, module_org, target_sat): composite_cv.publish() assert not composite_cv.read().needs_publish # Add some content_views to the composite view - self.add_content_views_to_composite(composite_cv, module_org, 2) + self.add_content_views_to_composite(target_sat, composite_cv, module_org, 2) # Needs_publish should be set to True when a component CV is added/removed assert composite_cv.read().needs_publish composite_cv.publish()