Skip to content

Mark tests for RHEL6 client testing#20760

Open
jameerpathan111 wants to merge 2 commits intoSatelliteQE:6.16.zfrom
jameerpathan111:rhel6_client
Open

Mark tests for RHEL6 client testing#20760
jameerpathan111 wants to merge 2 commits intoSatelliteQE:6.16.zfrom
jameerpathan111:rhel6_client

Conversation

@jameerpathan111
Copy link
Contributor

@jameerpathan111 jameerpathan111 commented Feb 10, 2026

Problem Statement

We want to check how the robottelo tests are doing for rhel6 client with Satellite 6.16

Solution

  • Mark PIT tests for RHEL6 and run prt jobs
  • Skip assertion for RHEL6 host registration because of a known issue

Related Issues

Summary by Sourcery

Broaden RHEL client test coverage and supportability to include RHEL6 by relaxing version-specific test markers.

New Features:

  • Enable RHEL6 content hosts in the supportability configuration.

Tests:

  • Relax RHEL version selection markers across API, CLI, UI, long-run, destructive, and upgrade tests to run for any numeric RHEL major version.

Summary by Sourcery

Enable RHEL 6 client coverage across robottelo tests by generalizing RHEL version markers and adapting registration expectations.

New Features:

  • Add support for RHEL 6 client repositories and supportability configuration.

Enhancements:

  • Generalize RHEL version selection markers to run many scenarios across any numeric RHEL major version and align selected tests with the default RHEL content host version.

Tests:

  • Update numerous CLI, API, UI, long-run, destructive, and upgrade tests to allow execution on RHEL 6 clients while relaxing or adjusting assertions to avoid false failures on RHEL 6 registration behavior.

@jameerpathan111 jameerpathan111 self-assigned this Feb 10, 2026
@jameerpathan111 jameerpathan111 added No-CherryPick PR doesnt need CherryPick to previous branches Do Not Merge 6.16.z labels Feb 10, 2026
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 10, 2026

Reviewer's Guide

Extend Robottelo RHEL client test support to include RHEL6 by broadening version markers and relaxing strict success expectations on registration/assertions for RHEL6, plus wiring RHEL6 client repositories into supportability and provisioning fixtures.

File-Level Changes

Change Details Files
Broaden RHEL version selection markers so most client tests run for any numeric RHEL major version while a smaller subset targets the default RHEL version from settings.
  • Replace many @pytest.mark.rhel_ver_match(...) usages with @pytest.mark.rhel_ver_list(r'^[\d]+$') to allow all numeric RHEL major versions, including 6.
  • Update tests that previously hard‑coded specific versions (e.g. 7, 8, 9) to instead use rhel_ver_list with settings.content_host.default_rhel_version where the scenario should stay bound to the primary supported version.
  • Normalize some regex-based markers (e.g. '[^6].*') to simpler forms like '[^6]' where only the major version is used.
tests/foreman/cli/test_host.py
tests/foreman/cli/test_registration.py
tests/foreman/api/test_reporttemplates.py
tests/foreman/api/test_registration.py
tests/foreman/api/test_ansible.py
tests/foreman/cli/test_ansible.py
tests/foreman/ui/test_ansible.py
tests/foreman/ui/test_registration.py
tests/foreman/cli/test_remoteexecution.py
tests/foreman/ui/test_host.py
tests/foreman/cli/test_activationkey.py
tests/foreman/ui/test_repositories.py
tests/foreman/api/test_errata.py
tests/foreman/api/test_provisioningtemplate.py
tests/foreman/ui/test_activationkey.py
tests/foreman/ui/test_errata.py
tests/foreman/longrun/test_oscap.py
tests/foreman/cli/test_errata.py
tests/foreman/ui/test_reporttemplates.py
tests/foreman/api/test_provisioning.py
tests/foreman/ui/test_remoteexecution.py
tests/new_upgrades/test_remoteexecution.py
tests/foreman/cli/test_reporttemplates.py
tests/foreman/cli/test_computeresource_rhev.py
tests/foreman/cli/test_computeresource_vmware.py
tests/foreman/destructive/test_remoteexecution.py
tests/foreman/longrun/test_remoteexecution.py
tests/upgrades/test_client.py
tests/upgrades/test_remoteexecution.py
tests/foreman/cli/test_bootdisk.py
tests/foreman/cli/test_computeresource_libvirt.py
tests/foreman/destructive/test_host.py
tests/foreman/destructive/test_infoblox.py
tests/foreman/ui/test_computeresource_libvirt.py
tests/foreman/ui/test_package.py
tests/foreman/ui/test_rhcloud_insights.py
tests/foreman/ui/test_rhcloud_inventory.py
tests/new_upgrades/test_subscription.py
tests/upgrades/test_errata.py
tests/upgrades/test_repository.py
tests/upgrades/test_subscription.py
Relax test assertions that assume successful registration or subscription so tests can execute on RHEL6 even when registration semantics differ.
  • Wrap many assert result.status == 0 and assert host.subscribed checks with a conditional if <host>.os_version.major != 6 across CLI, API, UI, long-run, destructive, and upgrade tests.
  • Guard string-based expectations on registration output (e.g. 'The registered system name is ...') behind the same RHEL6 check.
  • Adjust some tests that rely on post-registration UUID/host lookups to skip those validations for RHEL6 where data may not exist.
