1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

tests: qemuxml2argv: Verify that disk secret alias is correct with user-aliases

Change the disk encryption type to qcow2+luks so that the appropriate
secret objects are generated. This tests that the proper alias is used
for the passphrase secret object.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2018-05-23 16:00:33 +02:00
parent e1b0c4bf65
commit 3bf1959524
4 changed files with 11 additions and 4 deletions

View File

@ -7,6 +7,8 @@ QEMU_AUDIO_DRV=none \
/usr/bin/qemu-system-x86_64 \
-name gentoo \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-gentoo/master-key.aes \
-machine pc-i440fx-1.4,accel=kvm,usb=off,dump-guest-core=off \
-m 4096 \
-smp 4,sockets=4,cores=1,threads=1 \
@ -43,7 +45,11 @@ id=drive-ua-myDisk1,cache=none \
-drive file=/var/lib/libvirt/images/gentoo.qcow2,format=qcow2,if=none,\
id=drive-ua-myDisk2 \
-device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-ua-myDisk2,id=ua-myDisk2 \
-drive file=/var/lib/libvirt/images/OtherDemo.img,format=qcow2,if=none,\
-object secret,id=ua-myEncryptedDisk1-luks-secret0,\
data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
-drive file=/var/lib/libvirt/images/OtherDemo.img,encrypt.format=luks,\
encrypt.key-secret=ua-myEncryptedDisk1-luks-secret0,format=qcow2,if=none,\
id=drive-ua-myEncryptedDisk1 \
-device virtio-blk-pci,bus=pci.0,addr=0x7,drive=drive-ua-myEncryptedDisk1,\
id=ua-myEncryptedDisk1 \

View File

@ -55,7 +55,7 @@
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/OtherDemo.img'/>
<target dev='vdb' bus='virtio'/>
<encryption format='qcow'>
<encryption format='luks'>
<secret type='passphrase' uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/>
</encryption>
<alias name='ua-myEncryptedDisk1'/>

View File

@ -2839,7 +2839,8 @@ mymain(void)
QEMU_CAPS_PIIX_DISABLE_S4, QEMU_CAPS_VNC,
QEMU_CAPS_DEVICE_ISA_SERIAL,
QEMU_CAPS_HDA_DUPLEX,
QEMU_CAPS_CCID_EMULATED);
QEMU_CAPS_CCID_EMULATED,
QEMU_CAPS_QCOW2_LUKS, QEMU_CAPS_OBJECT_SECRET);
DO_TEST("user-aliases2", QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI);
DO_TEST("user-aliases-usb", QEMU_CAPS_KVM,
QEMU_CAPS_PIIX_DISABLE_S3, QEMU_CAPS_PIIX_DISABLE_S4,

View File

@ -1173,7 +1173,7 @@ mymain(void)
DO_TEST("pseries-cpu-exact",
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE);
DO_TEST("user-aliases", NONE);
DO_TEST("user-aliases", QEMU_CAPS_QCOW2_LUKS);
DO_TEST("input-virtio-ccw",
QEMU_CAPS_CCW,
QEMU_CAPS_VIRTIO_KEYBOARD,