Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RHEL10,9,8] Cover restrict repos by host OS, RHEL major versions #17415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

damoore044
Copy link
Contributor

@damoore044 damoore044 commented Jan 22, 2025

Problem Statement

Cover [SAT-30636], which adds rhel-10 option to the Repository OS Restrict flag.

  • 3 repos restricted to RHEL-10/9/8 , using one matching registered host of one the selected rhel versions.
  • in 6.16.z and 6.15.z, implicitly selected RHEL versions will be 9/8/7 (N-2) from supportability.yaml.

Solution

Implement stubbed coverage, that could have discovered this missing option during initial automation runs.

PRT Case

trigger: test-robottelo
pytest: tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos

@damoore044 damoore044 added CherryPick PR needs CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 labels Jan 22, 2025
@damoore044 damoore044 self-assigned this Jan 22, 2025
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9964
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos --external-logging
Test Result : ================= 3 passed, 133 warnings in 1033.52s (0:17:13) =================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jan 22, 2025
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Jan 23, 2025
Copy link

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

Just one question, but generally ACK from an SME point of view.

tests/foreman/api/test_subscription.py Outdated Show resolved Hide resolved
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9974
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos --external-logging
Test Result : ================= 3 passed, 131 warnings in 942.14s (0:15:42) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jan 23, 2025
@damoore044 damoore044 marked this pull request as ready for review February 6, 2025 16:33
@damoore044 damoore044 requested a review from a team as a code owner February 6, 2025 16:33
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 6, 2025
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos

@damoore044 damoore044 changed the title Test OS Restrict for repositories [RHEL10,9,8] Cover restrict repos by host OS, RHEL major versions Feb 6, 2025
@Satellite-QE
Copy link
Collaborator

Satellite-QE commented Feb 6, 2025

PRT Result

Build Number: 10111
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos --external-logging
Test Result : ============= 2 passed, 81 warnings, 1 error in 798.64s (0:13:18) ==============

^ one Broker checkout error [RHEL9 chost] for

failed on setup with "podman.errors.exceptions.APIError: 409 Client Error: 
Conflict (cannot exec in a container that is not running; container {} is stopped).

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Feb 6, 2025
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10112
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos --external-logging
Test Result : ============= 2 passed, 97 warnings, 1 error in 868.83s (0:14:28) ==============

@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10115
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos --external-logging
Test Result : ============= 2 passed, 85 warnings, 1 error in 854.92s (0:14:14) ==============

Copy link
Contributor

@vsedmik vsedmik left a comment

Choose a reason for hiding this comment

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

Left a couple of proposals to consider and a question.

tests/foreman/api/test_subscription.py Show resolved Hide resolved
tests/foreman/api/test_subscription.py Outdated Show resolved Hide resolved
assert repo.label in sub_man_repos

# restrict each repo to a different RHEL major version
rhel_majors = [ver for ver in rhel_versions]
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't the rhel_versions major already?

>>> rhel_versions = [
                    rhel_major_ver
                    for rhel_major_ver in settings.supportability.content_hosts.rhel.versions
                    if 'fips' not in str(rhel_major_ver)
                ][-3:]
>>> rhel_versions
[8, 9, 10]
Suggested change
rhel_majors = [ver for ver in rhel_versions]

Copy link
Contributor Author

@damoore044 damoore044 Feb 7, 2025

Choose a reason for hiding this comment

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

yes they are I just made a copy list (rhel_majors) to edit without editing the original list (rhel_versions).

Copy link
Contributor Author

@damoore044 damoore044 Feb 13, 2025

Choose a reason for hiding this comment

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

since I don't use the original list of RHEL versions later in the test, we can just mutate the list in this loop without making a copy.

tests/foreman/api/test_subscription.py Outdated Show resolved Hide resolved
tests/foreman/api/test_subscription.py Outdated Show resolved Hide resolved
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos[rhel9-ipv4]

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10126
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos[rhel9-ipv4] --external-logging
Test Result : =================== 9 warnings, 1 error in 599.97s (0:09:59) ===================

@damoore044 damoore044 force-pushed the os_restrict_repo branch 2 times, most recently from 665c45d to e65b57e Compare February 13, 2025 15:57
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos

@damoore044 damoore044 requested a review from vsedmik February 13, 2025 16:17
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10172
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos --external-logging
Test Result : ============= 2 failed, 81 warnings, 1 error in 852.54s (0:14:12) ==============

@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10173
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos --external-logging
Test Result : ============= 2 failed, 84 warnings, 1 error in 1031.83s (0:17:11) =============

@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10176
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_subscription.py::test_positive_os_restriction_on_repos --external-logging
Test Result : ============= 2 passed, 84 warnings, 1 error in 1032.72s (0:17:12) =============

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 CherryPick PR needs CherryPick to previous branches PRT-Failed Indicates that latest PRT run is failed for the PR Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants