mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-20 00:03:56 +00:00
Add Trusted Platform Module (TPM) support for Qemu VMs
This commit is contained in:
@ -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