block: filter filename when testing encrypted images
PATCH v2 1/1 block: filter filename when testing encrypted images
qemu-io prints a warning message
"Disk image '/home/berrange/src/virt/qemu/tests/qemu-iotests/scratch/t.qcow2' is encrypted."
when opening an encrypted image, which was mistakenly included in the expected output for test 131. Add _filter_testdir into the command pipeline to strip the local path.
--- tests/qemu-iotests/131 | 8 ++++---- tests/qemu-iotests/131.out | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
tests/qemu-iotests/131 +4 -4
@@ -48,19 +48,19 @@ IMGOPTS="encryption=on" _make_test_img $size echo echo "== reading whole image ==" -echo "astrochicken" | $QEMU_IO -c "read 0 $size" "$TEST_IMG" | _filter_qemu_io +echo "astrochicken" | $QEMU_IO -c "read 0 $size" "$TEST_IMG" | _filter_qemu_io | _filter_testdir echo echo "== rewriting whole image ==" -echo "astrochicken" | $QEMU_IO -c "write -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io +echo "astrochicken" | $QEMU_IO -c "write -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io | _filter_testdir echo echo "== verify pattern ==" -echo "astrochicken" | $QEMU_IO -c "read -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io +echo "astrochicken" | $QEMU_IO -c "read -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io | _filter_testdir echo echo "== verify pattern failure with wrong password ==" -echo "platypus" | $QEMU_IO -c "read -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io +echo "platypus" | $QEMU_IO -c "read -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io | _filter_testdir # success, all done
tests/qemu-iotests/131.out +4 -4
@@ -11,7 +11,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 encryption=on Encrypted images are deprecated Support for them will be removed in a future release. You can use 'qemu-img convert' to convert your image to an unencrypted one. -Disk image '/home/berrange/src/virt/qemu/tests/qemu-iotests/scratch/t.qcow2' is encrypted. +Disk image 'TEST_DIR/t.qcow2' is encrypted. password: read 134217728/134217728 bytes at offset 0 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -20,7 +20,7 @@ read 134217728/134217728 bytes at offset 0 Encrypted images are deprecated Support for them will be removed in a future release. You can use 'qemu-img convert' to convert your image to an unencrypted one. -Disk image '/home/berrange/src/virt/qemu/tests/qemu-iotests/scratch/t.qcow2' is encrypted. +Disk image 'TEST_DIR/t.qcow2' is encrypted. password: wrote 134217728/134217728 bytes at offset 0 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -29,7 +29,7 @@ wrote 134217728/134217728 bytes at offset 0 Encrypted images are deprecated Support for them will be removed in a future release. You can use 'qemu-img convert' to convert your image to an unencrypted one. -Disk image '/home/berrange/src/virt/qemu/tests/qemu-iotests/scratch/t.qcow2' is encrypted. +Disk image 'TEST_DIR/t.qcow2' is encrypted. password: read 134217728/134217728 bytes at offset 0 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -38,7 +38,7 @@ read 134217728/134217728 bytes at offset 0 Encrypted images are deprecated Support for them will be removed in a future release. You can use 'qemu-img convert' to convert your image to an unencrypted one. -Disk image '/home/berrange/src/virt/qemu/tests/qemu-iotests/scratch/t.qcow2' is encrypted. +Disk image 'TEST_DIR/t.qcow2' is encrypted. password: Pattern verification failed at offset 0, 134217728 bytes read 134217728/134217728 bytes at offset 0
Signature · 1 line
2.1.0
Quoted 8 lines · Daniel P. Berrange
qemu-io prints a warning message
"Disk image '
/home/berrange/src/virt/qemu/tests/qemu-iotests/scratch/t.qcow2' is encrypted."when opening an encrypted image, which was mistakenly included in the expected output for test 131. Add
_filter_testdirinto the command pipeline to strip the local path.
Quoted 5 lines
Signed-off-by Daniel P. Berrange <[email protected]>--- tests/qemu-iotests/131 | 8 ++++---- tests/qemu-iotests/131.out | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Am 20.05.2015 um 17:52 hat Daniel P. Berrange geschrieben:
Quoted 9 lines
qemu-io prints a warning message
"Disk image '
/home/berrange/src/virt/qemu/tests/qemu-iotests/scratch/t.qcow2' is encrypted."when opening an encrypted image, which was mistakenly included in the expected output for test 131. Add
_filter_testdirinto the command pipeline to strip the local path.Signed-off-by Daniel P. Berrange <[email protected]>
Thanks, squashed into the commit adding that test case.
Kevin