Skip to content

Commit

Permalink
Remove Data telemetry option from convert2rhel tests (SatelliteQE#15512)
Browse files Browse the repository at this point in the history
* Remove Data telemetry option from convert2rhel tests

Signed-off-by: Gaurav Talreja <[email protected]>

* Add check to vefify convert2rhel conversion facts

Signed-off-by: Gaurav Talreja <[email protected]>

---------

Signed-off-by: Gaurav Talreja <[email protected]>
  • Loading branch information
Gauravtalreja1 authored and jyejare committed Oct 19, 2024
1 parent 67aee1a commit 6affbe2
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions tests/foreman/api/test_convert2rhel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}',
},
Expand All @@ -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}',
Expand All @@ -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
Expand All @@ -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]
Expand All @@ -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}',
},
Expand All @@ -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}',
Expand All @@ -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'

0 comments on commit 6affbe2

Please sign in to comment.