about summary refs log tree commit diff
path: root/nixos/tests/systemd-initrd-luks-tpm2.nix
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-10-23 12:02:04 +0000
committerGitHub <noreply@github.com>2023-10-23 12:02:04 +0000
commit2c2c0379b759c234413de63478847266cdc8ed93 (patch)
tree92ebd45d1cd2a17d5fb63ff5c6c006a4d8f25f7e /nixos/tests/systemd-initrd-luks-tpm2.nix
parent1026189bd67abfd6f7def1c697988217caafbc5c (diff)
parenta3b463e8874fe9182e758919eeb18bb44070097c (diff)
downloadnixlib-2c2c0379b759c234413de63478847266cdc8ed93.tar
nixlib-2c2c0379b759c234413de63478847266cdc8ed93.tar.gz
nixlib-2c2c0379b759c234413de63478847266cdc8ed93.tar.bz2
nixlib-2c2c0379b759c234413de63478847266cdc8ed93.tar.lz
nixlib-2c2c0379b759c234413de63478847266cdc8ed93.tar.xz
nixlib-2c2c0379b759c234413de63478847266cdc8ed93.tar.zst
nixlib-2c2c0379b759c234413de63478847266cdc8ed93.zip
Merge staging-next into staging
Diffstat (limited to 'nixos/tests/systemd-initrd-luks-tpm2.nix')
-rw-r--r--nixos/tests/systemd-initrd-luks-tpm2.nix27
1 files changed, 1 insertions, 26 deletions
diff --git a/nixos/tests/systemd-initrd-luks-tpm2.nix b/nixos/tests/systemd-initrd-luks-tpm2.nix
index d9dd9118a3a2..e292acfd1c5f 100644
--- a/nixos/tests/systemd-initrd-luks-tpm2.nix
+++ b/nixos/tests/systemd-initrd-luks-tpm2.nix
@@ -9,7 +9,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
       # Booting off the TPM2-encrypted device requires an available init script
       mountHostNixStore = true;
       useEFIBoot = true;
-      qemu.options = ["-chardev socket,id=chrtpm,path=/tmp/mytpm1/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0"];
+      tpm.enable = true;
     };
     boot.loader.systemd-boot.enable = true;
 
@@ -33,29 +33,6 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
   };
 
   testScript = ''
-    import subprocess
-    import os
-    import time
-
-
-    class Tpm:
-        def __init__(self):
-            os.mkdir("/tmp/mytpm1")
-            self.start()
-
-        def start(self):
-            self.proc = subprocess.Popen(["${pkgs.swtpm}/bin/swtpm", "socket", "--tpmstate", "dir=/tmp/mytpm1", "--ctrl", "type=unixio,path=/tmp/mytpm1/swtpm-sock", "--log", "level=20", "--tpm2"])
-
-        def wait_for_death_then_restart(self):
-            while self.proc.poll() is None:
-                print("waiting for tpm to die")
-                time.sleep(1)
-            assert self.proc.returncode == 0
-            self.start()
-
-    tpm = Tpm()
-
-
     # Create encrypted volume
     machine.wait_for_unit("multi-user.target")
     machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdb -")
@@ -66,8 +43,6 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
     machine.succeed("sync")
     machine.crash()
 
-    tpm.wait_for_death_then_restart()
-
     # Boot and decrypt the disk
     machine.wait_for_unit("multi-user.target")
     assert "/dev/mapper/cryptroot on / type ext4" in machine.succeed("mount")