All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v5 0/6] Add cache mode option to qemu-iotests, and change default mode to "writeback"
@ 2013-12-03  8:25 Fam Zheng
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 1/6] qemu-iotests: Add "-c <cache-mode>" option Fam Zheng
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Fam Zheng @ 2013-12-03  8:25 UTC (permalink / raw
  To: qemu-devel; +Cc: kwolf, WenchaoXia, stefanha

This series adds cache mode option in the iotests framework. Test cases are
updated to make use of cache mode and mask supported modes.

v5: Fix help test for "-c mode". (Wenchao)

v4: Address Stefan's comments:
    Add _default_cache_mode.
    Split last two cases in 048 to 074.
    Use long option "--cache" instead of "-t" for qemu-io.

v3: Change _unsupported_qemu_io_options to _supported_cache_modes.
    Change default mode to "writeback".
    Clean up some whitespaces in the end of series.
    Fix "026.out.nocache" case.
    Fix 048 case on tmpfs.


Fam Zheng (6):
  qemu-iotests: Add "-c <cache-mode>" option
  qemu-iotests: Honour cache mode in iotests.py
  qemu-iotests: Add _default_cache_mode and _supported_cache_modes
  qemu-iotests: Change default cache mode to "writeback"
  qemu-iotests: Clean up spaces in usage output
  qemu-iotests: Split qcow2 only cases in 048

 tests/qemu-iotests/026        |  3 +-
 tests/qemu-iotests/039        |  3 +-
 tests/qemu-iotests/048        | 27 --------------
 tests/qemu-iotests/048.out    | 16 --------
 tests/qemu-iotests/052        |  4 +-
 tests/qemu-iotests/074        | 86 +++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/074.out    | 18 +++++++++
 tests/qemu-iotests/check      |  2 +-
 tests/qemu-iotests/common     | 35 +++++++++++++-----
 tests/qemu-iotests/common.rc  | 25 ++++++++-----
 tests/qemu-iotests/iotests.py |  3 +-
 11 files changed, 153 insertions(+), 69 deletions(-)
 create mode 100644 tests/qemu-iotests/074
 create mode 100644 tests/qemu-iotests/074.out

-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH v5 1/6] qemu-iotests: Add "-c <cache-mode>" option
  2013-12-03  8:25 [Qemu-devel] [PATCH v5 0/6] Add cache mode option to qemu-iotests, and change default mode to "writeback" Fam Zheng
@ 2013-12-03  8:25 ` Fam Zheng
  2013-12-03  8:59   ` Wenchao Xia
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 2/6] qemu-iotests: Honour cache mode in iotests.py Fam Zheng
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Fam Zheng @ 2013-12-03  8:25 UTC (permalink / raw
  To: qemu-devel; +Cc: kwolf, WenchaoXia, stefanha

The option sets cache mode used in the tests. "-nocache" is changed to
an alias to "-c none", and internally passes "-t none" to qemu-io.

Python scripts will make use of option this in the next commit.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/check  |  2 +-
 tests/qemu-iotests/common | 21 +++++++++++++++++++--
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index f5f328f..dc0105c 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -242,7 +242,7 @@ do
             fi
 
             reference=$seq.out
-            if (echo $QEMU_IO_OPTIONS | grep -s -- '--nocache' > /dev/null); then
+            if [ "$CACHEMODE" = "none" ]; then
                 [ -f $seq.out.nocache ] && reference=$seq.out.nocache
             fi
 
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index 8cde7f1..4743c9e 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -42,13 +42,16 @@ expunge=true
 have_test_arg=false
 randomize=false
 valgrind=false
+cachemode=false
 rm -f $tmp.list $tmp.tmp $tmp.sed
 
 export IMGFMT=raw
 export IMGFMT_GENERIC=true
 export IMGPROTO=file
 export IMGOPTS=""
+export CACHEMODE="writethrough"
 export QEMU_IO_OPTIONS=""
+export CACHEMODE_IS_DEFAULT=true
 
 for r
 do
@@ -113,7 +116,12 @@ s/ .*//p
         IMGOPTS="$r"
         imgopts=false
         continue
-
+    elif $cachemode
+    then
+        CACHEMODE="$r"
+        CACHEMODE_IS_DEFAULT=false
+        cachemode=false
+        continue
     fi
 
     xpand=true
@@ -147,6 +155,7 @@ check options
     -o options          -o options to pass to qemu-img create/convert
     -T                        output timestamps
     -r                         randomize test order
+    -c mode             cache mode
 
 testlist options
     -g group[,group...]        include tests from these groups
@@ -219,7 +228,8 @@ testlist options
             xpand=false
             ;;
         -nocache)