tests/foreman/cli/test_host.py
tests/foreman/cli/test_registration.py
tests/foreman/api/test_reporttemplates.py
tests/foreman/api/test_registration.py
tests/foreman/api/test_ansible.py
tests/foreman/cli/test_ansible.py
tests/foreman/ui/test_ansible.py
tests/foreman/ui/test_registration.py
tests/foreman/cli/test_remoteexecution.py
tests/foreman/ui/test_host.py
tests/foreman/cli/test_activationkey.py
tests/foreman/ui/test_repositories.py
tests/foreman/api/test_errata.py
tests/foreman/ui/test_activationkey.py
tests/foreman/ui/test_errata.py
tests/foreman/longrun/test_oscap.py
tests/foreman/cli/test_errata.py
tests/foreman/ui/test_reporttemplates.py
tests/foreman/api/test_capsulecontent.py
tests/foreman/api/test_subscription.py
tests/foreman/api/test_http_proxy.py
tests/foreman/destructive/test_registration.py
tests/foreman/endtoend/test_api_endtoend.py
tests/foreman/ui/test_fact.py
tests/foreman/cli/test_fact.py
tests/foreman/cli/test_repository.py
tests/foreman/cli/test_satellitesync.py
tests/foreman/sys/test_capsule_loadbalancer.py
tests/new_upgrades/test_client.py
Introduce explicit support for RHEL6 client repositories and allow RHEL6 in supportability and provisioning flows.
  • Add rhsclient6 repository metadata and mapping to robottelo.constants (id, name, distro, version, product, key).
  • Extend supportability.yaml RHEL versions list to include 6 (and keep existing FIPS variants).
  • Generalize provisioning fixtures that select kickstart content so that RHEL <=7 (including 6) uses the non-bos key rather than assuming only 7 is special.
robottelo/constants/__init__.py
conf/supportability.yaml
pytest_fixtures/component/provision_capsule_pxe.py
pytest_fixtures/component/provision_pxe.py
pytest_fixtures/component/provisioning_template.py
Minor behavioral tweaks and small test logic adjustments discovered while broadening version support.
  • Normalize some tracer and Ansible-related markers from patterns like '[^6].*' to '[^6]' to match only the major version part.
  • Change some commands from dnf to yum in capsule content tests to be compatible with older RHEL versions.
  • Unskip or relax a few tests that previously skipped deprecated SRPM repos, leaving them active for broader coverage where configured.
  • Import settings where needed after switching markers to use settings.content_host.default_rhel_version.
