[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 36/37] block: vhdx qemu-iotest - log replay of dat
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 36/37] block: vhdx qemu-iotest - log replay of data sector |
Date: |
Fri, 8 Nov 2013 11:12:30 +0100 |
From: Jeff Cody <address@hidden>
This tests the replay of a data sector in a VHDX image file.
The image file is a 10G dynamic image, with 4MB block size. The
image was created with qemu-img, and the log left unplayed by
modification of the vhdx image format driver.
It was verified under both QEMU and Hyper-V that the image file,
post log replay, matched.
Signed-off-by: Jeff Cody <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
tests/qemu-iotests/070 | 67 +++++++++++++++++++++
tests/qemu-iotests/070.out | 8 +++
tests/qemu-iotests/group | 1 +
.../sample_images/iotest-dirtylog-10G-4M.vhdx.bz2 | Bin 0 -> 4490 bytes
4 files changed, 76 insertions(+)
create mode 100755 tests/qemu-iotests/070
create mode 100644 tests/qemu-iotests/070.out
create mode 100644
tests/qemu-iotests/sample_images/iotest-dirtylog-10G-4M.vhdx.bz2
diff --git a/tests/qemu-iotests/070 b/tests/qemu-iotests/070
new file mode 100755
index 0000000..41bf100
--- /dev/null
+++ b/tests/qemu-iotests/070
@@ -0,0 +1,67 @@
+#!/bin/bash
+#
+# Test VHDX log replay from an image with a journal that needs to be
+# replayed
+#
+# Copyright (C) 2013 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# creator
address@hidden
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+
+_cleanup()
+{
+ _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_supported_fmt vhdx
+_supported_proto generic
+_supported_os Linux
+
+# With the log replayed, the pattern 0xa5 extends to 0xc025000
+# If the log was not replayed, it would only extend to 0xc000000
+#
+# This image is a 10G dynamic image, with 4M block size, and 1 unplayed
+# data sector in the log
+#
+# This image was created with qemu-img, however it was verified using
+# Hyper-V to properly replay the logs and give the same post-replay
+# image as qemu.
+_use_sample_img iotest-dirtylog-10G-4M.vhdx.bz2
+
+echo
+echo "=== Verify open image read-only fails, due to dirty log ==="
+$QEMU_IO -r -c "read -pP 0xa5 0 18M" "$TEST_IMG" 2>&1 | grep -o "Permission
denied"
+
+echo "=== Verify open image replays log ==="
+$QEMU_IO -c "read -pP 0xa5 0 18M" "$TEST_IMG" | _filter_qemu_io
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/070.out b/tests/qemu-iotests/070.out
new file mode 100644
index 0000000..9db8ff2
--- /dev/null
+++ b/tests/qemu-iotests/070.out
@@ -0,0 +1,8 @@
+QA output created by 070
+
+=== Verify open image read-only fails, due to dirty log ===
+Permission denied
+=== Verify open image replays log ===
+read 18874368/18874368 bytes at offset 0
+18 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index c57ff35..b18b241 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -75,3 +75,4 @@
067 rw auto
068 rw auto
069 rw auto
+070 rw auto
diff --git a/tests/qemu-iotests/sample_images/iotest-dirtylog-10G-4M.vhdx.bz2
b/tests/qemu-iotests/sample_images/iotest-dirtylog-10G-4M.vhdx.bz2
new file mode 100644
index
0000000000000000000000000000000000000000..4b91cfc654b9b8b46ff45918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Br>l%LQDBh-Yho1cCrX^4Op
z(5=0HV0G*(XC*C-9n;mzg&EO$fb3%F5Kdo6D<t%|YKe(pyHCElU)address@hidden
zv5l$lNiMgJfL?Vgpl%{R1fUR1;lZxC%gI6fZm^^jg?f}c;<address@hidden;
z#P6GI^;hw;+jP9Bp_*b0h=G-Xiq`X+u95Sxeny+S&uM)>`;S-Wm{zjuN@<DzDhOI&
zDffAmL9dX-F7lT1+M|O*IwRY~6U9UHwp8cYVQF5QH73(i1wjk#SXk>address@hidden
address@hidden(bVtN^T;#h&Kjmr~RW!lfHiQ)address@hidden
zT_l9#?1?G(cWe4PaAa^c9<^v|C*U|Hd;KqQ1U(6~-W<y1PL)address@hidden
zw0)mmR&2FX=zv_YfiAC}Gy}R64gN#Y=f$fzYu4ekC8FU}ZfMs{(wN>Os*D_1SJM*B
zihwUF&bkv<;0ROMxlAWXB|w+}0H>1{j0sHNo29BN^maob2Q_2wXp?u1`zLYWR%#?u
z5H`LAqrFm?c+XhK=j!x;06TH^@<txkXZVp;address@hidden&{`4HZ;C>
z=Y^;lt-N>c?~1T|HvB1`6y+*;0uB6}CtoL#c~yy1#@(AdewS^}Q2!&address@hidden(
zG(i4|address@hidden>^>N0
z9lW$B>>^&R<@V`{$+67xy4TSXw{gQ#tPmhXK!HXW08~InM-@;NQ#qzVRTM!n8r>UO
zd<vuj1VliH5Cj>&E_7Hf6JqJd2TZme>sPUr<kaS;*2yk~ramR9;ta7j>@Jvf0sNXV
z_V6jK^tCnDU_hq(q&lR$<uH#(MyhjqJgxb092h|@<{SqZ&ar3Alx#-nMTxhi9Z_08
z{=L;_7baci#`0?=G>lx+g8{^N9ax;`Q&e`wk)a;address@hidden>+!6C=lyuU=;W
address@hidden<IaFfm_wXjiz<r<7U~<address@hidden
address@hidden;ihyhjk?Ja(address@hidden;wUC%W
z(VZ$2)u?WorC~2YG%D8&address@hidden|address@hidden
address@hidden<W2;JcxcwUy8#3g_^X6bQKsO{eT)Ey1
z004wfIV&^fIF1&rYhWyM;je3KGtC*j8gXqpzN7U2E_8j-mqtVr>a;7V+G0B`U}#`B
ze821FVs(GlSEk%HbFSJu?gQ8wL0>OalmvhfgCPVA5tt(e2*M1Iw+NiP^F;z3xc3?e
address@hidden&y|yxk0U`5;;}7s+N!|)3XQga7MpNCa
zw`e;address@hidden|Id6J!Oxei=Q6GxOp5jztzkW8m29_ReF8l?hqluWO;(+?CylQyv?7
zApSFV4bQV+NF?)@NdDpsIcZ{#j?&v2#8|iZugcr0TuV%|MOb(MGe97sZib!$FyjVz
zVFb#xh!7xG$%%h<ww{Q&lMz#79EGYs&Ga&I&cQMDEhs-Dwmg>MNL0Y_mrq=5lC0YH
zYhu$Mg}=+zKQ|*hdMbv3_FIRUD{qmJqHW{P;address@hidden;!oZ|r;y1)GN+WF!lzNn0_$^}
zd&?gWd02wW^=qm)2wgj>NaPWzx6xTTazbGrT6ZS1GuAG#Oj_gS_7*4J)Yn{4u==&-
zjed!WmN$T=mRi9!{&q1AhLqhhwDg_<?BD^o1=d1EQ;3DC10CfAH!E|address@hidden(a!vgge!
z*w)vmMNK(oa(address@hidden>rW`;tMCo?oH5*H;i2YDhwL-RgaPW+9~!5i{Qr{SZbPd
zIM$?7a<;DIh_uhMWDyq_>address@hidden;O1!6Bvi1
address@hidden(R`x%qr)X6t<address@hidden@hcmaC1y
z0JEj-eup=j+jJNlse7-fDb}q(i(+E^kt7!pU`j>~fvh?(&4GKKym~<address@hidden
z-o*VC%qLZ8xkSND_J)eX6GD2uU9bQN30GGR&}DUc7~A{t%wsSGY0PB(Y8OP7e_Jj-
z*Dqc{l25fuaM<m&n8;hzb3MrB>EH)G=|rvUJwCxb5ds7NA_N3OOmymrw&d^*<N*;7
zA_M^rO||=VDGv^ZzEvk)YQ(ZUKq0x-kNebWpv}22AM;b#={mdrqAGwm*s3hoAEV5<
cz~{b~DWmIpofZ)k0WbKwk}1N3gWEPVaE0D!L;wH)
literal 0
HcmV?d00001
--
1.8.3.1
- [Qemu-devel] [PULL v2 02/37] qemu-iotests: Filter out actual image size in 067, (continued)
- [Qemu-devel] [PULL v2 02/37] qemu-iotests: Filter out actual image size in 067, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 29/37] block: vhdx - remove BAT file offset bit shifting, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 30/37] block: vhdx - move more endian translations to vhdx-endian.c, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 03/37] block/raw-posix: fix FreeBSD compilation, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 32/37] block: vhdx - fix comment typos in header, fix incorrect struct fields, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 07/37] block: qemu-iotests, add quotes to $TEST_IMG usage in 019, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 08/37] block: qemu-iotests, removes duplicate double quotes in 039, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 33/37] block: vhdx - add .bdrv_create() support, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 37/37] block: Round up total_sectors, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 10/37] block: qemu-iotests, add quotes to $TEST_IMG usage in 061, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 36/37] block: vhdx qemu-iotest - log replay of data sector,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v2 11/37] blockdev: fix drive_init() opts and bs_opts leaks, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 15/37] qdev-monitor-test: add device_add leak test cases, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 21/37] block: vhdx - log support struct and defines, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 22/37] block: vhdx - break endian translation functions out, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 26/37] block: vhdx - add region overlap detection for image files, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 28/37] block: vhdx write support, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 31/37] block: vhdx - break out code operations to functions, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 35/37] block: qemu-iotests for vhdx, add write test support, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 34/37] block: vhdx - update _make_test_img() to filter out vhdx options, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 23/37] block: vhdx - update log guid in header, and first write tracker, Stefan Hajnoczi, 2013/11/08