From 1bf68ea9135a800743816566210b9f77d481ea57 Mon Sep 17 00:00:00 2001 From: shwsingh Date: Thu, 19 Dec 2024 15:59:24 +0530 Subject: [PATCH] Update target os name due to RHELC-1737 --- robottelo/utils/issue_handlers/__init__.py | 2 +- tests/foreman/api/test_convert2rhel.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/robottelo/utils/issue_handlers/__init__.py b/robottelo/utils/issue_handlers/__init__.py index 803b5800080..19b7802141a 100644 --- a/robottelo/utils/issue_handlers/__init__.py +++ b/robottelo/utils/issue_handlers/__init__.py @@ -3,7 +3,7 @@ # Methods related to issue handlers in general from robottelo.utils.issue_handlers import bugzilla, jira -handler_methods = {'BZ': bugzilla.is_open_bz, 'SAT': jira.is_open_jira} +handler_methods = {'BZ': bugzilla.is_open_bz, 'SAT': jira.is_open_jira, 'RHELC': jira.is_open_jira} SUPPORTED_HANDLERS = tuple(f"{handler}" for handler in handler_methods) diff --git a/tests/foreman/api/test_convert2rhel.py b/tests/foreman/api/test_convert2rhel.py index 5ae7a3ed392..345e7ee372f 100644 --- a/tests/foreman/api/test_convert2rhel.py +++ b/tests/foreman/api/test_convert2rhel.py @@ -19,6 +19,7 @@ from robottelo.config import settings from robottelo.constants import DEFAULT_ARCHITECTURE, REPOS +from robottelo.utils.issue_handlers import is_open def create_repo(sat, org, repo_url, ssl_cert=None): @@ -328,7 +329,12 @@ def test_convert2rhel_oracle_with_pre_conversion_template_check( assert host_content['facts']['conversions::success'] == 'true' convert2rhel_facts = json.loads(oracle.execute('cat /etc/rhsm/facts/convert2rhel.facts').stdout) assert convert2rhel_facts['conversions.env.CONVERT2RHEL_THROUGH_FOREMAN'] == '1' - assert target_os_name in convert2rhel_facts['conversions.target_os.name'] + # https://issues.redhat.com/browse/RHELC-1737 + assert ( + "Oracle" + if is_open('RHELC-1737') + else target_os_name in convert2rhel_facts['conversions.target_os.name'] + ) assert convert2rhel_facts['conversions.success'] is True @@ -422,5 +428,10 @@ def test_convert2rhel_centos_with_pre_conversion_template_check( assert host_content['facts']['conversions::success'] == 'true' convert2rhel_facts = json.loads(centos.execute('cat /etc/rhsm/facts/convert2rhel.facts').stdout) assert convert2rhel_facts['conversions.env.CONVERT2RHEL_THROUGH_FOREMAN'] == '1' - assert target_os_name in convert2rhel_facts['conversions.target_os.name'] + # https://issues.redhat.com/browse/RHELC-1737 + assert ( + "CentOS" + if is_open('RHELC-1737') + else target_os_name in convert2rhel_facts['conversions.target_os.name'] + ) assert convert2rhel_facts['conversions.success'] is True