direct-io.hg

changeset 8349:8c5b7b6772ae

Added unit test for VMX configuration files.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Tue Dec 13 18:08:17 2005 +0000 (2005-12-13)
parents d37644abe52d
children 62d9ac63e7f5
files tools/python/xen/xm/tests/test_create.py
line diff
     1.1 --- a/tools/python/xen/xm/tests/test_create.py	Tue Dec 13 18:07:51 2005 +0000
     1.2 +++ b/tools/python/xen/xm/tests/test_create.py	Tue Dec 13 18:08:17 2005 +0000
     1.3 @@ -141,5 +141,55 @@ cpu_weight = 0.75
     1.4                   })
     1.5              
     1.6  
     1.7 +    def testVMXConfigFile(self):
     1.8 +        (fd, fname) = tempfile.mkstemp()
     1.9 +        try:
    1.10 +            os.write(fd,
    1.11 +                     '''
    1.12 +kernel = "/usr/lib/xen/boot/vmxloader"
    1.13 +builder='vmx'
    1.14 +memory = 128
    1.15 +name = "ExampleVMXDomain"
    1.16 +vcpus=1
    1.17 +vif = [ 'type=ioemu, bridge=xenbr0' ]
    1.18 +disk = [ 'file:/var/images/min-el3-i386.img,ioemu:hda,w' ]
    1.19 +device_model = '/usr/lib/xen/bin/qemu-dm'
    1.20 +sdl=0
    1.21 +vnc=1
    1.22 +vncviewer=1
    1.23 +ne2000=0
    1.24 +                     ''')
    1.25 +        finally:
    1.26 +            os.close(fd)
    1.27 +
    1.28 +        self.t('-f %s display=fakedisplay' % fname,
    1.29 +               { 'kernel'      : '/usr/lib/xen/boot/vmxloader',
    1.30 +                 'builder'     : 'vmx',
    1.31 +                 'memory'      : 128,
    1.32 +                 'name'        : 'ExampleVMXDomain',
    1.33 +                 'vcpus'       : 1,
    1.34 +                 'nics'        : -1,
    1.35 +                 'vif'         : ['type=ioemu, bridge=xenbr0'],
    1.36 +                 'disk'        : [['file:/var/images/min-el3-i386.img',
    1.37 +                                   'ioemu:hda', 'w', None]],
    1.38 +                 'device_model': '/usr/lib/xen/bin/qemu-dm',
    1.39 +
    1.40 +                 'extra'       : ('VNC_VIEWER=%s:%d ' %
    1.41 +                                  (xen.xm.create.get_host_addr(),
    1.42 +                                   xen.xm.create.VNC_BASE_PORT + 1)),
    1.43 +                 'vnc'         : 1,
    1.44 +                 'vncviewer'   : 1,
    1.45 +
    1.46 +                 'xm_file'     : fname,
    1.47 +                 'defconfig'   : fname,
    1.48 +                 'display'     : 'fakedisplay',
    1.49 +
    1.50 +                 'boot'        : 'c',
    1.51 +                 'dhcp'        : 'off',
    1.52 +                 'interface'   : 'eth0',
    1.53 +                 'path'        : '.:/etc/xen',
    1.54 +               })
    1.55 +
    1.56 +
    1.57  def test_suite():
    1.58      return unittest.makeSuite(test_create)