From 65b25d0b14cce1258b75baa0bd559b4bb08e6c9c Mon Sep 17 00:00:00 2001 From: Tomas Srnka Date: Sat, 1 Aug 2026 09:06:23 +0200 Subject: [PATCH] test(integration): cover the premade NixOS base image in the distro matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tar-only publish gate in nixos-base-image.yml cannot catch a base image that does not boot: the pre-shim 26.05 image passed every tar assertion and still froze at boot with no units. Building a template from the published image and reaching ready exercises the parts that are still ours — the busybox Bootstrap standing in for the missing FHS userland, the /sbin/e2b-nixos-init activation shim, and the /etc/systemd/system drop-in removal that lets setup-etc take over. Pinned to the immutable tag, never :latest: phases/base/hash.go keys the base layer on the image reference as written, so a republished :latest would keep building from the stale cached layer and a CI failure would not reproduce. --- .../tests/api/templates/distro_build_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/integration/internal/tests/api/templates/distro_build_test.go b/tests/integration/internal/tests/api/templates/distro_build_test.go index 158a6bf9d0..1f70575fec 100644 --- a/tests/integration/internal/tests/api/templates/distro_build_test.go +++ b/tests/integration/internal/tests/api/templates/distro_build_test.go @@ -15,6 +15,9 @@ import ( // own package names under set -e, links its own init binary and regenerates its // own CA bundle, so a build that reaches ready with the start and ready commands // executed proves the whole profile resolves and that envd boots under it. +// +// NixOS installs nothing — see its case below — so there the same assertions +// prove the boot path rather than the package set. func TestTemplateBuildDistroFamilies(t *testing.T) { t.Parallel() @@ -43,6 +46,22 @@ func TestTemplateBuildDistroFamilies(t *testing.T) { templateName: "test-distro-alpine", fromImage: "alpine:3.24", }, + // Premade, so the profile declares no packages and a PkgInstall that + // exits 1: everything provisioning installs elsewhere is baked into the + // image's own NixOS configuration. Reaching ready therefore proves the + // parts that are still ours — the busybox Bootstrap standing in for the + // FHS userland the image has no /bin/sh for before its first activation, + // the /sbin/e2b-nixos-init activation shim, and the drop-in removal that + // lets setup-etc take over /etc/systemd/system. + // + // Pinned to the immutable tag, never :latest: the base-layer cache key is + // the image reference as written (phases/base/hash.go), so a republished + // :latest would keep building from the stale cached layer. + { + name: "NixOS premade", + templateName: "test-distro-nixos", + fromImage: "e2bdev/nixos:26.05-20260731", + }, } for _, tc := range testCases {