mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
incus: add tpm to container test
This commit is contained in:
parent
0e12722d4b
commit
ed24c80ef6
@ -36,7 +36,8 @@ in
|
||||
networking.nftables.enable = true;
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
testScript = # python
|
||||
''
|
||||
def instance_is_up(_) -> bool:
|
||||
status, _ = machine.execute("incus exec container --disable-stdin --force-interactive /run/current-system/sw/bin/systemctl -- is-system-running")
|
||||
return status == 0
|
||||
@ -94,6 +95,13 @@ in
|
||||
meminfo_bytes = " ".join(meminfo.split(' ')[-2:])
|
||||
assert meminfo_bytes == "125000 kB", f"Wrong amount of memory reported from /proc/meminfo, want: '125000 kB', got: '{meminfo_bytes}'"
|
||||
|
||||
with subtest("virtual tpm can be configured"):
|
||||
machine.succeed("incus config device add container vtpm tpm path=/dev/tpm0 pathrm=/dev/tpmrm0")
|
||||
machine.succeed("incus exec container -- test -e /dev/tpm0")
|
||||
machine.succeed("incus exec container -- test -e /dev/tpmrm0")
|
||||
machine.succeed("incus config device remove container vtpm")
|
||||
machine.fail("incus exec container -- test -e /dev/tpm0")
|
||||
|
||||
with subtest("lxc-generator"):
|
||||
with subtest("lxc-container generator configures plain container"):
|
||||
# reuse the existing container to save some time
|
||||
|
Loading…
Reference in New Issue
Block a user