qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2][qemu-iotests] explicitly use bash interpreter
@ 2010-04-24  8:20 Stefan Hajnoczi
  2010-04-24  8:20 ` [Qemu-devel] [PATCH 2/2][qemu-iotests] test bdrv_truncate() Stefan Hajnoczi
  2010-04-26  9:46 ` [Qemu-devel] Re: [PATCH 1/2][qemu-iotests] explicitly use bash interpreter Christoph Hellwig
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2010-04-24  8:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Christoph Hellwig, Stefan Hajnoczi

The tests use bash language features like 'let', which aren't supported
by /bin/sh on systems that use a conservative shell like dash.  This
patch changes the interpreter to /bin/bash.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
v2:
Fixed comment about dash's support for the 'local' command.  Thanks Jamie
Lokier <jamie@shareable.org>.

 001            |    2 +-
 002            |    2 +-
 003            |    2 +-
 004            |    2 +-
 005            |    2 +-
 006            |    2 +-
 007            |    2 +-
 008            |    2 +-
 009            |    2 +-
 010            |    2 +-
 011            |    2 +-
 012            |    2 +-
 013            |    2 +-
 014            |    2 +-
 015            |    2 +-
 016            |    2 +-
 017            |    2 +-
 018            |    2 +-
 019            |    2 +-
 020            |    2 +-
 021            |    2 +-
 022            |    2 +-
 023            |    2 +-
 024            |    2 +-
 check          |    2 +-
 common         |    2 +-
 common.config  |    2 +-
 common.filter  |    2 +-
 common.pattern |    2 +-
 common.rc      |    2 +-
 30 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/001 b/001
index bb96dca..fe66a8e 100755
--- a/001
+++ b/001
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Test simple read/write using plain bdrv_read/bdrv_write
 #
diff --git a/002 b/002
index a634e1e..57af974 100755
--- a/002
+++ b/002
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Test simple read/write using plain bdrv_pread/bdrv_pwrite
 #
diff --git a/003 b/003
index 23a406e..656da99 100755
--- a/003
+++ b/003
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Test simple read/write using bdrv_aio_readv/bdrv_aio_writev
 #
diff --git a/004 b/004
index 0c45845..3de7ed8 100755
--- a/004
+++ b/004
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Make sure we can't read and write outside of the image size.
 #
diff --git a/005 b/005
index 1debdc4..480276b 100755
--- a/005
+++ b/005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Make sure qemu-img can create 5TB images
 #
diff --git a/006 b/006
index 58b8213..98ef4ea 100755
--- a/006
+++ b/006
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Make sure qemu-img rejects > 127GB images for the vpc format as the format
 # doesn't support this.
diff --git a/007 b/007
index b2b6df3..2de1aa4 100755
--- a/007
+++ b/007
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Check for one possible case of qcow2 refcount corruption.
 #
diff --git a/008 b/008
index 26d1102..b697deb 100755
--- a/008
+++ b/008
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Test simple asynchronous read/write operations.
 #
diff --git a/009 b/009
index ebcc8de..1499b77 100755
--- a/009
+++ b/009
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Nolan I qcow2 corruption - incorrectly reports free clusters
 #
diff --git a/010 b/010
index 2cb5eeb..440e9f6 100755
--- a/010
+++ b/010
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Nolan II qcow2 corruption - wrong used cluster
 #
diff --git a/011 b/011
index 9106e74..87b4082 100755
--- a/011
+++ b/011
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Test for AIO allocation on the same cluster
 #
diff --git a/012 b/012
index a1b45fc..32a2647 100755
--- a/012
+++ b/012
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Make sure we can open read-only images
 #
diff --git a/013 b/013
index bd9fdef..0671bf6 100755
--- a/013
+++ b/013
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # qcow2 pattern test, empty and compressed image - 4k cluster patterns
 #
diff --git a/014 b/014
index ee7bf21..f38af43 100755
--- a/014
+++ b/014
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # qcow2 pattern test, complex patterns including compression and snapshots
 # Using patterns for 4k cluster size.
diff --git a/015 b/015
index 34b475f..f3b0acc 100755
--- a/015
+++ b/015
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Combined test to grow the refcount table and test snapshots.
 #
diff --git a/016 b/016
index 1dbdcb5..e09ab86 100755
--- a/016
+++ b/016
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Test I/O after EOF for growable images.
 #
diff --git a/017 b/017
index 1580ef7..d861961 100755
--- a/017
+++ b/017
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Simple backing file reads
 #
diff --git a/018 b/018
index c6233f1..0a348fe 100755
--- a/018
+++ b/018
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Merge backing file into test image when converting the image
 #
diff --git a/019 b/019
index 20893c5..711255e 100755
--- a/019
+++ b/019
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # When using a backing file for the output image in qemu-img convert,
 # the backing file clusters must not copied. The data must still be
diff --git a/020 b/020
index 4c9778d..546e074 100755
--- a/020
+++ b/020
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Commit changes to backing file
 #
