mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
nixos/tests/systemd-initrd-credentials: init
This commit is contained in:
parent
7d36daa76a
commit
dd15d6c248
2 changed files with 33 additions and 0 deletions
|
@ -1295,6 +1295,7 @@ in
|
||||||
systemd-escaping = runTest ./systemd-escaping.nix;
|
systemd-escaping = runTest ./systemd-escaping.nix;
|
||||||
systemd-initrd-bridge = runTest ./systemd-initrd-bridge.nix;
|
systemd-initrd-bridge = runTest ./systemd-initrd-bridge.nix;
|
||||||
systemd-initrd-btrfs-raid = runTest ./systemd-initrd-btrfs-raid.nix;
|
systemd-initrd-btrfs-raid = runTest ./systemd-initrd-btrfs-raid.nix;
|
||||||
|
systemd-initrd-credentials = runTest ./systemd-initrd-credentials.nix;
|
||||||
systemd-initrd-luks-fido2 = runTest ./systemd-initrd-luks-fido2.nix;
|
systemd-initrd-luks-fido2 = runTest ./systemd-initrd-luks-fido2.nix;
|
||||||
systemd-initrd-luks-keyfile = runTest ./systemd-initrd-luks-keyfile.nix;
|
systemd-initrd-luks-keyfile = runTest ./systemd-initrd-luks-keyfile.nix;
|
||||||
systemd-initrd-luks-empty-passphrase = handleTest ./initrd-luks-empty-passphrase.nix {
|
systemd-initrd-luks-empty-passphrase = handleTest ./initrd-luks-empty-passphrase.nix {
|
||||||
|
|
32
nixos/tests/systemd-initrd-credentials.nix
Normal file
32
nixos/tests/systemd-initrd-credentials.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
name = "systemd-initrd-credentials";
|
||||||
|
|
||||||
|
nodes.machine =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
virtualisation = {
|
||||||
|
qemu.options = [
|
||||||
|
"-smbios type=11,value=io.systemd.credential:cred-smbios=secret-smbios"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "dmi_sysfs" ];
|
||||||
|
|
||||||
|
boot.kernelParams = [ "systemd.set_credential=cred-cmdline:secret-cmdline" ];
|
||||||
|
|
||||||
|
boot.initrd.systemd = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
machine.wait_for_unit("multi-user.target")
|
||||||
|
|
||||||
|
# Check credential passed via kernel command line
|
||||||
|
assert "secret-cmdline" in machine.succeed("systemd-creds --system cat cred-cmdline")
|
||||||
|
|
||||||
|
# Check credential passed via SMBIOS
|
||||||
|
assert "secret-smbios" in machine.succeed("systemd-creds --system cat cred-smbios")
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue