WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XM-TEST] Fix 02_block_device_write_verif

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XM-TEST] Fix 02_block_device_write_verify.py test to parse md5sum output correctly.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Jun 2006 15:25:28 +0000
Delivery-date: Wed, 14 Jun 2006 08:28:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 5d4b9dc8821809768c2948f625e6f7e5597f4b5c
# Parent  0de8a4a023d05f5468e7e2130d6b29ab5b99faa7
[XM-TEST] Fix 02_block_device_write_verify.py test to parse md5sum output 
correctly.

The 02_block_device_write_verify.py test that I wrote is failing because
the regular expression to extract the md5sum is only looking at the
first line of output and the sum is in a subsequent line (after the
output from dd).

This patch fixes the test by adding the multiline flag to the search
parameters so that the search looks in all lines of the output for the
md5sum.  I added the multiline flag in all searches to make the tests
more robust against changes in the output format of the commands used.

I'm not exactly sure how this slipped through my testing.  I suspect
that I forgot to install the new python file after updating the test to
use dd and then tested the old version a second time by accident.
Either that or it really did work when I tested it and the output format
has changed for some reason.

I tested this patch against xen-unstable 10326 and the 02 test fails
without the patch and succeeds with it.

Thanks to James Dykman for some help with this.

Signed-off-by Harry Butterworth <butterwo@xxxxxxxxxx>
---
 tools/xm-test/tests/block-integrity/01_block_device_read_verify.py  |    4 ++--
 tools/xm-test/tests/block-integrity/02_block_device_write_verify.py |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff -r 0de8a4a023d0 -r 5d4b9dc88218 
tools/xm-test/tests/block-integrity/01_block_device_read_verify.py
--- a/tools/xm-test/tests/block-integrity/01_block_device_read_verify.py        
Tue Jun 13 15:38:58 2006 +0100
+++ b/tools/xm-test/tests/block-integrity/01_block_device_read_verify.py        
Tue Jun 13 15:41:27 2006 +0100
@@ -31,7 +31,7 @@ traceCommand("cat /dev/urandom > /dev/ra
 
 s, o = traceCommand("md5sum /dev/ram1")
 
-dom0_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", o)
+dom0_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", o, re.M)
 
 block_attach(domain, "phy:ram1", "hda1")
 
@@ -40,7 +40,7 @@ except ConsoleError, e:
 except ConsoleError, e:
     FAIL(str(e))
 
-domU_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", run["output"])
+domU_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", run["output"], re.M)
 
 domain.closeConsole()
 
diff -r 0de8a4a023d0 -r 5d4b9dc88218 
tools/xm-test/tests/block-integrity/02_block_device_write_verify.py
--- a/tools/xm-test/tests/block-integrity/02_block_device_write_verify.py       
Tue Jun 13 15:38:58 2006 +0100
+++ b/tools/xm-test/tests/block-integrity/02_block_device_write_verify.py       
Tue Jun 13 15:41:27 2006 +0100
@@ -37,7 +37,7 @@ except ConsoleError, e:
 except ConsoleError, e:
     FAIL(str(e))
 
-domU_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", run["output"])
+domU_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", run["output"], re.M)
 
 domain.closeConsole()
 
@@ -45,7 +45,7 @@ domain.stop()
 
 s, o = traceCommand("md5sum /dev/ram1")
 
-dom0_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", o)
+dom0_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", o, re.M)
 
 if domU_md5sum_match == None:
     FAIL("Failed to get md5sum of data written in domU.")

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XM-TEST] Fix 02_block_device_write_verify.py test to parse md5sum output correctly., Xen patchbot-unstable <=