ia64/xen-unstable

changeset 10397:5d4b9dc88218

[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@uk.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Jun 13 15:41:27 2006 +0100 (2006-06-13)
parents 0de8a4a023d0
children 2fea03842f40
files tools/xm-test/tests/block-integrity/01_block_device_read_verify.py tools/xm-test/tests/block-integrity/02_block_device_write_verify.py
line diff
     1.1 --- a/tools/xm-test/tests/block-integrity/01_block_device_read_verify.py	Tue Jun 13 15:38:58 2006 +0100
     1.2 +++ b/tools/xm-test/tests/block-integrity/01_block_device_read_verify.py	Tue Jun 13 15:41:27 2006 +0100
     1.3 @@ -31,7 +31,7 @@ traceCommand("cat /dev/urandom > /dev/ra
     1.4  
     1.5  s, o = traceCommand("md5sum /dev/ram1")
     1.6  
     1.7 -dom0_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", o)
     1.8 +dom0_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", o, re.M)
     1.9  
    1.10  block_attach(domain, "phy:ram1", "hda1")
    1.11  
    1.12 @@ -40,7 +40,7 @@ try:
    1.13  except ConsoleError, e:
    1.14      FAIL(str(e))
    1.15  
    1.16 -domU_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", run["output"])
    1.17 +domU_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", run["output"], re.M)
    1.18  
    1.19  domain.closeConsole()
    1.20  
     2.1 --- a/tools/xm-test/tests/block-integrity/02_block_device_write_verify.py	Tue Jun 13 15:38:58 2006 +0100
     2.2 +++ b/tools/xm-test/tests/block-integrity/02_block_device_write_verify.py	Tue Jun 13 15:41:27 2006 +0100
     2.3 @@ -37,7 +37,7 @@ try:
     2.4  except ConsoleError, e:
     2.5      FAIL(str(e))
     2.6  
     2.7 -domU_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", run["output"])
     2.8 +domU_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", run["output"], re.M)
     2.9  
    2.10  domain.closeConsole()
    2.11  
    2.12 @@ -45,7 +45,7 @@ domain.stop()
    2.13  
    2.14  s, o = traceCommand("md5sum /dev/ram1")
    2.15  
    2.16 -dom0_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", o)
    2.17 +dom0_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", o, re.M)
    2.18  
    2.19  if domU_md5sum_match == None:
    2.20      FAIL("Failed to get md5sum of data written in domU.")