From f5e18fd3467cc023006445240b7563508d40c185 Mon Sep 17 00:00:00 2001 From: Ladislav Vasina Date: Mon, 9 Dec 2024 15:58:48 +0100 Subject: [PATCH 1/4] Reporting test fixes for stream --- tests/foreman/ui/test_reporttemplates.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/foreman/ui/test_reporttemplates.py b/tests/foreman/ui/test_reporttemplates.py index 722b6e8be39..fbc56615183 100644 --- a/tests/foreman/ui/test_reporttemplates.py +++ b/tests/foreman/ui/test_reporttemplates.py @@ -282,7 +282,7 @@ def test_positive_generate_subscriptions_report_json( :CaseImportance: Medium """ # generate Subscriptions report - with session: + with module_target_sat.ui_session() as session: file_path = session.reporttemplate.generate( 'Subscription - General Report', values={'output_format': 'JSON'} ) @@ -295,10 +295,12 @@ def test_positive_generate_subscriptions_report_json( 'Account number', 'Available', 'Contract number', + 'Days Remaining', 'End date', 'ID', 'Name', 'Organization', + 'Product Host Count', 'Quantity', 'SKU', 'Start date', @@ -386,7 +388,7 @@ def test_positive_schedule_generation_and_get_mail( # make sure postfix daemon is running target_sat.execute('systemctl start postfix') # generate Subscriptions report - with session: + with target_sat.ui_session() as session: session.reporttemplate.schedule( 'Subscription - General Report', values={ @@ -426,10 +428,12 @@ def test_positive_schedule_generation_and_get_mail( 'Account number', 'Available', 'Contract number', + 'Days Remaining', 'End date', 'ID', 'Name', 'Organization', + 'Product Host Count', 'Quantity', 'SKU', 'Start date', @@ -556,9 +560,7 @@ def test_positive_installable_errata_with_user( :BZ: 1726504 """ - activation_key = target_sat.api.ActivationKey( - environment=function_lce, organization=function_org - ).create() + activation_key = target_sat.api.ActivationKey(organization=function_org).create() custom_cv = target_sat.api.ContentView(organization=function_org).create() ERRATUM_ID = str(settings.repos.yum_6.errata[2]) target_sat.cli_factory.setup_org_for_a_custom_repo( @@ -608,7 +610,7 @@ def test_positive_installable_errata_with_user( # Downgrade the package assert rhel_contenthost.execute(f'yum downgrade -y {FAKE_1_CUSTOM_PACKAGE}').status == 0 # Generate the report - with session: + with target_sat.ui_session() as session: session.organization.select(function_org.name) session.location.select(function_location.name) result_json = session.reporttemplate.generate( From 2daf512598ed5b0d5e79d3db7251e795cec7c6e6 Mon Sep 17 00:00:00 2001 From: Ladislav Vasina Date: Mon, 9 Dec 2024 19:51:34 +0100 Subject: [PATCH 2/4] Add force option to AK content-override which was added recently --- robottelo/host_helpers/cli_factory.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/robottelo/host_helpers/cli_factory.py b/robottelo/host_helpers/cli_factory.py index 7f9c73cb86f..cad2d29e58c 100644 --- a/robottelo/host_helpers/cli_factory.py +++ b/robottelo/host_helpers/cli_factory.py @@ -689,8 +689,14 @@ def setup_org_for_a_custom_repo(self, options=None): ) # Override custom product to true ( turned off by default in 6.14 ) custom_repo = self._satellite.cli.Repository.info({'id': custom_repo['id']}) + # Force flag added in hammer-cli-katello#977 self._satellite.cli.ActivationKey.content_override( - {'id': activationkey_id, 'content-label': custom_repo['content-label'], 'value': 'true'} + { + 'id': activationkey_id, + 'content-label': custom_repo['content-label'], + 'value': 'true', + 'force': 'true', + } ) return { 'activationkey-id': activationkey_id, From 066db48c11c0c86f7a78e0d08b49d1cd7c8aede5 Mon Sep 17 00:00:00 2001 From: Ladislav Vasina Date: Mon, 9 Dec 2024 21:18:34 +0100 Subject: [PATCH 3/4] Revert cli_factory change --- robottelo/host_helpers/cli_factory.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/robottelo/host_helpers/cli_factory.py b/robottelo/host_helpers/cli_factory.py index cad2d29e58c..5002fe3c208 100644 --- a/robottelo/host_helpers/cli_factory.py +++ b/robottelo/host_helpers/cli_factory.py @@ -691,12 +691,7 @@ def setup_org_for_a_custom_repo(self, options=None): custom_repo = self._satellite.cli.Repository.info({'id': custom_repo['id']}) # Force flag added in hammer-cli-katello#977 self._satellite.cli.ActivationKey.content_override( - { - 'id': activationkey_id, - 'content-label': custom_repo['content-label'], - 'value': 'true', - 'force': 'true', - } + {'id': activationkey_id, 'content-label': custom_repo['content-label'], 'value': 'true'} ) return { 'activationkey-id': activationkey_id, From 6c1e5af9192668ffc3ce84ed1cfbff2cd68a87aa Mon Sep 17 00:00:00 2001 From: Ladislav Vasina Date: Mon, 9 Dec 2024 21:19:31 +0100 Subject: [PATCH 4/4] Comment fixed --- robottelo/host_helpers/cli_factory.py | 1 - 1 file changed, 1 deletion(-) diff --git a/robottelo/host_helpers/cli_factory.py b/robottelo/host_helpers/cli_factory.py index 5002fe3c208..7f9c73cb86f 100644 --- a/robottelo/host_helpers/cli_factory.py +++ b/robottelo/host_helpers/cli_factory.py @@ -689,7 +689,6 @@ def setup_org_for_a_custom_repo(self, options=None): ) # Override custom product to true ( turned off by default in 6.14 ) custom_repo = self._satellite.cli.Repository.info({'id': custom_repo['id']}) - # Force flag added in hammer-cli-katello#977 self._satellite.cli.ActivationKey.content_override( {'id': activationkey_id, 'content-label': custom_repo['content-label'], 'value': 'true'} )