qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] qemu-iotests: Test L1 table growth


From: Kevin Wolf
Subject: [Qemu-devel] [PATCH] qemu-iotests: Test L1 table growth
Date: Mon, 6 Jul 2009 15:59:27 +0200

Signed-off-by: Kevin Wolf <address@hidden>
---
I don't really like about this one that it contains the monitor echo of our
commands from stdin. It contains lots of control characters and who knows if
the monitor won't change to do a more reasonable echo some time... However, we
need the monitor output to see if an error occured during savevm or loadvm. So,
I'm open for suggestions, but in case nobody has a better option, let's do it
this way.

 016           |   77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 016.out       |   15 +++++++++++
 common.filter |    6 ++++
 group         |    1 +
 4 files changed, 99 insertions(+), 0 deletions(-)
 create mode 100755 016
 create mode 100644 016.out

diff --git a/016 b/016
new file mode 100755
index 0000000..5cb2080
--- /dev/null
+++ b/016
@@ -0,0 +1,77 @@
+#!/bin/sh
+#
+# Grow the L1 table
+#
+# Copyright (C) 2009 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+# USA
+#
+
+# 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
+       true
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# currently only qcow2 allows for consistency checks using qemu-img
+_supported_fmt qcow2
+_supported_os Linux
+
+echo
+echo "creating image"
+
+# For 4k cluster, an L2 table spans 2M of the virtual disk
+# To trigger an L1 table growth it is enough to have the image size 2M aligned
+# and write a snapshot with VM data.
+size=2M
+_make_test_img -o cluster_size=4k $size
+
+# Create a snapshot with VM state
+echo "creating first snapshot"
+$QEMU -hda $TEST_IMG -monitor stdio <<EOF 2>&1 | _filter_qemu
+savevm test
+quit
+EOF
+
+# Try to load it again
+$QEMU -hda $TEST_IMG -monitor stdio <<EOF 2>&1 | _filter_qemu
+loadvm test
+quit
+EOF
+
+echo
+echo "checking image for errors"
+_check_test_img
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/016.out b/016.out
new file mode 100644
index 0000000..0554d54
--- /dev/null
+++ b/016.out
@@ -0,0 +1,15 @@
+QA output created by 016
+
+creating image
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2097152 cluster_size=4096 
+creating first snapshot
+ssasavsavesavevsavevmsavevm
 savevm tsavevm 
tesavevm 
tessavevm test
+QEMU monitor - type 'help' for more information
+(qemu) (qemu) qququiquit
+lloloaloadloadvloadvmloadvm
 loadvm tloadvm 
teloadvm 
tesloadvm test
+QEMU monitor - type 'help' for more information
+(qemu) (qemu) qququiquit
+
+checking image for errors
+No errors were found on the image.
+*** done
diff --git a/common.filter b/common.filter
index b12f50b..dc90fa4 100644
--- a/common.filter
+++ b/common.filter
@@ -141,5 +141,11 @@ _filter_qemu_io()
     sed -e "s/[0-9]* ops\; [0-9/:. sec]* ([0-9/.]* [GMKiBbytes]*\/sec and 
[0-9/.]* ops\/sec)/X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
 }
 
+# sanitize qemu output
+_filter_qemu()
+{
+    sed -e "s/QEMU [0-9.]* monitor/QEMU monitor/" | grep -v -e kqemu -e kvm
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/group b/group
index 3beb952..3dfcb7b 100644
--- a/group
+++ b/group
@@ -22,3 +22,4 @@
 013 rw auto
 014 rw auto
 015 rw snapshot auto
+016 snapshot auto
-- 
1.6.0.6





reply via email to

[Prev in Thread] Current Thread [Next in Thread]