tests/foreman/api/test_ansible.py
tests/foreman/cli/test_ansible.py
tests/foreman/cli/test_remoteexecution.py
tests/foreman/api/test_capsulecontent.py
tests/foreman/api/test_repository.py
tests/foreman/cli/test_discoveredhost.py
tests/foreman/destructive/test_remoteexecution.py
tests/foreman/longrun/test_remoteexecution.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@jameerpathan111 jameerpathan111 changed the title [ignore] [do not merge] Mark tests for RHEL6 client testing [do not merge] Mark tests for RHEL6 client testing Feb 11, 2026
@jameerpathan111 jameerpathan111 force-pushed the rhel6_client branch 6 times, most recently from c54e358 to c160325 Compare February 13, 2026 13:59
@jameerpathan111 jameerpathan111 force-pushed the rhel6_client branch 2 times, most recently from 10be053 to 954293a Compare February 16, 2026 10:09
@jameerpathan111 jameerpathan111 changed the title [do not merge] Mark tests for RHEL6 client testing Mark tests for RHEL6 client testing Feb 16, 2026
@jameerpathan111 jameerpathan111 marked this pull request as ready for review February 16, 2026 15:24
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 4 issues, and left some high level feedback:

  • There are several places where os_version.major is compared to the string '6' instead of the integer 6 (e.g. in test_positive_global_registration_end_to_end and test_positive_export_import_consume_incremental_yum_repo), which will never evaluate as expected; align these checks to use a consistent type.
  • In a few tests you switched to @pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version]) instead of using rhel_ver_list (e.g. in tests/foreman/ui/test_registration.py and tests/foreman/ui/test_remoteexecution.py), which changes the marker semantics; verify these should be rhel_ver_list([settings.content_host.default_rhel_version]) for list-style selection.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- There are several places where `os_version.major` is compared to the string `'6'` instead of the integer `6` (e.g. in `test_positive_global_registration_end_to_end` and `test_positive_export_import_consume_incremental_yum_repo`), which will never evaluate as expected; align these checks to use a consistent type.
- In a few tests you switched to `@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version])` instead of using `rhel_ver_list` (e.g. in `tests/foreman/ui/test_registration.py` and `tests/foreman/ui/test_remoteexecution.py`), which changes the marker semantics; verify these should be `rhel_ver_list([settings.content_host.default_rhel_version])` for list-style selection.

## Individual Comments

### Comment 1
<location> `conf/supportability.yaml:5` </location>
<code_context>
     default_os_name: "RedHat"
     rhel:
-      versions: [7,'7_fips', 8, '8_fips', 9, '9_fips']
+      versions: [6, 7, '7_fips', 8, '8_fips', 9, '9_fips']
</code_context>

<issue_to_address>
**question:** Clarify whether a RHEL 6 FIPS variant should be represented in the support matrix

You added `6` but not `'6_fips'`, whereas 7–9 all include FIPS variants. If RHEL 6 FIPS is supported, please add `'6_fips'` for consistency; if it’s explicitly unsupported, this asymmetry is fine but should be intentional.
</issue_to_address>

### Comment 2
<location> `tests/foreman/ui/test_registration.py:425` </location>
<code_context>


