direct-io.hg

changeset 12284:52732dd77150

Update all block tests to use the Xen Virtual Block Device (xvd) rather than IDEor SCSI.

This patch also modifies
09_block_attach_and_dettach_device_check_data_pos.py to force / to be
read-write otherwise the mkdir fails.

Also Whistspace cleanups.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
author Ewan Mellor <ewan@xensource.com>
date Wed Nov 01 08:39:45 2006 +0000 (2006-11-01)
parents 515332c7a901
children 579d60866f3d
files tools/xm-test/tests/block-create/01_block_attach_device_pos.py tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py tools/xm-test/tests/block-create/09_block_attach_and_dettach_device_check_data_pos.py tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py tools/xm-test/tests/block-create/12_block_attach_shared_domU.py tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py tools/xm-test/tests/block-integrity/01_block_device_read_verify.py tools/xm-test/tests/block-integrity/02_block_device_write_verify.py tools/xm-test/tests/block-list/01_block-list_pos.py tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py
line diff
     1.1 --- a/tools/xm-test/tests/block-create/01_block_attach_device_pos.py	Wed Nov 01 08:38:22 2006 +0000
     1.2 +++ b/tools/xm-test/tests/block-create/01_block_attach_device_pos.py	Wed Nov 01 08:39:45 2006 +0000
     1.3 @@ -32,12 +32,12 @@ except ConsoleError, e:
     1.4      FAIL(str(e))
     1.5      
     1.6  
     1.7 -block_attach(domain, "phy:ram1", "sdb1")
     1.8 +block_attach(domain, "phy:ram1", "xvda1")
     1.9  
    1.10 -try:	
    1.11 -	run = console.runCmd("cat /proc/partitions")
    1.12 +try:
    1.13 +    run = console.runCmd("cat /proc/partitions")
    1.14  except ConsoleError, e:
    1.15 -	FAIL(str(e))
    1.16 +    FAIL(str(e))
    1.17  
    1.18  # Close the console
    1.19  domain.closeConsole()
    1.20 @@ -45,5 +45,5 @@ domain.closeConsole()
    1.21  # Stop the domain (nice shutdown)
    1.22  domain.stop()
    1.23  
    1.24 -if not re.search("sdb1",run["output"]):
    1.25 +if not re.search("xvda1",run["output"]):
    1.26      FAIL("Device is not actually connected to the domU")
     2.1 --- a/tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py	Wed Nov 01 08:38:22 2006 +0000
     2.2 +++ b/tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py	Wed Nov 01 08:39:45 2006 +0000
     2.3 @@ -32,10 +32,10 @@ except ConsoleError, e:
     2.4      FAIL(str(e))
     2.5      
     2.6  
     2.7 -block_attach(domain, "file:/dev/ram1", "sdb2")
     2.8 +block_attach(domain, "file:/dev/ram1", "xvda1")
     2.9  
    2.10  try:
    2.11 -	run = console.runCmd("cat /proc/partitions")
    2.12 +    run = console.runCmd("cat /proc/partitions")
    2.13  except ConsoleError, e:
    2.14          FAIL(str(e))
    2.15  
    2.16 @@ -45,5 +45,5 @@ domain.closeConsole()
    2.17  # Stop the domain (nice shutdown)
    2.18  domain.stop()
    2.19  
    2.20 -if not re.search("sdb2",run["output"]):
    2.21 -	FAIL("Device is not actually connected to the domU")
    2.22 +if not re.search("xvda1",run["output"]):
    2.23 +    FAIL("Device is not actually connected to the domU")
     3.1 --- a/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py	Wed Nov 01 08:38:22 2006 +0000
     3.2 +++ b/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py	Wed Nov 01 08:39:45 2006 +0000
     3.3 @@ -30,14 +30,14 @@ except ConsoleError, e:
     3.4      FAIL(str(e))
     3.5      
     3.6  for i in range(10):
     3.7 -	status, output = traceCommand("xm block-attach %s phy:ram1 sdb1 w" % domain.getName())
     3.8 -        if i == 0 and status != 0:
     3.9 -            FAIL("xm block attach returned invalid %i != 0" % status)
    3.10 -	if i > 0 and status == 0:
    3.11 -            FAIL("xm block-attach (repeat) returned invalid %i > 0" % status)
    3.12 -	run = console.runCmd("cat /proc/partitions")
    3.13 -	if not re.search("sdb1", run['output']):
    3.14 -            FAIL("Device is not actually attached to domU")
    3.15 +    status, output = traceCommand("xm block-attach %s phy:ram1 xvda1 w" % domain.getName())
    3.16 +    if i == 0 and status != 0:
    3.17 +        FAIL("xm block attach returned invalid %i != 0" % status)
    3.18 +    if i > 0 and status == 0:
    3.19 +        FAIL("xm block-attach (repeat) returned invalid %i > 0" % status)
    3.20 +    run = console.runCmd("cat /proc/partitions")
    3.21 +    if not re.search("xvda1", run['output']):
    3.22 +        FAIL("Device is not actually attached to domU")
    3.23  
    3.24  # Close the console
    3.25  domain.closeConsole()
     4.1 --- a/tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py	Wed Nov 01 08:38:22 2006 +0000
     4.2 +++ b/tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py	Wed Nov 01 08:39:45 2006 +0000
     4.3 @@ -32,15 +32,15 @@ except ConsoleError, e:
     4.4      
     4.5  
     4.6  for i in range(10):
     4.7 -	block_attach(domain, "phy:ram1", "sdb1")
     4.8 -	run = console.runCmd("cat /proc/partitions")
     4.9 -	if not re.search("sdb1", run["output"]):
    4.10 -		FAIL("Failed to attach block device: /proc/partitions does not show that!")
    4.11 -		
    4.12 -	block_detach(domain, "sdb1")
    4.13 -	run = console.runCmd("cat /proc/partitions")
    4.14 -	if re.search("sdb1", run["output"]):
    4.15 -		FAIL("Failed to dettach block device: /proc/partitions still showing that!")
    4.16 +    block_attach(domain, "phy:ram1", "xvda1")
    4.17 +    run = console.runCmd("cat /proc/partitions")
    4.18 +    if not re.search("xvda1", run["output"]):
    4.19 +        FAIL("Failed to attach block device: /proc/partitions does not show that!")
    4.20 +
    4.21 +    block_detach(domain, "xvda1")
    4.22 +    run = console.runCmd("cat /proc/partitions")
    4.23 +    if re.search("xvda1", run["output"]):
    4.24 +        FAIL("Failed to dettach block device: /proc/partitions still showing that!")
    4.25  
    4.26  # Close the console
    4.27  domain.closeConsole()
     5.1 --- a/tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py	Wed Nov 01 08:38:22 2006 +0000
     5.2 +++ b/tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py	Wed Nov 01 08:39:45 2006 +0000
     5.3 @@ -8,13 +8,11 @@ from XmTestLib import *
     5.4  if ENABLE_HVM_SUPPORT:
     5.5      SKIP("Block-attach not supported for HVM domains")
     5.6  
     5.7 -status, output = traceCommand("xm block-attach NOT-EXIST phy:ram1 sdb1 w")
     5.8 +status, output = traceCommand("xm block-attach NOT-EXIST phy:ram1 xvda1 w")
     5.9  
    5.10  eyecatcher = "Error"
    5.11  where = output.find(eyecatcher)
    5.12  if status == 0:
    5.13 -	FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
    5.14 +    FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
    5.15  elif where == -1:
    5.16 -	FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
    5.17 -	
    5.18 -
    5.19 +    FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
     6.1 --- a/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py	Wed Nov 01 08:38:22 2006 +0000
     6.2 +++ b/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py	Wed Nov 01 08:39:45 2006 +0000
     6.3 @@ -30,18 +30,18 @@ except ConsoleError, e:
     6.4      FAIL(str(e))
     6.5      
     6.6  
     6.7 -status, output = traceCommand("xm block-attach %s phy:NOT-EXIST sdb1 w" % domain.getName())
     6.8 +status, output = traceCommand("xm block-attach %s phy:NOT-EXIST xvda1 w" % domain.getName())
     6.9  eyecatcher = "Error"
    6.10  where = output.find(eyecatcher)
    6.11  if status == 0:
    6.12 -	FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
    6.13 +    FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
    6.14  elif where == -1:
    6.15 -	FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
    6.16 +    FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
    6.17  
    6.18  try:
    6.19 -	run = console.runCmd("cat /proc/partitions")
    6.20 +    run = console.runCmd("cat /proc/partitions")
    6.21  except ConsoleError, e:
    6.22 -	FAIL(str(e))
    6.23 +    FAIL(str(e))
    6.24  
    6.25  # Close the console
    6.26  domain.closeConsole()
    6.27 @@ -49,5 +49,5 @@ domain.closeConsole()
    6.28  # Stop the domain (nice shutdown)
    6.29  domain.stop()
    6.30  
    6.31 -if re.search("sdb1",run["output"]):
    6.32 -	FAIL("Non existent Device was connected to the domU")
    6.33 +if re.search("xvda1",run["output"]):
    6.34 +    FAIL("Non existent Device was connected to the domU")
     7.1 --- a/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py	Wed Nov 01 08:38:22 2006 +0000
     7.2 +++ b/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py	Wed Nov 01 08:39:45 2006 +0000
     7.3 @@ -29,18 +29,18 @@ except ConsoleError, e:
     7.4      saveLog(console.getHistory())
     7.5      FAIL(str(e))
     7.6  
     7.7 -status, output = traceCommand("xm block-attach %s file:/dev/NOT-EXIST sdb1 w" % domain.getName())
     7.8 +status, output = traceCommand("xm block-attach %s file:/dev/NOT-EXIST xvda1 w" % domain.getName())
     7.9  eyecatcher = "Error"
    7.10  where = output.find(eyecatcher)
    7.11  if status == 0:
    7.12 -	FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
    7.13 +    FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
    7.14  elif where == -1:
    7.15 -	FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
    7.16 -	
    7.17 +    FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
    7.18 +    
    7.19  try:
    7.20 -	run = console.runCmd("cat /proc/partitions")
    7.21 +    run = console.runCmd("cat /proc/partitions")
    7.22  except ConsoleError, e:
    7.23 -	FAIL(str(e))
    7.24 +    FAIL(str(e))
    7.25  
    7.26  # Close the console
    7.27  domain.closeConsole()
    7.28 @@ -48,5 +48,5 @@ domain.closeConsole()
    7.29  # Stop the domain (nice shutdown)
    7.30  domain.stop()
    7.31  
    7.32 -if re.search("sdb1",run["output"]):
    7.33 -	FAIL("Non existent Device was connected to the domU")
    7.34 +if re.search("xvda1",run["output"]):
    7.35 +    FAIL("Non existent Device was connected to the domU")
     8.1 --- a/tools/xm-test/tests/block-create/09_block_attach_and_dettach_device_check_data_pos.py	Wed Nov 01 08:38:22 2006 +0000
     8.2 +++ b/tools/xm-test/tests/block-create/09_block_attach_and_dettach_device_check_data_pos.py	Wed Nov 01 08:39:45 2006 +0000
     8.3 @@ -12,7 +12,7 @@ if ENABLE_HVM_SUPPORT:
     8.4      SKIP("Block-attach not supported for HVM domains")
     8.5  
     8.6  # Create a domain (default XmTestDomain, with our ramdisk)
     8.7 -domain = XmTestDomain()
     8.8 +domain = XmTestDomain(extraConfig={"extra":"rw"})
     8.9  
    8.10  try:
    8.11      console = domain.start()
    8.12 @@ -35,27 +35,27 @@ if s != 0:
    8.13      FAIL("mke2fs returned %i != 0" % s)
    8.14  
    8.15  for i in range(10):
    8.16 -	block_attach(domain, "phy:ram1", "hda1")
    8.17 -	run = console.runCmd("cat /proc/partitions")
    8.18 -	if not re.search("hda1", run["output"]):
    8.19 -		FAIL("Failed to attach block device: /proc/partitions does not show that!")
    8.20 -	
    8.21 -	console.runCmd("mkdir -p /mnt/hda1; mount /dev/hda1 /mnt/hda1")
    8.22 -	
    8.23 -	if i:
    8.24 -		run = console.runCmd("cat /mnt/hda1/myfile | grep %s" % (i-1))
    8.25 -		if run['return']:
    8.26 -			FAIL("File created was lost or not updated!")
    8.27 -	
    8.28 -	console.runCmd("echo \"%s\" > /mnt/hda1/myfile" % i)
    8.29 -	run = console.runCmd("cat /mnt/hda1/myfile")
    8.30 -	print run['output']
    8.31 -	console.runCmd("umount /mnt/hda1")
    8.32 -	
    8.33 -	block_detach(domain, "hda1")
    8.34 -	run = console.runCmd("cat /proc/partitions")
    8.35 -	if re.search("hda1", run["output"]):
    8.36 -		FAIL("Failed to dettach block device: /proc/partitions still showing that!")
    8.37 +    block_attach(domain, "phy:ram1", "xvda1")
    8.38 +    run = console.runCmd("cat /proc/partitions")
    8.39 +    if not re.search("xvda1", run["output"]):
    8.40 +        FAIL("Failed to attach block device: /proc/partitions does not show that!")
    8.41 +    
    8.42 +    console.runCmd("mkdir -p /mnt/xvda1; mount /dev/xvda1 /mnt/xvda1")
    8.43 +    
    8.44 +    if i:
    8.45 +        run = console.runCmd("cat /mnt/xvda1/myfile | grep %s" % (i-1))
    8.46 +        if run['return']:
    8.47 +            FAIL("File created was lost or not updated!")
    8.48 +    
    8.49 +    console.runCmd("echo \"%s\" > /mnt/xvda1/myfile" % i)
    8.50 +    run = console.runCmd("cat /mnt/xvda1/myfile")
    8.51 +    print run['output']
    8.52 +    console.runCmd("umount /mnt/xvda1")
    8.53 +    
    8.54 +    block_detach(domain, "xvda1")
    8.55 +    run = console.runCmd("cat /proc/partitions")
    8.56 +    if re.search("xvda1", run["output"]):
    8.57 +        FAIL("Failed to dettach block device: /proc/partitions still showing that!")
    8.58  
    8.59  # Close the console
    8.60  domain.closeConsole()
     9.1 --- a/tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py	Wed Nov 01 08:38:22 2006 +0000
     9.2 +++ b/tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py	Wed Nov 01 08:39:45 2006 +0000
     9.3 @@ -15,7 +15,7 @@ from XmTestLib.block_utils import *
     9.4  def availableRamdisks():
     9.5      i = 0
     9.6      while os.access("/dev/ram%d" % i, os.F_OK ):
     9.7 -    	i += 1
     9.8 +        i += 1
     9.9  
    9.10      return i
    9.11  
    9.12 @@ -36,7 +36,7 @@ def detach(devname):
    9.13          return -2, "Failed to detach block device: /proc/partitions still showing that!"
    9.14  
    9.15      return 0, None
    9.16 -	
    9.17 +    
    9.18  if ENABLE_HVM_SUPPORT:
    9.19      SKIP("Block-attach not supported for HVM domains")
    9.20  
    9.21 @@ -69,22 +69,22 @@ while i < ramdisks or devices:
    9.22      op = random.randint(0,1) # 1 = attach, 0 = detach
    9.23      if (not devices or op) and i < ramdisks:
    9.24          i += 1
    9.25 -	devname = "/dev/hda%d" % i
    9.26 -	phy = "/dev/ram%d" % i
    9.27 -	print "Attaching %s to %s" % (devname, phy)
    9.28 -	status, msg = attach( phy, devname )
    9.29 -	if status:
    9.30 -	    FAIL(msg)
    9.31 -	else:
    9.32 -	    devices.append(devname)
    9.33 +    devname = "/dev/xvda%d" % i
    9.34 +    phy = "/dev/ram%d" % i
    9.35 +    print "Attaching %s to %s" % (devname, phy)
    9.36 +    status, msg = attach( phy, devname )
    9.37 +    if status:
    9.38 +        FAIL(msg)
    9.39 +    else:
    9.40 +        devices.append(devname)
    9.41  
    9.42      elif devices:
    9.43          devname = random.choice(devices)
    9.44 -	devices.remove(devname)
    9.45 -	print "Detaching %s" % devname
    9.46 -	status, msg = detach(devname)
    9.47 -	if status:
    9.48 -	    FAIL(msg)
    9.49 +    devices.remove(devname)
    9.50 +    print "Detaching %s" % devname
    9.51 +    status, msg = detach(devname)
    9.52 +    if status:
    9.53 +        FAIL(msg)
    9.54  
    9.55  # Close the console
    9.56  domain.closeConsole()
    10.1 --- a/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py	Wed Nov 01 08:38:22 2006 +0000
    10.2 +++ b/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py	Wed Nov 01 08:39:45 2006 +0000
    10.3 @@ -24,7 +24,7 @@ if s != 0:
    10.4  
    10.5  # Now try to start a DomU with write access to /dev/ram0
    10.6  
    10.7 -config = {"disk":"phy:/dev/ram0,hda1,w"}
    10.8 +config = {"disk":"phy:/dev/ram0,xvda1,w"}
    10.9  
   10.10  domain = XmTestDomain(extraConfig=config);
   10.11  
    11.1 --- a/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py	Wed Nov 01 08:38:22 2006 +0000
    11.2 +++ b/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py	Wed Nov 01 08:39:45 2006 +0000
    11.3 @@ -8,7 +8,7 @@ from XmTestLib import *
    11.4  if ENABLE_HVM_SUPPORT:
    11.5      SKIP("Block-attach not supported for HVM domains")
    11.6  
    11.7 -config = {"disk":"phy:/dev/ram0,hda1,w"}
    11.8 +config = {"disk":"phy:/dev/ram0,xvda1,w"}
    11.9  
   11.10  dom1 = XmTestDomain(extraConfig=config)
   11.11  dom2 = XmTestDomain(dom1.getName() + "-2",
    12.1 --- a/tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py	Wed Nov 01 08:38:22 2006 +0000
    12.2 +++ b/tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py	Wed Nov 01 08:39:45 2006 +0000
    12.3 @@ -9,7 +9,7 @@ from XmTestLib.block_utils import block_
    12.4  if ENABLE_HVM_SUPPORT:
    12.5      SKIP("Block-detach not supported for HVM domains")
    12.6  
    12.7 -config = {"disk":"phy:/dev/ram0,hda1,w"}
    12.8 +config = {"disk":"phy:/dev/ram0,xvda1,w"}
    12.9  domain = XmTestDomain(extraConfig=config)
   12.10  
   12.11  try:
   12.12 @@ -21,7 +21,7 @@ except DomainError, e:
   12.13  
   12.14  try:
   12.15      console.setHistorySaveCmds(value=True)
   12.16 -    run = console.runCmd("cat /proc/partitions | grep hda1")
   12.17 +    run = console.runCmd("cat /proc/partitions | grep xvda1")
   12.18      run2 = console.runCmd("cat /proc/partitions")
   12.19  except ConsoleError, e:
   12.20      FAIL(str(e))
   12.21 @@ -29,10 +29,10 @@ except ConsoleError, e:
   12.22  if run["return"] != 0:
   12.23      FAIL("block device isn't attached; can't detach!")
   12.24  
   12.25 -block_detach(domain, "hda1")
   12.26 +block_detach(domain, "xvda1")
   12.27  try:
   12.28  
   12.29 -    run = console.runCmd("cat /proc/partitions | grep hda1")
   12.30 +    run = console.runCmd("cat /proc/partitions | grep xvda1")
   12.31  except ConsoleError, e:
   12.32      saveLog(console.getHistory())
   12.33      FAIL(str(e))
    13.1 --- a/tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py	Wed Nov 01 08:38:22 2006 +0000
    13.2 +++ b/tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py	Wed Nov 01 08:39:45 2006 +0000
    13.3 @@ -18,9 +18,9 @@ except DomainError, e:
    13.4          print e.extra
    13.5      FAIL("Unable to create domain")
    13.6  
    13.7 -block_attach(domain, "phy:/dev/ram0", "hda1")
    13.8 +block_attach(domain, "phy:/dev/ram0", "xvda1")
    13.9  try:
   13.10 -    run = console.runCmd("cat /proc/partitions | grep hda1")
   13.11 +    run = console.runCmd("cat /proc/partitions | grep xvda1")
   13.12  except ConsoleError, e:
   13.13      saveLog(console.getHistory())
   13.14      FAIL(str(e))
   13.15 @@ -28,9 +28,9 @@ except ConsoleError, e:
   13.16  if run["return"] != 0:
   13.17      FAIL("Failed to verify that block dev is attached")
   13.18  
   13.19 -block_detach(domain, "hda1")
   13.20 +block_detach(domain, "xvda1")
   13.21  try:
   13.22 -    run = console.runCmd("cat /proc/partitions | grep hda1")
   13.23 +    run = console.runCmd("cat /proc/partitions | grep xvda1")
   13.24  except ConsoleError, e:
   13.25      saveLog(console.getHistory())
   13.26      FAIL(str(e))
    14.1 --- a/tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py	Wed Nov 01 08:38:22 2006 +0000
    14.2 +++ b/tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py	Wed Nov 01 08:39:45 2006 +0000
    14.3 @@ -19,7 +19,7 @@ except DomainError, e:
    14.4          print e.extra
    14.5      FAIL("Unable to create domain")
    14.6  
    14.7 -status, output = traceCommand("xm block-detach %s sda1" % domain.getId())
    14.8 +status, output = traceCommand("xm block-detach %s xvda1" % domain.getId())
    14.9  
   14.10  eyecatcher1 = "Error:"
   14.11  eyecatcher2 = "Traceback"
    15.1 --- a/tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py	Wed Nov 01 08:38:22 2006 +0000
    15.2 +++ b/tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py	Wed Nov 01 08:39:45 2006 +0000
    15.3 @@ -9,7 +9,7 @@ from XmTestLib.block_utils import block_
    15.4  if ENABLE_HVM_SUPPORT:
    15.5      SKIP("Block-detach not supported for HVM domains")
    15.6  
    15.7 -config = {"disk":"phy:/dev/ram0,hda1,w"}
    15.8 +config = {"disk":"phy:/dev/ram0,xvda1,w"}
    15.9  domain = XmTestDomain(extraConfig=config)
   15.10  
   15.11  try:
   15.12 @@ -20,7 +20,7 @@ except DomainError, e:
   15.13      FAIL("Unable to create domain")
   15.14  
   15.15  try:
   15.16 -    run = console.runCmd("cat /proc/partitions | grep hda1")
   15.17 +    run = console.runCmd("cat /proc/partitions | grep xvda1")
   15.18      run2 = console.runCmd("cat /proc/partitions")
   15.19  except ConsoleError, e:
   15.20      FAIL(str(e))
   15.21 @@ -28,10 +28,10 @@ except ConsoleError, e:
   15.22  if run["return"] != 0:
   15.23      FAIL("block device isn't attached; can't detach!")
   15.24  
   15.25 -block_detach(domain, "hda1")
   15.26 +block_detach(domain, "xvda1")
   15.27  try:
   15.28  
   15.29 -    run = console.runCmd("cat /proc/partitions | grep hda1")
   15.30 +    run = console.runCmd("cat /proc/partitions | grep xvda1")
   15.31  except ConsoleError, e:
   15.32      saveLog(console.getHistory())
   15.33      FAIL(str(e))
    16.1 --- a/tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py	Wed Nov 01 08:38:22 2006 +0000
    16.2 +++ b/tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py	Wed Nov 01 08:39:45 2006 +0000
    16.3 @@ -12,7 +12,7 @@ def checkXmLongList(domain):
    16.4      s, o = traceCommand("xm list --long %s" % domain.getName())
    16.5      if s != 0:
    16.6          FAIL("xm list --long <dom> failed")
    16.7 -    if re.search("hda1", o):
    16.8 +    if re.search("xvda1", o):
    16.9          return True
   16.10      else:
   16.11          return False
   16.12 @@ -27,12 +27,12 @@ try:
   16.13  except DomainError,e:
   16.14      FAIL(str(e))
   16.15  
   16.16 -block_attach(domain, "phy:/dev/ram0", "hda1")
   16.17 +block_attach(domain, "phy:/dev/ram0", "xvda1")
   16.18  
   16.19  if not checkXmLongList(domain):
   16.20 -    FAIL("xm long list does not show that hda1 was attached")
   16.21 +    FAIL("xm long list does not show that xvda1 was attached")
   16.22  
   16.23 -block_detach(domain, "hda1")
   16.24 +block_detach(domain, "xvda1")
   16.25  
   16.26  if checkXmLongList(domain):
   16.27 -    FAIL("xm long list does not show that hda1 was removed")
   16.28 +    FAIL("xm long list does not show that xvda1 was removed")
    17.1 --- a/tools/xm-test/tests/block-integrity/01_block_device_read_verify.py	Wed Nov 01 08:38:22 2006 +0000
    17.2 +++ b/tools/xm-test/tests/block-integrity/01_block_device_read_verify.py	Wed Nov 01 08:39:45 2006 +0000
    17.3 @@ -33,10 +33,10 @@ s, o = traceCommand("md5sum /dev/ram1")
    17.4  
    17.5  dom0_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", o, re.M)
    17.6  
    17.7 -block_attach(domain, "phy:ram1", "hda1")
    17.8 +block_attach(domain, "phy:ram1", "xvda1")
    17.9  
   17.10  try:
   17.11 -    run = console.runCmd("md5sum /dev/hda1")
   17.12 +    run = console.runCmd("md5sum /dev/xvda1")
   17.13  except ConsoleError, e:
   17.14      FAIL(str(e))
   17.15  
    18.1 --- a/tools/xm-test/tests/block-integrity/02_block_device_write_verify.py	Wed Nov 01 08:38:22 2006 +0000
    18.2 +++ b/tools/xm-test/tests/block-integrity/02_block_device_write_verify.py	Wed Nov 01 08:39:45 2006 +0000
    18.3 @@ -28,12 +28,12 @@ except DomainError, e:
    18.4  
    18.5  console.setHistorySaveCmds(value=True)
    18.6  
    18.7 -block_attach(domain, "phy:ram1", "hda1")
    18.8 +block_attach(domain, "phy:ram1", "xvda1")
    18.9  
   18.10  console.setTimeout(120)
   18.11  
   18.12  try:
   18.13 -    run = console.runCmd("dd if=/dev/urandom bs=512 count=`cat /sys/block/hda1/size` | tee /dev/hda1 | md5sum")
   18.14 +    run = console.runCmd("dd if=/dev/urandom bs=512 count=`cat /sys/block/xvda1/size` | tee /dev/xvda1 | md5sum")
   18.15  except ConsoleError, e:
   18.16      FAIL(str(e))
   18.17  
    19.1 --- a/tools/xm-test/tests/block-list/01_block-list_pos.py	Wed Nov 01 08:38:22 2006 +0000
    19.2 +++ b/tools/xm-test/tests/block-list/01_block-list_pos.py	Wed Nov 01 08:39:45 2006 +0000
    19.3 @@ -11,7 +11,7 @@ from XmTestLib import *
    19.4  if ENABLE_HVM_SUPPORT:
    19.5      SKIP("Block-list not supported for HVM domains")
    19.6  
    19.7 -config = {"disk":"phy:/dev/ram0,hda1,w"}
    19.8 +config = {"disk":"phy:/dev/ram0,xvda1,w"}
    19.9  domain = XmTestDomain(extraConfig=config)
   19.10  
   19.11  try:
   19.12 @@ -22,7 +22,7 @@ except DomainError, e:
   19.13      FAIL("Unable to create domain")
   19.14  
   19.15  status, output = traceCommand("xm block-list %s" % domain.getId())
   19.16 -eyecatcher = "769"
   19.17 +eyecatcher = "51713"
   19.18  where = output.find(eyecatcher)
   19.19  if status != 0:
   19.20      FAIL("xm block-list returned bad status, expected 0, status is %i" % status)
   19.21 @@ -31,7 +31,7 @@ elif where < 0:
   19.22  
   19.23  #Verify the block device on DomainU
   19.24  try:
   19.25 -    run = console.runCmd("cat /proc/partitions | grep hda1")
   19.26 +    run = console.runCmd("cat /proc/partitions | grep xvda1")
   19.27  except ConsoleError, e:
   19.28      saveLog(console.getHistory())
   19.29      FAIL(str(e))
    20.1 --- a/tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py	Wed Nov 01 08:38:22 2006 +0000
    20.2 +++ b/tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py	Wed Nov 01 08:39:45 2006 +0000
    20.3 @@ -22,11 +22,11 @@ except DomainError, e:
    20.4      FAIL("Unable to create domain")
    20.5  
    20.6  #Attach one virtual block device to domainU
    20.7 -block_attach(domain, "phy:/dev/ram0", "hda1")
    20.8 +block_attach(domain, "phy:/dev/ram0", "xvda1")
    20.9  
   20.10  #Verify block-list on Domain0
   20.11  status, output = traceCommand("xm block-list %s" % domain.getId())
   20.12 -eyecatcher = "769"
   20.13 +eyecatcher = "51713"
   20.14  where = output.find(eyecatcher)
   20.15  if status != 0:
   20.16      FAIL("xm block-list returned bad status, expected 0, status is %i" % status)
   20.17 @@ -35,7 +35,7 @@ elif where < 0 :
   20.18  
   20.19  #Verify attached block device on DomainU
   20.20  try:
   20.21 -    run = console.runCmd("cat /proc/partitions | grep hda1")
   20.22 +    run = console.runCmd("cat /proc/partitions | grep xvda1")
   20.23  except ConsoleError, e:
   20.24      saveLog(console.getHistory())
   20.25      FAIL(str(e))
    21.1 --- a/tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py	Wed Nov 01 08:38:22 2006 +0000
    21.2 +++ b/tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py	Wed Nov 01 08:39:45 2006 +0000
    21.3 @@ -11,7 +11,7 @@ from XmTestLib import *
    21.4  if ENABLE_HVM_SUPPORT:
    21.5      SKIP("Block-list not supported for HVM domains")
    21.6  
    21.7 -config = {"disk":"phy:/dev/ram0,hda1,w"}
    21.8 +config = {"disk":"phy:/dev/ram0,xvda1,w"}
    21.9  domain = XmTestDomain(extraConfig=config)
   21.10  
   21.11  try:
   21.12 @@ -26,14 +26,14 @@ if status != 0:
   21.13      FAIL("Fail to list block device")
   21.14  
   21.15  #Add another virtual block device to the domain
   21.16 -status, output = traceCommand("xm block-attach %s phy:/dev/ram1 hda2 w" % domain.getId())
   21.17 +status, output = traceCommand("xm block-attach %s phy:/dev/ram1 xvda2 w" % domain.getId())
   21.18  if status != 0:
   21.19      FAIL("Fail to attach block device")
   21.20  
   21.21  #Verify block-list on Domain0
   21.22  status, output = traceCommand("xm block-list %s" % domain.getId())
   21.23 -eyecatcher1 = "769"
   21.24 -eyecatcher2 = "770"
   21.25 +eyecatcher1 = "51713"
   21.26 +eyecatcher2 = "51714"
   21.27  where1 = output.find(eyecatcher1)
   21.28  where2 = output.find(eyecatcher2)
   21.29  if status != 0:
   21.30 @@ -43,7 +43,7 @@ elif (where1 < 0) and (where2 < 0):
   21.31  
   21.32  #Verify attached block device on DomainU
   21.33  try:
   21.34 -    run = console.runCmd("cat /proc/partitions | grep hda1;cat /proc/partitions | grep hda2")
   21.35 +    run = console.runCmd("cat /proc/partitions | grep xvda1;cat /proc/partitions | grep xvda2")
   21.36  except ConsoleError, e:
   21.37      saveLog(console.getHistory())
   21.38      FAIL(str(e))
    22.1 --- a/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py	Wed Nov 01 08:38:22 2006 +0000
    22.2 +++ b/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py	Wed Nov 01 08:39:45 2006 +0000
    22.3 @@ -22,39 +22,39 @@ if s != 0:
    22.4  if o:
    22.5      FAIL("block-list without devices reported something!")
    22.6  
    22.7 -block_attach(domain, "phy:/dev/ram0", "hda1")
    22.8 +block_attach(domain, "phy:/dev/ram0", "xvda1")
    22.9  
   22.10  s, o = traceCommand("xm block-list %s" % domain.getName())
   22.11  if s != 0:
   22.12      FAIL("block-list failed")
   22.13 -if o.find("769") == -1:
   22.14 +if o.find("51713") == -1:
   22.15      FAIL("block-list didn't show the block device I just attached!")
   22.16  
   22.17 -block_attach(domain, "phy:/dev/ram1", "hda2")
   22.18 +block_attach(domain, "phy:/dev/ram1", "xvda2")
   22.19  
   22.20  s, o = traceCommand("xm block-list %s" % domain.getName())
   22.21  if s != 0:
   22.22      FAIL("block-list failed")
   22.23 -if o.find("770") == -1:
   22.24 +if o.find("51714") == -1:
   22.25      FAIL("block-list didn't show the other block device I just attached!")
   22.26  
   22.27 -block_detach(domain, "hda1")
   22.28 +block_detach(domain, "xvda1")
   22.29  
   22.30  s, o = traceCommand("xm block-list %s" % domain.getName())
   22.31  if s != 0:
   22.32      FAIL("block-list failed after detaching a device")
   22.33 -if o.find("769") != -1:
   22.34 -    FAIL("hda1 still shown in block-list after detach!")
   22.35 -if o.find("770") == -1:
   22.36 -    FAIL("hda2 not shown after detach of hda1!")
   22.37 +if o.find("51713") != -1:
   22.38 +    FAIL("xvda1 still shown in block-list after detach!")
   22.39 +if o.find("51714") == -1:
   22.40 +    FAIL("xvda2 not shown after detach of xvda1!")
   22.41  
   22.42 -block_detach(domain, "hda2")
   22.43 +block_detach(domain, "xvda2")
   22.44  
   22.45  s, o = traceCommand("xm block-list %s" % domain.getName())
   22.46  if s != 0:
   22.47      FAIL("block-list failed after detaching another device")
   22.48 -if o.find("770") != -1:
   22.49 -    FAIL("hda2 still shown in block-list after detach!")
   22.50 +if o.find("51714") != -1:
   22.51 +    FAIL("xvda2 still shown in block-list after detach!")
   22.52  if o:
   22.53      FAIL("block-list still shows something after all devices detached!")
   22.54