vinix-ports / tests / FEED.md
35 lines · 26 sloc · 2.2 KB
Raw

Signed package integration test

Run the fixture on a Linux build machine with V, vpac, GnuPG, bsdtar, repo-add, sha256sum and unprivileged user/network namespaces. Set archives to the directory containing the source-built package archives.

work=$(mktemp -d)
v -o "$work/feed" tests/feed.v
"$work/feed" keys "$work/keys"
"$work/feed" publish "$work/keys" "$work/repo" x86_64 \
    "$archives"/musl-*.pkg.tar.zst "$archives"/busybox-*.pkg.tar.zst
"$work/feed" install "$work/keys" "$work/repo" x86_64 "$work/sdk" musl busybox

Each destination must be new. The publisher verifies each package signature, embeds signatures in the signed repository database, verifies both index signatures and records archive SHA-256 values in repo/packages.tsv. The installer checks the database and package signatures through vpac while syncing and resolving package names. Its isolated client keeps the root, database, cache, configuration and log under sdk/.

For a separate consumer, transfer the repository directory and obtain the expected fingerprint independently from the test owner. Import the public key into a client-only keyring.

"$work/feed" trust "$work/client-keys" "$work/repo/test-signer.asc" "$fingerprint"
"$work/feed" install "$work/client-keys" "$work/repo" x86_64 "$work/client" musl busybox

For a later SDK, publish the cumulative archive set to a new repository directory and install the desired package names into a new SDK. A remote builder can unpack a relative snapshot and set VPAC_MAKEPKG_ROOT and VPAC_MAKEPKG_DB to its extracted root and db directories.

tar --format=ustar --owner=0 --group=0 --zstd -cf "$work/sdk.tar.zst" -C "$work/sdk" root db
sha256sum "$work/sdk.tar.zst"

To boot the packages, pass an existing Vinix amd64 BIOS ISO to the diskless test. The runner uses the ISO's kernel and Limine boot files. Its --musl mode links a V probe with the installed musl SDK, checks its loader checksum in Vinix and exercises the Vinix malloc_trim implementation. BusyBox supplies PID 1, ash and the applets. The serial transcript is written to guest/serial.log.

v -o "$work/boot" tests/busybox/boot.v
"$work/boot" "$work/sdk/root" "$vinix_iso" "$work/guest" --musl