[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/30] qemu-iotests: add test for backing file overri
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 02/30] qemu-iotests: add test for backing file overriding |
Date: |
Fri, 27 Sep 2013 17:39:02 +0200 |
From: Fam Zheng <address@hidden>
Test that backing.file.filename option can be parsed and override the
backing file from image (backing file reflected with "info block").
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/051 | 17 ++++++++++++++++-
tests/qemu-iotests/051.out | 11 +++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 1f39c6a..78e1182 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -45,7 +45,14 @@ _supported_os Linux
function do_run_qemu()
{
echo Testing: "$@"
- echo quit | $QEMU -nographic -monitor stdio -serial none "$@"
+ (
+ if ! test -t 0; then
+ while read cmd; do
+ echo $cmd
+ done
+ fi
+ echo quit
+ ) | $QEMU -nographic -monitor stdio -serial none "$@"
echo
}
@@ -57,6 +64,9 @@ function run_qemu()
size=128M
_make_test_img $size
+cp $TEST_IMG $TEST_IMG.orig
+mv $TEST_IMG $TEST_IMG.base
+_make_test_img -b $TEST_IMG.base $size
echo
echo === Unknown option ===
@@ -67,6 +77,11 @@ run_qemu -drive file=$TEST_IMG,format=qcow2,unknown_opt=on
run_qemu -drive file=$TEST_IMG,format=qcow2,unknown_opt=1234
run_qemu -drive file=$TEST_IMG,format=qcow2,unknown_opt=foo
+echo
+echo === Overriding backing file ===
+echo
+
+echo "info block" | run_qemu -drive
file=$TEST_IMG,driver=qcow2,backing.file.filename=$TEST_IMG.orig -nodefaults
echo
echo === Enable and disable lazy refcounting on the command line, plus some
invalid values ===
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 88e8fa7..04bb236 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -1,5 +1,6 @@
QA output created by 051
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
backing_file='TEST_DIR/t.IMGFMT.base'
=== Unknown option ===
@@ -16,6 +17,16 @@ Testing: -drive
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: could
not open disk image TEST_DIR/t.qcow2: Block format 'qcow2' used by device
'ide0-hd0' doesn't support the option 'unknown_opt'
+=== Overriding backing file ===
+
+Testing: -drive
file=TEST_DIR/t.qcow2,driver=qcow2,backing.file.filename=TEST_DIR/t.qcow2.orig
-nodefaults
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) i[K[Din[K[D[Dinf[K[D[D[Dinfo[K[D[D[D[Dinfo
[K[D[D[D[D[Dinfo b[K[D[D[D[D[D[Dinfo
bl[K[D[D[D[D[D[D[Dinfo blo[K[D[D[D[D[D[D[D[Dinfo
bloc[K[D[D[D[D[D[D[D[D[Dinfo block[K
+ide0-hd0: TEST_DIR/t.qcow2 (qcow2)
+ Backing file: TEST_DIR/t.qcow2.orig (chain depth: 1)
+ [not inserted](qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
+
+
=== Enable and disable lazy refcounting on the command line, plus some invalid
values ===
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
--
1.8.1.4
- [Qemu-devel] [PULL 00/30] Block patches, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 01/30] block: fix backing file overriding, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 02/30] qemu-iotests: add test for backing file overriding,
Kevin Wolf <=
- [Qemu-devel] [PULL 05/30] block/get_block_status: set *pnum = 0 on error, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 06/30] block/get_block_status: avoid segfault if there is no backing_hd, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 04/30] qcow2: Don't shadow return value, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 03/30] qemu-iotests: Do not execute 052 with -nocache, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 10/30] block: introduce BlockDriver.bdrv_needs_filename to enable some drivers., Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 11/30] block: Fix compiler warning (-Werror=uninitialized), Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 07/30] vmdk: fix cluster size check for flat extents, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 09/30] qemu-iotests: add monolithicFlat creation test to 059, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 08/30] qemu-iotests: fix test case 059, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 17/30] block: qed - use QEMU_PACKED for on-disk structures, Kevin Wolf, 2013/09/27