-@pytest.mark.rhel_ver_match('8')
+@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version])
 @pytest.mark.no_containers
 def test_positive_parse_package_name_url(
</code_context>

<issue_to_address>
**issue (bug_risk):** Decorator `rhel_ver_match` is now passed a list instead of the expected string/regex pattern.

Elsewhere `@pytest.mark.rhel_ver_match` always receives a string/regex, and `@pytest.mark.rhel_ver_list` is the marker that takes lists. Passing a list here will likely break or bypass the marker logic. Please update this (and the similar changes below) to use `rhel_ver_list([settings.content_host.default_rhel_version])`, or keep `rhel_ver_match` with a string/regex, depending on what behavior you need.
</issue_to_address>

### Comment 3
<location> `tests/foreman/ui/test_registration.py:221` </location>
<code_context>
-            f'Failed to register host: {rhel_contenthost.hostname}\n'
-            f'StdOut: {res.stdout}\nStdErr: {res.stderr}'
-        )
+        if rhel_contenthost.os_version.major != '6':
+            assert res.status == 0, (
+                f'Failed to register host: {rhel_contenthost.hostname}\n'
</code_context>

<issue_to_address>
**issue (bug_risk):** Comparing `os_version.major` to the string `'6'` is likely a type mismatch and defeats the RHEL6 special-casing.

Elsewhere `os_version.major` is compared as an int (`!= 6`), so this string comparison (`'6'`) will never match and the assertion will still run on RHEL6, defeating the intended special-casing. Please compare against the integer (`!= 6`) or otherwise align the types, and update any similar `'6'` comparisons (e.g. in `tests/foreman/cli/test_satellitesync.py`).
</issue_to_address>

### Comment 4
<location> `tests/foreman/cli/test_satellitesync.py:2788` </location>
<code_context>
-            f'Failed to register host: {rhel_contenthost.hostname}\n'
-            f'StdOut: {res.stdout}\nStdErr: {res.stderr}'
-        )
+        if rhel_contenthost.os_version.major != '6':
+            assert res.status == 0, (
+                f'Failed to register host: {rhel_contenthost.hostname}\n'
</code_context>

<issue_to_address>
**issue (bug_risk):** Another instance of comparing `os_version.major` to the string `'6'` instead of an integer.

Because this uses `rhel_contenthost.os_version.major != '6'`, it will always be True if `os_version.major` is an int (as implied by other comparisons to `6`). That means the assertion still runs on RHEL6 and the intended relaxation doesn’t take effect. Please align this check with the rest of the suite (e.g. `!= 6` if numeric), or standardize on strings everywhere if the field is actually a string.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

default_os_name: "RedHat"
rhel:
versions: [7,'7_fips', 8, '8_fips', 9, '9_fips']
versions: [6, 7, '7_fips', 8, '8_fips', 9, '9_fips']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Clarify whether a RHEL 6 FIPS variant should be represented in the support matrix

You added 6 but not '6_fips', whereas 7–9 all include FIPS variants. If RHEL 6 FIPS is supported, please add '6_fips' for consistency; if it’s explicitly unsupported, this asymmetry is fine but should be intentional.



@pytest.mark.rhel_ver_match('9')
@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Decorator rhel_ver_match is now passed a list instead of the expected string/regex pattern.

Elsewhere @pytest.mark.rhel_ver_match always receives a string/regex, and @pytest.mark.rhel_ver_list is the marker that takes lists. Passing a list here will likely break or bypass the marker logic. Please update this (and the similar changes below) to use rhel_ver_list([settings.content_host.default_rhel_version]), or keep rhel_ver_match with a string/regex, depending on what behavior you need.

# run curl
result = rhel_contenthost.execute(cmd)
assert result.status == 0
if rhel_contenthost.os_version.major != '6':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Comparing os_version.major to the string '6' is likely a type mismatch and defeats the RHEL6 special-casing.

Elsewhere os_version.major is compared as an int (!= 6), so this string comparison ('6') will never match and the assertion will still run on RHEL6, defeating the intended special-casing. Please compare against the integer (!= 6) or otherwise align the types, and update any similar '6' comparisons (e.g. in tests/foreman/cli/test_satellitesync.py).

f'Failed to register host: {rhel_contenthost.hostname}\n'
f'StdOut: {res.stdout}\nStdErr: {res.stderr}'
)
if rhel_contenthost.os_version.major != '6':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Another instance of comparing os_version.major to the string '6' instead of an integer.

Because this uses rhel_contenthost.os_version.major != '6', it will always be True if os_version.major is an int (as implied by other comparisons to 6). That means the assertion still runs on RHEL6 and the intended relaxation doesn’t take effect. Please align this check with the rest of the suite (e.g. != 6 if numeric), or standardize on strings everywhere if the field is actually a string.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands Robottelo’s client-side test selection to allow running scenarios against RHEL6 content hosts (Satellite 6.16 context), primarily by widening RHEL version markers and relaxing a few registration-related assertions for RHEL6 due to known behavior differences.

Changes:

  • Add RHEL6 to the supported content host versions and introduce Satellite Client repo metadata for RHEL6 (ELS).
  • Broaden many tests from fixed RHEL lists (e.g., 7/8/9) to “any supported version” and/or to the configured default RHEL content host version.
  • Relax/skip specific registration assertions and switch some client commands to be more RHEL6-compatible (e.g., dnfyum in a spot).

Reviewed changes

