summary refs log tree commit diff
path: root/release/checks/no-roothash.nix
diff options
context:
space:
mode:
Diffstat (limited to 'release/checks/no-roothash.nix')
-rw-r--r--release/checks/no-roothash.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/release/checks/no-roothash.nix b/release/checks/no-roothash.nix
new file mode 100644
index 0000000..4c5c19c
--- /dev/null
+++ b/release/checks/no-roothash.nix
@@ -0,0 +1,31 @@
+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Alyssa Ross <hi@alyssa.is>
+
+import ../../lib/eval-config.nix ({ config, ... }:
+
+let
+  rootfs = import ../../host/rootfs { inherit config; };
+  initramfs = import ../../host/initramfs { inherit config rootfs; };
+in
+
+config.pkgs.nixosTest ({ stdenv, ... }: {
+  name = "spectrum-test-initramfs-no-roothash";
+  nodes = {};
+
+  testScript = ''
+    import shlex
+
+    flags = " ".join(map(shlex.quote, [
+      "qemu-kvm",
+      "-m", "512",
+      "-kernel", "${rootfs.kernel}/${stdenv.hostPlatform.linux-kernel.target}",
+      "-initrd", "${initramfs}",
+      "-append", "console=ttyS0 panic=-1",
+    ]))
+
+    machine = create_machine({"startCommand": flags})
+
+    machine.start()
+    machine.wait_for_console_text("roothash invalid or missing")
+  '';
+}))