Skip to content

fix(oci): account for OCA and pqrpm GPG key dbs - #602

Merged
sshmulev merged 1 commit into
osbuild:mainfrom
src-up:test-number-gpg-keys
Aug 26, 2026
Merged

fix(oci): account for OCA and pqrpm GPG key dbs#602
sshmulev merged 1 commit into
osbuild:mainfrom
src-up:test-number-gpg-keys

Conversation

@src-up

@src-up src-up commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

CIV counted only gpg-pubkey in the default rpmdb and expected 3 keys on all RHEL 9+. Still not sure where that number 3 is from.

On OCI, Oracle Cloud Agent imports 2 Oracle Linux keys at first boot.

  • On RHEL 9.7+ the Red Hat keys are imported by pqrpm into /usr/lib/pqrpm/lib/sysimage/rpm, so the default db only has the OCA keys.
  • RHEL 10 keeps Red Hat keys in the default db (3 RH + 2 OCA).

So Expect 2 in the default db on OCI 9.7–9.x, 5 on OCI 10, and add test_pqrpm_gpg_keys for the 2 Red Hat keys in the pqrpm db. Other clouds are unchanged.

@src-up
src-up requested review from F-X64 and sshmulev August 19, 2026 18:50

@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 left some high level feedback:

  • The release = version.parse(host.system_info.release) logic is duplicated across tests; consider centralizing release parsing or using a helper to avoid repetition and reduce the chance of inconsistencies.
  • The conditional branches in test_number_gpg_keys are becoming complex and cloud/distribution-specific; consider extracting the key-count logic into a small helper function to make the test easier to read and to update when new combinations are added.
  • The hard-coded key counts (e.g., 2 and 5) and paths (e.g., /usr/lib/pqrpm/lib/sysimage/rpm) are encoded as literals; consider defining them as named constants to clarify their meaning and make future adjustments simpler.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `release = version.parse(host.system_info.release)` logic is duplicated across tests; consider centralizing release parsing or using a helper to avoid repetition and reduce the chance of inconsistencies.
- The conditional branches in `test_number_gpg_keys` are becoming complex and cloud/distribution-specific; consider extracting the key-count logic into a small helper function to make the test easier to read and to update when new combinations are added.
- The hard-coded key counts (e.g., 2 and 5) and paths (e.g., `/usr/lib/pqrpm/lib/sysimage/rpm`) are encoded as literals; consider defining them as named constants to clarify their meaning and make future adjustments simpler.

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.

Comment thread test_suite/generic/test_generic.py Outdated
Comment thread test_suite/generic/test_generic.py Outdated
@src-up
src-up force-pushed the test-number-gpg-keys branch from 404f72e to 7777db1 Compare August 20, 2026 10:41

@sshmulev sshmulev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM +1

@src-up
src-up force-pushed the test-number-gpg-keys branch from 7777db1 to 9d686da Compare August 20, 2026 21:04
@src-up

src-up commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

@F-X64 do these changes look OK to you

@src-up
src-up force-pushed the test-number-gpg-keys branch from 9d686da to 319671d Compare August 21, 2026 17:41
@F-X64

F-X64 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

@src-up Changes look great, I got nothing to add to @sshmulev 's review

CIV counted only gpg-pubkey in the default rpmdb and expected 3 keys
on all RHEL 9+.  Not sure where that number 3 is from.

On OCI, Oracle Cloud Agent imports 2 Oracle Linux keys at first boot.

- On RHEL 9.7+ the Red Hat keys are imported by pqrpm into
/usr/lib/pqrpm/lib/sysimage/rpm, so the default db only has the OCA
keys.
- RHEL 10 keeps Red Hat keys in the default db (3 RH + 2 OCA).

So Expect 2 in the default db on OCI 9.7–9.x, 5 on OCI 10, and add
test_pqrpm_gpg_keys for the 2 Red Hat keys in the pqrpm db.
Other clouds are unchanged.
@src-up
src-up force-pushed the test-number-gpg-keys branch from 319671d to 10e9e5b Compare August 24, 2026 14:31
@sshmulev
sshmulev merged commit 37bfc64 into osbuild:main Aug 26, 2026
4 checks passed
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.

3 participants