Skip to content

Add a test for cosign sign - #22317

Open
ianballou wants to merge 1 commit into
SatelliteQE:masterfrom
ianballou:SAT-41872
Open

Add a test for cosign sign#22317
ianballou wants to merge 1 commit into
SatelliteQE:masterfrom
ianballou:SAT-41872

Conversation

@ianballou

@ianballou ianballou commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Problem Statement

We had no test for cosign sign. cosign is a tool used often for signing and attesting that container content is safe. Our OCI registry should be able to integrate with cosign.

Solution

Add a test for cosign sign. Also tests verification.

Installs cosign via the RPM hosted on GitHub. Also disables uploads to the public transparancy log that sigstore maintains.

Related Issues

https://redhat.atlassian.net/browse/SAT-41872

Summary by Sourcery

Tests:

  • Add a high-importance Docker API test that pulls an image, pushes it to Satellite’s registry, signs it with cosign, and verifies the signature.

@ianballou
ianballou requested a review from a team as a code owner July 31, 2026 16:25
@sourcery-ai

sourcery-ai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds an API-level integration test that signs and verifies a container image stored in Satellite’s registry using cosign, including setup of the image, registry credentials, cosign installation, key generation, signing, and verification steps.

File-Level Changes

Change Details Files
Add an integration test that validates cosign can sign and verify a container image pushed to Satellite’s registry.
  • Introduce test_cosign_sign_pushed_image to exercise cosign sign and verify against a Satellite-hosted image.
  • Pull a test image from an external registry, then push it into Satellite’s registry using podman with admin credentials.
  • Install cosign on the target Satellite host if missing and generate a temporary key pair for signing.
  • Use cosign sign with a local key and disabled transparency log upload to sign the pushed image.
  • Use cosign verify with the generated public key and relaxed tlog requirements to ensure the image signature verifies successfully.
tests/foreman/api/test_docker.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

@ianballou

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/api/test_docker.py::TestPodman::test_cosign_sign_pushed_image

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

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 ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16309
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_docker.py::TestPodman::test_cosign_sign_pushed_image --external-logging
Test Result : ================== 1 failed, 6 warnings in 960.88s (0:16:00) ===================

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Jul 31, 2026
@ianballou

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/api/test_docker.py::TestPodman::test_cosign_sign_pushed_image

@ianballou ianballou added the No-CherryPick PR doesnt need CherryPick to previous branches label Jul 31, 2026
@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 16310
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_docker.py::TestPodman::test_cosign_sign_pushed_image --external-logging
Test Result : ================== 1 passed, 6 warnings in 976.42s (0:16:16) ===================

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Jul 31, 2026

@aidenfine aidenfine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants