tests: remove redundant LUKS volume data files

The two removed files have exactly the same config as other LUKS volume
data files, simply with different file names. Consolidate down to just
two LUKS volume data files as that's all that we need for the test
coverage.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-09-17 12:32:54 +01:00
parent 285fdf373d
commit 093ee8b3e2
6 changed files with 19 additions and 61 deletions

View File

@ -1,11 +1,11 @@
qemu-img create -f luks \
--object secret,id=encrypt2.img_encrypt0,file=/path/to/secretFile \
-o key-secret=encrypt2.img_encrypt0 \
/var/lib/libvirt/images/encrypt2.img 5242880K
--object secret,id=LuksDemo.img_encrypt0,file=/path/to/secretFile \
-o key-secret=LuksDemo.img_encrypt0 \
/var/lib/libvirt/images/LuksDemo.img 5242880K
qemu-img convert --image-opts -n --target-image-opts \
--object secret,id=encrypt2.img_encrypt0,file=/path/to/secretFile \
--object secret,id=encrypt1.img_encrypt0,file=/path/to/inputSecretFile \
driver=luks,file.filename=/var/lib/libvirt/images/encrypt1.img,\
key-secret=encrypt1.img_encrypt0 \
driver=luks,file.filename=/var/lib/libvirt/images/encrypt2.img,\
key-secret=encrypt2.img_encrypt0
--object secret,id=LuksDemo.img_encrypt0,file=/path/to/secretFile \
--object secret,id=OtherDemo.img_encrypt0,file=/path/to/inputSecretFile \
driver=luks,file.filename=/var/lib/libvirt/images/OtherDemo.img,\
key-secret=OtherDemo.img_encrypt0 \
driver=luks,file.filename=/var/lib/libvirt/images/LuksDemo.img,\
key-secret=LuksDemo.img_encrypt0

View File

@ -1,7 +1,7 @@
qemu-img create -f qcow2 \
-o compat=0.10 /var/lib/libvirt/images/sparse-qcow2.img 1073741824K
qemu-img convert --image-opts -n --target-image-opts \
--object secret,id=encrypt2.img_encrypt0,file=/path/to/inputSecretFile \
driver=luks,file.filename=/var/lib/libvirt/images/encrypt2.img,\
key-secret=encrypt2.img_encrypt0 \
--object secret,id=OtherDemo.img_encrypt0,file=/path/to/inputSecretFile \
driver=luks,file.filename=/var/lib/libvirt/images/OtherDemo.img,\
key-secret=OtherDemo.img_encrypt0 \
driver=qcow2,file.filename=/var/lib/libvirt/images/sparse-qcow2.img

View File

@ -1,7 +1,7 @@
qemu-img create -f raw \
/var/lib/libvirt/images/sparse.img 1073741824K
qemu-img convert --image-opts -n --target-image-opts \
--object secret,id=encrypt2.img_encrypt0,file=/path/to/inputSecretFile \
driver=luks,file.filename=/var/lib/libvirt/images/encrypt2.img,\
key-secret=encrypt2.img_encrypt0 \
--object secret,id=OtherDemo.img_encrypt0,file=/path/to/inputSecretFile \
driver=luks,file.filename=/var/lib/libvirt/images/OtherDemo.img,\
key-secret=OtherDemo.img_encrypt0 \
driver=raw,file.filename=/var/lib/libvirt/images/sparse.img

View File

@ -264,16 +264,16 @@ mymain(void)
"pool-dir", "vol-file-qcow2",
"luks-convert-qcow2", 0);
DO_TEST("pool-dir", "vol-encrypt2",
"pool-dir", "vol-encrypt1",
DO_TEST("pool-dir", "vol-luks",
"pool-dir", "vol-luks-convert",
"luks-convert-encrypt", 0);
DO_TEST("pool-dir", "vol-file",
"pool-dir", "vol-encrypt2",
"pool-dir", "vol-luks-convert",
"luks-convert-encrypt2fileraw", 0);
DO_TEST("pool-dir", "vol-file-qcow2",
"pool-dir", "vol-encrypt2",
"pool-dir", "vol-luks-convert",
"luks-convert-encrypt2fileqcow2", 0);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;

View File

@ -1,21 +0,0 @@
<volume>
<name>encrypt1.img</name>
<key>/var/lib/libvirt/images/encrypt1.img</key>
<source>
</source>
<capacity unit="G">5</capacity>
<allocation>294912</allocation>
<target>
<path>/var/lib/libvirt/images/encrypt1.img</path>
<format type='raw'/>
<permissions>
<mode>0644</mode>
<owner>0</owner>
<group>0</group>
<label>unconfined_u:object_r:virt_image_t:s0</label>
</permissions>
<encryption format='luks'>
<secret type='passphrase' uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/>
</encryption>
</target>
</volume>

View File

@ -1,21 +0,0 @@
<volume>
<name>encrypt2.img</name>
<key>/var/lib/libvirt/images/encrypt2.img</key>
<source>
</source>
<capacity unit="G">5</capacity>
<allocation>294912</allocation>
<target>
<path>/var/lib/libvirt/images/encrypt2.img</path>
<format type='raw'/>
<permissions>
<mode>0644</mode>
<owner>0</owner>
<group>0</group>
<label>unconfined_u:object_r:virt_image_t:s0</label>
</permissions>
<encryption format='luks'>
<secret type='passphrase' uuid='e78d4b51-a2af-485f-b0f5-afca709af480'/>
</encryption>
</target>
</volume>