Skip to content

test(ci): install the rpm, and complete a read-only mount (#149) - #541

Merged
scttfrdmn merged 3 commits into
mainfrom
feat/149-rpm-and-completed-mount
Sep 20, 2026
Merged

scttfrdmn merged 3 commits into
mainfrom
feat/149-rpm-and-completed-mount

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes #149.

Two gaps in ci.yml's packaging job. Both let something ship unexercised for several releases, and
both are invisible from a green tree.

The rpm was never installed

All three rpms are built on every pull request. That is where a malformed header surfaces and nowhere
near enough: scripts/postinstall.sh and scripts/preremove.sh had been run by dpkg, and by
internal/config's tests against a staged root, and by no rpm anywhere. So every rpm this project
has published carried maintainer scripts that no rpm had executed — and the two package managers call
the same script with different arguments, dpkg's configure/remove/upgrade against rpm's instance
counts. The tests drive both spellings; only a real rpm confirms what rpm actually passes.

Now installed in a container over a read-only dist/, asserting the same filesystem facts the deb path
asserts in the same order, then removed with rpm -e and asserted to have left nothing — including
/sbin/mount.objectfs, which neither package manager owns, because postinstall.sh creates it so the
package contains no path under an aliased directory. That leaves preremove.sh as the only thing that
can take it away, and /sbin is a symlink to /usr/sbin on Rocky, which makes this the stronger test
of the two.

No CI mount had ever completed

mount(8) was proven to resolve -t objectfs to the installed helper. Nothing had ever had a
filesystem mounted and read a byte through it.

A real sudo mount -v -t objectfs s3://objectfs-ci /mnt/objectfs-ro -o ro,config=/etc/objectfs/ci.yaml
against a standalone substrate server, and then:

  • the kernel's own /proc/mounts entry exists, and its option list contains ro — which is what says
    -o ro reached the mount syscall rather than only the process. Without
    internal/fuse/mount.go's ro append the filesystem would enforce read-only in userspace while the
    kernel believed the mount was writable, which is the half-wired state A read-only mount: --read-only for objectfs mount, and ro for the fstab helper #532 found the feature in
  • a 21-byte object and a 1 MiB object under a prefix, both cmp'd against what the aws CLI put in
    the bucket. The large one is not decoration: a small file is one GetObject, 1 MiB spans several reads,
    so it is the one that can fail on offsets or on ranges assembled out of order. The prefix means sub/
    is a directory the mount has to invent
  • stat(2)'s size asserted separately from the bytes, because a read that returns the right content
    while the attribute path reports a wrong length is a state cmp cannot see and ls -l can
  • a write refused, and the errno checked. Every way a mount can be broken is also a failed write, so
    EROFS is the only answer that means A read-only mount: --read-only for objectfs mount, and ro for the fstab helper #532's gate is what refused
  • umount, then /proc/mounts clean and the directory underneath empty — a mount point still listing
    the bucket's entries after umount would mean the tree had been written into the covered directory,
    which is the failure that looks most like success
  • the bucket's key/size/ETag inventory unchanged across the whole thing

Three deviations from the issue body, each measured rather than assumed

On the runner, not in a container. The body prescribes --device /dev/fuse --cap-add SYS_ADMIN.
Passing /dev/fuse through presupposes the host already has it, so a container does not sidestep
whether ubuntu-latest has the device — it adds a second place for the answer to be no. And the deb is
installed on the runner by then, so mounting there exercises the installed /sbin/mount.objectfs,
which is #136's subject.

rockylinux/rockylinux:9, not rockylinux:9. Checked on Docker Hub rather than assumed:
library/rockylinux:9 was last pushed 2024-05-30 and is the deprecated location, while
rockylinux/rockylinux:9 — where the project moved — was pushed 2026-06-12.

substrate at the version in go.mod, not @latest. go list -m reads it, so the endpoint this
mount is proven against is the same code internal/testaws runs in-process, and a disagreement between
them cannot be a version difference. Dependabot moves both, because there is one version to move.

Also: credentials go in root's ~/.aws/credentials, not this shell's environment. sudo resets the
environment and an /etc/fstab entry has none at all — it is mount -a at boot, as root, with whatever
the AWS default chain finds on disk. internal/storage/s3's config has no credential keys, so the chain
is the only way in. The pair used is substrate's public built-in emulator credentials, the same ones
internal/testaws uses; no secret is read and no live credential is on this path.

The durable half

TestEveryPackagedFormatIsInstalledAndRemovedInCI couples nfpms.formats to what the packaging job
installs and removes. It is release_packages_test.go with the arrows the other way round: that file
couples "a format ci.yml builds" to "a format release.yml ships", and this one couples "a format the
packaging produces" to "a format CI has ever installed" — where the rpm's answer was no, for every
release.

Driven off the config's own formats: list, which is the part that lasts. nfpm also writes apk,
archlinux and ipk; a third format is a one-line change that release.yml's dist/ upload glob would
publish immediately and nothing would install. That format now fails this test until CI learns it.

Verification

go build ./...                             clean
go vet ./internal/config/                  clean
make test                                  rc=0, 37 packages ok, -race
GOOS=linux golangci-lint run ./internal/config/    0 issues

Local golangci-lint is v2.13.2 and ci.yml pins v2.12.2, so that run is a signal and not the
measurement — the required check is.

Mutation-verified, 8 mutations, 8 caught, 1 measured equivalent. Two results worth recording:

  • deleting rpm -e objectfs from the workflow passed the first version of the gate. The job's own
    diagnostics say "/sbin/mount.objectfs survived rpm -e, dangling", and an echo "::error::…" is
    executable text rather than a comment, so stripping comments does not remove it — the gate was reading
    a message about the removal while the removal was gone. That is the cosign verify-blob failure in
    release_signing_test.go one level down, reproduced by someone who had just read that comment, which
    is the argument for the structural rule over care. Fixed with a line-prefix match (runsCommand), and
    the identical mutation is now caught by name.
  • deleting one of the two deb installs survived and is genuinely equivalent — dpkg -i in the
    reinstall step still installs the format. Deleting both is caught. Measured, not assumed.
  • and one apparent survivor was a mutation that had not applied: a regex meant to delete the whole rpm
    step removed 8 lines of it. Deleting the real line range is caught.

Two things this deliberately does not do

No gate asserting the mount step exists. It would have to pin one step's exact command spelling,
which fails on a legitimate rewrite and catches little beyond deletion — and the step is self-checking
the moment it runs. The format-coverage gate is driven by .goreleaser.yml's data instead of by my
spelling, which is why that one is worth having and this one is not.

ci.yml's build-tags comment still says "ubuntu-latest has no /dev/fuse". That claim is what this
PR's mount step measures, and it is a comment rather than an observation. I am not editing it on a
prediction — the probe at the top of the new step reports the answer, and the comment gets corrected
from the job log rather than from reasoning.

Filed upstream

scttfrdmn/substrate#1237 — the standalone server exposes /health, /ready and /_substrate/reset
and no request log over HTTP, so an out-of-process consumer cannot count PUTs. The zero-writes claim here
is therefore a state diff (key, size, ETag) rather than the PUT count internal/difftest gets from
testaws' in-process recorder. The comment in the workflow says so, so the weaker proof is labelled rather
than mistaken for the real one.

Two gaps in `ci.yml`'s `packaging` job, both of which let something ship
unexercised for several releases.

**The rpm was never installed.** All three rpms are built on every pull
request, which is where a malformed header surfaces and nowhere near
enough: `scripts/postinstall.sh` and `scripts/preremove.sh` had been run
by dpkg and by `internal/config`'s tests against a staged root, and by no
rpm anywhere. So every published rpm carried maintainer scripts no rpm had
executed — and the two package managers call the same script with
different arguments, dpkg's `configure`/`remove`/`upgrade` against rpm's
instance counts. The tests drive both spellings; only a real rpm confirms
what rpm passes.

Installed in `rockylinux/rockylinux:9` over a read-only `dist/`, asserting
the same filesystem facts the deb path asserts, then removed with `rpm -e`
and asserted to have left nothing — including `/sbin/mount.objectfs`,
which neither package manager owns because `postinstall.sh` creates it, so
only `preremove.sh` can take it away.

**No CI mount had ever completed.** `mount(8)` was proven to *resolve*
`-t objectfs` to the installed helper; nothing had had a filesystem
mounted and read a byte through it. Now a real `sudo mount -t objectfs
s3://objectfs-ci /mnt/objectfs-ro -o ro,config=...` against a standalone
`substrate server`, with the bytes of a 21-byte object and a 1 MiB object
under a prefix compared through the mount, `ro` asserted in the kernel's
own option list, a write refused with EROFS, and the mountpoint empty
after `umount`.

Three deviations from the issue body, each measured rather than assumed:

- **On the runner, not in a container.** `--device /dev/fuse` presupposes
  the host has the device, so a container does not sidestep whether
  `ubuntu-latest` has it — and the deb is already installed at that point,
  so mounting here exercises the *installed* `/sbin/mount.objectfs`.
- **`rockylinux/rockylinux:9`, not `rockylinux:9`.** `library/rockylinux:9`
  was last pushed 2024-05-30 and is the deprecated location;
  `rockylinux/rockylinux:9` was pushed 2026-06-12.
- **substrate at the version in `go.mod`, not `@latest`,** so the endpoint
  this mount is proven against is the code `internal/testaws` runs
  in-process.

Plus the durable half: `TestEveryPackagedFormatIsInstalledAndRemovedInCI`
couples `nfpms.formats` to what the `packaging` job installs *and*
removes, so a third format — nfpm also writes apk, archlinux, ipk — fails
until CI learns it rather than being published by the `dist/` upload glob
with its scriptlets never executed.
@scttfrdmn scttfrdmn added the type: testing Test coverage, test infrastructure, or test improvements label Sep 20, 2026
@scttfrdmn scttfrdmn added priority: medium Important but not urgent effort: small Small effort - 2-4 hours area: ci-cd CI workflows, gates, and release automation labels Sep 20, 2026
The mount step added in the previous commit probed the device rather than
assuming it, and the answer contradicts what this repository has been
asserting since the fuse_mount tag was introduced:

    crw-rw-rw- 1 root root 10, 229 Sep 20 04:15 /dev/fuse
    fusermount3 version: 3.14.0

fusermount3 and /etc/fuse.conf are there too, and none of the three was
installed by that job — it reports `0 upgraded, 1 newly installed` for the
.deb alone. ubuntu-latest ships all of it.

Four claims are corrected to the measurement:

- ci.yml's build-tags matrix said "ubuntu-latest has no /dev/fuse, so they
  cannot run here". The suite is still compiled-only, but for a reason that
  is honest about what is unknown rather than one that is false.
- kernel_options_live_test.go's doc comment said the same, and used it to
  justify a coverage gap. The gap is real; its stated cause was not. Its
  only other dependency is testaws — in-process, no bucket, no credential —
  so the device was the whole barrier.
- The packaging header said a busy FUSE mount "needs /dev/fuse and a
  bucket" and so had to be left to the Go tests. Neither half holds. That
  path is exercisable here and is simply not exercised, which is now
  written down as a gap instead of as an impossibility.
- The same header said "dpkg only" and proposed `rpm -qp` as the follow-on.
  The previous commit does a real `rpm -i` and `rpm -e` in a container,
  which is the thing that matters: `rpm -qp` reads a header without running
  a scriptlet, and the scriptlets were the entire exposure.

What remains unknown is whether the fuse_mount suite *passes* on this
runner, and this commit deliberately does not guess. It would mount as a
non-root `go test` through fusermount3's setuid path rather than as root,
and it counts kernel READ requests, which is a property of the kernel
version rather than of objectfs. Filed as #543 with the evidence.

The `[ ! -c /dev/fuse ]` check stays. A runner image is not a constant —
ubuntu-latest migrates to Ubuntu 26 from 2026-10-19 — and a device that
arrived without being promised can leave the same way.

Refs #149, #543
@scttfrdmn

Copy link
Copy Markdown
Owner Author

The job log answered the one question this PR left open

packaging passed all 14 steps (run 35488688077, 4m6s). I said in the description that ci.yml's
ubuntu-latest has no /dev/fuse comment would be corrected from the log rather than from reasoning.
The log says the comment was wrong:

crw-rw-rw- 1 root root 10, 229 Sep 20 04:15 /dev/fuse
fusermount3 version: 3.14.0

A world-writable character device, fusermount3 3.14.0, and /etc/fuse.conf — and the deb step
reports 0 upgraded, 1 newly installed, so nothing in this job put them there. ubuntu-latest ships
all three. Corrected in f93be2f, in all four places that repeated it, and the consequence is filed as
#543 rather than acted on here: the fuse_mount suite's only other dependency is testaws, so
the device was its whole barrier, but whether it passes under a non-root go test through
fusermount3's setuid path is unmeasured and this PR does not guess.

The probe itself stays. ubuntu-latest migrates to Ubuntu 26 from 2026-10-19, and a device that
arrived without being promised can leave the same way.

What the mount step observed

-o ro became --read-only, which is #532 reaching mount(8) for the first time:

mount.objectfs: /usr/bin/objectfs mount --read-only --config /etc/objectfs/ci.yaml s3://objectfs-ci /mnt/objectfs-ro
mount.objectfs: mounted s3://objectfs-ci on /mnt/objectfs-ro (pid 18918, log /var/log/objectfs/mount-mnt-objectfs-ro.log)
objectfs 0.16.0 mounted s3://objectfs-ci at /mnt/objectfs-ro (read-only)
objectfs /mnt/objectfs-ro fuse.objectfs ro,nosuid,nodev,relatime,user_id=0,group_id=0,max_read=131072 0 0

The kernel carries ro in /proc/mounts, the synthesised directory is there (sub/ is not a key in
the bucket), the 1 MiB object reports 1048576 bytes through stat(2), and the write is refused with
the errno that means the read-only gate did the refusing rather than a broken mount:

total 1
-rw-r--r-- 1 root root 41 Sep 20 04:19 small.txt
drwxr-xr-x 2 root root  0 Sep 20 04:19 sub
total 1024
-rw-r--r-- 1 root root 1048576 Sep 20 04:19 large.bin
sh: 1: cannot create /mnt/objectfs-ro/written-by-ci.txt: Read-only file system

Everything else in that step is silent on success by construction — two cmps, the stat comparison,
umount, the /proc/mounts and empty-directory guards, and diff -u of the bucket inventory across
the mount. The step runs under bash -e, so exit 0 is each of them passing. The inventory before and
after are identical: no zero-length object from a create, no rewrite from a Setattr, nothing from the
cache flushing.

What the rpm step observed

rpm -i and rpm -e both ran real maintainer scripts, under rpm, for the first time in this
project's history:

installing /dist/objectfs-0.0.1~next-1.x86_64.rpm
objectfs-0.0.1~next-1.x86_64
objectfs: starting configuration written to /etc/objectfs/config.yaml
objectfs: installed (1). Next:
installed objectfs 0.0.1~next-1.x86_64
objectfs version 0.16.0
packaged version: 0.0.1-next
objectfs: file contents under these paths are kept, not removed:
rpm install and removal complete

installed (1) is the detail worth pointing at: that is rpm's instance count as $1, not dpkg's
configure. The two package managers call scripts/postinstall.sh with different arguments, and
until this step only one of the two spellings had ever been executed by the manager that passes it.
rpm -e then reached scripts/preremove.sh — the script #207 was filed about — and it kept
/etc/objectfs while removing the binary, the symlink, the unit and both modulefiles.

The version is 0.0.1~next rather than 0.16.1~next because actions/checkout clones one commit and
no tags, so goreleaser finds none and falls back to v0.0.0. That is deliberate and it makes the
modulefile assertion stronger, not weaker: ~ is rpm's prerelease separator and the content paths
keep the hyphen, so the step derives 0.0.1-next from the filename and finds both modulefiles at a
version string nothing could have hardcoded.

rockylinux/rockylinux:9 pulled at sha256:81019941…, and the rpm installed with neither a
repository nor --nodeps, which confirms the header carries no rpmlib(...) requires and that fuse3
is a Recommends rather than a hard dependency.

@scttfrdmn
scttfrdmn merged commit f912d34 into main Sep 20, 2026
42 checks passed
@scttfrdmn
scttfrdmn deleted the feat/149-rpm-and-completed-mount branch September 20, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci-cd CI workflows, gates, and release automation effort: small Small effort - 2-4 hours priority: medium Important but not urgent type: testing Test coverage, test infrastructure, or test improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The rpm is never installed, and no CI mount ever completes

1 participant