|
|
9ae3a8 |
From 75745b6eee8522c8b1eb05dc2be56f3245abae1b Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
Date: Wed, 6 Nov 2013 16:53:32 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 75/87] qemu-iotests: Quote $TEST_IMG* and $TEST_DIR usage
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1383756824-6921-10-git-send-email-mreitz@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 55564
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 09/21] qemu-iotests: Quote $TEST_IMG* and $TEST_DIR usage
|
|
|
9ae3a8 |
Bugzilla: 980771
|
|
|
9ae3a8 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Jeff Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
BZ: 980771
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
A lot of image filename and paths are used unquoted. Quote these to
|
|
|
9ae3a8 |
make sure that directories / filenames with spaces are not problematic.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Jeff Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit fef9c19139f4d69a080d99b8cbade163d0bbf0fc)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conflicts:
|
|
|
9ae3a8 |
tests/qemu-iotests/051
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conflicts because of the downstream-only patch
|
|
|
9ae3a8 |
9dcde11f25f85804f31d00fc45eed16595aebeec.
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
tests/qemu-iotests/001 | 6 ++---
|
|
|
9ae3a8 |
tests/qemu-iotests/002 | 36 ++++++++++++-------------
|
|
|
9ae3a8 |
tests/qemu-iotests/003 | 10 +++----
|
|
|
9ae3a8 |
tests/qemu-iotests/004 | 24 ++++++++---------
|
|
|
9ae3a8 |
tests/qemu-iotests/005 | 4 +--
|
|
|
9ae3a8 |
tests/qemu-iotests/007 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/008 | 6 ++---
|
|
|
9ae3a8 |
tests/qemu-iotests/009 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/010 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/011 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/012 | 4 +--
|
|
|
9ae3a8 |
tests/qemu-iotests/013 | 4 +--
|
|
|
9ae3a8 |
tests/qemu-iotests/014 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/015 | 16 +++++------
|
|
|
9ae3a8 |
tests/qemu-iotests/016 | 12 ++++-----
|
|
|
9ae3a8 |
tests/qemu-iotests/018 | 6 ++---
|
|
|
9ae3a8 |
tests/qemu-iotests/019 | 12 ++++-----
|
|
|
9ae3a8 |
tests/qemu-iotests/020 | 12 ++++-----
|
|
|
9ae3a8 |
tests/qemu-iotests/021 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/023 | 4 +--
|
|
|
9ae3a8 |
tests/qemu-iotests/024 | 12 ++++-----
|
|
|
9ae3a8 |
tests/qemu-iotests/025 | 4 +--
|
|
|
9ae3a8 |
tests/qemu-iotests/026 | 20 +++++++-------
|
|
|
9ae3a8 |
tests/qemu-iotests/027 | 10 +++----
|
|
|
9ae3a8 |
tests/qemu-iotests/028 | 6 ++---
|
|
|
9ae3a8 |
tests/qemu-iotests/029 | 12 ++++-----
|
|
|
9ae3a8 |
tests/qemu-iotests/031 | 12 ++++-----
|
|
|
9ae3a8 |
tests/qemu-iotests/032 | 4 +--
|
|
|
9ae3a8 |
tests/qemu-iotests/033 | 18 ++++++-------
|
|
|
9ae3a8 |
tests/qemu-iotests/034 | 64 ++++++++++++++++++++++----------------------
|
|
|
9ae3a8 |
tests/qemu-iotests/035 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/036 | 6 ++---
|
|
|
9ae3a8 |
tests/qemu-iotests/037 | 62 +++++++++++++++++++++---------------------
|
|
|
9ae3a8 |
tests/qemu-iotests/038 | 10 +++----
|
|
|
9ae3a8 |
tests/qemu-iotests/039 | 28 +++++++++----------
|
|
|
9ae3a8 |
tests/qemu-iotests/042 | 10 +++----
|
|
|
9ae3a8 |
tests/qemu-iotests/043 | 32 +++++++++++-----------
|
|
|
9ae3a8 |
tests/qemu-iotests/046 | 10 +++----
|
|
|
9ae3a8 |
tests/qemu-iotests/047 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/048 | 8 +++---
|
|
|
9ae3a8 |
tests/qemu-iotests/049 | 36 ++++++++++++-------------
|
|
|
9ae3a8 |
tests/qemu-iotests/050 | 20 +++++++-------
|
|
|
9ae3a8 |
tests/qemu-iotests/051 | 50 +++++++++++++++++-----------------
|
|
|
9ae3a8 |
tests/qemu-iotests/052 | 6 ++---
|
|
|
9ae3a8 |
tests/qemu-iotests/053 | 10 +++----
|
|
|
9ae3a8 |
tests/qemu-iotests/054 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/059 | 6 ++---
|
|
|
9ae3a8 |
tests/qemu-iotests/063 | 28 +++++++++----------
|
|
|
9ae3a8 |
tests/qemu-iotests/common.rc | 16 +++++------
|
|
|
9ae3a8 |
49 files changed, 337 insertions(+), 337 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
tests/qemu-iotests/001 | 6 ++--
|
|
|
9ae3a8 |
tests/qemu-iotests/002 | 36 ++++++++++++------------
|
|
|
9ae3a8 |
tests/qemu-iotests/003 | 10 +++---
|
|
|
9ae3a8 |
tests/qemu-iotests/004 | 24 ++++++++--------
|
|
|
9ae3a8 |
tests/qemu-iotests/005 | 4 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/007 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/008 | 6 ++--
|
|
|
9ae3a8 |
tests/qemu-iotests/009 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/010 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/011 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/012 | 4 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/013 | 4 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/014 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/015 | 16 +++++-----
|
|
|
9ae3a8 |
tests/qemu-iotests/016 | 12 ++++----
|
|
|
9ae3a8 |
tests/qemu-iotests/018 | 6 ++--
|
|
|
9ae3a8 |
tests/qemu-iotests/019 | 12 ++++----
|
|
|
9ae3a8 |
tests/qemu-iotests/020 | 12 ++++----
|
|
|
9ae3a8 |
tests/qemu-iotests/021 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/023 | 4 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/024 | 12 ++++----
|
|
|
9ae3a8 |
tests/qemu-iotests/025 | 4 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/026 | 20 ++++++------
|
|
|
9ae3a8 |
tests/qemu-iotests/027 | 10 +++---
|
|
|
9ae3a8 |
tests/qemu-iotests/028 | 6 ++--
|
|
|
9ae3a8 |
tests/qemu-iotests/029 | 12 ++++----
|
|
|
9ae3a8 |
tests/qemu-iotests/031 | 12 ++++----
|
|
|
9ae3a8 |
tests/qemu-iotests/032 | 4 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/033 | 18 ++++++------
|
|
|
9ae3a8 |
tests/qemu-iotests/034 | 64 +++++++++++++++++++++---------------------
|
|
|
9ae3a8 |
tests/qemu-iotests/035 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/036 | 6 ++--
|
|
|
9ae3a8 |
tests/qemu-iotests/037 | 62 ++++++++++++++++++++--------------------
|
|
|
9ae3a8 |
tests/qemu-iotests/038 | 10 +++---
|
|
|
9ae3a8 |
tests/qemu-iotests/039 | 28 +++++++++---------
|
|
|
9ae3a8 |
tests/qemu-iotests/042 | 10 +++---
|
|
|
9ae3a8 |
tests/qemu-iotests/043 | 32 ++++++++++----------
|
|
|
9ae3a8 |
tests/qemu-iotests/046 | 10 +++---
|
|
|
9ae3a8 |
tests/qemu-iotests/047 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/048 | 8 ++--
|
|
|
9ae3a8 |
tests/qemu-iotests/049 | 36 ++++++++++++------------
|
|
|
9ae3a8 |
tests/qemu-iotests/050 | 20 ++++++------
|
|
|
9ae3a8 |
tests/qemu-iotests/051 | 50 ++++++++++++++++----------------
|
|
|
9ae3a8 |
tests/qemu-iotests/052 | 6 ++--
|
|
|
9ae3a8 |
tests/qemu-iotests/053 | 10 +++---
|
|
|
9ae3a8 |
tests/qemu-iotests/054 | 2 +-
|
|
|
9ae3a8 |
tests/qemu-iotests/059 | 6 ++--
|
|
|
9ae3a8 |
tests/qemu-iotests/063 | 28 +++++++++---------
|
|
|
9ae3a8 |
tests/qemu-iotests/common.rc | 16 +++++-----
|
|
|
9ae3a8 |
49 files changed, 337 insertions(+), 337 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/001 b/tests/qemu-iotests/001
|
|
|
9ae3a8 |
index bd88dde..4e16469 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/001
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/001
|
|
|
9ae3a8 |
@@ -48,15 +48,15 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== reading whole image =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== rewriting whole image =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verify pattern =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/002 b/tests/qemu-iotests/002
|
|
|
9ae3a8 |
index 51d0a8f..6a865aa 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/002
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/002
|
|
|
9ae3a8 |
@@ -48,36 +48,36 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== reading whole image =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -p 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -p 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== rewriting whole image =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -pP 0xa 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -pP 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verify pattern =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -pP 0xa 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -pP 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "unaligned pwrite"
|
|
|
9ae3a8 |
-$QEMU_IO -c 'write -pP 0xab 66 42' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'write -pP 0xac 512 288' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'write -pP 0xad 800 224' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'write -pP 0xae 66000 128k' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'write -pP 0xaf 256k 42' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'write -pP 0xab 66 42' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'write -pP 0xac 512 288' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'write -pP 0xad 800 224' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'write -pP 0xae 66000 128k' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'write -pP 0xaf 256k 42' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "verify pattern"
|
|
|
9ae3a8 |
-$QEMU_IO -c 'read -pP 0xa 0 66' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'read -pP 0xab 66 42' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'read -pP 0xa 108 404' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'read -pP 0xac 512 288' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'read -pP 0xad 800 224' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'read -pP 0xa 1k 64976' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'read -pP 0xae 66000 128k' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'read -pP 0xa 197072 65072' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'read -pP 0xaf 256k 42' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c 'read -pP 0xa 262186 470' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'read -pP 0xa 0 66' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'read -pP 0xab 66 42' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'read -pP 0xa 108 404' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'read -pP 0xac 512 288' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'read -pP 0xad 800 224' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'read -pP 0xa 1k 64976' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'read -pP 0xae 66000 128k' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'read -pP 0xa 197072 65072' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'read -pP 0xaf 256k 42' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c 'read -pP 0xa 262186 470' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/003 b/tests/qemu-iotests/003
|
|
|
9ae3a8 |
index ee25fb8..98638d4 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/003
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/003
|
|
|
9ae3a8 |
@@ -50,27 +50,27 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== reading whole image =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "readv 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "readv 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== rewriting whole image =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "writev -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "writev -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verify pattern =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "readv -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "readv -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== vectored write =="
|
|
|
9ae3a8 |
$QEMU_IO -c "writev -P 0xb $offset $chunksize $chunksize \
|
|
|
9ae3a8 |
$chunksize $chunksize $chunksize $chunksize $chunksize" \
|
|
|
9ae3a8 |
- $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+ "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verify pattern =="
|
|
|
9ae3a8 |
$QEMU_IO -c "readv -P 0xb $offset $chunksize $chunksize \
|
|
|
9ae3a8 |
$chunksize $chunksize $chunksize $chunksize $chunksize" \
|
|
|
9ae3a8 |
- $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+ "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/004 b/tests/qemu-iotests/004
|
|
|
9ae3a8 |
index c76451c..651072e 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/004
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/004
|
|
|
9ae3a8 |
@@ -51,51 +51,51 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "write before image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "write $pre_offset 1M" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write $pre_offset 1M" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "write into image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "write $pre_offset 4M" $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "write $pre_offset 4M" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "write at image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "write $size 4096" $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "write $size 4096" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "write past image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "write $past_offset 4096" $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "write $past_offset 4096" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "pwrite past image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -p $past_offset 4096" $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -p $past_offset 4096" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "writev past image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "writev $past_offset 4096" $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "writev $past_offset 4096" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "read before image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "read $pre_offset 1M" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read $pre_offset 1M" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "read into image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "read $pre_offset 4M" $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "read $pre_offset 4M" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "read at image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "read $size 4096" $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "read $size 4096" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "read past image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "read $past_offset 4096" $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "read $past_offset 4096" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "pread past image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -p $past_offset 4096" $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -p $past_offset 4096" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "readv past image boundary"
|
|
|
9ae3a8 |
-$QEMU_IO -c "readv $past_offset 4096" $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "readv $past_offset 4096" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
|
|
|
9ae3a8 |
index b7970e3..9abcb84 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/005
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/005
|
|
|
9ae3a8 |
@@ -61,11 +61,11 @@ _make_test_img 5000G
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "small read"
|
|
|
9ae3a8 |
-$QEMU_IO -c "read 1024 4096" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read 1024 4096" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "small write"
|
|
|
9ae3a8 |
-$QEMU_IO -c "write 8192 4096" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write 8192 4096" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/007 b/tests/qemu-iotests/007
|
|
|
9ae3a8 |
index c454f2c..fc84445 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/007
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/007
|
|
|
9ae3a8 |
@@ -50,7 +50,7 @@ _make_test_img 1M
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
for i in `seq 1 10`; do
|
|
|
9ae3a8 |
echo "savevm $i"
|
|
|
9ae3a8 |
- $QEMU -nographic -hda $TEST_IMG -serial none -monitor stdio >/dev/null 2>&1 <
|
|
|
9ae3a8 |
+ $QEMU -nographic -hda "$TEST_IMG" -serial none -monitor stdio >/dev/null 2>&1 <
|
|
|
9ae3a8 |
savevm test-$i
|
|
|
9ae3a8 |
quit
|
|
|
9ae3a8 |
EOF
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/008 b/tests/qemu-iotests/008
|
|
|
9ae3a8 |
index 2c53bac..2d28efd 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/008
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/008
|
|
|
9ae3a8 |
@@ -48,15 +48,15 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== reading whole image =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "aio_read 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "aio_read 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== rewriting whole image =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "aio_write -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "aio_write -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verify pattern =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "aio_read -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "aio_read -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/009 b/tests/qemu-iotests/009
|
|
|
9ae3a8 |
index 25368c8..57a43f5 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/009
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/009
|
|
|
9ae3a8 |
@@ -57,7 +57,7 @@ $QEMU_IO \
|
|
|
9ae3a8 |
-c "write 4k 4k" \
|
|
|
9ae3a8 |
-c "write 9M 4k" \
|
|
|
9ae3a8 |
-c "read -P 65 -s 4k -l 4k 2044k 8k" \
|
|
|
9ae3a8 |
-$TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+"$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "checking image for errors"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/010 b/tests/qemu-iotests/010
|
|
|
9ae3a8 |
index 7b57929..896a005 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/010
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/010
|
|
|
9ae3a8 |
@@ -59,7 +59,7 @@ $QEMU_IO \
|
|
|
9ae3a8 |
-c "write -P 165 2044k 4k" \
|
|
|
9ae3a8 |
-c "write -P 99 8M 4k" \
|
|
|
9ae3a8 |
-c "read -P 165 2044k 8k" \
|
|
|
9ae3a8 |
-$TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+"$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "checking image for errors"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/011 b/tests/qemu-iotests/011
|
|
|
9ae3a8 |
index b03df68..1c5158a 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/011
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/011
|
|
|
9ae3a8 |
@@ -60,7 +60,7 @@ for i in `seq 1 10`; do
|
|
|
9ae3a8 |
# Note that we filter away the actual offset. That's because qemu
|
|
|
9ae3a8 |
# may re-order the two aio requests. We only want to make sure the
|
|
|
9ae3a8 |
# filesystem isn't corrupted afterwards anyway.
|
|
|
9ae3a8 |
- $QEMU_IO -c "aio_write $off1 1M" -c "aio_write $off2 1M" $TEST_IMG | \
|
|
|
9ae3a8 |
+ $QEMU_IO -c "aio_write $off1 1M" -c "aio_write $off2 1M" "$TEST_IMG" | \
|
|
|
9ae3a8 |
_filter_qemu_io | \
|
|
|
9ae3a8 |
sed -e 's/bytes at offset [0-9]*/bytes at offset XXX/g'
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/012 b/tests/qemu-iotests/012
|
|
|
9ae3a8 |
index 4052956..7c5b689 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/012
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/012
|
|
|
9ae3a8 |
@@ -50,11 +50,11 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== mark image read-only"
|
|
|
9ae3a8 |
-chmod a-w $TEST_IMG
|
|
|
9ae3a8 |
+chmod a-w "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== read from read-only image"
|
|
|
9ae3a8 |
-$QEMU_IO -r -c "read 0 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -r -c "read 0 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/013 b/tests/qemu-iotests/013
|
|
|
9ae3a8 |
index ce40d5c..389f4b8 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/013
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/013
|
|
|
9ae3a8 |
@@ -65,8 +65,8 @@ done
|
|
|
9ae3a8 |
echo "Compressing image"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.orig
|
|
|
9ae3a8 |
-$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c $TEST_IMG.orig $TEST_IMG
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.orig"
|
|
|
9ae3a8 |
+$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c "$TEST_IMG.orig" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "Testing compressed image"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/014 b/tests/qemu-iotests/014
|
|
|
9ae3a8 |
index a6d0aea..0edeb4b 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/014
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/014
|
|
|
9ae3a8 |
@@ -61,7 +61,7 @@ done
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# With snapshots
|
|
|
9ae3a8 |
for i in `seq 1 3`; do
|
|
|
9ae3a8 |
- $QEMU_IMG snapshot -c test$i $TEST_IMG
|
|
|
9ae3a8 |
+ $QEMU_IMG snapshot -c test$i "$TEST_IMG"
|
|
|
9ae3a8 |
for offset in $TEST_OFFSETS; do
|
|
|
9ae3a8 |
echo With snapshot test$i, offset $offset
|
|
|
9ae3a8 |
for op in $TEST_OPS; do
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/015 b/tests/qemu-iotests/015
|
|
|
9ae3a8 |
index 44c134f..099d757 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/015
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/015
|
|
|
9ae3a8 |
@@ -61,19 +61,19 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# Create two snapshots which fill the image with two different patterns
|
|
|
9ae3a8 |
echo "creating first snapshot"
|
|
|
9ae3a8 |
-$QEMU_IO -c "aio_write -P 123 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IMG snapshot -c snap1 $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "aio_write -P 123 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IMG snapshot -c snap1 "$TEST_IMG"
|
|
|
9ae3a8 |
echo "creating second snapshot"
|
|
|
9ae3a8 |
-$QEMU_IO -c "aio_write -P 165 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IMG snapshot -c snap2 $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "aio_write -P 165 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IMG snapshot -c snap2 "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# Now check the pattern
|
|
|
9ae3a8 |
echo "checking first snapshot"
|
|
|
9ae3a8 |
-$QEMU_IMG snapshot -a snap1 $TEST_IMG
|
|
|
9ae3a8 |
-$QEMU_IO -c "aio_read -P 123 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IMG snapshot -a snap1 "$TEST_IMG"
|
|
|
9ae3a8 |
+$QEMU_IO -c "aio_read -P 123 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
echo "checking second snapshot"
|
|
|
9ae3a8 |
-$QEMU_IMG snapshot -a snap2 $TEST_IMG
|
|
|
9ae3a8 |
-$QEMU_IO -c "aio_read -P 165 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IMG snapshot -a snap2 "$TEST_IMG"
|
|
|
9ae3a8 |
+$QEMU_IO -c "aio_read -P 165 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "checking image for errors"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/016 b/tests/qemu-iotests/016
|
|
|
9ae3a8 |
index a1467b8..b87a32b 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/016
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/016
|
|
|
9ae3a8 |
@@ -48,21 +48,21 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== reading at EOF =="
|
|
|
9ae3a8 |
-$QEMU_IO -g -c "read -P 0 $size 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -g -c "read -P 0 $size 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== reading far past EOF =="
|
|
|
9ae3a8 |
-$QEMU_IO -g -c "read -P 0 256M 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -g -c "read -P 0 256M 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== writing at EOF =="
|
|
|
9ae3a8 |
-$QEMU_IO -g -c "write -P 66 $size 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 66 $size 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -g -c "write -P 66 $size 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 66 $size 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== writing far past EOF =="
|
|
|
9ae3a8 |
-$QEMU_IO -g -c "write -P 66 256M 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 66 256M 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -g -c "write -P 66 256M 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 66 256M 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/018 b/tests/qemu-iotests/018
|
|
|
9ae3a8 |
index 453ce61..15fcfe5 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/018
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/018
|
|
|
9ae3a8 |
@@ -66,7 +66,7 @@ echo "Creating test image with backing file"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
TEST_IMG=$TEST_IMG_SAVE
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.base 6G
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.base" 6G
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "Filling test image"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
@@ -80,8 +80,8 @@ for offset in $TEST_OFFSETS; do
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.orig
|
|
|
9ae3a8 |
-$QEMU_IMG convert -O $IMGFMT $TEST_IMG.orig $TEST_IMG
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.orig"
|
|
|
9ae3a8 |
+$QEMU_IMG convert -O $IMGFMT "$TEST_IMG.orig" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "Reading"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019
|
|
|
9ae3a8 |
index 8872b30..cd3582c 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/019
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/019
|
|
|
9ae3a8 |
@@ -33,8 +33,8 @@ status=1 # failure is the default!
|
|
|
9ae3a8 |
_cleanup()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
_cleanup_test_img
|
|
|
9ae3a8 |
- rm -f $TEST_IMG.base
|
|
|
9ae3a8 |
- rm -f $TEST_IMG.orig
|
|
|
9ae3a8 |
+ rm -f "$TEST_IMG.base"
|
|
|
9ae3a8 |
+ rm -f "$TEST_IMG.orig"
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -68,8 +68,8 @@ _check_test_img
|
|
|
9ae3a8 |
echo "Creating test image with backing file"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.base
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.base 6G
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.base"
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.base" 6G
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "Filling test image"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
@@ -83,7 +83,7 @@ for offset in $TEST_OFFSETS; do
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.orig
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.orig"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -95,7 +95,7 @@ for backing_option in "-B $TEST_IMG.base" "-o backing_file=$TEST_IMG.base"; do
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo Testing conversion with $backing_option | _filter_testdir | _filter_imgfmt
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
- $QEMU_IMG convert -O $IMGFMT $backing_option $TEST_IMG.orig $TEST_IMG
|
|
|
9ae3a8 |
+ $QEMU_IMG convert -O $IMGFMT $backing_option "$TEST_IMG.orig" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "Checking if backing clusters are allocated when they shouldn't"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020
|
|
|
9ae3a8 |
index 2fb0ff8..b3c86d8 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/020
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/020
|
|
|
9ae3a8 |
@@ -31,8 +31,8 @@ status=1 # failure is the default!
|
|
|
9ae3a8 |
_cleanup()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
_cleanup_test_img
|
|
|
9ae3a8 |
- rm -f $TEST_IMG.base
|
|
|
9ae3a8 |
- rm -f $TEST_IMG.orig
|
|
|
9ae3a8 |
+ rm -f "$TEST_IMG.base"
|
|
|
9ae3a8 |
+ rm -f "$TEST_IMG.orig"
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -65,8 +65,8 @@ _check_test_img
|
|
|
9ae3a8 |
echo "Creating test image with backing file"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.base
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.base 6G
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.base"
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.base" 6G
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "Filling test image"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
@@ -80,8 +80,8 @@ for offset in $TEST_OFFSETS; do
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IMG commit $TEST_IMG
|
|
|
9ae3a8 |
-mv $TEST_IMG.base $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IMG commit "$TEST_IMG"
|
|
|
9ae3a8 |
+mv "$TEST_IMG.base" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "Reading from the backing file"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/021 b/tests/qemu-iotests/021
|
|
|
9ae3a8 |
index 6da79eb..1c69024 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/021
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/021
|
|
|
9ae3a8 |
@@ -53,7 +53,7 @@ for pattern in $INVALID_PATTERNS; do
|
|
|
9ae3a8 |
for op in $TEST_OPS; do
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== testing $op -P $pattern =="
|
|
|
9ae3a8 |
- $QEMU_IO -c "$op -P $pattern 0 4096" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+ $QEMU_IO -c "$op -P $pattern 0 4096" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/023 b/tests/qemu-iotests/023
|
|
|
9ae3a8 |
index 4f31b56..090ed23 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/023
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/023
|
|
|
9ae3a8 |
@@ -71,8 +71,8 @@ for CLUSTER_SIZE in $CLUSTER_SIZES; do
|
|
|
9ae3a8 |
echo "Compressing image"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- mv $TEST_IMG $TEST_IMG.orig
|
|
|
9ae3a8 |
- $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c $TEST_IMG.orig $TEST_IMG
|
|
|
9ae3a8 |
+ mv "$TEST_IMG" "$TEST_IMG.orig"
|
|
|
9ae3a8 |
+ $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c "$TEST_IMG.orig" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "Testing compressed image"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/024 b/tests/qemu-iotests/024
|
|
|
9ae3a8 |
index 554b74b..be974f0 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/024
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/024
|
|
|
9ae3a8 |
@@ -31,8 +31,8 @@ status=1 # failure is the default!
|
|
|
9ae3a8 |
_cleanup()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
_cleanup_test_img
|
|
|
9ae3a8 |
- rm -f $TEST_DIR/t.$IMGFMT.base_old
|
|
|
9ae3a8 |
- rm -f $TEST_DIR/t.$IMGFMT.base_new
|
|
|
9ae3a8 |
+ rm -f "$TEST_DIR/t.$IMGFMT.base_old"
|
|
|
9ae3a8 |
+ rm -f "$TEST_DIR/t.$IMGFMT.base_new"
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -62,19 +62,19 @@ echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_make_test_img 1G
|
|
|
9ae3a8 |
io_pattern writev 0 $CLUSTER_SIZE $((2 * CLUSTER_SIZE)) 8 0x11
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.base_old
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.base_old"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "Creating new backing file"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_make_test_img 1G
|
|
|
9ae3a8 |
io_pattern writev 0 $((2 * CLUSTER_SIZE)) $((4 * CLUSTER_SIZE)) 4 0x22
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.base_new
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.base_new"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "Creating COW image"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.base_old 1G
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.base_old" 1G
|
|
|
9ae3a8 |
io_pattern writev 0 $((4 * CLUSTER_SIZE)) 0 1 0x33
|
|
|
9ae3a8 |
io_pattern writev $((8 * CLUSTER_SIZE)) $((4 * CLUSTER_SIZE)) 0 1 0x33
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -100,7 +100,7 @@ io_pattern readv $((15 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo Rebase and test again
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
-$QEMU_IMG rebase -b $TEST_IMG.base_new $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IMG rebase -b "$TEST_IMG.base_new" "$TEST_IMG"
|
|
|
9ae3a8 |
io_pattern readv $((0 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
|
|
|
9ae3a8 |
io_pattern readv $((1 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
|
|
|
9ae3a8 |
io_pattern readv $((2 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/025 b/tests/qemu-iotests/025
|
|
|
9ae3a8 |
index 7062aa6..a7241cc 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/025
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/025
|
|
|
9ae3a8 |
@@ -56,7 +56,7 @@ _check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "=== Resizing image"
|
|
|
9ae3a8 |
-$QEMU_IO $TEST_IMG <
|
|
|
9ae3a8 |
+$QEMU_IO "$TEST_IMG" <
|
|
|
9ae3a8 |
length
|
|
|
9ae3a8 |
truncate $big_size
|
|
|
9ae3a8 |
length
|
|
|
9ae3a8 |
@@ -65,7 +65,7 @@ _check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "=== Verifying image size after reopen"
|
|
|
9ae3a8 |
-$QEMU_IO -c "length" $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IO -c "length" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "=== Verifying resized image"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026
|
|
|
9ae3a8 |
index 107a3ff..ebe29d0 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/026
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/026
|
|
|
9ae3a8 |
@@ -31,7 +31,7 @@ status=1 # failure is the default!
|
|
|
9ae3a8 |
_cleanup()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
_cleanup_test_img
|
|
|
9ae3a8 |
- rm $TEST_DIR/blkdebug.conf
|
|
|
9ae3a8 |
+ rm "$TEST_DIR/blkdebug.conf"
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -75,7 +75,7 @@ for imm in off; do
|
|
|
9ae3a8 |
for once in on off; do
|
|
|
9ae3a8 |
for vmstate in "" "-b"; do
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-cat > $TEST_DIR/blkdebug.conf <
|
|
|
9ae3a8 |
+cat > "$TEST_DIR/blkdebug.conf" <
|
|
|
9ae3a8 |
[inject-error]
|
|
|
9ae3a8 |
event = "$event"
|
|
|
9ae3a8 |
errno = "$errno"
|
|
|
9ae3a8 |
@@ -90,16 +90,16 @@ echo "Event: $event; errno: $errno; imm: $imm; once: $once; write $vmstate"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# We want to catch a simple L2 update, not the allocation of the first L2 table
|
|
|
9ae3a8 |
if [ "$event" == "l2_update" ]; then
|
|
|
9ae3a8 |
- $QEMU_IO -c "write $vmstate 0 512" $TEST_IMG > /dev/null 2>&1
|
|
|
9ae3a8 |
+ $QEMU_IO -c "write $vmstate 0 512" "$TEST_IMG" > /dev/null 2>&1
|
|
|
9ae3a8 |
fi
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IO -c "write $vmstate 0 128k " $BLKDBG_TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write $vmstate 0 128k " "$BLKDBG_TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# l2_load is not called on allocation, so issue a second write
|
|
|
9ae3a8 |
# Reads are another path to trigger l2_load, so do a read, too
|
|
|
9ae3a8 |
if [ "$event" == "l2_load" ]; then
|
|
|
9ae3a8 |
- $QEMU_IO -c "write $vmstate 0 128k " $BLKDBG_TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
- $QEMU_IO -c "read $vmstate 0 128k " $BLKDBG_TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+ $QEMU_IO -c "write $vmstate 0 128k " "$BLKDBG_TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+ $QEMU_IO -c "read $vmstate 0 128k " "$BLKDBG_TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
fi
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_check_test_img 2>&1 | grep -v "refcount=1 reference=0"
|
|
|
9ae3a8 |
@@ -133,7 +133,7 @@ for imm in off; do
|
|
|
9ae3a8 |
for once in on off; do
|
|
|
9ae3a8 |
for vmstate in "" "-b"; do
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-cat > $TEST_DIR/blkdebug.conf <
|
|
|
9ae3a8 |
+cat > "$TEST_DIR/blkdebug.conf" <
|
|
|
9ae3a8 |
[inject-error]
|
|
|
9ae3a8 |
event = "$event"
|
|
|
9ae3a8 |
errno = "$errno"
|
|
|
9ae3a8 |
@@ -145,7 +145,7 @@ _make_test_img 1G
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "Event: $event; errno: $errno; imm: $imm; once: $once; write $vmstate"
|
|
|
9ae3a8 |
-$QEMU_IO -c "write $vmstate 0 64M" $BLKDBG_TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write $vmstate 0 64M" "$BLKDBG_TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_check_test_img 2>&1 | grep -v "refcount=1 reference=0"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -172,7 +172,7 @@ for errno in 5 28; do
|
|
|
9ae3a8 |
for imm in off; do
|
|
|
9ae3a8 |
for once in on off; do
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-cat > $TEST_DIR/blkdebug.conf <
|
|
|
9ae3a8 |
+cat > "$TEST_DIR/blkdebug.conf" <
|
|
|
9ae3a8 |
[inject-error]
|
|
|
9ae3a8 |
event = "$event"
|
|
|
9ae3a8 |
errno = "$errno"
|
|
|
9ae3a8 |
@@ -184,7 +184,7 @@ _make_test_img 1G
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "Event: $event; errno: $errno; imm: $imm; once: $once"
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -b 0 64k" $BLKDBG_TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -b 0 64k" "$BLKDBG_TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_check_test_img 2>&1 | grep -v "refcount=1 reference=0"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/027 b/tests/qemu-iotests/027
|
|
|
9ae3a8 |
index 7d90481..3fa81b8 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/027
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/027
|
|
|
9ae3a8 |
@@ -54,23 +54,23 @@ _make_test_img $size
|
|
|
9ae3a8 |
# Otherwise an L2 table could get in the way after the data cluster.
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== writing first cluster to populate metadata =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -pP 0xde $cluster_size $cluster_size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -pP 0xde $cluster_size $cluster_size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== writing at sub-cluster granularity =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -pP 0xa $subcluster_offset $subcluster_size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -pP 0xa $subcluster_offset $subcluster_size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verify pattern =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -pP 0xa $subcluster_offset $subcluster_size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -pP 0xa $subcluster_offset $subcluster_size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verify zeroes before sub-cluster pattern =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -pP 0 -l $subcluster_offset 0 $subcluster_size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -pP 0 -l $subcluster_offset 0 $subcluster_size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verify zeroes after sub-cluster pattern =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -pP 0 -l 512 -s $subcluster_size $subcluster_offset $(( subcluster_size + 512 ))" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -pP 0 -l 512 -s $subcluster_size $subcluster_offset $(( subcluster_size + 512 ))" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
|
|
|
9ae3a8 |
index b091ba9..93a9fa6 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/028
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/028
|
|
|
9ae3a8 |
@@ -71,8 +71,8 @@ _check_test_img
|
|
|
9ae3a8 |
echo "Creating test image with backing file"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.base
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.base $image_size
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.base"
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.base" $image_size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "Filling test image"
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
@@ -97,7 +97,7 @@ io_zero readv $(( offset + 32 * 1024 )) 512 1024 32
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# Rebase it on top of its base image
|
|
|
9ae3a8 |
-$QEMU_IMG rebase -b $TEST_IMG.base $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IMG rebase -b "$TEST_IMG.base" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/029 b/tests/qemu-iotests/029
|
|
|
9ae3a8 |
index 0ad5e45..b424726 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/029
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/029
|
|
|
9ae3a8 |
@@ -47,16 +47,16 @@ _supported_os Linux
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
CLUSTER_SIZE=65536
|
|
|
9ae3a8 |
_make_test_img 64M
|
|
|
9ae3a8 |
-$QEMU_IMG snapshot -c foo $TEST_IMG
|
|
|
9ae3a8 |
-$QEMU_IO -c 'write -b 0 4k' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IMG snapshot -a foo $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
|
|
|
9ae3a8 |
+$QEMU_IO -c 'write -b 0 4k' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IMG snapshot -a foo "$TEST_IMG"
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
CLUSTER_SIZE=1024
|
|
|
9ae3a8 |
_make_test_img 16M
|
|
|
9ae3a8 |
-$QEMU_IMG snapshot -c foo $TEST_IMG
|
|
|
9ae3a8 |
-$QEMU_IO -c 'write -b 0 4M' $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IMG snapshot -a foo $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
|
|
|
9ae3a8 |
+$QEMU_IO -c 'write -b 0 4M' "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IMG snapshot -a foo "$TEST_IMG"
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/031 b/tests/qemu-iotests/031
|
|
|
9ae3a8 |
index 2d5e3b1..c9070b0 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/031
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/031
|
|
|
9ae3a8 |
@@ -56,22 +56,22 @@ for IMGOPTS in "compat=0.10" "compat=1.1"; do
|
|
|
9ae3a8 |
echo === Create image with unknown header extension ===
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
_make_test_img 64M
|
|
|
9ae3a8 |
- ./qcow2.py $TEST_IMG add-header-ext 0x12345678 "This is a test header extension"
|
|
|
9ae3a8 |
- ./qcow2.py $TEST_IMG dump-header
|
|
|
9ae3a8 |
+ ./qcow2.py "$TEST_IMG" add-header-ext 0x12345678 "This is a test header extension"
|
|
|
9ae3a8 |
+ ./qcow2.py "$TEST_IMG" dump-header
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo === Rewrite header with no backing file ===
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
- $QEMU_IMG rebase -u -b "" $TEST_IMG
|
|
|
9ae3a8 |
- ./qcow2.py $TEST_IMG dump-header
|
|
|
9ae3a8 |
+ $QEMU_IMG rebase -u -b "" "$TEST_IMG"
|
|
|
9ae3a8 |
+ ./qcow2.py "$TEST_IMG" dump-header
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo === Add a backing file and format ===
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
- $QEMU_IMG rebase -u -b "/some/backing/file/path" -F host_device $TEST_IMG
|
|
|
9ae3a8 |
- ./qcow2.py $TEST_IMG dump-header
|
|
|
9ae3a8 |
+ $QEMU_IMG rebase -u -b "/some/backing/file/path" -F host_device "$TEST_IMG"
|
|
|
9ae3a8 |
+ ./qcow2.py "$TEST_IMG" dump-header
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/032 b/tests/qemu-iotests/032
|
|
|
9ae3a8 |
index 7155568..b1ba5c3 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/032
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/032
|
|
|
9ae3a8 |
@@ -55,12 +55,12 @@ _make_test_img 64M
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# Allocate every other cluster so that afterwards a big write request will
|
|
|
9ae3a8 |
# actually loop a while and issue many I/O requests for the lower layer
|
|
|
9ae3a8 |
-for i in $(seq 0 128 4096); do echo "write ${i}k 64k"; done | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+for i in $(seq 0 128 4096); do echo "write ${i}k 64k"; done | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo === AIO request during close ===
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
-$QEMU_IO -c "aio_write 0 4M" -c "close" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "aio_write 0 4M" -c "close" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/033 b/tests/qemu-iotests/033
|
|
|
9ae3a8 |
index 9aee078..ea3351c 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/033
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/033
|
|
|
9ae3a8 |
@@ -48,24 +48,24 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== preparing image =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0xa 0x200 0x400" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0xa 0x20000 0x600" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -z 0x400 0x20000" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0xa 0x200 0x400" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0xa 0x20000 0x600" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -z 0x400 0x20000" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verifying patterns (1) =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0xa 0x200 0x200" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x0 0x400 0x20000" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0xa 0x20400 0x200" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0xa 0x200 0x200" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x0 0x400 0x20000" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0xa 0x20400 0x200" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== rewriting zeroes =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0xb 0x10000 0x10000" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -z 0x10000 0x10000" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0xb 0x10000 0x10000" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -z 0x10000 0x10000" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verifying patterns (2) =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x0 0x400 0x20000" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x0 0x400 0x20000" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/034 b/tests/qemu-iotests/034
|
|
|
9ae3a8 |
index 8254df8..67f1959 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/034
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/034
|
|
|
9ae3a8 |
@@ -49,63 +49,63 @@ echo
|
|
|
9ae3a8 |
echo "== creating backing file for COW tests =="
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_make_test_img $size
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x55 0 1M" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.base
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x55 0 1M" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.base"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.base 6G
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.base" 6G
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== zero write with backing file =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -z 64k 192k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -z 513k 13k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -z 64k 192k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -z 513k 13k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verifying patterns (3) =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x55 0 64k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x0 64k 192k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x55 256k 257k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x0 513k 13k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x55 526k 498k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x55 0 64k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x0 64k 192k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x55 256k 257k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x0 513k 13k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x55 526k 498k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== overwriting zero cluster =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0xa 60k 8k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0xb 64k 8k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0xc 76k 4k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0xd 252k 8k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0xe 248k 8k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0xa 60k 8k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0xb 64k 8k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0xc 76k 4k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0xd 252k 8k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0xe 248k 8k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verifying patterns (4) =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x55 0 60k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0xa 60k 4k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0xb 64k 8k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x0 72k 4k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0xc 76k 4k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x0 80k 168k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0xe 248k 8k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0xd 256k 4k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x55 260k 64k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x55 0 60k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0xa 60k 4k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0xb 64k 8k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x0 72k 4k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0xc 76k 4k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x0 80k 168k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0xe 248k 8k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0xd 256k 4k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x55 260k 64k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== re-zeroing overwritten area =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -z 64k 192k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -z 64k 192k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== verifying patterns (5) =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x55 0 60k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0xa 60k 4k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x0 64k 192k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0xd 256k 4k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x55 260k 253k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x0 513k 13k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x55 526k 498k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x55 0 60k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0xa 60k 4k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x0 64k 192k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0xd 256k 4k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x55 260k 253k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x0 513k 13k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x55 526k 498k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/035 b/tests/qemu-iotests/035
|
|
|
9ae3a8 |
index 9d2d347..ebe9b8c 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/035
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/035
|
|
|
9ae3a8 |
@@ -59,7 +59,7 @@ function generate_requests() {
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-generate_requests | $QEMU_IO $TEST_IMG | _filter_qemu_io |\
|
|
|
9ae3a8 |
+generate_requests | $QEMU_IO "$TEST_IMG" | _filter_qemu_io |\
|
|
|
9ae3a8 |
sed -e 's/bytes at offset [0-9]*/bytes at offset XXX/g'
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/036 b/tests/qemu-iotests/036
|
|
|
9ae3a8 |
index 4dbfc57..e049a64 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/036
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/036
|
|
|
9ae3a8 |
@@ -53,15 +53,15 @@ IMGOPTS="compat=1.1"
|
|
|
9ae3a8 |
echo === Create image with unknown autoclear feature bit ===
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
_make_test_img 64M
|
|
|
9ae3a8 |
-./qcow2.py $TEST_IMG set-feature-bit autoclear 63
|
|
|
9ae3a8 |
-./qcow2.py $TEST_IMG dump-header
|
|
|
9ae3a8 |
+./qcow2.py "$TEST_IMG" set-feature-bit autoclear 63
|
|
|
9ae3a8 |
+./qcow2.py "$TEST_IMG" dump-header
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo === Repair image ===
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
_check_test_img -r all
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-./qcow2.py $TEST_IMG dump-header
|
|
|
9ae3a8 |
+./qcow2.py "$TEST_IMG" dump-header
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/037 b/tests/qemu-iotests/037
|
|
|
9ae3a8 |
index c11460b..743bae3 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/037
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/037
|
|
|
9ae3a8 |
@@ -66,50 +66,50 @@ function backing_io()
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-backing_io 0 256 write | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io 0 256 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.base
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.base"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.base 6G
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.base" 6G
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== COW in a single cluster =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x77 0 2k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x88 6k 2k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x99 9k 2k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x77 0 2k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x88 6k 2k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x99 9k 2k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x77 0 2k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-backing_io $((2 * 1024)) 8 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x88 6k 2k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-backing_io $((8 * 1024)) 2 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x99 9k 2k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-backing_io $((11 * 1024)) 2 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x77 0 2k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io $((2 * 1024)) 8 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x88 6k 2k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io $((8 * 1024)) 2 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x99 9k 2k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io $((11 * 1024)) 2 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== COW in two-cluster allocations =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x77 16k 6k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x88 26k 6k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x99 33k 5k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x77 16k 6k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x88 26k 6k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x99 33k 5k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x77 16k 6k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-backing_io $((22 * 1024)) 8 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x88 26k 6k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-backing_io $((32 * 1024)) 2 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x99 33k 5k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-backing_io $((38 * 1024)) 4 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x77 16k 6k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io $((22 * 1024)) 8 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x88 26k 6k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io $((32 * 1024)) 2 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x99 33k 5k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io $((38 * 1024)) 4 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== COW in multi-cluster allocations =="
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x77 48k 15k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x88 66k 14k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x99 83k 15k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x77 48k 15k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-backing_io $((63 * 1024)) 6 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x88 66k 14k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-backing_io $((80 * 1024)) 6 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x99 83k 15k" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-backing_io $((98 * 1024)) 4 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x77 48k 15k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x88 66k 14k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x99 83k 15k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x77 48k 15k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io $((63 * 1024)) 6 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x88 66k 14k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io $((80 * 1024)) 6 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x99 83k 15k" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io $((98 * 1024)) 4 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/038 b/tests/qemu-iotests/038
|
|
|
9ae3a8 |
index 90de1a7..7bb7906 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/038
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/038
|
|
|
9ae3a8 |
@@ -66,11 +66,11 @@ function backing_io()
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-backing_io 0 256 write | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io 0 256 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.base
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.base"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.base 6G
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.base" 6G
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Some concurrent requests touching the same cluster =="
|
|
|
9ae3a8 |
@@ -94,7 +94,7 @@ function overlay_io()
|
|
|
9ae3a8 |
echo aio_write -P 0x90 4080k 80k
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-overlay_io | $QEMU_IO $TEST_IMG | _filter_qemu_io |\
|
|
|
9ae3a8 |
+overlay_io | $QEMU_IO "$TEST_IMG" | _filter_qemu_io |\
|
|
|
9ae3a8 |
sed -e 's/bytes at offset [0-9]*/bytes at offset XXX/g' \
|
|
|
9ae3a8 |
-e 's/qemu-io> //g' | paste - - | sort | tr '\t' '\n'
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -124,7 +124,7 @@ function verify_io()
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-verify_io | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+verify_io | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
|
|
|
9ae3a8 |
index ae35175..f85b4ce 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/039
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/039
|
|
|
9ae3a8 |
@@ -54,10 +54,10 @@ echo "== Checking that image is clean on shutdown =="
|
|
|
9ae3a8 |
IMGOPTS="compat=1.1,lazy_refcounts=on"
|
|
|
9ae3a8 |
_make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x5a 0 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x5a 0 512" ""$TEST_IMG"" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# The dirty bit must not be set
|
|
|
9ae3a8 |
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
|
|
|
9ae3a8 |
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
@@ -68,20 +68,20 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
old_ulimit=$(ulimit -c)
|
|
|
9ae3a8 |
ulimit -c 0 # do not produce a core dump on abort(3)
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
ulimit -c "$old_ulimit"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# The dirty bit must be set
|
|
|
9ae3a8 |
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
|
|
|
9ae3a8 |
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Read-only access must still work =="
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IO -r -c "read -P 0x5a 0 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -r -c "read -P 0x5a 0 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# The dirty bit must be set
|
|
|
9ae3a8 |
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
|
|
|
9ae3a8 |
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Repairing the image file must succeed =="
|
|
|
9ae3a8 |
@@ -89,12 +89,12 @@ echo "== Repairing the image file must succeed =="
|
|
|
9ae3a8 |
_check_test_img -r all
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# The dirty bit must not be set
|
|
|
9ae3a8 |
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
|
|
|
9ae3a8 |
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Data should still be accessible after repair =="
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x5a 0 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x5a 0 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Opening a dirty image read/write should repair it =="
|
|
|
9ae3a8 |
@@ -104,16 +104,16 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
old_ulimit=$(ulimit -c)
|
|
|
9ae3a8 |
ulimit -c 0 # do not produce a core dump on abort(3)
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
ulimit -c "$old_ulimit"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# The dirty bit must be set
|
|
|
9ae3a8 |
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
|
|
|
9ae3a8 |
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IO -c "write 0 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write 0 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# The dirty bit must not be set
|
|
|
9ae3a8 |
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
|
|
|
9ae3a8 |
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Creating an image file with lazy_refcounts=off =="
|
|
|
9ae3a8 |
@@ -123,11 +123,11 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
old_ulimit=$(ulimit -c)
|
|
|
9ae3a8 |
ulimit -c 0 # do not produce a core dump on abort(3)
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
ulimit -c "$old_ulimit"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# The dirty bit must not be set since lazy_refcounts=off
|
|
|
9ae3a8 |
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
|
|
|
9ae3a8 |
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/042 b/tests/qemu-iotests/042
|
|
|
9ae3a8 |
index 16b2fdb..94ce3a9 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/042
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/042
|
|
|
9ae3a8 |
@@ -48,27 +48,27 @@ echo "== Creating zero size image =="
|
|
|
9ae3a8 |
_make_test_img 0
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.orig
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.orig"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Converting the image =="
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IMG convert -O $IMGFMT $TEST_IMG.orig $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IMG convert -O $IMGFMT "$TEST_IMG.orig" "$TEST_IMG"
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Converting the image, compressed =="
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if [ "$IMGFMT" == "qcow2" ]; then
|
|
|
9ae3a8 |
- $QEMU_IMG convert -c -O $IMGFMT $TEST_IMG.orig $TEST_IMG
|
|
|
9ae3a8 |
+ $QEMU_IMG convert -c -O $IMGFMT "$TEST_IMG.orig" "$TEST_IMG"
|
|
|
9ae3a8 |
fi
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Rebasing the image =="
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IMG rebase -u -b $TEST_IMG.orig $TEST_IMG
|
|
|
9ae3a8 |
-$QEMU_IMG rebase -b $TEST_IMG.orig $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IMG rebase -u -b "$TEST_IMG.orig" "$TEST_IMG"
|
|
|
9ae3a8 |
+$QEMU_IMG rebase -b "$TEST_IMG.orig" "$TEST_IMG"
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/043 b/tests/qemu-iotests/043
|
|
|
9ae3a8 |
index 478773d..d7f1231 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/043
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/043
|
|
|
9ae3a8 |
@@ -31,7 +31,7 @@ status=1 # failure is the default!
|
|
|
9ae3a8 |
_cleanup()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
_cleanup_test_img
|
|
|
9ae3a8 |
- rm -f $TEST_IMG.[123].base
|
|
|
9ae3a8 |
+ rm -f "$TEST_IMG".[123].base
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -47,39 +47,39 @@ _supported_os Linux
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
size=128M
|
|
|
9ae3a8 |
_make_test_img $size
|
|
|
9ae3a8 |
-$QEMU_IMG rebase -u -b $TEST_IMG $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IMG rebase -u -b "$TEST_IMG" "$TEST_IMG"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== backing file references self =="
|
|
|
9ae3a8 |
_img_info --backing-chain
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_make_test_img $size
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.base
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.base $size
|
|
|
9ae3a8 |
-$QEMU_IMG rebase -u -b $TEST_IMG $TEST_IMG.base
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.base"
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.base" $size
|
|
|
9ae3a8 |
+$QEMU_IMG rebase -u -b "$TEST_IMG" "$TEST_IMG.base"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== parent references self =="
|
|
|
9ae3a8 |
_img_info --backing-chain
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_make_test_img $size
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.1.base
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.1.base $size
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.2.base
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.2.base $size
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.3.base
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.3.base $size
|
|
|
9ae3a8 |
-$QEMU_IMG rebase -u -b $TEST_IMG.2.base $TEST_IMG.1.base
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.1.base"
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.1.base" $size
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.2.base"
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.2.base" $size
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.3.base"
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.3.base" $size
|
|
|
9ae3a8 |
+$QEMU_IMG rebase -u -b "$TEST_IMG.2.base" "$TEST_IMG.1.base"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== ancestor references another ancestor =="
|
|
|
9ae3a8 |
_img_info --backing-chain
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_make_test_img $size
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.1.base
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.1.base $size
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.2.base
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.2.base $size
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.1.base"
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.1.base" $size
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.2.base"
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.2.base" $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== finite chain of length 3 (human) =="
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotests/046
|
|
|
9ae3a8 |
index 987bfff..3f17ceb 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/046
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/046
|
|
|
9ae3a8 |
@@ -66,11 +66,11 @@ function backing_io()
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-backing_io 0 32 write | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+backing_io 0 32 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.base
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.base"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.base 6G
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.base" 6G
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Some concurrent requests touching the same cluster =="
|
|
|
9ae3a8 |
@@ -185,7 +185,7 @@ aio_flush
|
|
|
9ae3a8 |
EOF
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-overlay_io | $QEMU_IO blkdebug::$TEST_IMG | _filter_qemu_io |\
|
|
|
9ae3a8 |
+overlay_io | $QEMU_IO blkdebug::"$TEST_IMG" | _filter_qemu_io |\
|
|
|
9ae3a8 |
sed -e 's/bytes at offset [0-9]*/bytes at offset XXX/g'
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
@@ -252,7 +252,7 @@ function verify_io()
|
|
|
9ae3a8 |
echo read -P 17 0x11c000 0x4000
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-verify_io | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+verify_io | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/047 b/tests/qemu-iotests/047
|
|
|
9ae3a8 |
index 0cf36b4..c35cd09 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/047
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/047
|
|
|
9ae3a8 |
@@ -66,7 +66,7 @@ read -P 0x55 1M 128k
|
|
|
9ae3a8 |
EOF
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-qemu_io_cmds | $QEMU_IO $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+qemu_io_cmds | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/048 b/tests/qemu-iotests/048
|
|
|
9ae3a8 |
index 7cce049..9b9d118 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/048
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/048
|
|
|
9ae3a8 |
@@ -31,13 +31,13 @@ _cleanup()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
echo "Cleanup"
|
|
|
9ae3a8 |
_cleanup_test_img
|
|
|
9ae3a8 |
- rm ${TEST_IMG2}
|
|
|
9ae3a8 |
+ rm "${TEST_IMG2}"
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_compare()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- $QEMU_IMG compare "$@" $TEST_IMG ${TEST_IMG2}
|
|
|
9ae3a8 |
+ $QEMU_IMG compare "$@" "$TEST_IMG" "${TEST_IMG2}"
|
|
|
9ae3a8 |
echo $?
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -59,12 +59,12 @@ _make_test_img $size
|
|
|
9ae3a8 |
io_pattern write 524288 $CLUSTER_SIZE $CLUSTER_SIZE 4 45
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# Compare identical images
|
|
|
9ae3a8 |
-cp $TEST_IMG ${TEST_IMG2}
|
|
|
9ae3a8 |
+cp "$TEST_IMG" "${TEST_IMG2}"
|
|
|
9ae3a8 |
_compare
|
|
|
9ae3a8 |
_compare -q
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# Compare images with different size
|
|
|
9ae3a8 |
-$QEMU_IMG resize $TEST_IMG +512M
|
|
|
9ae3a8 |
+$QEMU_IMG resize "$TEST_IMG" +512M
|
|
|
9ae3a8 |
_compare
|
|
|
9ae3a8 |
_compare -s
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/049 b/tests/qemu-iotests/049
|
|
|
9ae3a8 |
index 6c6017e..93aa0ea 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/049
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/049
|
|
|
9ae3a8 |
@@ -63,13 +63,13 @@ sizes+="1024.0 1024.0b 1.5k 1.5K 1.5M 1.5G 1.5T"
|
|
|
9ae3a8 |
echo "== 1. Traditional size parameter =="
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
for s in $sizes; do
|
|
|
9ae3a8 |
- test_qemu_img create -f $IMGFMT $TEST_IMG $s
|
|
|
9ae3a8 |
+ test_qemu_img create -f $IMGFMT "$TEST_IMG" $s
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== 2. Specifying size via -o =="
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
for s in $sizes; do
|
|
|
9ae3a8 |
- test_qemu_img create -f $IMGFMT -o size=$s $TEST_IMG
|
|
|
9ae3a8 |
+ test_qemu_img create -f $IMGFMT -o size=$s "$TEST_IMG"
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== 3. Invalid sizes =="
|
|
|
9ae3a8 |
@@ -77,8 +77,8 @@ echo
|
|
|
9ae3a8 |
sizes="-1024 -1k 1kilobyte foobar"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
for s in $sizes; do
|
|
|
9ae3a8 |
- test_qemu_img create -f $IMGFMT $TEST_IMG -- $s
|
|
|
9ae3a8 |
- test_qemu_img create -f $IMGFMT -o size=$s $TEST_IMG
|
|
|
9ae3a8 |
+ test_qemu_img create -f $IMGFMT "$TEST_IMG" -- $s
|
|
|
9ae3a8 |
+ test_qemu_img create -f $IMGFMT -o size=$s "$TEST_IMG"
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== Check correct interpretation of suffixes for cluster size =="
|
|
|
9ae3a8 |
@@ -87,35 +87,35 @@ sizes="1024 1024b 1k 1K 1M "
|
|
|
9ae3a8 |
sizes+="1024.0 1024.0b 0.5k 0.5K 0.5M"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
for s in $sizes; do
|
|
|
9ae3a8 |
- test_qemu_img create -f $IMGFMT -o cluster_size=$s $TEST_IMG 64M
|
|
|
9ae3a8 |
+ test_qemu_img create -f $IMGFMT -o cluster_size=$s "$TEST_IMG" 64M
|
|
|
9ae3a8 |
done
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== Check compat level option =="
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o compat=0.10 $TEST_IMG 64M
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o compat=1.1 $TEST_IMG 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o compat=0.10 "$TEST_IMG" 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o compat=1.1 "$TEST_IMG" 64M
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o compat=0.42 $TEST_IMG 64M
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o compat=foobar $TEST_IMG 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o compat=0.42 "$TEST_IMG" 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o compat=foobar "$TEST_IMG" 64M
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== Check preallocation option =="
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o preallocation=off $TEST_IMG 64M
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o preallocation=metadata $TEST_IMG 64M
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o preallocation=1234 $TEST_IMG 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o preallocation=off "$TEST_IMG" 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o preallocation=metadata "$TEST_IMG" 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o preallocation=1234 "$TEST_IMG" 64M
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== Check encryption option =="
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o encryption=off $TEST_IMG 64M
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o encryption=on $TEST_IMG 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o encryption=off "$TEST_IMG" 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o encryption=on "$TEST_IMG" 64M
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== Check lazy_refcounts option (only with v3) =="
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o compat=1.1,lazy_refcounts=off $TEST_IMG 64M
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o compat=1.1,lazy_refcounts=on $TEST_IMG 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o compat=1.1,lazy_refcounts=off "$TEST_IMG" 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o compat=1.1,lazy_refcounts=on "$TEST_IMG" 64M
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o compat=0.10,lazy_refcounts=off $TEST_IMG 64M
|
|
|
9ae3a8 |
-test_qemu_img create -f $IMGFMT -o compat=0.10,lazy_refcounts=on $TEST_IMG 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o compat=0.10,lazy_refcounts=off "$TEST_IMG" 64M
|
|
|
9ae3a8 |
+test_qemu_img create -f $IMGFMT -o compat=0.10,lazy_refcounts=on "$TEST_IMG" 64M
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/050 b/tests/qemu-iotests/050
|
|
|
9ae3a8 |
index 05793e2..07802bc 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/050
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/050
|
|
|
9ae3a8 |
@@ -31,8 +31,8 @@ status=1 # failure is the default!
|
|
|
9ae3a8 |
_cleanup()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
_cleanup_test_img
|
|
|
9ae3a8 |
- rm -f $TEST_IMG.old
|
|
|
9ae3a8 |
- rm -f $TEST_IMG.new
|
|
|
9ae3a8 |
+ rm -f "$TEST_IMG.old"
|
|
|
9ae3a8 |
+ rm -f "$TEST_IMG.new"
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -53,21 +53,21 @@ echo "== Creating images =="
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
size=10M
|
|
|
9ae3a8 |
_make_test_img $size
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x40 0 1048576" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.old
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x40 0 1048576" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.old"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_make_test_img $size
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P 0x5a 0 1048576" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.new
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P 0x5a 0 1048576" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.new"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-_make_test_img -b $TEST_IMG.old $size
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -z 0 1048576" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+_make_test_img -b "$TEST_IMG.old" $size
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -z 0 1048576" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Rebasing the image =="
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IMG rebase -b $TEST_IMG.new $TEST_IMG
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0x00 0 1048576" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IMG rebase -b "$TEST_IMG.new" "$TEST_IMG"
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0x00 0 1048576" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
|
|
|
9ae3a8 |
index 93a2797..b8775b6 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/051
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/051
|
|
|
9ae3a8 |
@@ -62,21 +62,21 @@ echo
|
|
|
9ae3a8 |
echo === Unknown option ===
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,format=qcow2,unknown_opt=
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,format=qcow2,unknown_opt=on
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,format=qcow2,unknown_opt=1234
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,format=qcow2,unknown_opt=foo
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",format=qcow2,unknown_opt=
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",format=qcow2,unknown_opt=on
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",format=qcow2,unknown_opt=1234
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",format=qcow2,unknown_opt=foo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo === Enable and disable lazy refcounting on the command line, plus some invalid values ===
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=on
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=off
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=42
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=foo
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=on
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=off
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=42
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=foo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
@@ -85,8 +85,8 @@ echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_make_test_img -ocompat=0.10 $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=on
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=off
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=on
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=off
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo === No medium ===
|
|
|
9ae3a8 |
@@ -112,21 +112,21 @@ echo
|
|
|
9ae3a8 |
echo === Read-only ===
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,if=floppy,readonly=on
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,if=ide,media=cdrom,readonly=on
|
|
|
9ae3a8 |
-#run_qemu -drive file=$TEST_IMG,if=scsi,media=cdrom,readonly=on
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",if=floppy,readonly=on
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",if=ide,media=cdrom,readonly=on
|
|
|
9ae3a8 |
+#run_qemu -drive file="$TEST_IMG",if=scsi,media=cdrom,readonly=on
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,if=ide,readonly=on
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,if=virtio,readonly=on
|
|
|
9ae3a8 |
-#run_qemu -drive file=$TEST_IMG,if=scsi,readonly=on
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",if=ide,readonly=on
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",if=virtio,readonly=on
|
|
|
9ae3a8 |
+#run_qemu -drive file="$TEST_IMG",if=scsi,readonly=on
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device ide-cd,drive=disk
|
|
|
9ae3a8 |
-#run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk
|
|
|
9ae3a8 |
+#run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device ide-drive,drive=disk
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device ide-hd,drive=disk
|
|
|
9ae3a8 |
-#run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
|
|
|
9ae3a8 |
-#run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-drive,drive=disk
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk
|
|
|
9ae3a8 |
+#run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
|
|
|
9ae3a8 |
+#run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo === Cache modes ===
|
|
|
9ae3a8 |
@@ -146,8 +146,8 @@ echo
|
|
|
9ae3a8 |
echo === Specifying the protocol layer ===
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,file.driver=file
|
|
|
9ae3a8 |
-run_qemu -drive file=$TEST_IMG,file.driver=qcow2
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",file.driver=file
|
|
|
9ae3a8 |
+run_qemu -drive file="$TEST_IMG",file.driver=qcow2
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo === Parsing protocol from file name ===
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/052 b/tests/qemu-iotests/052
|
|
|
9ae3a8 |
index 14a5126..f955b69 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/052
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/052
|
|
|
9ae3a8 |
@@ -48,12 +48,12 @@ _make_test_img $size
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== reading whole image =="
|
|
|
9ae3a8 |
-$QEMU_IO -s -c "read 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -s -c "read 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== writing whole image does not modify image =="
|
|
|
9ae3a8 |
-$QEMU_IO -s -c "write -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P 0 0 $size" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -s -c "write -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P 0 0 $size" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/053 b/tests/qemu-iotests/053
|
|
|
9ae3a8 |
index bc56992..e589e5f 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/053
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/053
|
|
|
9ae3a8 |
@@ -30,7 +30,7 @@ status=1 # failure is the default!
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_cleanup()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- rm -f $TEST_IMG.orig
|
|
|
9ae3a8 |
+ rm -f "$TEST_IMG.orig"
|
|
|
9ae3a8 |
_cleanup_test_img
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
9ae3a8 |
@@ -47,13 +47,13 @@ echo
|
|
|
9ae3a8 |
echo "== Creating single sector image =="
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_make_test_img 512
|
|
|
9ae3a8 |
-$QEMU_IO -c "write -P0xa 0 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.orig
|
|
|
9ae3a8 |
+$QEMU_IO -c "write -P0xa 0 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.orig"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Converting the image, compressed =="
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IMG convert -c -O $IMGFMT $TEST_IMG.orig $TEST_IMG
|
|
|
9ae3a8 |
+$QEMU_IMG convert -c -O $IMGFMT "$TEST_IMG.orig" "$TEST_IMG"
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
@@ -64,7 +64,7 @@ _img_info | grep '^virtual size:'
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "== Verifying the compressed image =="
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-$QEMU_IO -c "read -P0xa 0 512" $TEST_IMG | _filter_qemu_io
|
|
|
9ae3a8 |
+$QEMU_IO -c "read -P0xa 0 512" "$TEST_IMG" | _filter_qemu_io
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/054 b/tests/qemu-iotests/054
|
|
|
9ae3a8 |
index b360429..5a0d1b1 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/054
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/054
|
|
|
9ae3a8 |
@@ -49,7 +49,7 @@ _make_test_img $((1024*1024))T
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
echo "creating too large image (1 EB) using qcow2.py"
|
|
|
9ae3a8 |
_make_test_img 4G
|
|
|
9ae3a8 |
-./qcow2.py $TEST_IMG set-header size $((1024 ** 6))
|
|
|
9ae3a8 |
+./qcow2.py "$TEST_IMG" set-header size $((1024 ** 6))
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
# success, all done
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
|
|
|
9ae3a8 |
index d2b3f9e..dd6addf 100755
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/059
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/059
|
|
|
9ae3a8 |
@@ -51,20 +51,20 @@ echo "=== Testing invalid granularity ==="
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
_make_test_img 64M
|
|
|
9ae3a8 |
poke_file "$TEST_IMG" "$granularity_offset" "\xff\xff\xff\xff\xff\xff\xff\xff"
|
|
|
9ae3a8 |
-{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
|
|
|
9ae3a8 |
+{ $QEMU_IO -c "read 0 512" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "=== Testing too big L2 table size ==="
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
_make_test_img 64M
|
|
|
9ae3a8 |
poke_file "$TEST_IMG" "$grain_table_size_offset" "\xff\xff\xff\xff"
|
|
|
9ae3a8 |
-{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
|
|
|
9ae3a8 |
+{ $QEMU_IO -c "read 0 512" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "=== Testing too big L1 table size ==="
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
_make_test_img 64M
|
|
|
9ae3a8 |
poke_file "$TEST_IMG" "$capacity_offset" "\xff\xff\xff\xff"
|
|
|
9ae3a8 |
poke_file "$TEST_IMG" "$grain_table_size_offset" "\x01\x00\x00\x00"
|
|
|
9ae3a8 |
-{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
|
|
|
9ae3a8 |
+{ $QEMU_IO -c "read 0 512" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "=== Testing monolithicFlat creation and opening ==="
|
|
|
9ae3a8 |
echo
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/063 b/tests/qemu-iotests/063
|
|
|
9ae3a8 |
index de0cbbd..2ab8f20 100644
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/063
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/063
|
|
|
9ae3a8 |
@@ -32,7 +32,7 @@ status=1 # failure is the default!
|
|
|
9ae3a8 |
_cleanup()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
_cleanup_test_img
|
|
|
9ae3a8 |
- rm -f $TEST_IMG.orig $TEST_IMG.raw $TEST_IMG.raw2
|
|
|
9ae3a8 |
+ rm -f "$TEST_IMG.orig" "$TEST_IMG.raw" "$TEST_IMG.raw2"
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -49,47 +49,47 @@ _make_test_img 4M
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== Testing conversion with -n fails with no target file =="
|
|
|
9ae3a8 |
# check .orig file does not exist
|
|
|
9ae3a8 |
-rm -f $TEST_IMG.orig
|
|
|
9ae3a8 |
-if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n $TEST_IMG $TEST_IMG.orig >/dev/null 2>&1; then
|
|
|
9ae3a8 |
+rm -f "$TEST_IMG.orig"
|
|
|
9ae3a8 |
+if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG.orig" >/dev/null 2>&1; then
|
|
|
9ae3a8 |
exit 1
|
|
|
9ae3a8 |
fi
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== Testing conversion with -n succeeds with a target file =="
|
|
|
9ae3a8 |
-rm -f $TEST_IMG.orig
|
|
|
9ae3a8 |
-cp $TEST_IMG $TEST_IMG.orig
|
|
|
9ae3a8 |
-if ! $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n $TEST_IMG $TEST_IMG.orig ; then
|
|
|
9ae3a8 |
+rm -f "$TEST_IMG.orig"
|
|
|
9ae3a8 |
+cp "$TEST_IMG" "$TEST_IMG.orig"
|
|
|
9ae3a8 |
+if ! $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG.orig" ; then
|
|
|
9ae3a8 |
exit 1
|
|
|
9ae3a8 |
fi
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== Testing conversion to raw is the same after conversion with -n =="
|
|
|
9ae3a8 |
# compare the raw files
|
|
|
9ae3a8 |
-if ! $QEMU_IMG convert -f $IMGFMT -O raw $TEST_IMG $TEST_IMG.raw1 ; then
|
|
|
9ae3a8 |
+if ! $QEMU_IMG convert -f $IMGFMT -O raw "$TEST_IMG" "$TEST_IMG.raw1" ; then
|
|
|
9ae3a8 |
exit 1
|
|
|
9ae3a8 |
fi
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-if ! $QEMU_IMG convert -f $IMGFMT -O raw $TEST_IMG.orig $TEST_IMG.raw2 ; then
|
|
|
9ae3a8 |
+if ! $QEMU_IMG convert -f $IMGFMT -O raw "$TEST_IMG.orig" "$TEST_IMG.raw2" ; then
|
|
|
9ae3a8 |
exit 1
|
|
|
9ae3a8 |
fi
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-if ! cmp $TEST_IMG.raw1 $TEST_IMG.raw2 ; then
|
|
|
9ae3a8 |
+if ! cmp "$TEST_IMG.raw1" "$TEST_IMG.raw2" ; then
|
|
|
9ae3a8 |
exit 1
|
|
|
9ae3a8 |
fi
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== Testing conversion back to original format =="
|
|
|
9ae3a8 |
-if ! $QEMU_IMG convert -f raw -O $IMGFMT -n $TEST_IMG.raw2 $TEST_IMG ; then
|
|
|
9ae3a8 |
+if ! $QEMU_IMG convert -f raw -O $IMGFMT -n "$TEST_IMG.raw2" "$TEST_IMG" ; then
|
|
|
9ae3a8 |
exit 1
|
|
|
9ae3a8 |
fi
|
|
|
9ae3a8 |
_check_test_img
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "== Testing conversion to a smaller file fails =="
|
|
|
9ae3a8 |
-rm -f $TEST_IMG.orig
|
|
|
9ae3a8 |
-mv $TEST_IMG $TEST_IMG.orig
|
|
|
9ae3a8 |
+rm -f "$TEST_IMG.orig"
|
|
|
9ae3a8 |
+mv "$TEST_IMG" "$TEST_IMG.orig"
|
|
|
9ae3a8 |
_make_test_img 2M
|
|
|
9ae3a8 |
-if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n $TEST_IMG.orig $TEST_IMG >/dev/null 2>&1; then
|
|
|
9ae3a8 |
+if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG.orig" "$TEST_IMG" >/dev/null 2>&1; then
|
|
|
9ae3a8 |
exit 1
|
|
|
9ae3a8 |
fi
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-rm -f $TEST_IMG.orig $TEST_IMG.raw $TEST_IMG.raw2
|
|
|
9ae3a8 |
+rm -f "$TEST_IMG.orig" "$TEST_IMG.raw" "$TEST_IMG.raw2"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
echo "*** done"
|
|
|
9ae3a8 |
rm -f $seq.full
|
|
|
9ae3a8 |
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
|
|
|
9ae3a8 |
index 6730955..1b22db0 100644
|
|
|
9ae3a8 |
--- a/tests/qemu-iotests/common.rc
|
|
|
9ae3a8 |
+++ b/tests/qemu-iotests/common.rc
|
|
|
9ae3a8 |
@@ -164,12 +164,12 @@ _cleanup_test_img()
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
nbd)
|
|
|
9ae3a8 |
kill $QEMU_NBD_PID
|
|
|
9ae3a8 |
- rm -f $TEST_IMG_FILE
|
|
|
9ae3a8 |
+ rm -f "$TEST_IMG_FILE"
|
|
|
9ae3a8 |
;;
|
|
|
9ae3a8 |
file)
|
|
|
9ae3a8 |
- rm -f $TEST_DIR/t.$IMGFMT
|
|
|
9ae3a8 |
- rm -f $TEST_DIR/t.$IMGFMT.orig
|
|
|
9ae3a8 |
- rm -f $TEST_DIR/t.$IMGFMT.base
|
|
|
9ae3a8 |
+ rm -f "$TEST_DIR/t.$IMGFMT"
|
|
|
9ae3a8 |
+ rm -f "$TEST_DIR/t.$IMGFMT.orig"
|
|
|
9ae3a8 |
+ rm -f "$TEST_DIR/t.$IMGFMT.base"
|
|
|
9ae3a8 |
if [ -n "$SAMPLE_IMG_FILE" ]
|
|
|
9ae3a8 |
then
|
|
|
9ae3a8 |
rm -f "$TEST_DIR/$SAMPLE_IMG_FILE"
|
|
|
9ae3a8 |
@@ -177,11 +177,11 @@ _cleanup_test_img()
|
|
|
9ae3a8 |
;;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
rbd)
|
|
|
9ae3a8 |
- rbd rm $TEST_DIR/t.$IMGFMT > /dev/null
|
|
|
9ae3a8 |
+ rbd rm "$TEST_DIR/t.$IMGFMT" > /dev/null
|
|
|
9ae3a8 |
;;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
sheepdog)
|
|
|
9ae3a8 |
- collie vdi delete $TEST_DIR/t.$IMGFMT
|
|
|
9ae3a8 |
+ collie vdi delete "$TEST_DIR/t.$IMGFMT"
|
|
|
9ae3a8 |
;;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
esac
|
|
|
9ae3a8 |
@@ -189,7 +189,7 @@ _cleanup_test_img()
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_check_test_img()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- $QEMU_IMG check "$@" -f $IMGFMT $TEST_IMG 2>&1 | _filter_testdir | \
|
|
|
9ae3a8 |
+ $QEMU_IMG check "$@" -f $IMGFMT "$TEST_IMG" 2>&1 | _filter_testdir | \
|
|
|
9ae3a8 |
sed -e '/allocated.*fragmented.*compressed clusters/d' \
|
|
|
9ae3a8 |
-e 's/qemu-img: This image format does not support checks/No errors were found on the image./' \
|
|
|
9ae3a8 |
-e '/Image end offset: [0-9]\+/d'
|
|
|
9ae3a8 |
@@ -197,7 +197,7 @@ _check_test_img()
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
_img_info()
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- $QEMU_IMG info "$@" $TEST_IMG 2>&1 | \
|
|
|
9ae3a8 |
+ $QEMU_IMG info "$@" "$TEST_IMG" 2>&1 | \
|
|
|
9ae3a8 |
sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
|
|
|
9ae3a8 |
-e "s#$TEST_DIR#TEST_DIR#g" \
|
|
|
9ae3a8 |
-e "s#$IMGFMT#IMGFMT#g" \
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|