Skip to content

Commit 8327d6b

Browse files
Mark tests for RHEL6 client testing (#20760)
* Mark tests for RHEL6 client testing * Fix test failures for rhel6 client
1 parent a760242 commit 8327d6b

53 files changed

Lines changed: 262 additions & 183 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

conf/supportability.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ supportability:
22
content_hosts:
33
default_os_name: "RedHat"
44
rhel:
5-
versions: [7,'7_fips', 8, '8_fips', 9, '9_fips']
5+
versions: [6, 7, '7_fips', 8, '8_fips', 9, '9_fips']

pytest_fixtures/component/provision_capsule_pxe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def capsule_provisioning_rhel_content(
237237
assert task_status['result'] == 'success'
238238
rhel_xy = Version(
239239
constants.REPOS['kickstart'][f'rhel{rhel_ver}']['version']
240-
if rhel_ver == 7
240+
if rhel_ver <= 7
241241
else constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos']['version']
242242
)
243243
o_systems = sat.api.OperatingSystem().search(

pytest_fixtures/component/provision_pxe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def module_provisioning_rhel_content(
9999
assert task_status['result'] == 'success'
100100
rhel_xy = Version(
101101
constants.REPOS['kickstart'][f'rhel{rhel_ver}']['version']
102-
if rhel_ver == 7
102+
if rhel_ver <= 7
103103
else constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos']['version']
104104
)
105105
o_systems = sat.api.OperatingSystem().search(

pytest_fixtures/component/provisioning_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def module_sync_kickstart_content(
9090
assert task_status['result'] == 'success'
9191
rhel_xy = Version(
9292
constants.REPOS['kickstart'][f'rhel{rhel_ver}']['version']
93-
if rhel_ver == 7
93+
if rhel_ver <= 7
9494
else constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos']['version']
9595
)
9696
o_systems = module_target_sat.api.OperatingSystem().search(

robottelo/constants/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@
290290
'rhsc8': 'Red Hat Satellite Capsule 6.16 for RHEL 8 x86_64 (RPMs)',
291291
'rhsc9': 'Red Hat Satellite Capsule 6.16 for RHEL 9 x86_64 (RPMs)',
292292
'rhsc7_iso': 'Red Hat Satellite Capsule 6.4 (for RHEL 7 Server) (ISOs)',
293+
'rhsclient6': 'Red Hat Satellite Client 6 (for RHEL 6 Server - ELS) (RPMs)',
293294
'rhsclient7': 'Red Hat Satellite Client 6 (for RHEL 7 Server) (RPMs)',
294295
'rhsclient8': 'Red Hat Satellite Client 6 for RHEL 8 x86_64 (RPMs)',
295296
'rhsclient9': 'Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs)',
@@ -382,7 +383,7 @@
382383
'major_version': 6,
383384
'distro_repository': True,
384385
'key': 'rhel',
385-
'version': '6.8',
386+
'version': '6.10',
386387
},
387388
'rhs9': {
388389
'id': 'satellite-6.16-for-rhel-9-x86_64-rpms',
@@ -433,6 +434,15 @@
433434
'id': 'rhel-7-server-satellite-capsule-6.4-isos',
434435
'name': ('Red Hat Satellite Capsule 6.4 for RHEL 7 Server ISOs x86_64'),
435436
},
437+
'rhsclient6': {
438+
'id': 'rhel-6-server-els-satellite-client-6-rpms',
439+
'name': ('Red Hat Satellite Client 6 for RHEL 6 Server - ELS RPMs x86_64'),
440+
'version': '6',
441+
'reposet': REPOSET['rhsclient6'],
442+
'product': PRDS['rhel_els'],
443+
'distro': 'rhel6',
444+
'key': PRODUCT_KEY_SAT_CLIENT,
445+
},
436446
'rhsclient7': {
437447
'id': 'rhel-7-server-satellite-client-6-rpms',
438448
'name': ('Red Hat Satellite Client 6 for RHEL 7 Server RPMs x86_64'),

tests/foreman/api/test_capsulecontent.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@ def test_positive_remove_capsule_orphans(
14161416
'repos_collection',
14171417
[
14181418
{
1419-
'distro': 'rhel9',
1419+
'distro': f'rhel{settings.content_host.default_rhel_version}',
14201420
'YumRepository': {'url': settings.repos.yum_0.url},
14211421
}
14221422
],
@@ -1518,22 +1518,23 @@ def test_complete_sync_fixes_metadata(
15181518
location=default_location,
15191519
activation_keys=[repos_collection.setup_content_data['activation_key']['name']],
15201520
)
1521-
assert result.status == 0, f'Failed to register host: {result.stderr}'
1521+
if rhel_contenthost.os_version.major != 6:
1522+
assert result.status == 0, f'Failed to register host: {result.stderr}'
15221523
host = module_target_sat.api.Host().search(
15231524
query={'search': f'name="{rhel_contenthost.hostname}"'}
15241525
)[0]
15251526
assert nc.id == host.content_facet_attributes['content_source_id'], (
15261527
'Expected to see the Capsule as the content source'
15271528
)
15281529

1529-
result = rhel_contenthost.execute('dnf repolist')
1530+
result = rhel_contenthost.execute('yum repolist')
15301531
assert result.status == 0
15311532
assert repos_collection.setup_content_data['repos'][0].content_label in result.stdout
15321533

1533-
result = rhel_contenthost.execute('dnf install -y cheetah') # with dependencies
1534+
result = rhel_contenthost.execute('yum install -y cheetah') # with dependencies
15341535
assert result.status == 0
15351536

1536-
result = rhel_contenthost.execute('dnf -y update')
1537+
result = rhel_contenthost.execute('yum -y update')
15371538
assert result.status == 0
15381539

15391540
@pytest.mark.skip_if_not_set('capsule')

tests/foreman/api/test_computeresource_vmware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
@pytest.mark.parametrize('vmware', ['vmware7', 'vmware8'], indirect=True)
2626
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True)
2727
@pytest.mark.parametrize('provision_method', ['build', 'bootdisk'])
28-
@pytest.mark.rhel_ver_match('[8]')
28+
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
2929
def test_positive_provision_end_to_end(
3030
request,
3131
setting_update,

tests/foreman/api/test_discoveredhost.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import pytest
1818
from wait_for import TimedOutError, wait_for
1919

20+
from robottelo.config import settings
2021
from robottelo.logging import logger
2122
from robottelo.utils.datafactory import valid_data_list
2223

@@ -169,7 +170,7 @@ class TestDiscoveredHost:
169170
@pytest.mark.on_premises_provisioning
170171
@pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True)
171172
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True)
172-
@pytest.mark.rhel_ver_list([8, 9])
173+
@pytest.mark.rhel_ver_match(r'^\d+$')
173174
def test_positive_provision_pxe_host(
174175
self,
175176
module_provisioning_rhel_content,
@@ -223,7 +224,7 @@ def test_positive_provision_pxe_host(
223224
@pytest.mark.on_premises_provisioning
224225
@pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True)
225226
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True)
226-
@pytest.mark.rhel_ver_list([8, 9])
227+
@pytest.mark.rhel_ver_match(r'^\d+$')
227228
def test_positive_provision_pxe_less_host(
228229
self,
229230
module_discovery_sat,
@@ -352,7 +353,7 @@ def test_positive_refresh_facts_pxe_host(self, module_target_sat):
352353
@pytest.mark.on_premises_provisioning
353354
@pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True)
354355
@pytest.mark.parametrize('pxe_loader', ['uefi'], indirect=True)
355-
@pytest.mark.rhel_ver_match('9')
356+
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
356357
def test_positive_reboot_pxe_host(
357358
self,
358359
module_provisioning_rhel_content,
@@ -394,7 +395,7 @@ def test_positive_reboot_pxe_host(
394395

395396
@pytest.mark.on_premises_provisioning
396397
@pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True)
397-
@pytest.mark.rhel_ver_match('9')
398+
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
398399
def test_positive_reboot_all_pxe_hosts(
399400
self,
400401
module_provisioning_rhel_content,

tests/foreman/api/test_errata.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def _publish_and_wait(sat, org, cv, search_rate=1, max_tries=10):
515515

516516

517517
@pytest.mark.upgrade
518-
@pytest.mark.rhel_ver_match('[^6]')
518+
@pytest.mark.rhel_ver_match(r'^\d+$')
519519
@pytest.mark.no_containers
520520
@pytest.mark.e2e
521521
def test_positive_install_in_hc(
@@ -579,9 +579,10 @@ def test_positive_install_in_hc(
579579
target=target_sat,
580580
loc=None,
581581
)
582-
assert result.status == 0, (
583-
f'Failed to register the host - {client.hostname}: {result.stderr}'
584-
)
582+
if client.os_version.major != 6:
583+
assert result.status == 0, (
584+
f'Failed to register the host - {client.hostname}: {result.stderr}'
585+
)
585586
client.add_rex_key(satellite=target_sat)
586587
assert client.subscribed
587588
client.run(r'subscription-manager repos --enable \*')
@@ -705,7 +706,7 @@ def test_positive_install_in_hc(
705706
)
706707

707708

708-
@pytest.mark.rhel_ver_match('[^6]')
709+
@pytest.mark.rhel_ver_match(r'^\d+$')
709710
@pytest.mark.no_containers
710711
@pytest.mark.e2e
711712
@pytest.mark.pit_client
@@ -1496,7 +1497,8 @@ def test_positive_incremental_update_apply_to_envs_cvs(
14961497
target=target_sat,
14971498
loc=None,
14981499
)
1499-
assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}'
1500+
if rhel_contenthost.os_version.major != 6:
1501+
assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}'
15001502
assert rhel_contenthost.subscribed
15011503
rhel_contenthost.execute(r'subscription-manager repos --enable \*')
15021504

tests/foreman/api/test_http_proxy.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def test_positive_end_to_end(
144144

145145
@pytest.mark.e2e
146146
@pytest.mark.upgrade
147-
@pytest.mark.rhel_ver_match('9')
147+
@pytest.mark.rhel_ver_match(r'^\d+$')
148148
@pytest.mark.run_in_one_thread
149149
@pytest.mark.parametrize(
150150
'setup_http_proxy',
@@ -179,7 +179,8 @@ def test_positive_install_content_with_http_proxy(
179179
180180
:parametrized: yes
181181
"""
182-
repo_to_use = 'rhsclient9'
182+
rhelver = rhel_contenthost.os_version.major
183+
repo_to_use = f'rhsclient{rhelver}'
183184
pkg_name = 'katello-host-tools'
184185
org = function_sca_manifest_org
185186
lce = module_target_sat.api.LifecycleEnvironment(organization=org).create()
@@ -215,7 +216,8 @@ def test_positive_install_content_with_http_proxy(
215216
target=module_target_sat,
216217
loc=None,
217218
)
218-
assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}'
219+
if rhel_contenthost.os_version.major != 6:
220+
assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}'
219221
assert rhel_contenthost.subscribed
220222

221223
result = rhel_contenthost.execute(f'yum install -y {pkg_name}')

0 commit comments

Comments
 (0)