mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Add Trusted Platform Module (TPM) support for Qemu VMs
This commit is contained in:
1 parent
eb1b70456f
commit
ae200d9add
5 files changed
+120
-9
No files matched your search
@@ -173,7 +173,7 @@ async def test_termination_callback(vm):
|
||||
await vm._termination_callback(0)
|
||||
assert vm.status == "stopped"
|
||||
|
||||
await queue.get(1) # Ping
|
||||
await queue.get(1) # Ping
|
||||
|
||||
(action, event, kwargs) = await queue.get(1)
|
||||
assert action == "node.updated"
|
||||
@@ -401,6 +401,17 @@ async def test_spice_option(vm, fake_qemu_img_binary):
|
||||
assert '-vga qxl' in ' '.join(options)
|
||||
|
||||
|
||||
async def test_tpm_option(vm, tmpdir, fake_qemu_img_binary):
|
||||
|
||||
vm.manager.get_qemu_version = AsyncioMagicMock(return_value="3.1.0")
|
||||
vm._tpm = True
|
||||
tpm_sock = os.path.join(vm.temporary_directory, "swtpm.sock")
|
||||
options = await vm._build_command()
|
||||
assert '-chardev socket,id=chrtpm,path={}'.format(tpm_sock) in ' '.join(options)
|
||||
assert '-tpmdev emulator,id=tpm0,chardev=chrtpm' in ' '.join(options)
|
||||
assert '-device tpm-tis,tpmdev=tpm0' in ' '.join(options)
|
||||
|
||||
|
||||
async def test_disk_options_multiple_disk(vm, tmpdir, fake_qemu_img_binary):
|
||||
|
||||
vm._hda_disk_image = str(tmpdir / "test0.qcow2")
|
||||
|
||||
Reference in new issue
Block a user