diff --git a/021 b/021
index c0241ae..eb61230 100755
--- a/021
+++ b/021
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Test handling of invalid patterns arguments to qemu-io
 #
diff --git a/022 b/022
index ccf2319..635ad14 100755
--- a/022
+++ b/022
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Test bdrv_load/save_vmstate using the usual patterns
 #
diff --git a/023 b/023
index 883ca47..55c5be7 100755
--- a/023
+++ b/023
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # qcow2 pattern test with various cluster sizes
 #
diff --git a/024 b/024
index 3cad287..2b2ebf1 100755
--- a/024
+++ b/024
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Rebasing COW images
 #
diff --git a/check b/check
index 8652e8c..e0eaa7a 100755
--- a/check
+++ b/check
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2009 Red Hat, Inc.
 # Copyright (c) 2000-2002,2006 Silicon Graphics, Inc.  All Rights Reserved.
diff --git a/common b/common
index c246766..988fd5e 100644
--- a/common
+++ b/common
@@ -1,4 +1,4 @@
-#!/bin/sh 
+#!/bin/bash
 #
 # Copyright (C) 2009 Red Hat, Inc.
 # Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
diff --git a/common.config b/common.config
index cbbf39d..bdd0530 100644
--- a/common.config
+++ b/common.config
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2009 Red Hat, Inc.
 # Copyright (c) 2000-2003,2006 Silicon Graphics, Inc.  All Rights Reserved.
diff --git a/common.filter b/common.filter
index ba464a5..ce81266 100644
--- a/common.filter
+++ b/common.filter
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2009 Red Hat, Inc.
 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
diff --git a/common.pattern b/common.pattern
index a40d0d0..c2b84b8 100644
--- a/common.pattern
+++ b/common.pattern
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2009 Red Hat, Inc.
 #
diff --git a/common.rc b/common.rc
index 0a7ba00..da58f92 100644
--- a/common.rc
+++ b/common.rc
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (C) 2009 Red Hat, Inc.
 # Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
-- 
1.7.0

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

* [Qemu-devel] [PATCH 2/2][qemu-iotests] test bdrv_truncate()
  2010-04-24  8:20 [Qemu-devel] [PATCH 1/2][qemu-iotests] explicitly use bash interpreter Stefan Hajnoczi
@ 2010-04-24  8:20 ` Stefan Hajnoczi
  2010-04-26  7:08   ` [Qemu-devel] " Kevin Wolf
  2010-04-26  9:46   ` Christoph Hellwig
  2010-04-26  9:46 ` [Qemu-devel] Re: [PATCH 1/2][qemu-iotests] explicitly use bash interpreter Christoph Hellwig
  1 sibling, 2 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2010-04-24  8:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Christoph Hellwig, Stefan Hajnoczi

This patch adds an image resize grow test to ensure that existing data
is not lost during grow and new space is zeroed.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 025     |   73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 025.out |   25 +++++++++++++++++++++
 group   |    1 +
 3 files changed, 99 insertions(+), 0 deletions(-)
 create mode 100755 025
 create mode 100644 025.out

