Skip to content

fix: handle RHEL 9.8 Azure test failures (GPG keys, RHUI cert, rpm-sequoia) - #618

Closed
sshmulev wants to merge 7 commits into
mainfrom
fix/civ-test-failures-rhel98
Closed

sshmulev wants to merge 7 commits into
mainfrom
fix/civ-test-failures-rhel98

Conversation

@sshmulev

Copy link
Copy Markdown
Collaborator

Summary

Fixes multiple CIV test failures on RHEL 9.8 Azure images:

  • ensure_rpm_usable_before_tests fixture: Was causing 29 test Errors by running yum -y update rpm-sequoia openssl-libs on RHEL 9 where repos return 404. Now handles 404, 403, "not registered", and "not installed" errors gracefully instead of asserting.
  • test_number_gpg_keys: On RHEL 9.8 Azure, GPG keys moved to the pqrpm db (/usr/lib/pqrpm/lib/sysimage/rpm). Updated to detect pqrpm and expect 0 keys in the default rpmdb. Also fixed rpm -q → rpm -qa to avoid counting the "package not installed" error message.
  • test_pqrpm_gpg_keys: Extended from OCI-only to also run on Azure (expects 3 keys: 2 Red Hat + 1 Microsoft).
  • test_rhui_certificate_date: Added '-ha' to source_suffixes so HA images resolve to content-ha.crt instead of content-base.crt.

Test plan

  • Deployed a RHEL 9.8 HA Azure VM (rhel-ha-azure-9.8-20260908.3.x86_64.vhd) on eastus
  • Verified test_number_gpg_keys, test_pqrpm_gpg_keys, and test_rhui_certificate_date all pass
  • Verified fixture fix eliminates all 29 Errors (0 Errors on full test run)
  • Flake8 clean

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).
- test_number_gpg_keys: detect pqrpm db and expect 0 keys in default
  rpmdb when keys are stored there (RHEL 9.8 Azure)
- test_number_gpg_keys: use rpm -qa instead of rpm -q to avoid counting
  "package not installed" message as a line
- test_pqrpm_gpg_keys: extend to Azure (3 keys) instead of OCI-only
- test_rhui_certificate_date: add '-ha' to source_suffixes so HA images
  resolve to content-ha.crt instead of content-base.crt

Verified on a live RHEL 9.8 HA Azure VM: all 3 tests pass.

@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 reviewed your changes and they look great!


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

@sshmulev

Copy link
Copy Markdown
Collaborator Author

Superseded by a cleaner PR with only the relevant fixes (conftest.py changes already merged separately).

@sshmulev sshmulev closed this Sep 15, 2026
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