Tests for LUKS driver
v9 cover Tests for LUKS driver
This series contains the 3 test suite patches that had to be dropped from the v6 series during merge with the block tree:
v6: https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg04935.html
v7: https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg06687.html
v8: https://lists.gnu.org/archive/html/qemu-devel/2016-04/msg02736.html
Changed in v9:
- Use QEMU_IMG_EXTRA_ARGS in common.rc
- Use 'write -z' instead of 'write -P 0'
Changed in v8:
- Add conversion of 039.out & 137.out to new opts variable name
- Fix 012 and 048 to not assume TEST_IMG_FILE is always set
- Clarify why we don't change _qemu_img_wrapper in commit msg
Changed in v7:
- Avoid setting TEST_IMG_FILE when IMGPROTO=file in common.rc for traditional (not --image-opts) variable setup
Daniel P. Berrange (3):
block: add support for --image-opts in block I/O tests
block: add support for encryption secrets in block I/O tests
block: enable testing of LUKS driver with block I/O tests
tests/qemu-iotests/004 | 2 +- tests/qemu-iotests/012 | 5 ++- tests/qemu-iotests/039.out | 20 ++++++------ tests/qemu-iotests/048 | 26 +++++++++++---- tests/qemu-iotests/048.out | 6 ++-- tests/qemu-iotests/052 | 4 +++ tests/qemu-iotests/052.out | 4 +++ tests/qemu-iotests/061.out | 8 ++--- tests/qemu-iotests/100 | 7 ++++ tests/qemu-iotests/100.out | 14 ++++++++ tests/qemu-iotests/137.out | 4 +-- tests/qemu-iotests/common | 15 ++++++++- tests/qemu-iotests/common.config | 21 ++++++++++-- tests/qemu-iotests/common.filter | 3 +- tests/qemu-iotests/common.rc | 69 ++++++++++++++++++++++++++++++---------- 15 files changed, 160 insertions(+), 48 deletions(-)
Signature · 1 line
2.5.5
PATCH v9 2/3 block: add support for encryption secrets in block I/O tests
The LUKS block driver tests will require the ability to specify encryption secrets with block devices. This requires using the --object argument to qemu-img/qemu-io to create a 'secret' object.
When the IMGKEYSECRET env variable is set, it provides the password to be associated with a secret called 'keysec0'
The _qemu_img_wrapper function isn't modified as that needs to cope with differing syntax for subcommands, so can't be made to use the image opts syntax unconditionally.
--- tests/qemu-iotests/common | 1 + tests/qemu-iotests/common.config | 6 ++++++ tests/qemu-iotests/common.filter | 3 ++- tests/qemu-iotests/common.rc | 9 +++++++-- 4 files changed, 16 insertions(+), 3 deletions(-)
tests/qemu-iotests/common +1 -0
@@ -53,6 +53,7 @@ export QEMU_IO_OPTIONS="" export CACHEMODE_IS_DEFAULT=true export QEMU_OPTIONS="-nodefaults" export VALGRIND_QEMU= +export IMGKEYSECRET= export IMGOPTSSYNTAX=false for r
tests/qemu-iotests/common.config +6 -0
@@ -126,6 +126,9 @@ _qemu_io_wrapper() local QEMU_IO_ARGS="$QEMU_IO_OPTIONS" if [ "$IMGOPTSSYNTAX" = "true" ]; then QEMU_IO_ARGS="--image-opts $QEMU_IO_ARGS" + if [ -n "$IMGKEYSECRET" ]; then + QEMU_IO_ARGS="--object secret,id=keysec0,data=$IMGKEYSECRET $QEMU_IO_ARGS" + fi fi local RETVAL (
@@ -161,6 +164,9 @@ export QEMU_NBD=_qemu_nbd_wrapper QEMU_IMG_EXTRA_ARGS= if [ "$IMGOPTSSYNTAX" = "true" ]; then QEMU_IMG_EXTRA_ARGS="--image-opts $QEMU_IMG_EXTRA_ARGS" + if [ -n "$IMGKEYSECRET" ]; then + QEMU_IMG_EXTRA_ARGS="--object secret,id=keysec0,data=$IMGKEYSECRET $QEMU_IMG_EXTRA_ARGS" + fi fi export QEMU_IMG_EXTRA_ARGS
tests/qemu-iotests/common.filter +2 -1
@@ -97,7 +97,8 @@ _filter_img_create() -e "s# block_state_zero=\\(on\\|off\\)##g" \ -e "s# log_size=[0-9]\\+##g" \ -e "s/archipelago:a/TEST_DIR\//g" \ - -e "s# refcount_bits=[0-9]\\+##g" + -e "s# refcount_bits=[0-9]\\+##g" \ + -e "s# key-secret=[a-zA-Z0-9]\\+##g" } _filter_img_info()
tests/qemu-iotests/common.rc +7 -2
@@ -129,6 +129,7 @@ _make_test_img() local img_name="" local use_backing=0 local backing_file="" + local object_options="" if [ -n "$TEST_IMG_FILE" ]; then img_name=$TEST_IMG_FILE
@@ -139,6 +140,10 @@ _make_test_img() if [ -n "$IMGOPTS" ]; then optstr=$(_optstr_add "$optstr" "$IMGOPTS") fi + if [ -n "$IMGKEYSECRET" ]; then + object_options="--object secret,id=keysec0,data=$IMGKEYSECRET" + optstr=$(_optstr_add "$optstr" "key-secret=keysec0") + fi if [ "$1" = "-b" ]; then use_backing=1
@@ -156,9 +161,9 @@ _make_test_img() # XXX(hch): have global image options? ( if [ $use_backing = 1 ]; then - $QEMU_IMG create -f $IMGFMT $extra_img_options -b "$backing_file" "$img_name" $image_size 2>&1 + $QEMU_IMG create $object_options -f $IMGFMT $extra_img_options -b "$backing_file" "$img_name" $image_size 2>&1 else - $QEMU_IMG create -f $IMGFMT $extra_img_options "$img_name" $image_size 2>&1 + $QEMU_IMG create $object_options -f $IMGFMT $extra_img_options "$img_name" $image_size 2>&1 fi ) | _filter_img_create
Signature · 1 line
2.5.5
PATCH v9 1/3 block: add support for --image-opts in block I/O tests
In reply to Daniel P. BerrangeCurrently all block tests use the traditional syntax for images just specifying a filename. To support the LUKS driver without resorting to JSON, the tests need to be able to use the new --image-opts argument to qemu-img and qemu-io.
This introduces a new env variable IMGOPTSSYNTAX. If this is set to 'true', then qemu-img/qemu-io should use --image-opts.
--- tests/qemu-iotests/039.out | 20 +++++++------- tests/qemu-iotests/061.out | 8 +++--- tests/qemu-iotests/137.out | 4 +-- tests/qemu-iotests/common | 7 ++++- tests/qemu-iotests/common.config | 15 +++++++++-- tests/qemu-iotests/common.rc | 57 +++++++++++++++++++++++++++++----------- 6 files changed, 77 insertions(+), 34 deletions(-)
tests/qemu-iotests/039.out +10 -10
@@ -12,9 +12,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then - exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else - exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; fi ) incompatible_features 0x1 ERROR cluster 5 refcount=0 reference=1
@@ -51,9 +51,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then - exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else - exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; fi ) incompatible_features 0x1 ERROR cluster 5 refcount=0 reference=1
@@ -69,9 +69,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then - exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else - exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; fi ) incompatible_features 0x0 No errors were found on the image.
@@ -92,9 +92,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then - exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else - exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; fi ) incompatible_features 0x1 ERROR cluster 5 refcount=0 reference=1
@@ -106,9 +106,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then - exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else - exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; fi ) incompatible_features 0x0 No errors were found on the image.
tests/qemu-iotests/061.out +4 -4
@@ -58,9 +58,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 wrote 131072/131072 bytes at offset 0 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then - exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else - exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; fi ) magic 0x514649fb version 3
@@ -220,9 +220,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 wrote 131072/131072 bytes at offset 0 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then - exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else - exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; fi ) magic 0x514649fb version 3
tests/qemu-iotests/137.out +2 -2
@@ -32,9 +32,9 @@ Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of t wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then - exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else - exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"; + exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; fi ) incompatible_features 0x0 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
tests/qemu-iotests/common +6 -1
@@ -53,6 +53,7 @@ export QEMU_IO_OPTIONS="" export CACHEMODE_IS_DEFAULT=true export QEMU_OPTIONS="-nodefaults" export VALGRIND_QEMU= +export IMGOPTSSYNTAX=false for r do
@@ -399,7 +400,11 @@ BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \ done # Set qemu-io cache mode with $CACHEMODE we have -QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS -f $IMGFMT --cache $CACHEMODE" +if [ "$IMGOPTSSYNTAX" = "true" ]; then + QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --cache $CACHEMODE" +else + QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS -f $IMGFMT --cache $CACHEMODE" +fi # Set default options for qemu-img create -o if they were not specified _set_default_imgopts
tests/qemu-iotests/common.config +13 -2
@@ -123,12 +123,16 @@ _qemu_img_wrapper() _qemu_io_wrapper() { local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind + local QEMU_IO_ARGS="$QEMU_IO_OPTIONS" + if [ "$IMGOPTSSYNTAX" = "true" ]; then + QEMU_IO_ARGS="--image-opts $QEMU_IO_ARGS" + fi local RETVAL ( if [ "${VALGRIND_QEMU}" == "y" ]; then - exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@" + exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" else - exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@" + exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" fi ) RETVAL=$?
@@ -154,6 +158,13 @@ export QEMU_IMG=_qemu_img_wrapper export QEMU_IO=_qemu_io_wrapper export QEMU_NBD=_qemu_nbd_wrapper +QEMU_IMG_EXTRA_ARGS= +if [ "$IMGOPTSSYNTAX" = "true" ]; then + QEMU_IMG_EXTRA_ARGS="--image-opts $QEMU_IMG_EXTRA_ARGS" +fi +export QEMU_IMG_EXTRA_ARGS + + default_machine=$($QEMU -machine help | sed -n '/(default)/ s/ .*//p') default_alias_machine=$($QEMU -machine help | \ sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
tests/qemu-iotests/common.rc +42 -15
70 lines not on this page · raw message
Signature · 1 line
2.5.5
PATCH v9 3/3 block: enable testing of LUKS driver with block I/O tests
In reply to Daniel P. BerrangeThis adds support for testing the LUKS driver with the block I/O test framework.
cd tests/qemu-io-tests
./check -luks
A handful of test cases are modified to work with luks
- 004 - whitelist luks format
- 012 - use TEST_IMG_FILE instead of TEST_IMG for file ops
- 048 - use TEST_IMG_FILE instead of TEST_IMG for file ops. don't assume extended image contents is all zeros, explicitly initialize with zeros
Make file size smaller to avoid having to decrypt 1 GB of data.
- 052 - don't assume initial image contents is all zeros, explicitly initialize with zeros
- 100 - don't assume initial image contents is all zeros, explicitly initialize with zeros
With this patch applied, the results are as follows:
Passed: 001 002 003 004 005 008 009 010 011 012 021 032 043
047 048 049 052 087 100 134 143
Failed: 033 120 140 145
Skipped: 007 013 014 015 017 018 019 020 022 023 024 025 026
027 028 029 030 031 034 035 036 037 038 039 040 041
042 043 044 045 046 047 049 050 051 053 054 055 056
057 058 059 060 061 062 063 064 065 066 067 068 069
070 071 072 073 074 075 076 077 078 079 080 081 082
083 084 085 086 087 088 089 090 091 092 093 094 095
096 097 098 099 101 102 103 104 105 107 108 109 110
111 112 113 114 115 116 117 118 119 121 122 123 124
128 129 130 131 132 133 134 135 136 137 138 139 141
142 144 146 148 150 152The reasons for the failed tests are:
- 033 - needs adapting to use image opts syntax with blkdebug and test image in order to correctly set align property
- 120 - needs adapting to use correct -drive syntax for luks
- 140 - needs adapting to use correct -drive syntax for luks
- 145 - needs adapting to use correct -drive syntax for luks
The vast majority of skipped tests are exercising code that is qcow2 specific, though a couple could probably be usefully enabled for luks too.
--- tests/qemu-iotests/004 | 2 +- tests/qemu-iotests/012 | 5 ++++- tests/qemu-iotests/048 | 26 +++++++++++++++++++------- tests/qemu-iotests/048.out | 6 ++++-- tests/qemu-iotests/052 | 4 ++++ tests/qemu-iotests/052.out | 4 ++++ tests/qemu-iotests/100 | 7 +++++++ tests/qemu-iotests/100.out | 14 ++++++++++++++ tests/qemu-iotests/common | 7 +++++++ tests/qemu-iotests/common.rc | 3 +++ 10 files changed, 67 insertions(+), 11 deletions(-)
tests/qemu-iotests/004 +1 -1
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter -_supported_fmt raw qcow qcow2 qed vdi vmdk vhdx +_supported_fmt raw qcow qcow2 qed vdi vmdk vhdx luks _supported_proto generic _supported_os Linux
tests/qemu-iotests/012 +4 -1
@@ -43,13 +43,16 @@ _supported_fmt generic _supported_proto file _supported_os Linux +# Remove once all tests are fixed to use TEST_IMG_FILE +# correctly and common.rc sets it unconditionally +test -z "$TEST_IMG_FILE" && TEST_IMG_FILE=$TEST_IMG size=128M _make_test_img $size echo echo "== mark image read-only" -chmod a-w "$TEST_IMG" +chmod a-w "$TEST_IMG_FILE" echo echo "== read from read-only image"
tests/qemu-iotests/048 +19 -7
@@ -31,13 +31,13 @@ _cleanup() { echo "Cleanup" _cleanup_test_img - rm "${TEST_IMG2}" + rm "${TEST_IMG_FILE2}" } trap "_cleanup; exit \$status" 0 1 2 3 15 _compare() { - $QEMU_IMG compare "$@" "$TEST_IMG" "${TEST_IMG2}" + $QEMU_IMG compare $QEMU_IMG_EXTRA_ARGS "$@" "$TEST_IMG" "${TEST_IMG2}" echo $? }
@@ -46,25 +46,37 @@ _compare() . ./common.filter . ./common.pattern -_supported_fmt raw qcow qcow2 qed +_supported_fmt raw qcow qcow2 qed luks _supported_proto file _supported_os Linux +# Remove once all tests are fixed to use TEST_IMG_FILE +# correctly and common.rc sets it unconditionally +test -z "$TEST_IMG_FILE" && TEST_IMG_FILE=$TEST_IMG + # Setup test basic parameters TEST_IMG2=$TEST_IMG.2 +TEST_IMG_FILE2=$TEST_IMG_FILE.2 CLUSTER_SIZE=4096 -size=1024M +size=128M _make_test_img $size io_pattern write 524288 $CLUSTER_SIZE $CLUSTER_SIZE 4 45 # Compare identical images -cp "$TEST_IMG" "${TEST_IMG2}" +cp "$TEST_IMG_FILE" "${TEST_IMG_FILE2}" _compare _compare -q # Compare images with different size -$QEMU_IMG resize -f $IMGFMT "$TEST_IMG" +512M +if [ "$IMGOPTSSYNTAX" = "true" ]; then + $QEMU_IMG resize $QEMU_IMG_EXTRA_ARGS "$TEST_IMG" +32M +else + $QEMU_IMG resize -f $IMGFMT "$TEST_IMG" +32M +fi +# Ensure extended space is zero-initialized +$QEMU_IO "$TEST_IMG" -c "write -z $size 32M" | _filter_qemu_io + _compare _compare -s
@@ -77,7 +89,7 @@ _compare # Test unaligned case of mismatch offsets in allocated clusters _make_test_img $size io_pattern write 0 512 0 1 100 -cp "$TEST_IMG" "$TEST_IMG2" +cp "$TEST_IMG_FILE" "$TEST_IMG_FILE2" io_pattern write 512 512 0 1 101 _compare
tests/qemu-iotests/048.out +4 -2
@@ -1,5 +1,5 @@ QA output created by 048 -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 === IO: pattern 45 wrote 4096/4096 bytes at offset 524288 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -13,6 +13,8 @@ Images are identical. 0 0 Image resized. +wrote 33554432/33554432 bytes at offset 134217728 +32 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Warning: Image size mismatch! Images are identical. 0
@@ -28,7 +30,7 @@ wrote 4096/4096 bytes at offset 0 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Content mismatch at offset 0! 1 -Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 === IO: pattern 100 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
tests/qemu-iotests/052 +4 -0
@@ -48,6 +48,10 @@ size=128M _make_test_img $size echo +echo "== initializing whole image ==" +$QEMU_IO -c "write -z 0 $size" "$TEST_IMG" | _filter_qemu_io + +echo echo "== reading whole image ==" $QEMU_IO -s -c "read 0 $size" "$TEST_IMG" | _filter_qemu_io
tests/qemu-iotests/052.out +4 -0
@@ -1,6 +1,10 @@ QA output created by 052 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +== initializing whole image == +wrote 134217728/134217728 bytes at offset 0 +128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + == reading whole image == read 134217728/134217728 bytes at offset 0 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
tests/qemu-iotests/100 +7 -0
@@ -47,6 +47,7 @@ size=128M echo echo "== Single request ==" _make_test_img $size +$QEMU_IO -c "write -z 0 8k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "multiwrite 0 4k" "$TEST_IMG" | _filter_qemu_io echo
@@ -59,6 +60,7 @@ _cleanup_test_img echo echo "== Sequential requests ==" _make_test_img $size +$QEMU_IO -c "write -z 0 12k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "multiwrite 0 4k ; 4k 4k" "$TEST_IMG" | _filter_qemu_io echo
@@ -72,6 +74,7 @@ _cleanup_test_img echo echo "== Superset overlapping requests ==" _make_test_img $size +$QEMU_IO -c "write -z 0 8k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "multiwrite 0 4k ; 1k 2k" "$TEST_IMG" | _filter_qemu_io echo
@@ -87,6 +90,7 @@ _cleanup_test_img echo echo "== Subset overlapping requests ==" _make_test_img $size +$QEMU_IO -c "write -z 0 8k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "multiwrite 1k 2k ; 0k 4k" "$TEST_IMG" | _filter_qemu_io echo
@@ -102,6 +106,7 @@ _cleanup_test_img echo echo "== Head overlapping requests ==" _make_test_img $size +$QEMU_IO -c "write -z 0 8k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "multiwrite 0k 2k ; 0k 4k" "$TEST_IMG" | _filter_qemu_io echo
@@ -116,6 +121,7 @@ _cleanup_test_img echo echo "== Tail overlapping requests ==" _make_test_img $size +$QEMU_IO -c "write -z 0 8k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "multiwrite 2k 2k ; 0k 4k" "$TEST_IMG" | _filter_qemu_io echo
@@ -130,6 +136,7 @@ _cleanup_test_img echo echo "== Disjoint requests ==" _make_test_img $size +$QEMU_IO -c "write -z 0 72k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "multiwrite 0 4k ; 64k 4k" "$TEST_IMG" | _filter_qemu_io echo
tests/qemu-iotests/100.out +14 -0
@@ -2,6 +2,8 @@ QA output created by 100 == Single request == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +wrote 8192/8192 bytes at offset 0 +8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 4096/4096 bytes at offset 0 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -13,6 +15,8 @@ read 4096/4096 bytes at offset 4096 == Sequential requests == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +wrote 12288/12288 bytes at offset 0 +12 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 8192/8192 bytes at offset 0 8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -26,6 +30,8 @@ read 4096/4096 bytes at offset 8192 == Superset overlapping requests == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +wrote 8192/8192 bytes at offset 0 +8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 6144/6144 bytes at offset 0 6 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -39,6 +45,8 @@ read 4096/4096 bytes at offset 4096 == Subset overlapping requests == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +wrote 8192/8192 bytes at offset 0 +8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 6144/6144 bytes at offset 1024 6 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -52,6 +60,8 @@ read 4096/4096 bytes at offset 4096 == Head overlapping requests == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +wrote 8192/8192 bytes at offset 0 +8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 6144/6144 bytes at offset 0 6 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -63,6 +73,8 @@ read 4096/4096 bytes at offset 4096 == Tail overlapping requests == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +wrote 8192/8192 bytes at offset 0 +8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 6144/6144 bytes at offset 2048 6 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -74,6 +86,8 @@ read 4096/4096 bytes at offset 4096 == Disjoint requests == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +wrote 73728/73728 bytes at offset 0 +72 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 8192/8192 bytes at offset 0 8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
tests/qemu-iotests/common +7 -0
@@ -209,6 +209,13 @@ testlist options xpand=false ;; + -luks) + IMGOPTSSYNTAX=true + IMGFMT=luks + IMGKEYSECRET=123456 + xpand=false + ;; + -qed) IMGFMT=qed xpand=false
tests/qemu-iotests/common.rc +3 -0
@@ -55,6 +55,9 @@ umask 022 if [ "$IMGOPTSSYNTAX" = "true" ]; then DRIVER="driver=$IMGFMT" + if [ "$IMGFMT" = "luks" ]; then + DRIVER="$DRIVER,key-secret=keysec0" + fi if [ "$IMGPROTO" = "file" ]; then TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT TEST_IMG="$DRIVER,file.filename=$TEST_DIR/t.$IMGFMT"
Signature · 1 line
2.5.5
Max Reitz
AppliedQuoted 28 lines · Daniel P. Berrange
This series contains the 3 test suite patches that had to be dropped from the v6 series during merge with the block tree:
v6: https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg04935.html
v7: https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg06687.html
v8: https://lists.gnu.org/archive/html/qemu-devel/2016-04/msg02736.htmlChanged in v9:
- Use
QEMU_IMG_EXTRA_ARGSin common.rc
- Use 'write -z' instead of 'write -P 0'Changed in v8:
- Add conversion of 039.out & 137.out to new opts variable name
- Fix 012 and 048 to not assumeTEST_IMG_FILEis always set
- Clarify why we don't change_qemu_img_wrapperin commit msgChanged in v7:
- Avoid setting
TEST_IMG_FILEwhen IMGPROTO=file in common.rc for traditional (not --image-opts) variable setupDaniel P. Berrange (3):
block: add support for --image-opts in block I/O tests
block: add support for encryption secrets in block I/O tests
block: enable testing of LUKS driver with block I/O tests
Quoted 16 lines
tests/qemu-iotests/004 | 2 +- tests/qemu-iotests/012 | 5 ++- tests/qemu-iotests/039.out | 20 ++++++------ tests/qemu-iotests/048 | 26 +++++++++++---- tests/qemu-iotests/048.out | 6 ++-- tests/qemu-iotests/052 | 4 +++ tests/qemu-iotests/052.out | 4 +++ tests/qemu-iotests/061.out | 8 ++--- tests/qemu-iotests/100 | 7 ++++ tests/qemu-iotests/100.out | 14 ++++++++ tests/qemu-iotests/137.out | 4 +-- tests/qemu-iotests/common | 15 ++++++++- tests/qemu-iotests/common.config | 21 ++++++++++-- tests/qemu-iotests/common.filter | 3 +- tests/qemu-iotests/common.rc | 69 ++++++++++++++++++++++++++++++---------- 15 files changed, 160 insertions(+), 48 deletions(-)
Thanks, applied to my block-next branch:
https://github.com/XanClic/qemu/commits/block-next
Max