@@ -25,11 +25,13 @@ const PLATFORM = resolveIntegrationPlatform(process.env.INTEGRATION_PLATFORM ??
2525const ROOTFS_CHECK_PATH = process . env . INTEGRATION_ROOTFS_CHECK_PATH ?? "/etc/debian_version" ;
2626const VM_CHECK_COMMAND = process . env . INTEGRATION_VM_CHECK_COMMAND ?? "cat /etc/debian_version" ;
2727const VM_CHECK_EXPECT = process . env . INTEGRATION_VM_CHECK_EXPECT ?? "12" ;
28+ const BUSYBOX_IMAGE = process . env . INTEGRATION_BUSYBOX_IMAGE ?? "busybox:latest" ;
2829
2930const imageSlug = IMAGE . replace ( / [ ^ a - z 0 - 9 . _ - ] + / gi, "-" ) . toLowerCase ( ) ;
3031const tempRoot = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , `docker2vm-integration-${ imageSlug } -` ) ) ;
3132const rootfsOutDir = path . join ( tempRoot , `${ imageSlug } -rootfs` ) ;
3233const assetsOutDir = path . join ( tempRoot , `${ imageSlug } -assets` ) ;
34+ const busyboxAssetsOutDir = path . join ( tempRoot , "busybox-assets-smoke" ) ;
3335
3436afterAll ( ( ) => {
3537 fs . rmSync ( tempRoot , { recursive : true , force : true } ) ;
@@ -162,6 +164,52 @@ describe("oci2gondolin integration", () => {
162164 }
163165 }
164166 } , 420_000 ) ;
167+
168+ it ( "keeps the busybox VM smoke check" , async ( ) => {
169+ requireBinary ( process . arch === "arm64" ? "qemu-system-aarch64" : "qemu-system-x86_64" ) ;
170+
171+ const result = await runCommand (
172+ "bun" ,
173+ [
174+ "run" ,
175+ "src/bin/oci2gondolin.ts" ,
176+ "--image" ,
177+ BUSYBOX_IMAGE ,
178+ "--platform" ,
179+ PLATFORM ,
180+ "--mode" ,
181+ "assets" ,
182+ "--out" ,
183+ busyboxAssetsOutDir ,
184+ ] ,
185+ { cwd : REPO_ROOT , timeoutMs : 300_000 } ,
186+ ) ;
187+
188+ assertSuccess ( result , "oci2gondolin busybox assets conversion" ) ;
189+
190+ const originalGuestDir = process . env . GONDOLIN_GUEST_DIR ;
191+ const vmSandbox = resolveVmSandboxOptions ( ) ;
192+
193+ let vm : VM | null = null ;
194+ try {
195+ process . env . GONDOLIN_GUEST_DIR = busyboxAssetsOutDir ;
196+ vm = await VM . create ( { sandbox : vmSandbox } ) ;
197+
198+ const busyboxResult = await vm . exec ( [ "/bin/busybox" , "echo" , "integration-busybox-ok" ] ) ;
199+ expect ( busyboxResult . exitCode ) . toBe ( 0 ) ;
200+ expect ( busyboxResult . stdout ) . toContain ( "integration-busybox-ok" ) ;
201+ } finally {
202+ await vm ?. close ( ) . catch ( ( ) => {
203+ // ignore close errors in test teardown
204+ } ) ;
205+
206+ if ( originalGuestDir === undefined ) {
207+ delete process . env . GONDOLIN_GUEST_DIR ;
208+ } else {
209+ process . env . GONDOLIN_GUEST_DIR = originalGuestDir ;
210+ }
211+ }
212+ } , 420_000 ) ;
165213} ) ;
166214
167215function resolveIntegrationPlatform ( raw : string ) : "linux/amd64" | "linux/arm64" {
0 commit comments