tests: add testBoot parameter to disable boot tests

This commit is contained in:
lassulus 2022-11-10 09:46:06 +01:00
parent 78d9448fcf
commit c5973aed4e

View file

@ -13,6 +13,7 @@
, efi ? true , efi ? true
, enableOCR ? false , enableOCR ? false
, testMode ? "direct" # can be one of direct module cli , testMode ? "direct" # can be one of direct module cli
, testBoot ? true # if we actually want to test booting or just create/mount
}: }:
let let
lib = pkgs.lib; lib = pkgs.lib;
@ -141,6 +142,7 @@
machine.succeed("${tsp-mount}") # verify that the command is idempotent machine.succeed("${tsp-mount}") # verify that the command is idempotent
''} ''}
${lib.optionalString testBoot ''
# mount nix-store in /mnt # mount nix-store in /mnt
machine.succeed("mkdir -p /mnt/nix/store") machine.succeed("mkdir -p /mnt/nix/store")
machine.succeed("mount --bind /nix/store /mnt/nix/store") machine.succeed("mount --bind /nix/store /mnt/nix/store")
@ -161,6 +163,8 @@
machine.start() machine.start()
${bootCommands} ${bootCommands}
machine.wait_for_unit("local-fs.target") machine.wait_for_unit("local-fs.target")
''}
${extraTestScript} ${extraTestScript}
''; '';
}; };