-            QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache"
+            CACHEMODE="none"
+            CACHEMODE_IS_DEFAULT=false
             xpand=false
             ;;
 
@@ -258,6 +268,10 @@ testlist options
             imgopts=true
             xpand=false
             ;;
+        -c)
+            cachemode=true
+            xpand=false
+            ;;
         -r)        # randomize test order
             randomize=true
             xpand=false
@@ -334,6 +348,9 @@ 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 --cache $CACHEMODE"
+
 # Set default options for qemu-img create -o if they were not specified
 _set_default_imgopts
 
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH v5 2/6] qemu-iotests: Honour cache mode in iotests.py
  2013-12-03  8:25 [Qemu-devel] [PATCH v5 0/6] Add cache mode option to qemu-iotests, and change default mode to "writeback" Fam Zheng
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 1/6] qemu-iotests: Add "-c <cache-mode>" option Fam Zheng
@ 2013-12-03  8:25 ` Fam Zheng
  2013-12-03 14:27   ` Benoît Canet
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 3/6] qemu-iotests: Add _default_cache_mode and _supported_cache_modes Fam Zheng
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Fam Zheng @ 2013-12-03  8:25 UTC (permalink / raw
  To: qemu-devel; +Cc: kwolf, WenchaoXia, stefanha

This will allow overriding cache mode from the "-c mode" option.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/iotests.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index fb10ff4..c84a1a5 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -37,6 +37,7 @@ qemu_args = os.environ.get('QEMU', 'qemu').strip().split(' ')
 imgfmt = os.environ.get('IMGFMT', 'raw')
 imgproto = os.environ.get('IMGPROTO', 'file')
 test_dir = os.environ.get('TEST_DIR', '/var/tmp')
+cachemode = os.environ.get('CACHEMODE')
 
 socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper')
 
@@ -96,7 +97,7 @@ class VM(object):
         '''Add a virtio-blk drive to the VM'''
         options = ['if=virtio',
                    'format=%s' % imgfmt,
-                   'cache=none',
+                   'cache=%s' % cachemode,
                    'file=%s' % path,
                    'id=drive%d' % self._num_drives]
         if opts:
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH v5 3/6] qemu-iotests: Add _default_cache_mode and _supported_cache_modes
  2013-12-03  8:25 [Qemu-devel] [PATCH v5 0/6] Add cache mode option to qemu-iotests, and change default mode to "writeback" Fam Zheng
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 1/6] qemu-iotests: Add "-c <cache-mode>" option Fam Zheng
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 2/6] qemu-iotests: Honour cache mode in iotests.py Fam Zheng
@ 2013-12-03  8:25 ` Fam Zheng
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 4/6] qemu-iotests: Change default cache mode to "writeback" Fam Zheng
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Fam Zheng @ 2013-12-03  8:25 UTC (permalink / raw
  To: qemu-devel; +Cc: kwolf, WenchaoXia, stefanha

This replaces _unsupported_qemu_io_options and check for support of
current cache mode, and allow to provide a default if user didn't
specify.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/026       |  3 ++-
 tests/qemu-iotests/039       |  3 ++-
 tests/qemu-iotests/052       |  4 ++--
 tests/qemu-iotests/common.rc | 25 +++++++++++++++----------
 4 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026
index ebe29d0..c9c5f83 100755
--- a/tests/qemu-iotests/026
+++ b/tests/qemu-iotests/026
@@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto generic
 _supported_os Linux
-
+_default_cache_mode "writethrough"
+_supported_cache_modes "writethrough" "none"
 
 echo "Errors while writing 128 kB"
 echo
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
index 8bade92..6abf472 100755
--- a/tests/qemu-iotests/039
+++ b/tests/qemu-iotests/039
@@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto generic
 _supported_os Linux
-_unsupported_qemu_io_options --nocache
+_default_cache_mode "writethrough"
+_supported_cache_modes "writethrough"
 
 size=128M
 
diff --git a/tests/qemu-iotests/052 b/tests/qemu-iotests/052
index f5f9683..4d4e411 100755
--- a/tests/qemu-iotests/052
+++ b/tests/qemu-iotests/052
@@ -41,8 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt generic
 _supported_proto generic
 _supported_os Linux
-_unsupported_qemu_io_options --nocache
-
+_default_cache_mode "writethrough"
+_supported_cache_modes "writethrough"
 
 size=128M
 _make_test_img $size
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 7f62457..47cef6d 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -387,18 +387,23 @@ _supported_os()
     _notrun "not suitable for this OS: $HOSTOS"
 }
 
-_unsupported_qemu_io_options()
+_supported_cache_modes()
 {
-    for bad_opt
-    do
-        for opt in $QEMU_IO_OPTIONS
-        do
-            if [ "$bad_opt" = "$opt" ]
-            then
-                _notrun "not suitable for qemu-io option: $bad_opt"
-            fi
-        done
+    for mode; do
+        if [ "$mode" = "$CACHEMODE" ]; then
+            return
+        fi
     done
+    _notrun "not suitable for cache mode: $CACHEMODE"
+}
+
+_default_cache_mode()
+{
+    if $CACHEMODE_IS_DEFAULT; then
+        CACHEMODE="$1"
+        QEMU_IO="$QEMU_IO --cache $1"
+        return
+    fi
 }
 
 # this test requires that a specified command (executable) exists
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH v5 4/6] qemu-iotests: Change default cache mode to "writeback"
  2013-12-03  8:25 [Qemu-devel] [PATCH v5 0/6] Add cache mode option to qemu-iotests, and change default mode to "writeback" Fam Zheng
                   ` (2 preceding siblings ...)
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 3/6] qemu-iotests: Add _default_cache_mode and _supported_cache_modes Fam Zheng
@ 2013-12-03  8:25 ` Fam Zheng
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 5/6] qemu-iotests: Clean up spaces in usage output Fam Zheng
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 6/6] qemu-iotests: Split qcow2 only cases in 048 Fam Zheng
  5 siblings, 0 replies; 12+ messages in thread
From: Fam Zheng @ 2013-12-03  8:25 UTC (permalink / raw
  To: qemu-devel; +Cc: kwolf, WenchaoXia, stefanha

So that the tests can run faster.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/common | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index 4743c9e..b2a0944 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -49,7 +49,7 @@ export IMGFMT=raw
 export IMGFMT_GENERIC=true
 export IMGPROTO=file
 export IMGOPTS=""
-export CACHEMODE="writethrough"
+export CACHEMODE="writeback"
 export QEMU_IO_OPTIONS=""
 export CACHEMODE_IS_DEFAULT=true
 
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH v5 5/6] qemu-iotests: Clean up spaces in usage output
  2013-12-03  8:25 [Qemu-devel] [PATCH v5 0/6] Add cache mode option to qemu-iotests, and change default mode to "writeback" Fam Zheng
                   ` (3 preceding siblings ...)
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 4/6] qemu-iotests: Change default cache mode to "writeback" Fam Zheng
@ 2013-12-03  8:25 ` Fam Zheng
  2013-12-03 14:31   ` Benoît Canet
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 6/6] qemu-iotests: Split qcow2 only cases in 048 Fam Zheng
  5 siblings, 1 reply; 12+ messages in thread
