[Rpm-maint] [rpm-software-management/rpm] RPMTEST_CHECK should run in the snapshot by default (Issue #3545)

Michal Domonkos notifications at github.com
Wed Jan 29 10:16:18 UTC 2025


Currently, we allow individual tests to perform their objective in a separate (nested) container which we call a *snapshot*. The snapshot is a mutable variant of the read-only parent container that holds the `rpmtests` script itself. To request a snapshot, a test can declare `RPMTEST_SETUP_RW` instead of `RPMTEST_SETUP` at the top, and then use the `runroot` wrapper when calling the RPM binaries. To modify or inspect the snapshot's filesystem in between those `runroot` commands, a test can use the `$RPMTEST` path which points to it.

Since RPM is a package management tool, its purpose is to *modify* the root filesystem (or a different installroot if specified). Snapshots provide a way to isolate this from the test logic itself which typically uses various system utilities whose functionality could otherwise be affected. It basically allows a test to inspect the `$RPMTEST` filesystem from the outside, using the system utilities provided in the immutable test image.

This separation actually comes from the fakechroot times where it was more of a necessity than anything. However, it turns out to be a useful feature on its own since it provide a clear separation as described.

That said, most tests don't really need this separation as they don't make breaking changes to the filesystem that could potentially have an effect on the verification steps. In fact, I don't think we have any such tests at the moment that would benefit from such complete isolation. Yet, I don't think we should get rid of this ability altogether, either.

As it is now, the separation adds additional boilerplate and/or confusion to individual tests. One has to always remember to use `runroot` when calling RPM commands and `$RPMTEST` when e.g. creating files in the snapshot beforehand. Therefore, to make this experience less jarring and optimize for the most common use case (which doesn't require this kind of full isolation), we could either:

1. Alias `runroot rpm` to `rpm` (and similar variants) if `RPMTEST_SETUP_RW` was used, or
2. Run the entirety of `RPMTEST_CHECK` in a snapshot if `RPMTEST_SETUP_RW` was used, basically like `runroot_other ./this-test.sh'

No. 2 might prove to be challenging since we'd have to somehow wrap the contents of the M4 macro `RPMTEST_CHECK` inside an executable script that's run via `snapshot exec` or similar.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/3545
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/3545 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20250129/6b04be50/attachment.htm>


More information about the Rpm-maint mailing list