diff --git a/025 b/025
new file mode 100755
index 0000000..09e5b4d
--- /dev/null
+++ b/025
@@ -0,0 +1,73 @@
+#!/bin/bash
+#
+# Resizing images
+#
+# Copyright (C) 2010 IBM, Corp.
+#
+# 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=stefanha@linux.vnet.ibm.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+
+_cleanup()
+{
+	_cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.pattern
+
+_supported_fmt raw qcow2
+_supported_os Linux
+
+echo "=== Creating image"
+echo
+small_size=$((128 * 1024 * 1024))
+big_size=$((384 * 1024 * 1024))
+_make_test_img $small_size
+
+echo
+echo "=== Writing whole image"
+io_pattern write 0 $small_size 0 1 0xc5
+_check_test_img
+
+echo
+echo "=== Resizing image"
+$QEMU_IO -c "truncate $big_size" $TEST_IMG
+_check_test_img
+
+echo
+echo "=== Verifying image size"
+$QEMU_IO -c "length" $TEST_IMG
+
+echo
+echo "=== Verifying resized image"
+io_pattern read 0 $small_size 0 1 0xc5
+io_pattern read $small_size $(($big_size - $small_size)) 0 1 0
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/025.out b/025.out
new file mode 100644
index 0000000..26e3113
--- /dev/null
+++ b/025.out
@@ -0,0 +1,25 @@
+QA output created by 025
+=== Creating image
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 
+
+=== Writing whole image
+=== IO: pattern 0xc5
+qemu-io> wrote 134217728/134217728 bytes at offset 0
+128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-io> No errors were found on the image.
+
+=== Resizing image
+No errors were found on the image.
+
+=== Verifying image size
+384 MiB
+
+=== Verifying resized image
+=== IO: pattern 0xc5
+qemu-io> read 134217728/134217728 bytes at offset 0
+128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-io> === IO: pattern 0
+qemu-io> read 268435456/268435456 bytes at offset 134217728
+256 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-io> *** done
diff --git a/group b/group
index b4b3b40..3c0e630 100644
--- a/group
+++ b/group
@@ -31,3 +31,4 @@
 022 rw snapshot auto
 023 rw auto
 024 rw backing auto
+025 rw auto
-- 
1.7.0

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

* [Qemu-devel] Re: [PATCH 2/2][qemu-iotests] test bdrv_truncate()
  2010-04-24  8:20 ` [Qemu-devel] [PATCH 2/2][qemu-iotests] test bdrv_truncate() Stefan Hajnoczi
@ 2010-04-26  7:08   ` Kevin Wolf
  2010-04-26  9:46   ` Christoph Hellwig
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2010-04-26  7:08 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Christoph Hellwig

Am 24.04.2010 10:20, schrieb Stefan Hajnoczi:
> This patch adds an image resize grow test to ensure that existing data
> is not lost during grow and new space is zeroed.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> ---
>  025     |   73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  025.out |   25 +++++++++++++++++++++
>  group   |    1 +
>  3 files changed, 99 insertions(+), 0 deletions(-)
>  create mode 100755 025
>  create mode 100644 025.out
> 
> diff --git a/025 b/025
> new file mode 100755
> index 0000000..09e5b4d
> --- /dev/null
> +++ b/025
> @@ -0,0 +1,73 @@
> +#!/bin/bash
> +#
> +# Resizing images
> +#
> +# Copyright (C) 2010 IBM, Corp.
> +#
> +# 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=stefanha@linux.vnet.ibm.com
> +
> +seq=`basename $0`
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +
> +_cleanup()
> +{
> +	_cleanup_test_img
> +}
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +# get standard environment, filters and checks
> +. ./common.rc
> +. ./common.filter
> +. ./common.pattern
> +
> +_supported_fmt raw qcow2
> +_supported_os Linux
> +
> +echo "=== Creating image"
> +echo
> +small_size=$((128 * 1024 * 1024))
> +big_size=$((384 * 1024 * 1024))
> +_make_test_img $small_size
> +
> +echo
> +echo "=== Writing whole image"
> +io_pattern write 0 $small_size 0 1 0xc5
> +_check_test_img
> +
> +echo
> +echo "=== Resizing image"
> +$QEMU_IO -c "truncate $big_size" $TEST_IMG
> +_check_test_img

Here we could extend the test to check if the right image size is used
if the image isn't re-opened. Something like this:

$QEMU_IO $TEST_IMG <<EOF
length
truncate $big_size
length
EOF

Otherwise the test case looks good to me. We'll probably want another
one for shrinking images once this is supported by qcow2.

Kevin

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

* [Qemu-devel] Re: [PATCH 1/2][qemu-iotests] explicitly use bash interpreter
  2010-04-24  8:20 [Qemu-devel] [PATCH 1/2][qemu-iotests] explicitly use bash interpreter Stefan Hajnoczi
  2010-04-24  8:20 ` [Qemu-devel] [PATCH 2/2][qemu-iotests] test bdrv_truncate() Stefan Hajnoczi
@ 2010-04-26  9:46 ` Christoph Hellwig
  1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2010-04-26  9:46 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Kevin Wolf, qemu-devel, Christoph Hellwig

On Sat, Apr 24, 2010 at 09:20:18AM +0100, Stefan Hajnoczi wrote:
> The tests use bash language features like 'let', which aren't supported
> by /bin/sh on systems that use a conservative shell like dash.  This
> patch changes the interpreter to /bin/bash.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

Thanks, applied.

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

* [Qemu-devel] Re: [PATCH 2/2][qemu-iotests] test bdrv_truncate()
  2010-04-24  8:20 ` [Qemu-devel] [PATCH 2/2][qemu-iotests] test bdrv_truncate() Stefan Hajnoczi
  2010-04-26  7:08   ` [Qemu-devel] " Kevin Wolf
@ 2010-04-26  9:46   ` Christoph Hellwig
  1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2010-04-26  9:46 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Kevin Wolf, qemu-devel, Christoph Hellwig

On Sat, Apr 24, 2010 at 09:20:19AM +0100, Stefan Hajnoczi wrote:
> This patch adds an image resize grow test to ensure that existing data
> is not lost during grow and new space is zeroed.

Look good, but I'll wait for the qcow2 truncate support to hit mainline
to apply this.

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

end of thread, other threads:[~2010-04-26  9:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-24  8:20 [Qemu-devel] [PATCH 1/2][qemu-iotests] explicitly use bash interpreter Stefan Hajnoczi
2010-04-24  8:20 ` [Qemu-devel] [PATCH 2/2][qemu-iotests] test bdrv_truncate() Stefan Hajnoczi
2010-04-26  7:08   ` [Qemu-devel] " Kevin Wolf
2010-04-26  9:46   ` Christoph Hellwig
2010-04-26  9:46 ` [Qemu-devel] Re: [PATCH 1/2][qemu-iotests] explicitly use bash interpreter Christoph Hellwig

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).