From: Fam Zheng @ 2013-12-03  8:25 UTC (permalink / raw
  To: qemu-devel; +Cc: kwolf, WenchaoXia, stefanha

Whitespace changes to align columns.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/common | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index b2a0944..3e0ecfb 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -132,7 +132,7 @@ s/ .*//p
             echo "Usage: $0 [options] [testlist]"'
 
 common options
-    -v                        verbose
+    -v                  verbose
 
 check options
     -raw                test raw (default)
@@ -148,20 +148,18 @@ check options
     -sheepdog           test sheepdog
     -nbd                test nbd
     -ssh                test ssh
-    -xdiff                graphical mode diff
-    -nocache                use O_DIRECT on backing file
-    -misalign                misalign memory allocations
-    -n                        show me, do not run tests
+    -xdiff              graphical mode diff
+    -nocache            use O_DIRECT on backing file
+    -misalign           misalign memory allocations
+    -n                  show me, do not run tests
     -o options          -o options to pass to qemu-img create/convert
-    -T                        output timestamps
-    -r                         randomize test order
     -c mode             cache mode
 
 testlist options
     -g group[,group...]        include tests from these groups
     -x group[,group...]        exclude tests from these groups
     NNN                        include test NNN
-    NNN-NNN                include test range (eg. 012-021)
+    NNN-NNN                    include test range (eg. 012-021)
 '
             exit 0
             ;;
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH v5 6/6] qemu-iotests: Split qcow2 only cases in 048
  2013-12-03  8:25 [Qemu-devel] [PATCH v5 0/6] Add cache mode option to qemu-iotests, and change default mode to "writeback" Fam Zheng
                   ` (4 preceding siblings ...)
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 5/6] qemu-iotests: Clean up spaces in usage output Fam Zheng
@ 2013-12-03  8:25 ` Fam Zheng
  5 siblings, 0 replies; 12+ messages in thread
