From 8d177a18a5bae595e9662b8a6a38479517e7695f Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 18 Mar 2024 12:08:47 +0200 Subject: [PATCH] feat(tvix/boot): make VM cmdline and asserted VM output configurable This can be used in the future to boot proper NixOS VMs, which want a init= in their cmdline. Change-Id: Iad4a25d5081f3a6af1c7f62f15853f3afaae4a0c Reviewed-on: https://cl.tvl.fyi/c/depot/+/11190 Reviewed-by: Connor Brewster Autosubmit: flokli Tested-by: BuildkiteCI --- tvix/boot/tests/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tvix/boot/tests/default.nix b/tvix/boot/tests/default.nix index 3720bf149..108803d7a 100644 --- a/tvix/boot/tests/default.nix +++ b/tvix/boot/tests/default.nix @@ -18,6 +18,12 @@ let , isClosure ? false , importPathName ? null + # The cmdline to pass to the VM. + # Defaults to tvix.find, which lists all files in the store. + , vmCmdline ? "tvix.find" + # The string we expect to find in the VM output. + # Defaults the value of `path` (the store path we upload). + , assertVMOutput ? path }: assert isClosure -> importPathName == null; @@ -92,8 +98,8 @@ let '' + '' # Invoke a VM using tvix as the backing store, ensure the outpath appears in its listing. - CH_CMDLINE="tvix.find" run-tvix-vm 2>&1 | tee output.txt - grep ${path} output.txt + CH_CMDLINE="${vmCmdline}" run-tvix-vm 2>&1 | tee output.txt + grep "${assertVMOutput}" output.txt ''; requiredSystemFeatures = [ "kvm" ]; };