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] Added another test. Fix the existing tests to close the

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Added another test. Fix the existing tests to close the written config file
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Nov 2005 16:16:10 +0000
Delivery-date: Mon, 21 Nov 2005 16:16:44 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID d88b33abf533637d5b832381f38469e8255d5c58
# Parent  4f7b4ca2e30c83caf40e10876db62b5b48e7dd1f
Added another test.  Fix the existing tests to close the written config file
before running the test upon it, to ensure that the file is flushed.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 4f7b4ca2e30c -r d88b33abf533 tools/python/xen/xm/tests/test_create.py
--- a/tools/python/xen/xm/tests/test_create.py  Mon Nov 21 12:00:36 2005
+++ b/tools/python/xen/xm/tests/test_create.py  Mon Nov 21 12:03:45 2005
@@ -34,31 +34,79 @@
 
     def testCommandLine(self):
         (fd, fname) = tempfile.mkstemp()
+        os.close(fd)
+        self.t('-f %s kernel=/mykernel display=fakedisplay '
+               'macaddr=ab:cd:ef:ed nics=0' % fname,
+               { 'name'      : os.path.basename(fname),
+                 'xm_file'   : fname,
+                 'defconfig' : fname,
+                 'kernel'    : '/mykernel',
+                 'display'   : 'fakedisplay',
+                 'macaddr'   : 'ab:cd:ef:ed',
+                 'memory'    : 128,
+                 'vcpus'     : 1,
+                 'boot'      : 'c',
+                 'dhcp'      : 'off',
+                 'interface' : 'eth0',
+                 'path'      : '.:/etc/xen',
+                 'builder'   : 'linux',
+                 })
+
+
+    def testConfigFile(self):
+        (fd, fname) = tempfile.mkstemp()
         try:
-            self.t('-f %s kernel=/mykernel display=fakedisplay '
-                   'macaddr=ab:cd:ef:ed nics=0' % fname,
-                   { 'name'      : os.path.basename(fname),
-                     'xm_file'   : fname,
-                     'defconfig' : fname,
-                     'kernel'    : '/mykernel',
-                     'display'   : 'fakedisplay',
-                     'macaddr'   : 'ab:cd:ef:ed',
-                     'memory'    : 128,
-                     'vcpus'     : 1,
-                     'boot'      : 'c',
-                     'dhcp'      : 'off',
-                     'interface' : 'eth0',
-                     'path'      : '.:/etc/xen',
-                     'builder'   : 'linux',
-                     })
+            os.write(fd,
+                     '''
+kernel = "/boot/vmlinuz-xenU-smp"
+memory = 768
+name = "dom1"
+vcpus = 4
+nics = 1
+disk = ['phy:/dev/virt-blkdev-backend/dom1,sda1,w',
+'phy:/dev/virt-blkdev-backend/usr,sda2,r']
+root = "/dev/sda1 ro"
+extra = " profile=1 GATEWAY=10.0.1.254 NETMASK=255.255.0.0 IPADDR=10.0.134.1 
HOSTNAME=dom1"
+on_poweroff = 'destroy'
+on_reboot   = 'destroy'
+on_crash    = 'destroy'
+                     ''')
         finally:
             os.close(fd)
+
+        self.t('-f %s display=fakedisplay' % fname,
+               { 'kernel'      : '/boot/vmlinuz-xenU-smp',
+                 'memory'      : 768,
+                 'name'        : 'dom1',
+                 'vcpus'       : 4,
+                 'nics'        : 1,
+                 'root'        : '/dev/sda1 ro',
+                 'extra'       : ' profile=1 GATEWAY=10.0.1.254 
NETMASK=255.255.0.0 IPADDR=10.0.134.1 HOSTNAME=dom1',
+                 'on_poweroff' : 'destroy',
+                 'on_reboot'   : 'destroy',
+                 'on_crash'    : 'destroy',
+                 'disk'        : [['phy:/dev/virt-blkdev-backend/dom1',
+                                   'sda1', 'w', None],
+                                  ['phy:/dev/virt-blkdev-backend/usr',
+                                   'sda2', 'r', None]],
+
+                 'xm_file'     : fname,
+                 'defconfig'   : fname,
+                 'display'     : 'fakedisplay',
+
+                 'boot'        : 'c',
+                 'dhcp'        : 'off',
+                 'interface'   : 'eth0',
+                 'path'        : '.:/etc/xen',
+                 'builder'     : 'linux',
+               })
 
 
     def testConfigFileAndCommandLine(self):
         (fd, fname) = tempfile.mkstemp()
-        os.write(fd,
-                 '''
+        try:
+            os.write(fd,
+                     '''
 name       = "testname"
 memory     = 256
 ssidref    = 1
@@ -66,30 +114,30 @@
 maxmem     = 1024
 cpu        = 2
 cpu_weight = 0.75
-                 ''')
-        try:
-            self.t('-f %s display=fakedisplay macaddr=ab:cd:ef:ed nics=0' %
-              fname,
-                   { 'name'       : 'testname',
-                     'xm_file'    : fname,
-                     'defconfig'  : fname,
-                     'kernel'     : '/mykernel',
-                     'display'    : 'fakedisplay',
-                     'macaddr'    : 'ab:cd:ef:ed',
-                     'memory'     : 256,
-                     'maxmem'     : 1024,
-                     'cpu'        : 2,
-                     'ssidref'    : 1,
-                     'cpu_weight' : 0.75,
-                     'vcpus'      : 1,
-                     'boot'       : 'c',
-                     'dhcp'       : 'off',
-                     'interface'  : 'eth0',
-                     'path'       : '.:/etc/xen',
-                     'builder'    : 'linux',
-                     })
+                     ''')
         finally:
             os.close(fd)
+
+        self.t('-f %s display=fakedisplay macaddr=ab:cd:ef:ed nics=0' %
+          fname,
+               { 'name'       : 'testname',
+                 'xm_file'    : fname,
+                 'defconfig'  : fname,
+                 'kernel'     : '/mykernel',
+                 'display'    : 'fakedisplay',
+                 'macaddr'    : 'ab:cd:ef:ed',
+                 'memory'     : 256,
+                 'maxmem'     : 1024,
+                 'cpu'        : 2,
+                 'ssidref'    : 1,
+                 'cpu_weight' : 0.75,
+                 'vcpus'      : 1,
+                 'boot'       : 'c',
+                 'dhcp'       : 'off',
+                 'interface'  : 'eth0',
+                 'path'       : '.:/etc/xen',
+                 'builder'    : 'linux',
+                 })
             
 
 def test_suite():

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Added another test. Fix the existing tests to close the written config file, Xen patchbot -unstable <=