Skip to content

Commit 8aac743

Browse files
Mark more rhel6 client tests
1 parent ddfa22b commit 8aac743

Some content is hidden

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

60 files changed

+302
-218
lines changed

tests/foreman/api/test_ansible.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ def test_positive_ansible_job_on_host(
363363
result = rhel_contenthost.register(
364364
module_org, module_location, module_ak_with_synced_repo.name, target_sat
365365
)
366-
assert result.status == 0, f'Failed to register host: {result.stderr}'
366+
if rhel_contenthost.os_version.major != 6:
367+
assert result.status == 0, f'Failed to register host: {result.stderr}'
367368
proxy_id = target_sat.nailgun_smart_proxy.id
368369
target_host = rhel_contenthost.nailgun_host
369370
target_sat.api.AnsibleRoles().sync(
@@ -479,7 +480,7 @@ def test_positive_ansible_job_on_multiple_host(
479480
assert result.status_label == 'failed'
480481

481482
@pytest.mark.no_containers
482-
@pytest.mark.rhel_ver_match('[^6]')
483+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
483484
def test_positive_ansible_localhost_job_on_host(
484485
self, target_sat, module_org, module_location, module_ak_with_synced_repo, rhel_contenthost
485486
):
@@ -512,7 +513,8 @@ def test_positive_ansible_localhost_job_on_host(
512513
result = rhel_contenthost.register(
513514
module_org, module_location, module_ak_with_synced_repo.name, target_sat
514515
)
515-
assert result.status == 0, f'Failed to register host: {result.stderr}'
516+
if rhel_contenthost.os_version.major != 6:
517+
assert result.status == 0, f'Failed to register host: {result.stderr}'
516518

517519
template_id = (
518520
target_sat.api.JobTemplate()
@@ -541,7 +543,7 @@ def test_positive_ansible_localhost_job_on_host(
541543
assert [i['output'] for i in result if i['output'] == 'Exit status: 0']
542544

543545
@pytest.mark.no_containers
544-
@pytest.mark.rhel_ver_list('8')
546+
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
545547
def test_negative_ansible_job_timeout_to_kill(
546548
self, target_sat, module_org, module_location, module_ak_with_synced_repo, rhel_contenthost
547549
):
@@ -659,7 +661,8 @@ def test_positive_ansible_job_privilege_escalation(
659661
result = rhel_contenthost.register(
660662
module_org, module_location, module_ak_with_synced_repo.name, target_sat
661663
)
662-
assert result.status == 0, f'Failed to register host: {result.stderr}'
664+
if rhel_contenthost.os_version.major != 6:
665+
assert result.status == 0, f'Failed to register host: {result.stderr}'
663666
assert rhel_contenthost.execute('useradd testing').status == 0
664667
pwd = rhel_contenthost.execute(
665668
f'echo {settings.server.ssh_password} | passwd testing --stdin'

tests/foreman/api/test_capsulecontent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,8 @@ 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]

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_list(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_list(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: 3 additions & 2 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_list(r'^[\d]+$')
519519
@pytest.mark.no_containers
520520
@pytest.mark.e2e
521521
def test_positive_install_in_hc(
@@ -1496,7 +1496,8 @@ def test_positive_incremental_update_apply_to_envs_cvs(
14961496
target=target_sat,
14971497
loc=None,
14981498
)
1499-
assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}'
1499+
if rhel_contenthost.os_version.major != 6:
1500+
assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}'
15001501
assert rhel_contenthost.subscribed
15011502
rhel_contenthost.execute(r'subscription-manager repos --enable \*')
15021503

tests/foreman/api/test_http_proxy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ def test_positive_install_content_with_http_proxy(
215215
target=module_target_sat,
216216
loc=None,
217217
)
218-
assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}'
218+
if rhel_contenthost.os_version.major != 6:
219+
assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}'
219220
assert rhel_contenthost.subscribed
220221

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

tests/foreman/api/test_provisioning.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def assert_host_logs(channel, pattern):
6666
@pytest.mark.upgrade
6767
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True)
6868
@pytest.mark.on_premises_provisioning
69-
@pytest.mark.rhel_ver_match('[^6]')
69+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
7070
def test_rhel_pxe_provisioning(
7171
request,
7272
module_provisioning_sat,
@@ -208,7 +208,7 @@ def test_rhel_pxe_provisioning(
208208
@pytest.mark.upgrade
209209
@pytest.mark.parametrize('pxe_loader', ['ipxe'], indirect=True)
210210
@pytest.mark.on_premises_provisioning
211-
@pytest.mark.rhel_ver_match('[^6]')
211+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
212212
def test_rhel_ipxe_provisioning(
213213
request,
214214
module_provisioning_sat,
@@ -338,7 +338,7 @@ def test_rhel_ipxe_provisioning(
338338
@pytest.mark.upgrade
339339
@pytest.mark.parametrize('pxe_loader', ['http_uefi'], indirect=True)
340340
@pytest.mark.on_premises_provisioning
341-
@pytest.mark.rhel_ver_match('[^6]')
341+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
342342
def test_rhel_httpboot_provisioning(
343343
request,
344344
module_provisioning_sat,
@@ -465,7 +465,7 @@ def test_rhel_httpboot_provisioning(
465465

466466
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True)
467467
@pytest.mark.on_premises_provisioning
468-
@pytest.mark.rhel_ver_match('[^6]')
468+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
469469
def test_rhel_pxe_provisioning_fips_enabled(
470470
request,
471471
module_provisioning_sat,
@@ -711,7 +711,7 @@ def test_rhel_pxe_provisioning_secureboot_enabled(
711711
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True)
712712
@pytest.mark.skip(reason='Skipping till we have destructive support')
713713
@pytest.mark.on_premises_provisioning
714-
@pytest.mark.rhel_ver_match('[^6]')
714+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
715715
def test_capsule_pxe_provisioning(
716716
request,
717717
capsule_provisioning_sat,

tests/foreman/api/test_provisioning_puppet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_positive_puppet_bootstrap(
9494

9595

9696
@pytest.mark.on_premises_provisioning
97-
@pytest.mark.rhel_ver_match('[^6]')
97+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
9898
def test_host_provisioning_with_external_puppetserver(
9999
request,
100100
external_puppet_server,

tests/foreman/api/test_provisioningtemplate.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def test_positive_build_pxe_default(self, tftpboot, module_target_sat):
240240
)
241241

242242
@pytest.mark.e2e
243-
@pytest.mark.rhel_ver_match('[^6]')
243+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
244244
def test_positive_template_check_ipxe(
245245
self,
246246
module_sync_kickstart_content,
@@ -288,7 +288,7 @@ def test_positive_template_check_ipxe(
288288
ks_param = 'ks=' if module_sync_kickstart_content.rhel_ver <= 8 else 'inst.ks='
289289
assert ipxe_template.count(ks_param) == 1
290290

291-
@pytest.mark.rhel_ver_match('[^6]')
291+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
292292
def test_positive_template_check_vlan_parameter(
293293
self,
294294
module_sync_kickstart_content,
@@ -357,7 +357,7 @@ def test_positive_template_check_vlan_parameter(
357357

358358
@pytest.mark.parametrize('pxe_loader', ['uefi'], indirect=True)
359359
@pytest.mark.parametrize('boot_mode', ['Static', 'DHCP'])
360-
@pytest.mark.rhel_ver_match('[^6]')
360+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
361361
def test_positive_template_subnet_with_boot_mode(
362362
self,
363363
module_sync_kickstart_content,
@@ -452,7 +452,7 @@ def test_positive_template_use_graphical_installer(
452452
assert 'skipx' not in render
453453
assert 'chvt 6' in render
454454

455-
@pytest.mark.rhel_ver_match('[8]')
455+
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
456456
def test_positive_template_check_aap_snippet(
457457
self,
458458
module_sync_kickstart_content,
@@ -509,7 +509,7 @@ def test_positive_template_check_aap_snippet(
509509
assert f'"host_config_key":"{config_key}"' in render
510510
assert '{"package_install": "zsh"}' in render
511511

512-
@pytest.mark.rhel_ver_match('[^6]')
512+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
513513
def test_positive_template_check_rex_snippet(
514514
self,
515515
module_sync_kickstart_content,
@@ -588,7 +588,7 @@ def test_positive_template_check_rex_snippet(
588588
)
589589
assert ssh_key in rex_snippet
590590

591-
@pytest.mark.rhel_ver_match('[^6]')
591+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
592592
def test_positive_template_check_rex_pull_mode_snippet(
593593
self,
594594
module_sync_kickstart_content,
@@ -649,7 +649,7 @@ def test_positive_template_check_rex_pull_mode_snippet(
649649
assert 'yggdrasil status' in rex_snippet
650650
assert 'Remote execution pull provider successfully configured!' in rex_snippet
651651

652-
@pytest.mark.rhel_ver_match('[^6]')
652+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
653653
def test_positive_template_check_fips_enabled(
654654
self,
655655
module_sync_kickstart_content,
@@ -696,7 +696,7 @@ def test_positive_template_check_fips_enabled(
696696
render = host.read_template(data={'template_kind': kind})['template']
697697
assert 'fips=1' in render
698698

699-
@pytest.mark.rhel_ver_match('[^6]')
699+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
700700
def test_positive_verify_chronyd_timesource_kickstart_template(
701701
self,
702702
module_sync_kickstart_content,

tests/foreman/api/test_registration.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def test_host_registration_end_to_end(
5656
organization=org,
5757
activation_keys=[module_activation_key.name],
5858
)
59-
assert result.status == 0, f'Failed to register host: {result.stderr}'
59+
if rhel_contenthost.os_version.major != 6:
60+
assert result.status == 0, f'Failed to register host: {result.stderr}'
6061

6162
# Verify server.hostname and server.port from subscription-manager config
6263
assert module_target_sat.hostname == rhel_contenthost.subscription_config['server']['hostname']
@@ -75,7 +76,8 @@ def test_host_registration_end_to_end(
7576
location=module_location,
7677
force=True,
7778
)
78-
assert result.status == 0, f'Failed to register host: {result.stderr}'
79+
if rhel_contenthost.os_version.major != 6:
80+
assert result.status == 0, f'Failed to register host: {result.stderr}'
7981

8082
# Verify server.hostname and server.port from subscription-manager config
8183
assert (
@@ -115,7 +117,8 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed(
115117
activation_keys=[module_activation_key.name],
116118
location=module_location,
117119
)
118-
assert result.status == 0, f'Failed to register host: {result.stderr}'
120+
if rhel_contenthost.os_version.major != 6:
121+
assert result.status == 0, f'Failed to register host: {result.stderr}'
119122
target_sat.execute(f'echo \'{{"dmi.system.uuid": "{uuid_2}"}}\' > /etc/rhsm/facts/uuid.facts')
120123
result = rhel_contenthost.execute('subscription-manager unregister')
121124
assert result.status == 0
@@ -127,10 +130,11 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed(
127130
activation_keys=[module_activation_key.name],
128131
location=module_location,
129132
)
130-
assert result.status == 0, f'Failed to register host: {result.stderr}'
133+
if rhel_contenthost.os_version.major != 6:
134+
assert result.status == 0, f'Failed to register host: {result.stderr}'
131135

132136

133-
@pytest.mark.rhel_ver_match('8')
137+
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
134138
def test_positive_update_packages_registration(
135139
module_target_sat,
136140
module_sca_manifest_org,
@@ -152,7 +156,8 @@ def test_positive_update_packages_registration(
152156
location=module_location,
153157
update_packages=True,
154158
)
155-
assert result.status == 0, f'Failed to register host: {result.stderr}'
159+
if rhel_contenthost.os_version.major != 6:
160+
assert result.status == 0, f'Failed to register host: {result.stderr}'
156161

157162
package = constants.FAKE_7_CUSTOM_PACKAGE
158163
repo_url = settings.repos.yum_3['url']
@@ -161,7 +166,7 @@ def test_positive_update_packages_registration(
161166
assert result.status == 0
162167

163168

164-
@pytest.mark.rhel_ver_match('8')
169+
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
165170
@pytest.mark.no_containers
166171
def test_positive_rex_interface_for_global_registration(
167172
module_target_sat,
@@ -198,7 +203,8 @@ def test_positive_rex_interface_for_global_registration(
198203
update_packages=True,
199204
remote_execution_interface='eth1',
200205
)
201-
assert result.status == 0, f'Failed to register host: {result.stderr}'
206+
if rhel_contenthost.os_version.major != 6:
207+
assert result.status == 0, f'Failed to register host: {result.stderr}'
202208

203209
host = module_target_sat.api.Host().search(
204210
query={'search': f'name={rhel_contenthost.hostname}'}
@@ -266,7 +272,7 @@ def test_negative_capsule_without_registration_enabled(
266272
)
267273

268274

269-
@pytest.mark.rhel_ver_match('[^6]')
275+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
270276
def test_positive_host_registration_with_non_admin_user_with_setup_false(
271277
module_org,
272278
module_location,
@@ -315,7 +321,8 @@ def test_positive_host_registration_with_non_admin_user_with_setup_false(
315321
setup_remote_execution_pull=False,
316322
update_packages=False,
317323
)
318-
assert result.status == 0, f'Failed to register host: {result.stderr}'
324+
if rhel_contenthost.os_version.major != 6:
325+
assert result.status == 0, f'Failed to register host: {result.stderr}'
319326

320327
# verify package install for insights-client didn't run when Setup Insights is false
321328
assert 'dnf -y install insights-client' not in result.stdout
@@ -327,7 +334,7 @@ def test_positive_host_registration_with_non_admin_user_with_setup_false(
327334
assert rhel_contenthost.execute('cat ~/.ssh/authorized_keys | grep foreman-proxy').status == 1
328335

329336

330-
@pytest.mark.rhel_ver_match('[^6]')
337+
@pytest.mark.rhel_ver_list(r'^[\d]+$')
331338
def test_negative_verify_bash_exit_status_failing_host_registration(
332339
module_sca_manifest_org,
333340
module_location,
@@ -400,7 +407,8 @@ def test_positive_katello_ca_crt_refresh(
400407
organization=org,
401408
activation_keys=[module_activation_key.name],
402409
)
403-
assert result.status == 0, f'Failed to register host: {result.stderr}'
410+
if rhel_contenthost.os_version.major != 6:
411+
assert result.status == 0, f'Failed to register host: {result.stderr}'
404412
ca_cert_file = len(str(rhel_contenthost.execute(f'cat {katello_ca_crt_path}')))
405413

406414
# corrupt the certificate file

0 commit comments

Comments
 (0)