]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
tests: Use cryptsetup.passphrase for test_initrd_luks_lvm() as well
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 18 Dec 2023 11:39:59 +0000 (12:39 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 18 Dec 2023 13:55:31 +0000 (14:55 +0100)
The credential now applies to all instances of systemd-crypsetup@,
so let's use it for the LUKS+LVM test as well.

tests/test_initrd.py

index e201abc09f8647f1ee1401cc33695cb78058ab46..99623a6720659986171a344fd27dc9d1054c223d 100644 (file)
@@ -35,13 +35,12 @@ def passphrase() -> Iterator[Path]:
 
 
 @pytest.fixture(scope="module")
-def initrd(config: Image.Config, passphrase: Path) -> Iterator[Image]:
+def initrd(config: Image.Config) -> Iterator[Image]:
     with Image(
         config,
         options=[
             "--directory", "",
             "--include=mkosi-initrd/",
-            "--extra-tree", passphrase,
         ],
     ) as initrd:
         if initrd.config.distribution == Distribution.rhel_ubi:
@@ -180,7 +179,7 @@ def test_initrd_luks_lvm(config: Image.Config, initrd: Image, passphrase: Path)
             "--kernel-command-line=systemd.unit=mkosi-check-and-shutdown.service",
             "--kernel-command-line=root=LABEL=root",
             "--kernel-command-line=rw",
-            f"--kernel-command-line=rd.luks.key=/{passphrase.name}",
+            "--credential=cryptsetup.passphrase=mkosi",
             "--incremental",
             "--ephemeral",
             "--qemu-firmware=linux",