qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes
@ 2013-10-31 15:57 Jeff Cody
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 1/7] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests Jeff Cody
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Jeff Cody @ 2013-10-31 15:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

There are still problems with the qemu-iotests, if the pathname of the working
directory contains spaces.  This series fixes most of them.  To verify,
 ./check -qcow2 was run from a pathname with spaces (e.g., renamed ~/qemu-kvm
to "~/qemu-kvm test/").

The following tests still fail due to pathnames with spaces, and
are not addressed in this series: 059, 067.


Jeff Cody (7):
  block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests
  block: qemu-iotests, fix _make_test_img() to work with spaced
    pathnames
  block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017
  block: qemu-iotests, add quotes to $TEST_IMG usage in 019
  block: qemu-iotests, removes duplicate double quotes in 039
  block: qemu-iotests, add quotes to $TEST_IMG usage for 051
  block: qemu-iotests, add quotes to $TEST_IMG usage in 061

 tests/qemu-iotests/017            |  2 +-
 tests/qemu-iotests/019            |  6 +++---
 tests/qemu-iotests/039            |  2 +-
 tests/qemu-iotests/051            |  8 ++++----
 tests/qemu-iotests/061            |  6 +++---
 tests/qemu-iotests/common.pattern | 12 ++++++------
 tests/qemu-iotests/common.rc      | 13 +++++++++++--
 7 files changed, 29 insertions(+), 20 deletions(-)

-- 
1.8.3.1

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

* [Qemu-devel] [PATCH 1/7] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests
  2013-10-31 15:57 [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Jeff Cody
@ 2013-10-31 15:57 ` Jeff Cody
  2013-10-31 16:23   ` Eric Blake
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 2/7] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames Jeff Cody
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Jeff Cody @ 2013-10-31 15:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