From: Fam Zheng @ 2013-12-03  8:25 UTC (permalink / raw
  To: qemu-devel; +Cc: kwolf, WenchaoXia, stefanha

Format "raw" doesn't always work on certain file systems (e.g. tmpfs).
Use qcow2 to make the allocation status explicit and split into a new
case.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/048     | 27 ---------------
 tests/qemu-iotests/048.out | 16 ---------
 tests/qemu-iotests/074     | 86 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/074.out | 18 ++++++++++
 4 files changed, 104 insertions(+), 43 deletions(-)
 create mode 100644 tests/qemu-iotests/074
 create mode 100644 tests/qemu-iotests/074.out

diff --git a/tests/qemu-iotests/048 b/tests/qemu-iotests/048
index 9def7fc..65da46d 100755
--- a/tests/qemu-iotests/048
+++ b/tests/qemu-iotests/048
@@ -81,32 +81,5 @@ cp "$TEST_IMG" "$TEST_IMG2"
 io_pattern write 512 512 0 1 101
 _compare
 
-# Test cluster allocated in one, with IO error
-cat > "$TEST_DIR/blkdebug.conf"<<EOF
-[inject-error]
-event = "read_aio"
-errno = "5"
-once ="off"
-EOF
-_make_test_img $size
-cp "$TEST_IMG" "$TEST_IMG2"
-io_pattern write 512 512 0 1 102
-TEST_IMG="blkdebug:$TEST_DIR/blkdebug.conf:$TEST_IMG" _compare 2>&1 |\
-    _filter_testdir | _filter_imgfmt
-
-# Test cluster allocated in one, with different sizes and IO error in the part
-# that exists only in one image
-cat > "$TEST_DIR/blkdebug.conf"<<EOF
-[inject-error]
-event = "read_aio"
-errno = "5"
-once ="off"
-EOF
-_make_test_img $size
-TEST_IMG="$TEST_IMG2" _make_test_img 0
-io_pattern write 512 512 0 1 102
-TEST_IMG="blkdebug:$TEST_DIR/blkdebug.conf:$TEST_IMG" _compare 2>&1 |\
-    _filter_testdir | _filter_imgfmt
-
 # Cleanup
 status=0
diff --git a/tests/qemu-iotests/048.out b/tests/qemu-iotests/048.out
index d141e05..1aea6eb 100644
--- a/tests/qemu-iotests/048.out
+++ b/tests/qemu-iotests/048.out
@@ -37,20 +37,4 @@ qemu-io> wrote 512/512 bytes at offset 512
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 qemu-io> Content mismatch at offset 512!
 1
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 
-=== IO: pattern 102
-qemu-io> wrote 512/512 bytes at offset 512
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-qemu-io> qemu-img: Error while reading offset 0 of blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
-qemu-img: Error while reading offset 0: Input/output error
-4
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 
-Formatting 'TEST_DIR/t.IMGFMT.2', fmt=IMGFMT size=0 
-=== IO: pattern 102
-qemu-io> wrote 512/512 bytes at offset 512
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-qemu-io> qemu-img: Error while reading offset 0 of blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
-qemu-img: Error while reading offset 0 of blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
-Warning: Image size mismatch!
-4
 Cleanup
diff --git a/tests/qemu-iotests/074 b/tests/qemu-iotests/074
new file mode 100644
index 0000000..aba126c
--- /dev/null
+++ b/tests/qemu-iotests/074
@@ -0,0 +1,86 @@
+#!/bin/bash
+##
+## qemu-img compare test (qcow2 only ones)
+##
+##
+## Copyright (C) 2013 Red Hat, Inc.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+##
+#
+# creator
+owner=famz@redhat.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+status=1        # failure is the default!
+
+_cleanup()
+{
+    echo "Cleanup"
+    _cleanup_test_img
+    rm "${TEST_IMG2}"
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_compare()
+{
+    $QEMU_IMG compare "$@" "$TEST_IMG" "${TEST_IMG2}"
+    echo $?
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.pattern
+
+_supported_fmt qcow2
+_supported_proto file
+_supported_os Linux
+
+# Setup test basic parameters
+TEST_IMG2=$TEST_IMG.2
+CLUSTER_SIZE=4096
+size=1024M
+
+# Test cluster allocated in one, with IO error
+cat > "$TEST_DIR/blkdebug.conf"<<EOF
+[inject-error]
+event = "read_aio"
+errno = "5"
+once ="off"
+EOF
+_make_test_img $size
+cp "$TEST_IMG" "$TEST_IMG2"
+io_pattern write 512 512 0 1 102
+TEST_IMG="blkdebug:$TEST_DIR/blkdebug.conf:$TEST_IMG" _compare 2>&1 |\
+    _filter_testdir | _filter_imgfmt
+
+# Test cluster allocated in one, with different sizes and IO error in the part
+# that exists only in one image
+cat > "$TEST_DIR/blkdebug.conf"<<EOF
+[inject-error]
+event = "read_aio"
+errno = "5"
+once ="off"
+EOF
+_make_test_img $size
+TEST_IMG="$TEST_IMG2" _make_test_img 0
+io_pattern write 512 512 0 1 102
+TEST_IMG="blkdebug:$TEST_DIR/blkdebug.conf:$TEST_IMG" _compare 2>&1 |\
+    _filter_testdir | _filter_imgfmt
+
+# Cleanup
+status=0
diff --git a/tests/qemu-iotests/074.out b/tests/qemu-iotests/074.out
new file mode 100644
index 0000000..3deb594
--- /dev/null
+++ b/tests/qemu-iotests/074.out
@@ -0,0 +1,18 @@
+QA output created by 048
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
+=== IO: pattern 102
+qemu-io> wrote 512/512 bytes at offset 512
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-io> qemu-img: Error while reading offset 0 of blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
+qemu-img: Error while reading offset 0: Input/output error
+4
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
+Formatting 'TEST_DIR/t.IMGFMT.2', fmt=IMGFMT size=0
+=== IO: pattern 102
+qemu-io> wrote 512/512 bytes at offset 512
+512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-io> qemu-img: Error while reading offset 0 of blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
+qemu-img: Error while reading offset 0 of blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error
+Warning: Image size mismatch!
+4
+Cleanup
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH v5 1/6] qemu-iotests: Add "-c <cache-mode>" option
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 1/6] qemu-iotests: Add "-c <cache-mode>" option Fam Zheng
@ 2013-12-03  8:59   ` Wenchao Xia
  0 siblings, 0 replies; 12+ messages in thread
From: Wenchao Xia @ 2013-12-03  8:59 UTC (permalink / raw
  To: Fam Zheng, qemu-devel; +Cc: kwolf, stefanha

Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH v5 2/6] qemu-iotests: Honour cache mode in iotests.py
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 2/6] qemu-iotests: Honour cache mode in iotests.py Fam Zheng
@ 2013-12-03 14:27   ` Benoît Canet
  2013-12-03 15:19     ` Kevin Wolf
  0 siblings, 1 reply; 12+ messages in thread
From: Benoît Canet @ 2013-12-03 14:27 UTC (permalink / raw
  To: Fam Zheng; +Cc: kwolf, qemu-devel, stefanha, WenchaoXia

Le Tuesday 03 Dec 2013 à 16:25:23 (+0800), Fam Zheng a écrit :
> This will allow overriding cache mode from the "-c mode" option.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  tests/qemu-iotests/iotests.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> index fb10ff4..c84a1a5 100644
> --- a/tests/qemu-iotests/iotests.py
> +++ b/tests/qemu-iotests/iotests.py
> @@ -37,6 +37,7 @@ qemu_args = os.environ.get('QEMU', 'qemu').strip().split(' ')
>  imgfmt = os.environ.get('IMGFMT', 'raw')
>  imgproto = os.environ.get('IMGPROTO', 'file')
>  test_dir = os.environ.get('TEST_DIR', '/var/tmp')
> +cachemode = os.environ.get('CACHEMODE')
+cachemode = os.environ.get('CACHEMODE', "none")

This way the default would be preserved.

>  
>  socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper')
>  
> @@ -96,7 +97,7 @@ class VM(object):
>          '''Add a virtio-blk drive to the VM'''
>          options = ['if=virtio',
>                     'format=%s' % imgfmt,
> -                   'cache=none',
> +                   'cache=%s' % cachemode,
>                     'file=%s' % path,
>                     'id=drive%d' % self._num_drives]
>          if opts:
> -- 
> 1.8.4.2
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH v5 5/6] qemu-iotests: Clean up spaces in usage output
  2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 5/6] qemu-iotests: Clean up spaces in usage output Fam Zheng
@ 2013-12-03 14:31   ` Benoît Canet
  2013-12-04  1:01     ` Fam Zheng
  0 siblings, 1 reply; 12+ messages in thread
From: Benoît Canet @ 2013-12-03 14:31 UTC (permalink / raw
  To: Fam Zheng; +Cc: kwolf, qemu-devel, stefanha, WenchaoXia

Le Tuesday 03 Dec 2013 à 16:25:26 (+0800), Fam Zheng a écrit :
> Whitespace changes to align columns.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  tests/qemu-iotests/common | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
> index b2a0944..3e0ecfb 100644
> --- a/tests/qemu-iotests/common
> +++ b/tests/qemu-iotests/common
> @@ -132,7 +132,7 @@ s/ .*//p
>              echo "Usage: $0 [options] [testlist]"'
>  
>  common options
> -    -v                        verbose
> +    -v                  verbose
>  
>  check options
>      -raw                test raw (default)
> @@ -148,20 +148,18 @@ check options
>      -sheepdog           test sheepdog
>      -nbd                test nbd
>      -ssh                test ssh
> -    -xdiff                graphical mode diff
> -    -nocache                use O_DIRECT on backing file
> -    -misalign                misalign memory allocations
> -    -n                        show me, do not run tests
> +    -xdiff              graphical mode diff
> +    -nocache            use O_DIRECT on backing file
> +    -misalign           misalign memory allocations
> +    -n                  show me, do not run tests
>      -o options          -o options to pass to qemu-img create/convert
> -    -T                        output timestamps
> -    -r                         randomize test order

These two lines disapears.

>      -c mode             cache mode
>  
>  testlist options
>      -g group[,group...]        include tests from these groups
>      -x group[,group...]        exclude tests from these groups
>      NNN                        include test NNN
> -    NNN-NNN                include test range (eg. 012-021)
> +    NNN-NNN                    include test range (eg. 012-021)
>  '
>              exit 0
>              ;;
> -- 
> 1.8.4.2
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH v5 2/6] qemu-iotests: Honour cache mode in iotests.py
  2013-12-03 14:27   ` Benoît Canet
@ 2013-12-03 15:19     ` Kevin Wolf
  0 siblings, 0 replies; 12+ messages in thread
From: Kevin Wolf @ 2013-12-03 15:19 UTC (permalink / raw
  To: Benoît Canet; +Cc: Fam Zheng, qemu-devel, stefanha, WenchaoXia

Am 03.12.2013 um 15:27 hat Benoît Canet geschrieben:
> Le Tuesday 03 Dec 2013 à 16:25:23 (+0800), Fam Zheng a écrit :
> > This will allow overriding cache mode from the "-c mode" option.
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  tests/qemu-iotests/iotests.py | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
> > index fb10ff4..c84a1a5 100644
> > --- a/tests/qemu-iotests/iotests.py
> > +++ b/tests/qemu-iotests/iotests.py
> > @@ -37,6 +37,7 @@ qemu_args = os.environ.get('QEMU', 'qemu').strip().split(' ')
> >  imgfmt = os.environ.get('IMGFMT', 'raw')
> >  imgproto = os.environ.get('IMGPROTO', 'file')
> >  test_dir = os.environ.get('TEST_DIR', '/var/tmp')
> > +cachemode = os.environ.get('CACHEMODE')
> +cachemode = os.environ.get('CACHEMODE', "none")
> 
> This way the default would be preserved.

CACHEMODE is always set, so you'd never get the default anyway. If
anything, it would have to use that other environment variable that
tells us if we're running the default. It's probably not necessary,
though.

Kevin

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH v5 5/6] qemu-iotests: Clean up spaces in usage output
  2013-12-03 14:31   ` Benoît Canet
@ 2013-12-04  1:01     ` Fam Zheng
  0 siblings, 0 replies; 12+ messages in thread
From: Fam Zheng @ 2013-12-04  1:01 UTC (permalink / raw
  To: Benoît Canet; +Cc: kwolf, qemu-devel, stefanha, WenchaoXia

On 2013年12月03日 22:31, Benoît Canet wrote:
> Le Tuesday 03 Dec 2013 à 16:25:26 (+0800), Fam Zheng a écrit :
>>       -o options          -o options to pass to qemu-img create/convert
>> -    -T                        output timestamps
>> -    -r                         randomize test order
>
> These two lines disapears.
>

Good catch, Thanks.

Fam

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-12-04  1:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-03  8:25 [Qemu-devel] [PATCH v5 0/6] Add cache mode option to qemu-iotests, and change default mode to "writeback" Fam Zheng
2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 1/6] qemu-iotests: Add "-c <cache-mode>" option Fam Zheng
2013-12-03  8:59   ` Wenchao Xia
2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 2/6] qemu-iotests: Honour cache mode in iotests.py Fam Zheng
2013-12-03 14:27   ` Benoît Canet
2013-12-03 15:19     ` Kevin Wolf
2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 3/6] qemu-iotests: Add _default_cache_mode and _supported_cache_modes Fam Zheng
2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 4/6] qemu-iotests: Change default cache mode to "writeback" Fam Zheng
2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 5/6] qemu-iotests: Clean up spaces in usage output Fam Zheng
2013-12-03 14:31   ` Benoît Canet
2013-12-04  1:01     ` Fam Zheng
2013-12-03  8:25 ` [Qemu-devel] [PATCH v5 6/6] qemu-iotests: Split qcow2 only cases in 048 Fam Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.