Skip to content

tests: Add EROFS digest stability tests#255

Merged
cgwalters merged 1 commit intocomposefs:mainfrom
cgwalters:erofs-digest-prep
Mar 12, 2026
Merged

tests: Add EROFS digest stability tests#255
cgwalters merged 1 commit intocomposefs:mainfrom
cgwalters:erofs-digest-prep

Conversation

@cgwalters
Copy link
Collaborator

In preparation for some changes to the EROFS code
(reader hardening, but also some support for original
composefs v1 format), add tests which verify the
exact digest of the EROFS we generate today.

Assisted-by: OpenCode (Claude Opus 4)

@cgwalters cgwalters enabled auto-merge (rebase) March 11, 2026 23:35
Copy link
Collaborator

@allisonkarlitskaya allisonkarlitskaya left a comment

Choose a reason for hiding this comment

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

There's some similar testcases already in the same file which work via snapshotting with the debug dump (for easy diffability in case something changes)... those could also gain a hash output... and then maybe do something similar for this one too?

@cgwalters
Copy link
Collaborator Author

Thanks for looking at this! Yeah the insta-debug is definitely more debuggable vs checksum assertions, but OTOH if there was anything missing in our debug output (padding?) we could miss it. I think you're right though, adding checksums to those would be simple and helpful.

Doing this is a bit trickier for the container-based integration tests as those are intentionally integration tests - they don't have access to the debug representation (though of course we could add one).

In practice...if as we're developing the checksum differs, what I do in practice so far is look at the dumpfile output. Most of the time the bug lies in there, and even though we don't save the dumpfile in those tests, it's easy to get.

@cgwalters cgwalters force-pushed the erofs-digest-prep branch 2 times, most recently from a82ccf2 to d180ec7 Compare March 12, 2026 12:37
@cgwalters
Copy link
Collaborator Author

OK this is cleaner now.

I previously pushed another commit to use the "infamous" special.dump here but...this reveals more bugs which I will take in later patches.

This PR again is just to ensure we've nailed down exactly bit for bit the current erofs writer.

// `--bootable` is not supported.
const UBI10: ContainerImage = ContainerImage {
label: "ubi10",
image_ref: "docker://registry.access.redhat.com/ubi10/ubi:10.1-1772441712",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do these ever get garbage collected? I assume not, but also I have no idea where I would find that written down somewhere as a guarantee.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am not aware of any docs, but e.g.

$ skopeo inspect -n docker://registry.access.redhat.com/ubi9/ubi:9.0.0-1468.1655190709 | from json | get Created
2022-06-14T07:23:19.154905Z

Which corresponds to the very first release of RHEL 9.0...so I think we're pretty safe here.

centos-bootc is more likely to get GC'd at some point.

Anyways I spawned an agent to look at a task of copying "fixture" images to ghcr.io/composefs/test-fixture-$x so if we actually hit some problem we can just do that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

➡️ #258

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, rebased to use those images

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And now passing CI after I made them public

cgwalters added a commit that referenced this pull request Mar 12, 2026
The digest stability tests in PR #255 reference pinned container images
from upstream registries (registry.access.redhat.com, quay.io).

This job makes it easy for us to mirror fixture images to our own
namespace, just to double check they don't get GC'd.

Ref: #255 (comment)

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
In preparation for some changes to the EROFS code
(reader hardening, but also some support for original
 composefs v1 format), add tests which verify the
exact digest of the EROFS we generate today.

The container image references now point at ghcr.io/composefs
mirrors (populated by ci/fixture-images.txt) rather than
upstream registries, so tests won't break if upstream GCs
old builds.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters merged commit 43a0f13 into composefs:main Mar 12, 2026
31 of 33 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