The usage of $TEST_IMG was not properly quoted everywhere in
common.pattern.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 tests/qemu-iotests/common.pattern | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/qemu-iotests/common.pattern b/tests/qemu-iotests/common.pattern
index 00e0f60..ddfbca1 100644
--- a/tests/qemu-iotests/common.pattern
+++ b/tests/qemu-iotests/common.pattern
@@ -28,7 +28,7 @@ function do_is_allocated() {
 }
 
 function is_allocated() {
-    do_is_allocated "$@" | $QEMU_IO $TEST_IMG | _filter_qemu_io
+    do_is_allocated "$@" | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
 }
 
 function do_io() {
@@ -46,18 +46,18 @@ function do_io() {
 }
 
 function io_pattern() {
-    do_io "$@" | $QEMU_IO $TEST_IMG | _filter_qemu_io
+    do_io "$@" | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
 }
 
 function io() {
     local start=$2
     local pattern=$(( (start >> 9) % 256 ))
 
-    do_io "$@" $pattern | $QEMU_IO $TEST_IMG | _filter_qemu_io
+    do_io "$@" $pattern | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
 }
 
 function io_zero() {
-    do_io "$@" 0 | $QEMU_IO $TEST_IMG | _filter_qemu_io
+    do_io "$@" 0 | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
 }
 
 function io_test() {
@@ -117,8 +117,8 @@ function io_test2() {
     echo === Clusters to be compressed [3]
     io_pattern writev $((offset + 8 * $cluster_size)) $cluster_size $((9 * $cluster_size)) $num 165
 
-    mv $TEST_IMG $TEST_IMG.orig
-    $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c $TEST_IMG.orig $TEST_IMG
+    mv "$TEST_IMG" "$TEST_IMG.orig"
+    $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c "$TEST_IMG.orig" "$TEST_IMG"
 
     # Write the used clusters
     echo === Used clusters [1]
-- 
1.8.3.1

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

* [Qemu-devel] [PATCH 2/7] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames
  2013-10-31 15:57 [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Jeff Cody
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 1/7] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests Jeff Cody
@ 2013-10-31 15:57 ` Jeff Cody
  2013-10-31 16:23   ` Eric Blake
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 3/7] block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017 Jeff Cody
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Jeff Cody @ 2013-10-31 15:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

_make_test_img() currently works with spaced pathnames only when not
specifying a backing file.  This fixes it so that the backing file
argument is properly quoted.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 tests/qemu-iotests/common.rc | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 4e82604..d24de2c 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -111,6 +111,8 @@ _make_test_img()
     local image_size=$*
     local optstr=""
     local img_name=""
+    local use_backing=0
+    local backing_file=""
 
     if [ -n "$TEST_IMG_FILE" ]; then
         img_name=$TEST_IMG_FILE
@@ -123,7 +125,8 @@ _make_test_img()
     fi
 
     if [ "$1" = "-b" ]; then
-        extra_img_options="$1 $2"
+        use_backing=1
+        backing_file=$2
         image_size=$3
     fi
     if [ \( "$IMGFMT" = "qcow2" -o "$IMGFMT" = "qed" \) -a -n "$CLUSTER_SIZE" ]; then
@@ -135,7 +138,13 @@ _make_test_img()
     fi
 
     # XXX(hch): have global image options?
-    $QEMU_IMG create -f $IMGFMT $extra_img_options $img_name $image_size 2>&1 | \
+    (
+     if [ $use_backing = 1 ]; then
+        $QEMU_IMG create -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
+     fi
+    ) | \
         sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
             -e "s#$TEST_DIR#TEST_DIR#g" \
             -e "s#$IMGFMT#IMGFMT#g" \
-- 
1.8.3.1

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

* [Qemu-devel] [PATCH 3/7] block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017
  2013-10-31 15:57 [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Jeff Cody
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 1/7] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests Jeff Cody
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 2/7] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames Jeff Cody
@ 2013-10-31 15:57 ` Jeff Cody
  2013-10-31 16:25   ` Eric Blake
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 4/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 019 Jeff Cody
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Jeff Cody @ 2013-10-31 15:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

$TEST_IMG.base is used unquoted. Add quotes so that pathnames with
spaces are supported.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 tests/qemu-iotests/017 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017
index 45f2c0b..aba3faf 100755
--- a/tests/qemu-iotests/017
+++ b/tests/qemu-iotests/017
@@ -66,7 +66,7 @@ echo "Creating test image with backing file"
 echo
 
 TEST_IMG=$TEST_IMG_SAVE
-_make_test_img -b $TEST_IMG.base 6G
+_make_test_img -b "$TEST_IMG.base" 6G
 
 echo "Filling test image"
 echo
-- 
1.8.3.1

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

* [Qemu-devel] [PATCH 4/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 019
  2013-10-31 15:57 [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Jeff Cody
                   ` (2 preceding siblings ...)
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 3/7] block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017 Jeff Cody
@ 2013-10-31 15:57 ` Jeff Cody
  2013-10-31 17:00   ` Eric Blake
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 5/7] block: qemu-iotests, removes duplicate double quotes in 039 Jeff Cody
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Jeff Cody @ 2013-10-31 15:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

There were still instances of $TEST_IMG not being properly quoted.
This was in the usage of a string built up for a 'for' loop; modify
the loop so we can quote $TEST_IMG properly.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 tests/qemu-iotests/019 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019
index cd3582c..5bb18d0 100755
--- a/tests/qemu-iotests/019
+++ b/tests/qemu-iotests/019
@@ -90,12 +90,12 @@ mv "$TEST_IMG" "$TEST_IMG.orig"
 # Test the conversion twice: One test with the old-style -B option and another
 # one with -o backing_file
 
-for backing_option in "-B $TEST_IMG.base" "-o backing_file=$TEST_IMG.base"; do
+for backing_option in "-B " "-o backing_file="; do
 
     echo
-    echo Testing conversion with $backing_option | _filter_testdir | _filter_imgfmt
+    echo Testing conversion with $backing_option$TEST_IMG.base | _filter_testdir | _filter_imgfmt
     echo
-    $QEMU_IMG convert -O $IMGFMT $backing_option "$TEST_IMG.orig" "$TEST_IMG"
+    $QEMU_IMG convert -O $IMGFMT $backing_option"$TEST_IMG.base" "$TEST_IMG.orig" "$TEST_IMG"
 
     echo "Checking if backing clusters are allocated when they shouldn't"
     echo
-- 
1.8.3.1

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

* [Qemu-devel] [PATCH 5/7] block: qemu-iotests, removes duplicate double quotes in 039
  2013-10-31 15:57 [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Jeff Cody
                   ` (3 preceding siblings ...)
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 4/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 019 Jeff Cody
@ 2013-10-31 15:57 ` Jeff Cody
  2013-10-31 16:27   ` Eric Blake
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 6/7] block: qemu-iotests, add quotes to $TEST_IMG usage for 051 Jeff Cody
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Jeff Cody @ 2013-10-31 15:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

Test 039 had $TEST_IMG with duplicate double quotes - remove duplicate.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 tests/qemu-iotests/039 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
index f85b4ce..8bade92 100755
--- a/tests/qemu-iotests/039
+++ b/tests/qemu-iotests/039
@@ -54,7 +54,7 @@ echo "== Checking that image is clean on shutdown =="
 IMGOPTS="compat=1.1,lazy_refcounts=on"
 _make_test_img $size
 
-$QEMU_IO -c "write -P 0x5a 0 512" ""$TEST_IMG"" | _filter_qemu_io
+$QEMU_IO -c "write -P 0x5a 0 512" "$TEST_IMG" | _filter_qemu_io
 
 # The dirty bit must not be set
 ./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
-- 
1.8.3.1

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

* [Qemu-devel] [PATCH 6/7] block: qemu-iotests, add quotes to $TEST_IMG usage for 051
  2013-10-31 15:57 [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Jeff Cody
                   ` (4 preceding siblings ...)
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 5/7] block: qemu-iotests, removes duplicate double quotes in 039 Jeff Cody
@ 2013-10-31 15:57 ` Jeff Cody
  2013-10-31 17:03   ` Eric Blake
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 7/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 061 Jeff Cody
  2013-11-05 14:48 ` [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Stefan Hajnoczi
  7 siblings, 1 reply; 16+ messages in thread
From: Jeff Cody @ 2013-10-31 15:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

There were still a couple of instances of unquoted usage of
$TEST_IMG and $TEST_IMG.orig.  Quoted these so they will not fail
on pathnames with spaces in them.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 tests/qemu-iotests/051 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 356c375..0a4971d 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -64,9 +64,9 @@ function run_qemu()
 size=128M
 
 _make_test_img $size
-cp $TEST_IMG $TEST_IMG.orig
-mv $TEST_IMG $TEST_IMG.base
-_make_test_img -b $TEST_IMG.base $size
+cp "$TEST_IMG" "$TEST_IMG.orig"
+mv "$TEST_IMG" "$TEST_IMG.base"
+_make_test_img -b "$TEST_IMG.base" $size
 
 echo
 echo === Unknown option ===
@@ -81,7 +81,7 @@ echo
 echo === Overriding backing file ===
 echo
 
-echo "info block" | run_qemu -drive file=$TEST_IMG,driver=qcow2,backing.file.filename=$TEST_IMG.orig -nodefaults
+echo "info block" | run_qemu -drive file="$TEST_IMG",driver=qcow2,backing.file.filename="$TEST_IMG.orig" -nodefaults
 
 echo
 echo === Enable and disable lazy refcounting on the command line, plus some invalid values ===
-- 
1.8.3.1

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

* [Qemu-devel] [PATCH 7/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 061
  2013-10-31 15:57 [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Jeff Cody
                   ` (5 preceding siblings ...)
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 6/7] block: qemu-iotests, add quotes to $TEST_IMG usage for 051 Jeff Cody
@ 2013-10-31 15:57 ` Jeff Cody
  2013-10-31 16:29   ` Eric Blake
  2013-11-05 14:48 ` [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Stefan Hajnoczi
  7 siblings, 1 reply; 16+ messages in thread
From: Jeff Cody @ 2013-10-31 15:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

When creating images with backing files in the test, the backing
file argument was not quoted properly.  This caused the test to fail
when run from a pathname with a space.  Pass the backing argument in
with the -b option to _make_test_img, so it can be properly quoted.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 tests/qemu-iotests/061 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061
index fa9319d..e42f9bd 100755
--- a/tests/qemu-iotests/061
+++ b/tests/qemu-iotests/061
@@ -163,7 +163,7 @@ echo "=== Testing zero expansion on backed image ==="
 echo
 IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG.base" _make_test_img 64M
 $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
-IMGOPTS="compat=1.1,backing_file=$TEST_IMG.base" _make_test_img 64M
+IMGOPTS="compat=1.1" _make_test_img -b "$TEST_IMG.base" 64M
 $QEMU_IO -c "read -P 0x2a 0 128k" -c "write -z 0 64k" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
 _check_test_img
@@ -174,7 +174,7 @@ echo "=== Testing zero expansion on backed inactive clusters ==="
 echo
 IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG.base" _make_test_img 64M
 $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
-IMGOPTS="compat=1.1,backing_file=$TEST_IMG.base" _make_test_img 64M
+IMGOPTS="compat=1.1" _make_test_img -b "$TEST_IMG.base" 64M
 $QEMU_IO -c "write -z 0 64k" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG snapshot -c foo "$TEST_IMG"
 $QEMU_IO -c "write -P 0x42 0 128k" "$TEST_IMG" | _filter_qemu_io
@@ -190,7 +190,7 @@ echo "=== Testing zero expansion on backed image with shared L2 table ==="
 echo
 IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG.base" _make_test_img 64M
 $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io
-IMGOPTS="compat=1.1,backing_file=$TEST_IMG.base" _make_test_img 64M
+IMGOPTS="compat=1.1" _make_test_img -b "$TEST_IMG.base" 64M
 $QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io
 $QEMU_IMG snapshot -c foo "$TEST_IMG"
 $QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH 2/7] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 2/7] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames Jeff Cody
@ 2013-10-31 16:23   ` Eric Blake
  0 siblings, 0 replies; 16+ messages in thread
From: Eric Blake @ 2013-10-31 16:23 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel; +Cc: kwolf, stefanha

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

On 10/31/2013 09:57 AM, Jeff Cody wrote:
> _make_test_img() currently works with spaced pathnames only when not
> specifying a backing file.  This fixes it so that the backing file
> argument is properly quoted.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  tests/qemu-iotests/common.rc | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

As a slight optimization, you could avoid a subshell:

>      # XXX(hch): have global image options?
> -    $QEMU_IMG create -f $IMGFMT $extra_img_options $img_name $image_size 2>&1 | \
> +    (
> +     if [ $use_backing = 1 ]; then
> +        $QEMU_IMG create -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
> +     fi
> +    ) | \

$QEMU_IMG create -f $IMGFMT $extra_img_options \
  ${backing_file:+-b "$backing_file"} "$img_name" $image_size 2>&1 |

But as not everyone is a shell guru to recognize the ${var+:expansion}
trick, I'm fine with the version you proposed.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

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

* Re: [Qemu-devel] [PATCH 1/7] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 1/7] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests Jeff Cody
@ 2013-10-31 16:23   ` Eric Blake
  0 siblings, 0 replies; 16+ messages in thread
From: Eric Blake @ 2013-10-31 16:23 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel; +Cc: kwolf, stefanha

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

On 10/31/2013 09:57 AM, Jeff Cody wrote:
> The usage of $TEST_IMG was not properly quoted everywhere in
> common.pattern.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  tests/qemu-iotests/common.pattern | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

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

* Re: [Qemu-devel] [PATCH 3/7] block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 3/7] block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017 Jeff Cody
@ 2013-10-31 16:25   ` Eric Blake
  0 siblings, 0 replies; 16+ messages in thread
From: Eric Blake @ 2013-10-31 16:25 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel; +Cc: kwolf, stefanha

[-- Attachment #1: Type: text/plain, Size: 437 bytes --]

On 10/31/2013 09:57 AM, Jeff Cody wrote:
> $TEST_IMG.base is used unquoted. Add quotes so that pathnames with
> spaces are supported.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  tests/qemu-iotests/017 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

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

* Re: [Qemu-devel] [PATCH 5/7] block: qemu-iotests, removes duplicate double quotes in 039
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 5/7] block: qemu-iotests, removes duplicate double quotes in 039 Jeff Cody
@ 2013-10-31 16:27   ` Eric Blake
  0 siblings, 0 replies; 16+ messages in thread
From: Eric Blake @ 2013-10-31 16:27 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel; +Cc: kwolf, stefanha

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

On 10/31/2013 09:57 AM, Jeff Cody wrote:
> Test 039 had $TEST_IMG with duplicate double quotes - remove duplicate.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  tests/qemu-iotests/039 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

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

* Re: [Qemu-devel] [PATCH 7/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 061
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 7/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 061 Jeff Cody
@ 2013-10-31 16:29   ` Eric Blake
  0 siblings, 0 replies; 16+ messages in thread
From: Eric Blake @ 2013-10-31 16:29 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel; +Cc: kwolf, stefanha

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

On 10/31/2013 09:57 AM, Jeff Cody wrote:
> When creating images with backing files in the test, the backing
> file argument was not quoted properly.  This caused the test to fail
> when run from a pathname with a space.  Pass the backing argument in
> with the -b option to _make_test_img, so it can be properly quoted.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  tests/qemu-iotests/061 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

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

* Re: [Qemu-devel] [PATCH 4/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 019
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 4/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 019 Jeff Cody
@ 2013-10-31 17:00   ` Eric Blake
  0 siblings, 0 replies; 16+ messages in thread
From: Eric Blake @ 2013-10-31 17:00 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel; +Cc: kwolf, stefanha

[-- Attachment #1: Type: text/plain, Size: 1960 bytes --]

On 10/31/2013 09:57 AM, Jeff Cody wrote:
> There were still instances of $TEST_IMG not being properly quoted.
> This was in the usage of a string built up for a 'for' loop; modify
> the loop so we can quote $TEST_IMG properly.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  tests/qemu-iotests/019 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

> 
> diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019
> index cd3582c..5bb18d0 100755
> --- a/tests/qemu-iotests/019
> +++ b/tests/qemu-iotests/019
> @@ -90,12 +90,12 @@ mv "$TEST_IMG" "$TEST_IMG.orig"
>  # Test the conversion twice: One test with the old-style -B option and another
>  # one with -o backing_file
>  
> -for backing_option in "-B $TEST_IMG.base" "-o backing_file=$TEST_IMG.base"; do
> +for backing_option in "-B " "-o backing_file="; do
>  
>      echo
> -    echo Testing conversion with $backing_option | _filter_testdir | _filter_imgfmt
> +    echo Testing conversion with $backing_option$TEST_IMG.base | _filter_testdir | _filter_imgfmt

If $TEST_IMG has 2 consecutive spaces [*], this echo produces spurious
output (flattening to only 1 space).  To be completely robust, you must
quote here in the same manner...

>      echo
> -    $QEMU_IMG convert -O $IMGFMT $backing_option "$TEST_IMG.orig" "$TEST_IMG"
> +    $QEMU_IMG convert -O $IMGFMT $backing_option"$TEST_IMG.base" "$TEST_IMG.orig" "$TEST_IMG"

...as what you execute.  But as that corner case of misquoting doesn't
fail the test, your patch is a strict improvement, so I'm okay whether
you post a v2, or whether you keep this as-is and add:

Reviewed-by: Eric Blake <eblake@redhat.com>

[*] My favorite test for quoting bugs is renaming a directory to use
'two  spaces', because some quoting bugs are missed when you only test
'one space'.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

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

* Re: [Qemu-devel] [PATCH 6/7] block: qemu-iotests, add quotes to $TEST_IMG usage for 051
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 6/7] block: qemu-iotests, add quotes to $TEST_IMG usage for 051 Jeff Cody
@ 2013-10-31 17:03   ` Eric Blake
  0 siblings, 0 replies; 16+ messages in thread
From: Eric Blake @ 2013-10-31 17:03 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel; +Cc: kwolf, stefanha

[-- Attachment #1: Type: text/plain, Size: 519 bytes --]

On 10/31/2013 09:57 AM, Jeff Cody wrote:
> There were still a couple of instances of unquoted usage of
> $TEST_IMG and $TEST_IMG.orig.  Quoted these so they will not fail
> on pathnames with spaces in them.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  tests/qemu-iotests/051 | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

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

* Re: [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes
  2013-10-31 15:57 [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Jeff Cody
                   ` (6 preceding siblings ...)
  2013-10-31 15:57 ` [Qemu-devel] [PATCH 7/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 061 Jeff Cody
@ 2013-11-05 14:48 ` Stefan Hajnoczi
  7 siblings, 0 replies; 16+ messages in thread
From: Stefan Hajnoczi @ 2013-11-05 14:48 UTC (permalink / raw)
  To: Jeff Cody; +Cc: kwolf, qemu-devel, stefanha

On Thu, Oct 31, 2013 at 11:57:35AM -0400, Jeff Cody wrote:
> There are still problems with the qemu-iotests, if the pathname of the working
> directory contains spaces.  This series fixes most of them.  To verify,
>  ./check -qcow2 was run from a pathname with spaces (e.g., renamed ~/qemu-kvm
> to "~/qemu-kvm test/").
> 
> The following tests still fail due to pathnames with spaces, and
> are not addressed in this series: 059, 067.
> 
> 
> Jeff Cody (7):
>   block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests
>   block: qemu-iotests, fix _make_test_img() to work with spaced
>     pathnames
>   block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017
>   block: qemu-iotests, add quotes to $TEST_IMG usage in 019
>   block: qemu-iotests, removes duplicate double quotes in 039
>   block: qemu-iotests, add quotes to $TEST_IMG usage for 051
>   block: qemu-iotests, add quotes to $TEST_IMG usage in 061
> 
>  tests/qemu-iotests/017            |  2 +-
>  tests/qemu-iotests/019            |  6 +++---
>  tests/qemu-iotests/039            |  2 +-
>  tests/qemu-iotests/051            |  8 ++++----
>  tests/qemu-iotests/061            |  6 +++---
>  tests/qemu-iotests/common.pattern | 12 ++++++------
>  tests/qemu-iotests/common.rc      | 13 +++++++++++--
>  7 files changed, 29 insertions(+), 20 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

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

end of thread, other threads:[~2013-11-05 14:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31 15:57 [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Jeff Cody
2013-10-31 15:57 ` [Qemu-devel] [PATCH 1/7] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests Jeff Cody
2013-10-31 16:23   ` Eric Blake
2013-10-31 15:57 ` [Qemu-devel] [PATCH 2/7] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames Jeff Cody
2013-10-31 16:23   ` Eric Blake
2013-10-31 15:57 ` [Qemu-devel] [PATCH 3/7] block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017 Jeff Cody
2013-10-31 16:25   ` Eric Blake
2013-10-31 15:57 ` [Qemu-devel] [PATCH 4/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 019 Jeff Cody
2013-10-31 17:00   ` Eric Blake
2013-10-31 15:57 ` [Qemu-devel] [PATCH 5/7] block: qemu-iotests, removes duplicate double quotes in 039 Jeff Cody
2013-10-31 16:27   ` Eric Blake
2013-10-31 15:57 ` [Qemu-devel] [PATCH 6/7] block: qemu-iotests, add quotes to $TEST_IMG usage for 051 Jeff Cody
2013-10-31 17:03   ` Eric Blake
2013-10-31 15:57 ` [Qemu-devel] [PATCH 7/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 061 Jeff Cody
2013-10-31 16:29   ` Eric Blake
2013-11-05 14:48 ` [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).