Skip to content

fix: scope rpm-sequoia workaround to RHEL 10+ and handle repo errors - #617

Merged
sshmulev merged 3 commits into
mainfrom
fix/rpm-sequoia-fixture-rhel9
Sep 15, 2026
Merged

sshmulev merged 3 commits into
mainfrom
fix/rpm-sequoia-fixture-rhel9

Conversation

@sshmulev

Copy link
Copy Markdown
Collaborator

Summary

  • The ensure_rpm_usable_before_tests fixture was causing 29 test Errors on RHEL 9.x and 26 test Errors on RHEL 10.2 in Jenkins CIV runs
  • Root cause: the fixture runs yum -y update rpm-sequoia openssl-libs on all RHEL versions, but rpm-sequoia only exists on RHEL 10. On RHEL 9, the command fails because RHUI repos return 404, and the error handling only caught 403 and not registered patterns
  • Fix: skip the workaround entirely on non-RHEL-10, and on RHEL 10 handle 404 and not installed errors gracefully in addition to the existing 403/not registered handling

Test plan

  • Deployed a RHEL 9.8 HA Azure VM (rhel-ha-azure-9.8-20260908.3.x86_64.vhd) and ran the full CIV test suite
  • Confirmed 0 Errors (was 29) — all 86 tests collected and ran
  • Remaining 8 failures are legitimate test issues (broken RHUI repo codeready-builder-for-rhel-9-x86_64-eus-rhui-rpms returning 404, missing RHUI cert, GPG key mismatch, etc.)

The ensure_rpm_usable_before_tests fixture was causing test Errors on
RHEL 9.x (where rpm-sequoia doesn't exist) and on RHEL 10 when RHUI
repos return 404. Now skips on non-RHEL-10 and handles 404/403/not
registered/not installed errors gracefully.

Verified on a live RHEL 9.8 Azure VM: 0 Errors (was 29).

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="test_suite/conftest.py" line_range="204" />
<code_context>
         print("\n[!] OCI instance: skipping RHUI RPM workaround.")
         return

+    if not host.system_info.release.startswith("10"):
+        print(f"\n[!] RHEL {host.system_info.release}: rpm-sequoia not applicable, skipping workaround.")
+        return
</code_context>
<issue_to_address>
**nitpick (bug_risk):** The `startswith("10")` check is not an RHEL 10+ check: it skips RHEL 11 and later releases, while it still runs the workaround on any non-RHEL distribution whose release begins with `10` (for example, CentOS Stream 10). The fixture therefore does not match the documented scope.

**Triggers:** When a RHEL 11+ host or a non-RHEL 10 host runs the test suite.

**Suggested fix:** Parse the release major version and require `host.system_info.distribution == "rhel"` with `version.parse(host.system_info.release).major >= 10`.

```suggestion
    if host.system_info.distribution != "rhel" or version.parse(host.system_info.release).major < 10:
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread test_suite/conftest.py Outdated
@sshmulev
sshmulev merged commit 2832016 into main Sep 15, 2026
3 of 4 checks passed
@sshmulev
sshmulev deleted the fix/rpm-sequoia-fixture-rhel9 branch September 15, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant