[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 8/8] iotests: test internal persistent dirty bitmap
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-devel] [PATCH 8/8] iotests: test internal persistent dirty bitmap |
Date: |
Tue, 13 Jan 2015 20:02:25 +0300 |
The test performs several vm reloads with checking and updating dirty
bitmap.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
tests/qemu-iotests/115 | 96 ++++++++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/115.out | 64 +++++++++++++++++++++++++++++++
tests/qemu-iotests/group | 1 +
3 files changed, 161 insertions(+)
create mode 100755 tests/qemu-iotests/115
create mode 100644 tests/qemu-iotests/115.out
diff --git a/tests/qemu-iotests/115 b/tests/qemu-iotests/115
new file mode 100755
index 0000000..ef853b1
--- /dev/null
+++ b/tests/qemu-iotests/115
@@ -0,0 +1,96 @@
+#!/bin/bash
+#
+# Persistent dirty bitmap test
+#
+# Performs several vm reloads with checking and updating dirty bitmap.
+#
+# Copyright (C) 2014 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`
+status=1 # failure is the default!
+
+_cleanup()
+{
+ _cleanup_qemu
+ _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.qemu
+
+_supported_fmt qcow2
+_supported_os Linux
+
+size=1G
+_make_test_img $size
+
+qemu_comm_method="monitor"
+
+launch() {
+ _launch_qemu -drive file="${TEST_IMG}",id=disk\
+ -dirty-bitmap name=bitmap,drive=disk
+ echo
+ echo START VM
+}
+
+print_bitmap() {
+ _send_qemu_cmd $QEMU_HANDLE 'print_dirty_bitmap disk bitmap'\
+ "dirty regions end" | sed 's/^/ /'
+}
+
+write() {
+ _send_qemu_cmd $QEMU_HANDLE 'qemu-io disk "write ' $@ '"' "(qemu)"
+ echo
+ echo write $@
+}
+
+quit() {
+ _send_qemu_cmd $QEMU_HANDLE 'qemu-io disk flush' "(qemu)"
+ _send_qemu_cmd $QEMU_HANDLE 'quit' ""
+ echo QUIT
+ wait ${QEMU_PID[$QEMU_HANDLE]} 2>/dev/null
+}
+
+{
+ launch
+ print_bitmap
+ write 50m 1m
+ print_bitmap
+ quit
+
+ launch
+ print_bitmap
+ write 0m 10m
+ write 700m 200m
+ print_bitmap
+ quit
+
+ launch
+ print_bitmap
+ quit
+} | sed '/(qemu)/d'
+
+status=0
diff --git a/tests/qemu-iotests/115.out b/tests/qemu-iotests/115.out
new file mode 100644
index 0000000..d570c9f
--- /dev/null
+++ b/tests/qemu-iotests/115.out
@@ -0,0 +1,64 @@
+QA output created by 115
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
+
+START VM
+QEMU X.Y.Z monitor - type 'help' for more information
+ bitmap 'bitmap'
+ enabled: true
+ size: 2097152
+ granularity: 65536
+ dirty regions begin:
+ dirty regions end
+
+write 50m 1m
+wrote 1048576/1048576 bytes at offset 52428800
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+ bitmap 'bitmap'
+ enabled: true
+ size: 2097152
+ granularity: 65536
+ dirty regions begin:
+ 102400 -> 104447
+ dirty regions end
+QUIT
+
+START VM
+QEMU X.Y.Z monitor - type 'help' for more information
+ bitmap 'bitmap'
+ enabled: true
+ size: 2097152
+ granularity: 65536
+ dirty regions begin:
+ 102400 -> 104447
+ dirty regions end
+
+write 0m 10m
+wrote 10485760/10485760 bytes at offset 0
+10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+write 700m 200m
+wrote 209715200/209715200 bytes at offset 734003200
+200 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+ bitmap 'bitmap'
+ enabled: true
+ size: 2097152
+ granularity: 65536
+ dirty regions begin:
+ 0 -> 20479
+ 102400 -> 104447
+ 1433600 -> 1843199
+ dirty regions end
+QUIT
+
+START VM
+QEMU X.Y.Z monitor - type 'help' for more information
+ bitmap 'bitmap'
+ enabled: true
+ size: 2097152
+ granularity: 65536
+ dirty regions begin:
+ 0 -> 20479
+ 102400 -> 104447
+ 1433600 -> 1843199
+ dirty regions end
+QUIT
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index a4742c6..77377b3 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -115,3 +115,4 @@
111 rw auto quick
113 rw auto quick
114 rw auto quick
+115 rw auto quick
--
1.9.1
- Re: [Qemu-devel] [PATCH 1/8] spec: add qcow2-dirty-bitmaps specification, (continued)
- [Qemu-devel] [PATCH 4/8] block: store persistent dirty bitmaps, Vladimir Sementsov-Ogievskiy, 2015/01/13
- [Qemu-devel] [PATCH 3/8] qcow2: add dirty-bitmaps feature, Vladimir Sementsov-Ogievskiy, 2015/01/13
- [Qemu-devel] [PATCH 5/8] block: add bdrv_load_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2015/01/13
- [Qemu-devel] [PATCH 6/8] qemu: command line option for dirty bitmaps, Vladimir Sementsov-Ogievskiy, 2015/01/13
- [Qemu-devel] [PATCH 7/8] qmp: print dirty bitmap, Vladimir Sementsov-Ogievskiy, 2015/01/13
- [Qemu-devel] [PATCH 8/8] iotests: test internal persistent dirty bitmap,
Vladimir Sementsov-Ogievskiy <=
- Re: [Qemu-devel] [PATCH 0/8] block: persistent dirty bitmaps (RFC), Vladimir Sementsov-Ogievskiy, 2015/01/27