Skip to content

Commit 6405b44

Browse files
Don't include tracer, pull-provider, yggdrasil
1 parent 8aac743 commit 6405b44

16 files changed

+93
-70
lines changed

tests/foreman/api/test_ansible.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class TestAnsibleREX:
334334
@pytest.mark.e2e
335335
@pytest.mark.pit_client
336336
@pytest.mark.no_containers
337-
@pytest.mark.rhel_ver_list(r'^[\d]+$')
337+
@pytest.mark.rhel_ver_match('[^6]')
338338
def test_positive_ansible_job_on_host(
339339
self, target_sat, module_org, module_location, module_ak_with_synced_repo, rhel_contenthost
340340
):
@@ -357,14 +357,16 @@ def test_positive_ansible_job_on_host(
357357
:BZ: 2164400
358358
"""
359359
SELECTED_ROLE = 'RedHatInsights.insights-client'
360-
if rhel_contenthost.os_version.major <= 7:
361-
rhel_contenthost.create_custom_repos(rhel7=settings.repos.rhel7_os)
360+
rhelver = rhel_contenthost.os_version.major
361+
if rhelver <= 7:
362+
rhel_contenthost.create_custom_repos(**settings.repos[f'rhel{rhelver}_os'])
362363
assert rhel_contenthost.execute('yum install -y insights-client').status == 0
363364
result = rhel_contenthost.register(
364365
module_org, module_location, module_ak_with_synced_repo.name, target_sat
365366
)
366-
if rhel_contenthost.os_version.major != 6:
367+
if rhelver != 6:
367368
assert result.status == 0, f'Failed to register host: {result.stderr}'
369+
assert rhel_contenthost.subscribed
368370
proxy_id = target_sat.nailgun_smart_proxy.id
369371
target_host = rhel_contenthost.nailgun_host
370372
target_sat.api.AnsibleRoles().sync(
@@ -438,7 +440,9 @@ def test_positive_ansible_job_on_multiple_host(
438440
result = host.register(
439441
module_org, module_location, module_ak_with_synced_repo.name, target_sat
440442
)
441-
assert result.status == 0, f'Failed to register host: {result.stderr}'
443+
if host.os_version.major != 6:
444+
assert result.status == 0, f'Failed to register host: {result.stderr}'
445+
assert host.subscribed
442446
proxy_id = target_sat.nailgun_smart_proxy.id
443447
target_host = host.nailgun_host
444448
target_sat.api.AnsibleRoles().sync(
@@ -515,7 +519,7 @@ def test_positive_ansible_localhost_job_on_host(
515519
)
516520
if rhel_contenthost.os_version.major != 6:
517521
assert result.status == 0, f'Failed to register host: {result.stderr}'
518-
522+
assert rhel_contenthost.subscribed
519523
template_id = (
520524
target_sat.api.JobTemplate()
521525
.search(query={'search': 'name="Ansible - Run playbook"'})[0]
@@ -577,8 +581,9 @@ def test_negative_ansible_job_timeout_to_kill(
577581
result = rhel_contenthost.register(
578582
module_org, module_location, module_ak_with_synced_repo.name, target_sat
579583
)
580-
assert result.status == 0, f'Failed to register host: {result.stderr}'
581-
584+
if rhel_contenthost.os_version.major != 6:
585+
assert result.status == 0, f'Failed to register host: {result.stderr}'
586+
assert rhel_contenthost.subscribed
582587
template_id = (
583588
target_sat.api.JobTemplate()
584589
.search(query={'search': 'name="Ansible - Run playbook"'})[0]
@@ -663,6 +668,7 @@ def test_positive_ansible_job_privilege_escalation(
663668
)
664669
if rhel_contenthost.os_version.major != 6:
665670
assert result.status == 0, f'Failed to register host: {result.stderr}'
671+
assert rhel_contenthost.subscribed
666672
assert rhel_contenthost.execute('useradd testing').status == 0
667673
pwd = rhel_contenthost.execute(
668674
f'echo {settings.server.ssh_password} | passwd testing --stdin'

tests/foreman/api/test_errata.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 \*')

tests/foreman/api/test_provisioningtemplate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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_list(r'^[\d]+$')
591+
@pytest.mark.rhel_ver_match('[^6]')
592592
def test_positive_template_check_rex_pull_mode_snippet(
593593
self,
594594
module_sync_kickstart_content,

tests/foreman/api/test_registration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def test_negative_capsule_without_registration_enabled(
272272
)
273273

274274

275-
@pytest.mark.rhel_ver_list(r'^[\d]+$')
275+
@pytest.mark.rhel_ver_match('[^6]')
276276
def test_positive_host_registration_with_non_admin_user_with_setup_false(
277277
module_org,
278278
module_location,

tests/foreman/api/test_remoteexecution.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_positive_find_capsule_upgrade_playbook(target_sat):
3838

3939

4040
@pytest.mark.no_containers
41-
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
41+
@pytest.mark.rhel_ver_match('[^6]')
4242
@pytest.mark.parametrize(
4343
'setting_update',
4444
['remote_execution_global_proxy=False'],
@@ -171,7 +171,7 @@ def test_negative_time_to_pickup(
171171

172172

173173
@pytest.mark.no_containers
174-
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
174+
@pytest.mark.rhel_ver_match('[^6]')
175175
@pytest.mark.parametrize(
176176
'setting_update',
177177
['remote_execution_global_proxy=False'],

tests/foreman/api/test_reporttemplates.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ def test_positive_applied_errata(
388388
result = rhel_contenthost.register(
389389
function_org, function_location, activation_key.name, target_sat
390390
)
391-
assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout
391+
if rhel_contenthost.os_version.major != 6:
392+
assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout
392393
assert rhel_contenthost.subscribed
393394
rhel_contenthost.execute(r'subscription-manager repos --enable \*')
394395
assert rhel_contenthost.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0
@@ -465,7 +466,8 @@ def test_positive_applied_errata_report_with_invalid_errata(
465466
result = rhel_contenthost.register(
466467
function_org, function_location, activation_key.name, target_sat
467468
)
468-
assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout
469+
if rhel_contenthost.os_version.major != 6:
470+
assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout
469471
assert rhel_contenthost.subscribed
470472
rhel_contenthost.execute(r'subscription-manager repos --enable \*')
471473
assert rhel_contenthost.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0
@@ -542,7 +544,8 @@ def test_positive_applied_errata_by_search(
542544
.description
543545
)
544546
result = rhel_contenthost.register(function_org, None, activation_key.name, target_sat)
545-
assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout
547+
if rhel_contenthost.os_version.major != 6:
548+
assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout
546549
assert rhel_contenthost.subscribed
547550
rhel_contenthost.execute(r'subscription-manager repos --enable \*')
548551
assert rhel_contenthost.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0
@@ -636,8 +639,9 @@ def test_positive_applied_errata_for_specific_hosts(
636639
for host_info in [RHSA, RHBA]:
637640
chost = host_info['host']
638641
result = chost.register(module_org, None, activation_key.name, module_target_sat)
639-
assert f'The registered system name is: {chost.hostname}' in result.stdout
640-
assert chost.subscribed
642+
if chost.os_version.major != 6:
643+
assert f'The registered system name is: {chost.hostname}' in result.stdout
644+
assert chost.subscribed
641645
assert chost.execute(f'yum install -y {host_info["outdated_pkg"]}').status == 0
642646

643647
# now each erratum is applicable to one host,
@@ -869,7 +873,8 @@ def test_positive_generate_job_report(setup_content, module_target_sat, content_
869873
for host in content_hosts:
870874
host.register(org, None, ak.name, module_target_sat)
871875
host.add_rex_key(module_target_sat)
872-
assert host.subscribed
876+
if host.os_version.major != 6:
877+
assert host.subscribed
873878
# Run a Job on the Host
874879
template_id = (
875880
module_target_sat.api.JobTemplate()
@@ -951,7 +956,8 @@ def test_positive_installable_errata(
951956
result = rhel_contenthost.register(
952957
function_org, function_location, activation_key.name, target_sat
953958
)
954-
assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout
959+
if rhel_contenthost.os_version.major != 6:
960+
assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout
955961
assert rhel_contenthost.subscribed
956962

957963
# Remove package if already installed on this host
@@ -1073,8 +1079,10 @@ def test_positive_installed_products(
10731079
content_view=cv, organization=org, environment=cv.environment[-1]
10741080
).create()
10751081

1076-
rhel_contenthost.register(org, default_location, ak.name, target_sat)
1077-
assert rhel_contenthost.subscribed, 'Host registration failed.'
1082+
if rhel_contenthost.os_version.major != 6:
1083+
rhel_contenthost.register(org, default_location, ak.name, target_sat)
1084+
if rhel_contenthost.os_version.major != 6:
1085+
assert rhel_contenthost.subscribed, 'Host registration failed.'
10781086

10791087
input_data = {
10801088
'organization_id': org.id,

tests/foreman/cli/test_activationkey.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,8 @@ def test_positive_usage_limit(module_org, module_location, target_sat, content_h
600600
assert vm1.subscribed
601601
result = vm2.register(module_org, module_location, new_ak['name'], target_sat)
602602
assert not vm2.subscribed
603-
assert result.status, 'Second registration was expected to fail'
603+
if vm2.os_version.major != 6:
604+
assert result.status, 'Second registration was expected to fail'
604605
assert f"Max Hosts ({max_hosts}) reached for activation key '{new_ak.name}'" in result.stderr
605606

606607

@@ -800,7 +801,8 @@ def test_positive_update_aks_to_chost(
800801
activation_keys=ak['name'],
801802
target=module_target_sat,
802803
)
803-
assert rhel_contenthost.subscribed
804+
if rhel_contenthost.os_version.major != 6:
805+
assert rhel_contenthost.subscribed
804806

805807

806808
@pytest.mark.stubbed
@@ -1542,7 +1544,7 @@ def test_syspurpose_end_to_end(
15421544
res = rhel_contenthost.register(module_org, None, activation_key.name, target_sat)
15431545
if rhel_contenthost.os_version.major != 6:
15441546
assert res.status == 0, f'Failed to register host: {res.stderr}'
1545-
assert rhel_contenthost.subscribed
1547+
assert rhel_contenthost.subscribed
15461548
rhel_contenthost.enable_repo(module_rhst_repo)
15471549
host = target_sat.cli.Host.info({'name': rhel_contenthost.hostname})
15481550
# Assert system purpose values are set in the host as expected

tests/foreman/cli/test_host.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ def test_positive_host_list_with_cv_and_lce(
311311
"""
312312
# register client
313313
result = rhel_contenthost.register(function_org, None, function_ak_with_cv.name, target_sat)
314-
assert result.status == 0
314+
if rhel_contenthost.os_version.major != 6:
315+
assert result.status == 0
315316
assert rhel_contenthost.subscribed
316317
# list host command without specifying cv or lce
317318
host_list = target_sat.cli.Host.list(output_format='json')
@@ -1882,7 +1883,8 @@ def test_negative_multi_cv_registration(
18821883

18831884
# Register with global reg, just to get the sub-man config and certs right
18841885
result = rhel_contenthost.register(module_org, None, module_ak_with_cv.name, target_sat)
1885-
assert result.status == 0
1886+
if rhel_contenthost.os_version.major != 6:
1887+
assert result.status == 0
18861888
assert rhel_contenthost.subscribed
18871889

18881890
# Unregister the host
@@ -1954,7 +1956,8 @@ def test_positive_multi_cv_registration(
19541956
result = rhel_contenthost.register(
19551957
session_multicv_org, None, session_multicv_default_ak.name, session_multicv_sat
19561958
)
1957-
assert result.status == 0
1959+
if rhel_contenthost.os_version.major != 6:
1960+
assert result.status == 0
19581961
assert rhel_contenthost.subscribed
19591962

19601963
# Unregister the host
@@ -1968,7 +1971,8 @@ def test_positive_multi_cv_registration(
19681971
)
19691972

19701973
# Confirm that registration succeeds
1971-
assert res.status == 0
1974+
if rhel_contenthost.os_version.major != 6:
1975+
assert res.status == 0
19721976
assert rhel_contenthost.subscribed
19731977

19741978
# Confirm that the host is registered to both environments
@@ -2028,7 +2032,8 @@ def test_positive_multi_cv_assignment(
20282032
result = rhel_contenthost.register(
20292033
session_multicv_org, None, session_multicv_default_ak.name, session_multicv_sat
20302034
)
2031-
assert result.status == 0
2035+
if rhel_contenthost.os_version.major != 6:
2036+
assert result.status == 0
20322037
assert rhel_contenthost.subscribed
20332038

20342039
# Assign multiple content view environments to the host using hammer
@@ -2115,7 +2120,8 @@ def test_positive_multi_cv_host_repo_availability(
21152120
result = rhel_contenthost.register(
21162121
session_multicv_org, None, session_multicv_default_ak.name, session_multicv_sat
21172122
)
2118-
assert result.status == 0
2123+
if rhel_contenthost.os_version.major != 6:
2124+
assert result.status == 0
21192125
assert rhel_contenthost.subscribed
21202126

21212127
# Assign the host to multiple content view environments with subscription-manager
@@ -2173,7 +2179,7 @@ def test_positive_dump_enc_yaml(target_sat):
21732179
# -------------------------- HOST TRACE SUBCOMMAND SCENARIOS -------------------------
21742180
@pytest.mark.pit_client
21752181
@pytest.mark.client_release
2176-
@pytest.mark.rhel_ver_list(r'^[\d]+$')
2182+
@pytest.mark.rhel_ver_match('[^6]')
21772183
def test_positive_tracer_list_and_resolve(tracer_host, target_sat):
21782184
"""Install tracer on client, downgrade the service, check from the satellite
21792185
that tracer shows and resolves the problem. The test works with a package specified
@@ -2645,7 +2651,8 @@ def test_positive_reregister_rhel(
26452651
"""
26462652
# register client
26472653
result = rhel_contenthost.register(function_org, None, function_ak_with_cv.name, target_sat)
2648-
assert result.status == 0
2654+
if rhel_contenthost.os_version.major != 6:
2655+
assert result.status == 0
26492656
assert rhel_contenthost.subscribed
26502657
# remove local consumer certs
26512658
rhel_contenthost.execute('rm -rf /etc/pki/consumer/*')
@@ -2655,7 +2662,8 @@ def test_positive_reregister_rhel(
26552662
reregister = rhel_contenthost.register(
26562663
function_org, None, function_ak_with_cv.name, target_sat, force=True
26572664
)
2658-
assert reregister.status == 0
2665+
if rhel_contenthost.os_version.major != 6:
2666+
assert reregister.status == 0
26592667
assert rhel_contenthost.subscribed
26602668
certs = rhel_contenthost.execute("ls /etc/pki/consumer").stdout
26612669
assert 'cert.pem' in certs

tests/foreman/cli/test_registration.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ def test_upgrade_katello_ca_consumer_rpm(module_org, module_location, target_sat
165165
vm.register_contenthost(module_org.label)
166166
result = vm.execute('subscription-manager identity')
167167
# Result will be 0 if registered
168-
assert result.status == 0
168+
if vm.os_version.major != 6:
169+
assert result.status == 0
169170

170171

171172
@pytest.mark.rhel_ver_list(r'^[\d]+$')
@@ -179,7 +180,8 @@ def test_negative_register_twice(module_ak_with_cv, module_org, rhel_contenthost
179180
:parametrized: yes
180181
"""
181182
rhel_contenthost.register(module_org, None, module_ak_with_cv.name, target_sat)
182-
assert rhel_contenthost.subscribed
183+
if rhel_contenthost.os_version.major != 6:
184+
assert rhel_contenthost.subscribed
183185
result = rhel_contenthost.register(
184186
module_org, None, module_ak_with_cv.name, target_sat, force=False
185187
)
@@ -215,13 +217,12 @@ def test_positive_force_register_twice(module_ak_with_cv, module_org, rhel_conte
215217
)
216218
if rhel_contenthost.os_version.major != 6:
217219
assert result.status == 0
218-
assert f'Unregistering from: {target_sat.hostname}' in str(result.stdout)
219-
assert f'The registered system name is: {rhel_contenthost.hostname}' in str(result.stdout)
220-
reg_id_new = re.search(reg_id_pattern, result.stdout).group(1)
221-
assert f'The system has been registered with ID: {reg_id_new}' in str(result.stdout)
222-
assert reg_id_new != reg_id_old
223-
else:
224-
reg_id_new = re.search(reg_id_pattern, result.stdout).group(1) if result.stdout else None
220+
assert f'Unregistering from: {target_sat.hostname}' in str(result.stdout)
221+
assert f'The registered system name is: {rhel_contenthost.hostname}' in str(result.stdout)
222+
reg_id_new = re.search(reg_id_pattern, result.stdout).group(1)
223+
assert f'The system has been registered with ID: {reg_id_new}' in str(result.stdout)
224+
assert reg_id_new != reg_id_old
225+
reg_id_new = re.search(reg_id_pattern, result.stdout).group(1) if result.stdout else None
225226
assert rhel_contenthost.subscribed
226227
if reg_id_new:
227228
assert (

0 commit comments

Comments
 (0)