From 6affbe2014486218db513bd602de58e23983ebfc Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Fri, 5 Jul 2024 11:50:05 +0530 Subject: [PATCH] Remove Data telemetry option from convert2rhel tests (#15512) * Remove Data telemetry option from convert2rhel tests Signed-off-by: Gaurav Talreja * Add check to vefify convert2rhel conversion facts Signed-off-by: Gaurav Talreja --------- Signed-off-by: Gaurav Talreja --- tests/foreman/api/test_convert2rhel.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/tests/foreman/api/test_convert2rhel.py b/tests/foreman/api/test_convert2rhel.py index acb147209ec..3adbeb8eaf5 100644 --- a/tests/foreman/api/test_convert2rhel.py +++ b/tests/foreman/api/test_convert2rhel.py @@ -249,6 +249,8 @@ def test_convert2rhel_oracle_with_pre_conversion_template_check( and subscription status :parametrized: yes + + Verifies: SAT-24654 """ major = version.split('.')[0] assert oracle.execute('yum -y update').status == 0 @@ -272,9 +274,6 @@ def test_convert2rhel_oracle_with_pre_conversion_template_check( synchronous=False, data={ 'job_template_id': template_id, - 'inputs': { - 'Data telemetry': 'yes', - }, 'targeting_type': 'static_query', 'search_query': f'name = {oracle.hostname}', }, @@ -299,7 +298,6 @@ def test_convert2rhel_oracle_with_pre_conversion_template_check( 'inputs': { 'Activation Key': activation_key_rhel.id, 'Restart': 'yes', - 'Data telemetry': 'yes', }, 'targeting_type': 'static_query', 'search_query': f'name = {oracle.hostname}', @@ -320,6 +318,12 @@ def test_convert2rhel_oracle_with_pre_conversion_template_check( or host_content['operatingsystem_name'].startswith(f'RedHat {version}') or host_content['operatingsystem_name'].startswith(f'RHEL {version}') ) + # Wait for the host to be rebooted and SSH daemon to be started. + oracle.wait_for_connection() + + # Verify convert2rhel facts are generated, and verify fact conversions.success is true + assert oracle.execute('test -f /etc/rhsm/facts/convert2rhel.facts').status == 0 + assert host_content['facts']['conversions::success'] == 'true' @pytest.mark.e2e @@ -340,6 +344,8 @@ def test_convert2rhel_centos_with_pre_conversion_template_check( and subscription status :parametrized: yes + + Verifies: SAT-24654 """ host_content = module_target_sat.api.Host(id=centos.hostname).read_json() major = version.split('.')[0] @@ -355,9 +361,6 @@ def test_convert2rhel_centos_with_pre_conversion_template_check( synchronous=False, data={ 'job_template_id': template_id, - 'inputs': { - 'Data telemetry': 'yes', - }, 'targeting_type': 'static_query', 'search_query': f'name = {centos.hostname}', }, @@ -382,7 +385,6 @@ def test_convert2rhel_centos_with_pre_conversion_template_check( 'inputs': { 'Activation Key': activation_key_rhel.id, 'Restart': 'yes', - 'Data telemetry': 'yes', }, 'targeting_type': 'static_query', 'search_query': f'name = {centos.hostname}', @@ -405,3 +407,10 @@ def test_convert2rhel_centos_with_pre_conversion_template_check( or host_content['operatingsystem_name'].startswith(f'RedHat {version}') or host_content['operatingsystem_name'].startswith(f'RHEL {version}') ) + + # Wait for the host to be rebooted and SSH daemon to be started. + centos.wait_for_connection() + + # Verify convert2rhel facts are generated, and verify fact conversions.success is true + assert centos.execute('test -f /etc/rhsm/facts/convert2rhel.facts').status == 0 + assert host_content['facts']['conversions::success'] == 'true'