From: Harry Butterworth <harry@hebutterworth.freeserve.co.uk>
To: xen-devel@lists.xensource.com
Subject: [PATCH] [XM-TEST] block device write verify test 2nd attempt
Date: Tue, 23 May 2006 11:35:55 +0100 [thread overview]
Message-ID: <1148380556.10003.4.camel@localhost.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]
The only difference from the last version of the patch is that the minor
version number in configure.ac is incremented.
>From the patch:
+# This test imports a ram disk device as a physical device into a domU.
+# The domU initialises the ram disk with data from /dev/urandom and
calculates
+# the md5 checksum of the data (using tee as it is written so as to
avoid
+# reading it back from the device which might potentially mask
problems).
+# The domU is stopped and the md5 checksum of the data on the device is
+# calculated by dom0. The test succeeds if the checksums match,
indicating
+# that all the data written by domU was sucessfully committed to the
device.
+
This patch also enables tee and fancy head in busybox on the ramdisk. I
have tested the patch with both `make existing' where the tests run but
the new test fails because the ramdisk is missing tee and fancy head and
`make` where the test passes successfully.
The patch also installs the block-integrity tests in the default test
set so they get executed.
[-- Attachment #2: block_device_write_verify.patch --]
[-- Type: text/x-patch, Size: 3834 bytes --]
diff -r 14717dedba02 -r 6394ff30dfc0 tools/xm-test/configure.ac
--- a/tools/xm-test/configure.ac Sun May 21 19:15:58 2006
+++ b/tools/xm-test/configure.ac Tue May 23 10:26:21 2006
@@ -1,7 +1,7 @@
# xm-test configure.ac input script
# Basic header information
-AC_INIT([xm-test], [0.7.1])
+AC_INIT([xm-test], [0.7.2])
AM_INIT_AUTOMAKE([1.7 foreign])
# Check for dependencies
diff -r 14717dedba02 -r 6394ff30dfc0 tools/xm-test/grouptest/default
--- a/tools/xm-test/grouptest/default Sun May 21 19:15:58 2006
+++ b/tools/xm-test/grouptest/default Tue May 23 10:26:21 2006
@@ -1,6 +1,7 @@
block-create
block-destroy
block-list
+block-integrity
console
create
destroy
diff -r 14717dedba02 -r 6394ff30dfc0 tools/xm-test/ramdisk/configs/busybox
--- a/tools/xm-test/ramdisk/configs/busybox Sun May 21 19:15:58 2006
+++ b/tools/xm-test/ramdisk/configs/busybox Tue May 23 10:26:21 2006
@@ -92,7 +92,7 @@
CONFIG_FALSE=y
# CONFIG_FOLD is not set
CONFIG_HEAD=y
-# CONFIG_FEATURE_FANCY_HEAD is not set
+CONFIG_FEATURE_FANCY_HEAD=y
CONFIG_HOSTID=y
CONFIG_ID=y
CONFIG_INSTALL=y
@@ -127,8 +127,8 @@
CONFIG_SYNC=y
CONFIG_TAIL=y
CONFIG_FEATURE_FANCY_TAIL=n
-CONFIG_TEE=n
-CONFIG_FEATURE_TEE_USE_BLOCK_IO=n
+CONFIG_TEE=y
+CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
CONFIG_TEST=y
#
diff -r 14717dedba02 -r 6394ff30dfc0 tools/xm-test/tests/block-integrity/Makefile.am
--- a/tools/xm-test/tests/block-integrity/Makefile.am Sun May 21 19:15:58 2006
+++ b/tools/xm-test/tests/block-integrity/Makefile.am Tue May 23 10:26:21 2006
@@ -1,7 +1,8 @@
SUBDIRS =
-TESTS = 01_block_device_read_verify.test
+TESTS = 01_block_device_read_verify.test \
+ 02_block_device_write_verify.test
XFAIL_TESTS =
diff -r 14717dedba02 -r 6394ff30dfc0 tools/xm-test/tests/block-integrity/02_block_device_write_verify.py
--- /dev/null Sun May 21 19:15:58 2006
+++ b/tools/xm-test/tests/block-integrity/02_block_device_write_verify.py Tue May 23 10:26:21 2006
@@ -0,0 +1,63 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2006
+# Author: Harry Butterworth <butterwo@uk.ibm.com>
+
+# This test imports a ram disk device as a physical device into a domU.
+# The domU initialises the ram disk with data from /dev/urandom and calculates
+# the md5 checksum of the data (using tee as it is written so as to avoid
+# reading it back from the device which might potentially mask problems).
+# The domU is stopped and the md5 checksum of the data on the device is
+# calculated by dom0. The test succeeds if the checksums match, indicating
+# that all the data written by domU was sucessfully committed to the device.
+
+import re
+
+from XmTestLib import *
+from XmTestLib.block_utils import *
+
+if ENABLE_HVM_SUPPORT:
+ SKIP("Block-attach not supported for HVM domains")
+
+domain = XmTestDomain()
+
+try:
+ console = domain.start()
+except DomainError, e:
+ FAIL(str(e))
+
+console.setHistorySaveCmds(value=True)
+
+block_attach(domain, "phy:ram1", "hda1")
+
+console.setTimeout(120)
+
+try:
+ run = console.runCmd("head -c `cat /dev/hda1 | wc -c` /dev/urandom | tee /dev/hda1 | md5sum")
+except ConsoleError, e:
+ FAIL(str(e))
+
+domU_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", run["output"])
+
+domain.closeConsole()
+
+domain.stop()
+
+s, o = traceCommand("md5sum /dev/ram1")
+
+dom0_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", o)
+
+if domU_md5sum_match == None:
+ FAIL("Failed to get md5sum of data written in domU.")
+
+if dom0_md5sum_match == None:
+ FAIL("Failed to get md5sum of data read back in dom0.")
+
+if verbose:
+ print "md5sum domU:"
+ print domU_md5sum_match.group()
+ print "md5sum dom0:"
+ print dom0_md5sum_match.group()
+
+if domU_md5sum_match.group() != dom0_md5sum_match.group():
+ FAIL("MISCOMPARE: data read in dom0 did not match data written by domU.")
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2006-05-23 10:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-23 10:35 Harry Butterworth [this message]
2006-05-23 11:40 ` [PATCH] [XM-TEST] block device write verify test 2nd attempt Ewan Mellor
2006-05-23 12:35 ` Harry Butterworth
2006-05-24 10:20 ` Ewan Mellor
2006-05-24 11:08 ` Harry Butterworth
2006-05-24 12:37 ` Ewan Mellor
2006-05-24 13:09 ` Harry Butterworth
2006-05-24 22:01 ` Ewan Mellor
2006-05-24 9:52 ` Harry Butterworth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1148380556.10003.4.camel@localhost.localdomain \
--to=harry@hebutterworth.freeserve.co.uk \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.