Skip to content

Commit 45548b0

Browse files
committed
Keep busybox runtime check in matrix integration test
1 parent d5ccda8 commit 45548b0

2 files changed

Lines changed: 7 additions & 46 deletions

File tree

src/oci2gondolin/materialize/runtime-injection.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ const REQUIRED_RUNTIME_FILES: RuntimeFileSpec[] = [
2727
targetRelativePath: "bin/kmod",
2828
mode: 0o755,
2929
},
30+
{
31+
sourcePathInRootfs: "/bin/busybox",
32+
targetRelativePath: "bin/busybox",
33+
mode: 0o755,
34+
},
3035
{
3136
sourcePathInRootfs: "/usr/lib/libcrypto.so.3",
3237
targetRelativePath: "usr/lib/libcrypto.so.3",

test/integration/oci2gondolin.integration.test.ts

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ const PLATFORM = resolveIntegrationPlatform(process.env.INTEGRATION_PLATFORM ??
2525
const ROOTFS_CHECK_PATH = process.env.INTEGRATION_ROOTFS_CHECK_PATH ?? "/etc/debian_version";
2626
const VM_CHECK_COMMAND = process.env.INTEGRATION_VM_CHECK_COMMAND ?? "cat /etc/debian_version";
2727
const VM_CHECK_EXPECT = process.env.INTEGRATION_VM_CHECK_EXPECT ?? "12";
28-
const BUSYBOX_IMAGE = process.env.INTEGRATION_BUSYBOX_IMAGE ?? "busybox:latest";
2928

3029
const imageSlug = IMAGE.replace(/[^a-z0-9._-]+/gi, "-").toLowerCase();
3130
const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), `docker2vm-integration-${imageSlug}-`));
3231
const rootfsOutDir = path.join(tempRoot, `${imageSlug}-rootfs`);
3332
const assetsOutDir = path.join(tempRoot, `${imageSlug}-assets`);
34-
const busyboxAssetsOutDir = path.join(tempRoot, "busybox-assets-smoke");
3533

3634
afterAll(() => {
3735
fs.rmSync(tempRoot, { recursive: true, force: true });
@@ -152,52 +150,10 @@ describe("oci2gondolin integration", () => {
152150
const execResult = await vm.exec(["/bin/sh", "-lc", VM_CHECK_COMMAND]);
153151
expect(execResult.exitCode).toBe(0);
154152
expect(execResult.stdout).toContain(VM_CHECK_EXPECT);
155-
} finally {
156-
await vm?.close().catch(() => {
157-
// ignore close errors in test teardown
158-
});
159-
160-
if (originalGuestDir === undefined) {
161-
delete process.env.GONDOLIN_GUEST_DIR;
162-
} else {
163-
process.env.GONDOLIN_GUEST_DIR = originalGuestDir;
164-
}
165-
}
166-
}, 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 });
197153

198-
const busyboxResult = await vm.exec(["/bin/busybox", "echo", "integration-busybox-ok"]);
154+
const busyboxResult = await vm.exec(["/bin/busybox", "echo", "integration-vm-ok"]);
199155
expect(busyboxResult.exitCode).toBe(0);
200-
expect(busyboxResult.stdout).toContain("integration-busybox-ok");
156+
expect(busyboxResult.stdout).toContain("integration-vm-ok");
201157
} finally {
202158
await vm?.close().catch(() => {
203159
// ignore close errors in test teardown

0 commit comments

Comments
 (0)