Copilot reviewed 67 out of 67 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tests/upgrades/test_subscription.py Widens upgrade scenario client selection to more RHEL versions via marker change.
tests/upgrades/test_repository.py Widens upgrade scenario client selection to more RHEL versions via marker change.
tests/upgrades/test_remoteexecution.py Widens upgrade scenario client selection to more RHEL versions via marker change.
tests/upgrades/test_errata.py Widens upgrade scenario client selection to more RHEL versions via marker change.
tests/upgrades/test_client.py Switches upgrade client selection to settings.content_host.default_rhel_version.
tests/new_upgrades/test_subscription.py Widens new-upgrade scenario client selection via marker change.
tests/new_upgrades/test_remoteexecution.py Widens client selection and relaxes registration-output assertion on RHEL6.
tests/new_upgrades/test_client.py Relaxes registration-output assertion on RHEL6.
tests/foreman/ui/test_rhcloud_inventory.py Broadens RHEL marker selection for PIT coverage.
tests/foreman/ui/test_rhcloud_insights.py Broadens RHEL marker selection for UI insights coverage.
tests/foreman/ui/test_repositories.py Broadens RHEL marker selection; relaxes subscription assertion on RHEL6.
tests/foreman/ui/test_reporttemplates.py Broadens RHEL marker selection; relaxes registration-output assertion on RHEL6.
tests/foreman/ui/test_remoteexecution.py Uses default RHEL version for selection (via settings) and updates imports.
tests/foreman/ui/test_registration.py Broadens selection and relaxes some assertions for RHEL6 registration behavior.
tests/foreman/ui/test_package.py Switches RHEL marker to be driven by default RHEL version.
tests/foreman/ui/test_host.py Broadens RHEL selection and relaxes some registration assertions for RHEL6.
tests/foreman/ui/test_fact.py Relaxes registration assertion on RHEL6.
tests/foreman/ui/test_errata.py Broadens selection; relaxes fixture error assertion and switches selection to default RHEL.
tests/foreman/ui/test_discoveredhost.py Switches provisioning selection to default RHEL version.
tests/foreman/ui/test_computeresource_libvirt.py Broadens provisioning selection to include RHEL6.
tests/foreman/ui/test_ansible.py Broadens selection and relaxes registration assertions for RHEL6.
tests/foreman/ui/test_activationkey.py Broadens selection and relaxes registration assertions for RHEL6.
tests/foreman/sys/test_capsule_loadbalancer.py Relaxes registration assertions for RHEL6.
tests/foreman/longrun/test_remoteexecution.py Switches longrun selection to default RHEL version.
tests/foreman/longrun/test_oscap.py Adds RHEL6 to OSCAP longrun setup and broadens selection.
tests/foreman/endtoend/test_api_endtoend.py Relaxes registration assertion for RHEL6.
tests/foreman/destructive/test_remoteexecution.py Switches destructive selection to default RHEL version; updates imports.
tests/foreman/destructive/test_registration.py Relaxes registration assertion for RHEL6.
tests/foreman/destructive/test_infoblox.py Switches selection to default RHEL version.
tests/foreman/destructive/test_host.py Broadens selection to include RHEL6.
tests/foreman/cli/test_satellitesync.py Relaxes registration assertion for RHEL6.
tests/foreman/cli/test_repository.py Relaxes registration assertion for RHEL6.
tests/foreman/cli/test_repositories.py Broadens selection to include RHEL6.
tests/foreman/cli/test_reporttemplates.py Broadens selection; relaxes registration assertion for RHEL6.
tests/foreman/cli/test_report.py Broadens selection to include RHEL6.
tests/foreman/cli/test_remoteexecution.py Broadens selection; relaxes registration assertion for RHEL6; adds explicit non-RHEL6 markers for pull-provider tests.
tests/foreman/cli/test_registration.py Broadens selection; relaxes multiple registration assertions for RHEL6; adjusts UUID check.
tests/foreman/cli/test_host.py Broadens selection; relaxes multiple registration assertions for RHEL6; switches some markers to default RHEL.
tests/foreman/cli/test_fact.py Relaxes registration assertions for RHEL6.
tests/foreman/cli/test_errata.py Switches selection to default RHEL version.
tests/foreman/cli/test_discoveredhost.py Switches provisioning selection to default RHEL version; adds import.
tests/foreman/cli/test_contentaccess.py Broadens selection and switches some tests to default RHEL version.
tests/foreman/cli/test_computeresource_vmware.py Broadens selection and switches one test to default RHEL version.
tests/foreman/cli/test_computeresource_rhev.py Broadens selection to include RHEL6.
tests/foreman/cli/test_computeresource_libvirt.py Broadens selection to include RHEL6.
tests/foreman/cli/test_bootdisk.py Broadens selection to include RHEL6.
tests/foreman/cli/test_ansible.py Broadens selection; relaxes registration assertions for RHEL6; switches some markers to default RHEL.
tests/foreman/cli/test_activationkey.py Broadens selection; relaxes assertions for RHEL6; switches one test to default RHEL.
tests/foreman/api/test_subscription.py Relaxes registration assertions for RHEL6; switches one marker to default RHEL.
tests/foreman/api/test_repository.py Unskips an SRPM repo test by commenting out a skip marker.
tests/foreman/api/test_reporttemplates.py Broadens selection; relaxes registration-output assertions for RHEL6; modifies installed-products flow.
tests/foreman/api/test_remoteexecution.py Switches selection to exclude RHEL6 for pull-provider flows; relaxes registration assertion for RHEL6.
tests/foreman/api/test_registration.py Broadens selection; relaxes registration assertions for RHEL6; switches some markers to default RHEL.
tests/foreman/api/test_provisioningtemplate.py Broadens selection to include RHEL6; switches one marker to default RHEL.
tests/foreman/api/test_provisioning_puppet.py Broadens selection to include RHEL6.
tests/foreman/api/test_provisioning.py Broadens provisioning selection to include RHEL6.
tests/foreman/api/test_http_proxy.py Relaxes registration assertion for RHEL6.
tests/foreman/api/test_errata.py Broadens selection; relaxes registration assertions for RHEL6.
tests/foreman/api/test_discoveredhost.py Broadens selection and switches reboot tests to default RHEL; adds import.
tests/foreman/api/test_computeresource_vmware.py Switches selection to default RHEL version.
tests/foreman/api/test_capsulecontent.py Switches distro selection to default RHEL; relaxes registration assertion; replaces dnf with yum.
tests/foreman/api/test_ansible.py Broadens selection; refactors repo selection by detected major; relaxes registration assertions for RHEL6.
robottelo/constants/init.py Adds repo metadata for rhsclient6 (RHEL6 ELS Satellite Client).
pytest_fixtures/component/provisioning_template.py Adjusts kickstart version selection logic for rhel_ver <= 7 (includes RHEL6).
pytest_fixtures/component/provision_pxe.py Adjusts kickstart version selection logic for rhel_ver <= 7 (includes RHEL6).
pytest_fixtures/component/provision_capsule_pxe.py Adjusts kickstart version selection logic for rhel_ver <= 7 (includes RHEL6).
conf/supportability.yaml Adds RHEL6 to supported content host versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to 19
@pytest.mark.rhel_ver_list(r'^[\d]+$')
def test_positive_custom_products_disabled_by_default(
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as elsewhere: rhel_ver_list does not treat its argument as a regex. Using r'^[\d]+$' will not exclude non-numeric variants like 7_fips and may unintentionally expand the test matrix. Prefer rhel_ver_match(r'^\d+$') if you want numeric-only, or drop the marker if you want all supported variants.

Copilot uses AI. Check for mistakes.
Comment on lines 133 to 137
@pytest.mark.e2e
@pytest.mark.no_containers
@pytest.mark.pit_client
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_list(r'^[\d]+$')
def test_positive_global_registration_end_to_end(
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rhel_ver_list does not interpret regex patterns. With r'^[\d]+$' this test will effectively run on all supported versions (including *_fips) due to marker parsing logic, which doesn’t match the intent of “numeric majors only”. Use @pytest.mark.rhel_ver_match(r'^\d+$') instead if you want to target numeric majors.

Copilot uses AI. Check for mistakes.
Comment on lines +98 to 99
@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version])
def test_positive_run_default_job_template(
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rhel_ver_match takes a regex string; passing [settings.content_host.default_rhel_version] works only accidentally for single-digit majors and fails for multi-digit majors (e.g. 10). Use rhel_ver_list([settings.content_host.default_rhel_version]) or an anchored string regex instead.

Copilot uses AI. Check for mistakes.
Comment on lines +1030 to 1031
@pytest.mark.rhel_ver_list(r'^[\d]+$')
def test_positive_installed_products(
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rhel_ver_list does not process regex patterns. Using r'^[\d]+$' here won’t select only numeric majors and will effectively fall back to running on all supported versions (including *_fips). If you want numeric-only, switch to @pytest.mark.rhel_ver_match(r'^\d+$').

Copilot uses AI. Check for mistakes.
Comment on lines +1082 to 1086
if rhel_contenthost.os_version.major != 6:
rhel_contenthost.register(org, default_location, ak.name, target_sat)
if rhel_contenthost.os_version.major != 6:
assert rhel_contenthost.subscribed, 'Host registration failed.'

Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When os_version.major == 6, this test skips registration entirely but continues to generate a report for rhel_contenthost.hostname and asserts on the report contents. That will likely fail (host not present) rather than cleanly skipping. Either register the host for RHEL6 too (and relax only the known-broken assertion), or explicitly pytest.skip(...) for RHEL6 here; also the nested if os_version.major != 6 is redundant.

Suggested change
if rhel_contenthost.os_version.major != 6:
rhel_contenthost.register(org, default_location, ak.name, target_sat)
if rhel_contenthost.os_version.major != 6:
assert rhel_contenthost.subscribed, 'Host registration failed.'
if rhel_contenthost.os_version.major == 6:
pytest.skip('Host registration and installed products report are not supported on RHEL 6.')
rhel_contenthost.register(org, default_location, ak.name, target_sat)
assert rhel_contenthost.subscribed, 'Host registration failed.'

Copilot uses AI. Check for mistakes.
Comment on lines +221 to +222
if rhel_contenthost.os_version.major != '6':
assert result.status == 0
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os_version.major is used numerically throughout the codebase (e.g. > 7), so it’s an int. Comparing it to the string '6' (here and earlier in this test) will not behave as intended—!= '6' will always be true, and == '6' will never be true. Use integer comparisons (== 6 / != 6) so the RHEL6-specific logic actually takes effect.

Copilot uses AI. Check for mistakes.
"""

@pytest.mark.rhel_ver_list([7, 8, 9])
@pytest.mark.rhel_ver_list(r'^[\d]+$')
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rhel_ver_list markers are parsed by substring matching against settings.supportability...versions (see pytest_plugins/fixture_markers.py), not as a regex. Passing r'^[\d]+$' will not filter to numeric versions and will effectively fall back to running on all supported versions (including *_fips). If the goal is “any numeric major”, use @pytest.mark.rhel_ver_match(r'^\d+$') (or remove the marker entirely if you truly want all variants).

Copilot uses AI. Check for mistakes.


@pytest.mark.rhel_ver_match('9')
@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version])
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rhel_ver_match expects a regex string (or N-x). Passing a Python list relies on str([10]) == '[10]' being treated as a regex character class, which breaks for multi-digit majors (e.g. 10 won’t match). Prefer @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) or @pytest.mark.rhel_ver_match(f'^{settings.content_host.default_rhel_version}$').

Copilot uses AI. Check for mistakes.
Comment on lines +93 to 94
@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version])
@pytest.mark.no_containers
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rhel_ver_match expects a regex string. Supplying a list ([settings.content_host.default_rhel_version]) will break for multi-digit majors (e.g. 10) because str([10]) becomes '[10]' (a one-character regex class). Use rhel_ver_list([settings.content_host.default_rhel_version]) or rhel_ver_match(f'^{...}$').

Copilot uses AI. Check for mistakes.
Comment on lines +2788 to +2792
if rhel_contenthost.os_version.major != '6':
assert res.status == 0, (
f'Failed to register host: {rhel_contenthost.hostname}\n'
f'StdOut: {res.stdout}\nStdErr: {res.stderr}'
)
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os_version.major is an int; comparing to the string '6' makes the condition always true. This means the status assertion will still run on RHEL 6, defeating the intended exception handling.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.16.z No-CherryPick PR doesnt need CherryPick to previous branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant