提交 2c71edcf 编写于 作者: P Peter Krempa

tests: qemublock: basic qcow2 tests

Add tests for backing chain handling, including a very long chain which
is fully specified in the XML and an unterminated chain.

The top level disk image would generate the following '-drive':

file-qcow2-backing-chain-encryption.xml:
-drive file=/var/lib/libvirt/images/a,encrypt.format=luks,
    encrypt.key-secret=node-b-f-encalias,format=qcow2,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-qcow2-backing-chain-noopts.xml:
-drive file=/var/lib/libvirt/images/rhel7.3.1507297895,format=qcow2,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy

file-qcow2-backing-chain-unterminated.xml:
-drive file=/var/lib/libvirt/images/rhel7.3.1507297895,format=qcow2,if=none,id=drive-dummy
-device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 23a7f948
......@@ -461,6 +461,9 @@ mymain(void)
TEST_DISK_TO_JSON("file-raw-aio_native");
TEST_DISK_TO_JSON("file-backing_basic-aio_threads");
TEST_DISK_TO_JSON("file-raw-luks");
TEST_DISK_TO_JSON("file-qcow2-backing-chain-noopts");
TEST_DISK_TO_JSON("file-qcow2-backing-chain-unterminated");
TEST_DISK_TO_JSON("file-qcow2-backing-chain-encryption");
cleanup:
virHashFree(diskxmljsondata.schema);
......
{
"node-name": "node-b-f",
"read-only": false,
"driver": "qcow2",
"encrypt": {
"format": "luks",
"key-secret": "node-b-f-encalias"
},
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/a",
"node-name": "node-a-s",
"read-only": false,
"discard": "unmap"
},
"backing": "node-b-f"
}
{
"node-name": "node-b-f",
"read-only": true,
"driver": "qcow2",
"encrypt": {
"format": "aes",
"key-secret": "node-b-f-encalias"
},
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/b",
"node-name": "node-b-s",
"read-only": true,
"discard": "unmap"
},
"backing": null
}
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/a'>
<encryption format='luks'>
<secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f'/>
</encryption>
<privateData>
<nodenames>
<nodename type='storage' name='node-a-s'/>
<nodename type='format' name='node-b-f'/>
</nodenames>
</privateData>
</source>
<backingStore type='file' index='1'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/b'>
<privateData>
<nodenames>
<nodename type='storage' name='node-b-s'/>
<nodename type='format' name='node-b-f'/>
</nodenames>
</privateData>
<encryption format='qcow'>
<secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f'/>
</encryption>
</source>
<backingStore/>
</backingStore>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
</disk>
{
"node-name": "#block126",
"read-only": false,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.1507297895",
"node-name": "#block004",
"read-only": false,
"discard": "unmap"
},
"backing": "#block313"
}
{
"node-name": "#block313",
"read-only": true,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.1484071872",
"node-name": "#block256",
"read-only": true,
"discard": "unmap"
},
"backing": "#block556"
}
{
"node-name": "#block556",
"read-only": true,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.1483615252",
"node-name": "#block418",
"read-only": true,
"discard": "unmap"
},
"backing": "#block767"
}
{
"node-name": "#block767",
"read-only": true,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.1483605924",
"node-name": "#block624",
"read-only": true,
"discard": "unmap"
},
"backing": "#block937"
}
{
"node-name": "#block937",
"read-only": true,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.1483605920",
"node-name": "#block869",
"read-only": true,
"discard": "unmap"
},
"backing": "#block1157"
}
{
"node-name": "#block1157",
"read-only": true,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.1483546244",
"node-name": "#block1047",
"read-only": true,
"discard": "unmap"
},
"backing": "#block1392"
}
{
"node-name": "#block1392",
"read-only": true,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.1483545901",
"node-name": "#block1279",
"read-only": true,
"discard": "unmap"
},
"backing": "#block1523"
}
{
"node-name": "#block1523",
"read-only": true,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.1483545313",
"node-name": "#block1444",
"read-only": true,
"discard": "unmap"
},
"backing": "#block1742"
}
{
"node-name": "#block1742",
"read-only": true,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.1483536402",
"node-name": "#block1602",
"read-only": true,
"discard": "unmap"
},
"backing": "#block1909"
}
{
"node-name": "#block1909",
"read-only": true,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.qcow2",
"node-name": "#block1864",
"read-only": true,
"discard": "unmap"
},
"backing": null
}
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.1507297895'>
<privateData>
<nodenames>
<nodename type='storage' name='#block004'/>
<nodename type='format' name='#block126'/>
</nodenames>
</privateData>
</source>
<backingStore type='file' index='1'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.1484071872'>
<privateData>
<nodenames>
<nodename type='storage' name='#block256'/>
<nodename type='format' name='#block313'/>
</nodenames>
</privateData>
</source>
<backingStore type='file' index='2'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.1483615252'>
<privateData>
<nodenames>
<nodename type='storage' name='#block418'/>
<nodename type='format' name='#block556'/>
</nodenames>
</privateData>
</source>
<backingStore type='file' index='3'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.1483605924'>
<privateData>
<nodenames>
<nodename type='storage' name='#block624'/>
<nodename type='format' name='#block767'/>
</nodenames>
</privateData>
</source>
<backingStore type='file' index='4'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.1483605920'>
<privateData>
<nodenames>
<nodename type='storage' name='#block869'/>
<nodename type='format' name='#block937'/>
</nodenames>
</privateData>
</source>
<backingStore type='file' index='5'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.1483546244'>
<privateData>
<nodenames>
<nodename type='storage' name='#block1047'/>
<nodename type='format' name='#block1157'/>
</nodenames>
</privateData>
</source>
<backingStore type='file' index='6'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.1483545901'>
<privateData>
<nodenames>
<nodename type='storage' name='#block1279'/>
<nodename type='format' name='#block1392'/>
</nodenames>
</privateData>
</source>
<backingStore type='file' index='7'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.1483545313'>
<privateData>
<nodenames>
<nodename type='storage' name='#block1444'/>
<nodename type='format' name='#block1523'/>
</nodenames>
</privateData>
</source>
<backingStore type='file' index='8'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.1483536402'>
<privateData>
<nodenames>
<nodename type='storage' name='#block1602'/>
<nodename type='format' name='#block1742'/>
</nodenames>
</privateData>
</source>
<backingStore type='file' index='9'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.qcow2'>
<privateData>
<nodenames>
<nodename type='storage' name='#block1864'/>
<nodename type='format' name='#block1909'/>
</nodenames>
</privateData>
</source>
<backingStore/>
</backingStore>
</backingStore>
</backingStore>
</backingStore>
</backingStore>
</backingStore>
</backingStore>
</backingStore>
</backingStore>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
</disk>
{
"node-name": "#block126",
"read-only": false,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.1507297895",
"node-name": "#block004",
"read-only": false,
"discard": "unmap"
},
"backing": "#block313"
}
{
"node-name": "#block313",
"read-only": true,
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "/var/lib/libvirt/images/rhel7.3.1484071872",
"node-name": "#block256",
"read-only": true,
"discard": "unmap"
}
}
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.1507297895'>
<privateData>
<nodenames>
<nodename type='storage' name='#block004'/>
<nodename type='format' name='#block126'/>
</nodenames>
</privateData>
</source>
<backingStore type='file' index='1'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel7.3.1484071872'>
<privateData>
<nodenames>
<nodename type='storage' name='#block256'/>
<nodename type='format' name='#block313'/>
</nodenames>
</privateData>
</source>
</backingStore>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
</disk>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册