[Rpm-maint] [rpm-software-management/rpm] Eliminate the need for explicit RPMTEST_INIT (PR #3542)

Michal Domonkos notifications at github.com
Tue Jan 28 16:44:51 UTC 2025


@dmnks commented on this pull request.

Some documentation tweaks may be needed, otherwise looks good, thanks! This makes rpm test writing finally something that one can actually grasp without deep prior knowledge :smile: 

> @@ -135,10 +135,10 @@ For the typical structure of a single test, consult GNU Autotest's
 [documentation](https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/autoconf.html#Writing-Testsuites)
 as well as the existing tests.  Below are the specifics of RPM's test-suite:
 
-* Use `RPMTEST_SETUP` instead of `AT_SETUP`
-* Use `RPMTEST_CHECK` instead of `AT_CHECK`
-* Use `RPMTEST_CLEANUP` instead of `AT_CLEANUP`
-* Use `RPMTEST_INIT` to create a mutable snapshot (optional)
+* Use `RPMTEST_SETUP` instead of `AT_SETUP` to run a test in an immutable
+  system image with writable `.` and `/tmp`.
+* Use `RPMTEST_SETUP_RW` instead of `AT_SETUP` to run a test in a mutable

These could be worded better: the peculiarity here is that test script itself still runs *in* the immutable environment even if using `RPMTEST_SETUP_RW`. As it is now, the text makes you think the script runs in the snapshot (i.e. that `touch /hello` would work) :sweat_smile: 

How about something like:

* Use `RPMTEST_SETUP` instead of `AT_SETUP`. If your test needs to alter the root filesystem (e.g. to install a package), use `RPMTEST_SETUP_RW` instead to request a mutable snapshot of the filesystem.

Or something of that sorts, you get the point (it's getting late here, my creative mind is tired :sleeping:).

> @@ -156,6 +159,8 @@ as well as the existing tests.  Below are the specifics of RPM's test-suite:
       to the macro, e.g. `RPMTEST_USER([user1, user2])`.  Then, use
       `runroot_user -n <name>` to run a binary as a specific user
 * Use `RPMDB_RESET` to reinitialize a snapshot to an empty rpmdb (avoid this)
+* Use `RPMTEST_SNAPSHOT_MOUNT` create a mutable snapshot inside a immutable

*an* immutable :smile: (love these nitpicks, so easy to, well, nitpick)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3542#pullrequestreview-2578759992
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3542/review/2578759992 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20250128/273ad8a1/attachment.htm>


More information about the Rpm-maint mailing list