about summary refs log tree commit diff
path: root/tvix/boot/tests/default.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-03-18T10·08+0200
committerflokli <flokli@flokli.de>2024-03-18T16·10+0000
commit8d177a18a5bae595e9662b8a6a38479517e7695f (patch)
treee6aee7cd96f55c3499e5c6a26e9dd364f25f7660 /tvix/boot/tests/default.nix
parent898830b332b384fb9c4db124b0960bc3171e03bb (diff)
feat(tvix/boot): make VM cmdline and asserted VM output configurable r/7729
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 <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/boot/tests/default.nix')
-rw-r--r--tvix/boot/tests/default.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/tvix/boot/tests/default.nix b/tvix/boot/tests/default.nix
index 3720bf149efe..108803d7abcc 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" ];
       };