diff options
author | Adam C. Stephens <2071575+adamcstephens@users.noreply.github.com> | 2024-04-23 09:24:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-23 09:24:21 -0400 |
commit | d27469607149144e364195c0a4d7b75e7652fb5c (patch) | |
tree | 3e8ee7ae70b1df903cb77acdfcac71bec05783fd /nixos/tests | |
parent | a8cbb7b35083df06c6b0d8ffbe7d921da60df06f (diff) | |
parent | 8541ec6d85c40dad2841642aa16ab8b3a2f97d53 (diff) |
Merge pull request #306239 from mweinelt/incus-vtpm
nixos/incus: add support for software TPMs
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/incus/virtual-machine.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/tests/incus/virtual-machine.nix b/nixos/tests/incus/virtual-machine.nix index 48178aaed32c4..eebbbd113ed16 100644 --- a/nixos/tests/incus/virtual-machine.nix +++ b/nixos/tests/incus/virtual-machine.nix @@ -30,6 +30,9 @@ in memorySize = 1024; diskSize = 4096; + # Provide a TPM to test vTPM support for guests + tpm.enable = true; + incus.enable = true; }; networking.nftables.enable = true; @@ -47,8 +50,14 @@ in with subtest("virtual-machine image can be imported"): machine.succeed("incus image import ${vm-image-metadata}/*/*.tar.xz ${vm-image-disk}/nixos.qcow2 --alias nixos") + with subtest("virtual-machine can be created"): + machine.succeed("incus create nixos ${instance-name} --vm --config limits.memory=512MB --config security.secureboot=false") + + with subtest("virtual tpm can be configured"): + machine.succeed("incus config device add ${instance-name} vtpm tpm path=/dev/tpm0") + with subtest("virtual-machine can be launched and become available"): - machine.succeed("incus launch nixos ${instance-name} --vm --config limits.memory=512MB --config security.secureboot=false") + machine.succeed("incus start ${instance-name}") with machine.nested("Waiting for instance to start and be usable"): retry(instance_is_up) |