Skip to contentSkip to conversation

Update to use uClibc buildroot-snapshot

PATCH In review Tony Breeds 2 participants 17 messages Oct 20, 2006 – Nov 1, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/10 Update to use uClibc buildroot-snapshot

Update to use uClibc buildroot-snapshot.

Dated file no longer exists on upstream server.

---

tools/xm-test/ramdisk/Makefile.am | 3 +--

1 file changed, 1 insertion(+), 2 deletions(-)
tools/xm-test/ramdisk/Makefile.am +1 -2
@@ -2,9 +2,8 @@ INITRD ?= http://xm-test.xensource.com/r
 
 EXTRA_DIST = skel configs patches
 
-BR_TAR = buildroot-20060606.tar.bz2
+BR_TAR = buildroot-snapshot.tar.bz2
 BR_URL = http://buildroot.uclibc.org/downloads/snapshots/$(BR_TAR)
-#BR_URL = http://buildroot.uclibc.org/downloads/snapshots/buildroot-snapshot.tar.bz2
 BR_SRC = buildroot
 BR_IMG = $(BR_SRC)/rootfs.i386.ext2
#2 lore raw

PATCH 2/10 Remove hard coded reference to i386

In reply to a message not in the archive

Remove hard coded reference to i386.

In preparation for other architectures.

---

tools/xm-test/ramdisk/Makefile.am | 6 ++++--

1 file changed, 4 insertions(+), 2 deletions(-)
tools/xm-test/ramdisk/Makefile.am +4 -2
@@ -2,12 +2,14 @@ INITRD ?= http://xm-test.xensource.com/r
 
 EXTRA_DIST = skel configs patches
 
+BR_ARCH = $(shell uname -m | sed -e s/i.86/i386/)
+
 BR_TAR = buildroot-snapshot.tar.bz2
 BR_URL = http://buildroot.uclibc.org/downloads/snapshots/$(BR_TAR)
 BR_SRC = buildroot
-BR_IMG = $(BR_SRC)/rootfs.i386.ext2
+BR_IMG = $(BR_SRC)/rootfs.$(BR_ARCH).ext2
 
-BR_ROOT = build_i386/root
+BR_ROOT = build_$(BR_ARCH)/root
 
 HVM_SCRIPT = bin/create_disk_image
#3 lore raw

PATCH 3/10 Rename buildroot -> buildroot-i386

In reply to a message not in the archive

Rename buildroot -> buildroot-i386.

Also update Makefile.

After patch

---

tools/xm-test/ramdisk/Makefile.am            |    2 
tools/xm-test/ramdisk/configs/buildroot      |  330 -------------------
tools/xm-test/ramdisk/configs/buildroot-i386 |  330 +++++++++++++++++++
3 files changed, 331 insertions(+), 331 deletions(-)
tools/xm-test/ramdisk/Makefile.am +1 -1
@@ -31,7 +31,7 @@ endif
 	tar xjf $(BR_TAR)
 
 $(BR_IMG): $(BR_SRC)
-	cp configs/buildroot $(BR_SRC)/.config
+	cp configs/buildroot-$(BR_ARCH) $(BR_SRC)/.config
 	cp configs/busybox $(BR_SRC)/package/busybox/busybox.config
 	cp configs/uClibc $(BR_SRC)/toolchain/uClibc/uClibc.config
 	(for i in patches/buildroot/*.patch; do \
tools/xm-test/ramdisk/configs/buildroot-i386 new file +330 -0

330 lines not on this page · raw message

tools/xm-test/ramdisk/configs/buildroot deleted +0 -330

330 lines not on this page · raw message

#4 lore raw

PATCH 4/10 Update .hgignore to remove artifacts of ramdisk build

In reply to a message not in the archive

Update .hgignore to remove artifacts of ramdisk build.

---

.hgignore | 9 +++++++++

1 file changed, 9 insertions(+)
.hgignore +9 -0
@@ -184,6 +184,15 @@
 ^tools/xentrace/xenctx$
 ^tools/xentrace/xentrace$
 ^tools/xm-test/ramdisk/buildroot
+^tools/xm-test/aclocal.m4$
+^tools/xm-test/autom4te
+^tools/xm-test/install-sh$
+^tools/xm-test/missing$
+^tools/xm-test/config(ure|.log|.status)$
+^tools/xm-test/Makefile(.in)*$
+^tools/xm-test/.*/Makefile(.in)*$
+^tools/xm-test/lib/XmTestLib/config.py$
+^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^xen/BLOG$
 ^xen/TAGS$
 ^xen/arch/x86/asm-offsets\.s$
#5 lore raw

PATCH 5/10 Refactor code to encapsulate architecture decisions in one place

In reply to a message not in the archive

Refactor code to encapsulate architecture decisions in one place.

Also includes some whitespace fixes.

---

tools/xm-test/lib/XmTestLib/XenDomain.py   |   73 +++------------
tools/xm-test/lib/XmTestLib/arch.py        |  102 +++++++++++++++++++++
tools/xm-test/lib/XmTestReport/OSReport.py |   10 --
tools/xm-test/lib/XmTestReport/arch.py     |   42 ++++++++
4 files changed, 161 insertions(+), 66 deletions(-)
tools/xm-test/lib/XmTestLib/XenDomain.py +15 -58
@@ -20,33 +20,22 @@
 
 import sys
 import commands
-import os
 import re
 import time
 
 from Xm import *
+from arch import *
 from Test import *
 from config import *
 from Console import *
 from XenDevice import *
 
-BLOCK_ROOT_DEV = "hda"
-
-def getDeviceModel():
-    """Get the path to the device model based on
-    the architecture reported in uname"""
-    arch = os.uname()[4]
-    if re.search("64", arch):
-        return "/usr/lib64/xen/bin/qemu-dm"
-    else:
-        return "/usr/lib/xen/bin/qemu-dm"
 
 def getDefaultKernel():
-    """Get the path to the default DomU kernel"""
-    dom0Ver = commands.getoutput("uname -r");
-    domUVer = dom0Ver.replace("xen0", "xenU");
-    
-    return "/boot/vmlinuz-" + domUVer;
+    return arch.getDefaultKernel()
+
+def getRdPath():
+    return arch.getRdPath()
 
 def getUniqueName():
     """Get a uniqueish name for use in a domain"""
@@ -55,43 +44,8 @@ def getUniqueName():
     test_name = re.sub("\.test", "", test_name)
     test_name = re.sub("[\/\.]", "", test_name)
     name = "%s-%i" % (test_name, unixtime)
-    
+
     return name
-
-def getRdPath():
-    rdpath = os.environ.get("RD_PATH")
-    if not rdpath:
-        rdpath = "../../ramdisk"
-    rdpath = os.path.abspath(rdpath)
-
-    return rdpath
-
-ParavirtDefaults = {"memory"       : 64,
-                    "vcpus"        : 1,
-                    "kernel"       : getDefaultKernel(),
-                    "root"         : "/dev/ram0",
-                    "ramdisk"      : getRdPath() + "/initrd.img"
-                    }
-HVMDefaults =      {"memory"       : 64,
-                    "vcpus"        : 1,
-                    "acpi"         : 0,
-                    "apic"         : 0,
-                    "disk"         : ["file:%s/disk.img,ioemu:%s,w!" %
-                                   (getRdPath(), BLOCK_ROOT_DEV)],
-                    "kernel"       : "/usr/lib/xen/boot/hvmloader",
-                    "builder"      : "hvm",
-                    "sdl"          : 0,
-                    "vnc"          : 0,
-                    "vncviewer"    : 0,
-                    "nographic"    : 1,
-                    "serial"       : "pty",
-                    "device_model" : getDeviceModel()
-                    }
-
-if ENABLE_HVM_SUPPORT:
-    configDefaults = HVMDefaults
-else:
-    configDefaults = ParavirtDefaults
 
 class XenConfig:
     """An object to help create a xen-compliant config file"""
@@ -140,7 +94,8 @@ class XenConfig:
 
     def setOpt(self, name, value):
         """Set an option in the config"""
-        if name in self.opts.keys() and isinstance(self.opts[name], list) and not isinstance(value, list):
+        if name in self.opts.keys() and isinstance(self.opts[name] ,
+                                        list) and not isinstance(value, list):
                 self.opts[name] = [value]
         else:
             self.opts[name] = value
@@ -177,7 +132,7 @@ class DomainError(Exception):
             self.errorcode = int(errorcode)
         except Exception, e:
             self.errorcode = -1
-            
+
     def __str__(self):
         return str(self.msg)
 
@@ -199,7 +154,7 @@ class XenDomain:
         self.devices = {}
         self.netEnv = "bridge"
 
-        # Set domain type, either PV for ParaVirt domU or HVM for 
+        # Set domain type, either PV for ParaVirt domU or HVM for
         # FullVirt domain
         if ENABLE_HVM_SUPPORT:
             self.type = "HVM"
@@ -332,7 +287,8 @@ class XenDomain:
 
 class XmTestDomain(XenDomain):
 
-    def __init__(self, name=None, extraConfig=None, baseConfig=configDefaults):
+    def __init__(self, name=None, extraConfig=None,
+                 baseConfig=arch.configDefaults):
         """Create a new xm-test domain
         @param name: The requested domain name
         @param extraConfig: Additional configuration options
@@ -351,11 +307,12 @@ class XmTestDomain(XenDomain):
         XenDomain.__init__(self, config.getOpt("name"), config=config)
 
     def minSafeMem(self):
-        return 32
+        return arch.minSafeMem
 
 class XmTestNetDomain(XmTestDomain):
 
-    def __init__(self, name=None, extraConfig=None, baseConfig=configDefaults):
+    def __init__(self, name=None, extraConfig=None,
+                 baseConfig=arch.configDefaults):
         """Create a new xm-test domain with one network device
         @param name: The requested domain name
         @param extraConfig: Additional configuration options
tools/xm-test/lib/XmTestReport/OSReport.py +2 -8
diff -r 8c17d10f39c9 -r 413d8625debe tools/xm-test/lib/XmTestReport/OSReport.py
@@ -29,6 +29,7 @@ import os
 import os
 import commands
 import sys
+import arch
 
 class Machine:
 
@@ -89,8 +90,6 @@ class Machine:
         self.values = {}
         self.errors = 0
 
-        cpuValues = {"model_name"       : "Unknown",
-                     "flags"            : "Unknown"}
         xenValues = {"nr_cpus"          : "Unknown",
                      "nr_nodes"         : "Unknown",
                      "sockets_per_node" : "Unknown",
@@ -100,12 +99,7 @@ class Machine:
                      "total_memory"     : "Unknown"}
 
         xen = self.__getXenInfo(xenValues)
-        cpu = self.__getCpuInfo(cpuValues)
-
-        if cpu["model_name"] == "Unknown":   
-            cpuValues={"arch"  : "Unknown",
-                       "features": "Unknown"}
-            cpu=self.__getCpuInfo(cpuValues)
+        cpu = self.__getCpuInfo(arch.cpuValues)
 
         for k in xen.keys():
             self.values[k] = xen[k]
tools/xm-test/lib/XmTestLib/arch.py new file +102 -0

102 lines not on this page · raw message

tools/xm-test/lib/XmTestReport/arch.py new file +42 -0

42 lines not on this page · raw message

#6 lore raw

PATCH 6/10 Add configuration data for powerpc

In reply to a message not in the archive

Add configuration data for powerpc.

Allows for building of initrd, and running of tests.

---

tools/xm-test/lib/XmTestLib/arch.py             |   26 +
tools/xm-test/lib/XmTestReport/arch.py          |    6 
tools/xm-test/ramdisk/Makefile.am               |    2 
tools/xm-test/ramdisk/configs/buildroot-powerpc |  334 ++++++++++++++++
4 files changed, 367 insertions(+), 1 deletion(-)
tools/xm-test/lib/XmTestLib/arch.py +26 -0
@@ -80,6 +80,26 @@ ia_HVMDefaults =      {"memory"       : 
 }
 # End  : Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
 
+# Begin: PowerPC
+def ppc_minSafeMem():
+    return 64
+
+def ppc_getDefaultKernel():
+    """Get the path to the default DomU kernel"""
+    dom0Ver = commands.getoutput("uname -r");
+    domUVer = dom0Ver.replace("xen0", "xenU");
+
+    return "/boot/vmlinux-" + domUVer;
+
+ppc_ParavirtDefaults = {"memory"  : 64,
+                        "vcpus"   : 1,
+                        "kernel"  : ppc_getDefaultKernel(),
+                        "root"    : "/dev/ram0",
+                        "ramdisk" : getRdPath() + "/initrd.img",
+                        "extra"   : "xencons=tty128 console=tty128",
+}
+# End  : PowerPC
+
 """Convert from uname specification to a more general platform."""
 _uname_to_arch_map = {
     "i386"  : "x86",
@@ -87,6 +107,8 @@ _uname_to_arch_map = {
     "i586"  : "x86",
     "i686"  : "x86",
     "ia64"  : "ia64",
+    "ppc"   : "powerpc",
+    "ppc64" : "powerpc",
 }
 
 # Lookup current platform.
@@ -98,5 +120,9 @@ if _arch == "x86" or _arch == "ia64":
         configDefaults = ia_HVMDefaults
     else:
         configDefaults = ia_ParavirtDefaults
+elif _arch == "powerpc":
+    minSafeMem = ppc_minSafeMem
+    getDefaultKernel = ppc_getDefaultKernel
+    configDefaults = ppc_ParavirtDefaults
 else:
     raise ValueError, "Unknown architecture!"
tools/xm-test/lib/XmTestReport/arch.py +6 -0
diff -r 413d8625debe -r 2cc5afde2692 tools/xm-test/lib/XmTestReport/arch.py
@@ -29,6 +29,8 @@ _uname_to_arch_map = {
     "i586"  : "x86",
     "i686"  : "x86",
     "ia64"  : "ia64",
+    "ppc"   : "powerpc",
+    "ppc64" : "powerpc",
 }
 
 _arch = _uname_to_arch_map.get(os.uname()[4], "Unknown")
@@ -38,5 +40,9 @@ elif _arch == "ia64":
 elif _arch == "ia64":
     cpuValues = {"arch"     : "Unknown",
                  "features" : "Unknown"}
+elif _arch == "powerpc":
+    cpuValues = {"cpu"      : "Unknown",
+                 "platform" : "Unknown",
+                 "revision" : "Unknown"}
 else:
     raise ValueError, "Unknown architecture!"
tools/xm-test/ramdisk/Makefile.am +1 -1
diff -r 413d8625debe -r 2cc5afde2692 tools/xm-test/ramdisk/Makefile.am
@@ -2,7 +2,7 @@ INITRD ?= http://xm-test.xensource.com/r
 
 EXTRA_DIST = skel configs patches
 
-BR_ARCH = $(shell uname -m | sed -e s/i.86/i386/)
+BR_ARCH = $(shell uname -m | sed -e s/i.86/i386/ -e 's/ppc\(64\)*/powerpc/')
 
 BR_TAR = buildroot-snapshot.tar.bz2
 BR_URL = http://buildroot.uclibc.org/downloads/snapshots/$(BR_TAR)
tools/xm-test/ramdisk/configs/buildroot-powerpc new file +334 -0

334 lines not on this page · raw message

#7 lore raw

PATCH 7/10 Add ability to inspect messages from domain for arbitrary strings

In reply to a message not in the archive

Add ability to inspect messages from domain for arbitrary strings.

Used on PowerPC to FAIL(), if the guest domain hits a BUG() and enters XMON.

---

tools/xm-test/lib/XmTestLib/Console.py | 5 +++++
tools/xm-test/lib/XmTestLib/arch.py | 20 ++++++++++++++++++++

2 files changed, 25 insertions(+)
tools/xm-test/lib/XmTestLib/Console.py +5 -0
@@ -31,6 +31,7 @@ import fcntl
 import fcntl
 import select
 
+import arch
 from Test import *
 
 TIMEDOUT = 1
@@ -120,6 +121,7 @@ class XmConsole:
     def __getprompt(self, fd):
         timeout = 0
         bytes = 0
+        buffer = ""
         while timeout < 180:
             # eat anything while total bytes less than limit else raise RUNAWAY
             while (not self.limit) or (bytes < self.limit):
@@ -130,6 +132,7 @@ class XmConsole:
                         if self.debugMe:
                             sys.stdout.write(foo)
                         bytes += 1
+                        buffer += foo
                     except Exception, exn:
                         raise ConsoleError(str(exn))
                 else:
@@ -137,6 +140,8 @@ class XmConsole:
             else:
                 raise ConsoleError("Console run-away (exceeded %i bytes)"
                                    % self.limit, RUNAWAY)
+            # Check to see if the buffer contains anything interetsing
+            arch.checkBuffer(buffer)
             # press enter
             os.write(self.consoleFd, "\n")
             # look for prompt
tools/xm-test/lib/XmTestLib/arch.py +20 -0
diff -r 2cc5afde2692 -r 6bad455e70de tools/xm-test/lib/XmTestLib/arch.py
@@ -25,6 +25,8 @@ import config
 import config
 import commands
 
+from Test import *
+
 BLOCK_ROOT_DEV = "hda"
 
 # This isn't truly platform related but it makes the code tidier
@@ -38,6 +40,9 @@ def getRdPath():
     return rdpath
 
 # Begin: Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
+def ia_checkBuffer(buffer):
+    return
+
 def ia_minSafeMem():
     return 32
 
@@ -81,6 +86,19 @@ ia_HVMDefaults =      {"memory"       : 
 # End  : Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
 
 # Begin: PowerPC
+def ppc_checkBuffer(buffer):
+    checks = [
+        {"pattern" : re.compile("^\d+:mon>\s*$", re.MULTILINE),
+         "message" : "domain trapped into XMON"},
+    ]
+
+    for i in range(0, len(checks)):
+        check=checks[i]
+        if check.get('pattern').search(buffer):
+		FAIL(check.get('message'))
+
+    return
+
 def ppc_minSafeMem():
     return 64
 
@@ -116,6 +134,7 @@ if _arch == "x86" or _arch == "ia64":
 if _arch == "x86" or _arch == "ia64":
     minSafeMem = ia_minSafeMem
     getDefaultKernel = ia_getDefaultKernel
+    checkBuffer = ia_checkBuffer
     if config.ENABLE_HVM_SUPPORT:
         configDefaults = ia_HVMDefaults
     else:
@@ -123,6 +142,7 @@ elif _arch == "powerpc":
 elif _arch == "powerpc":
     minSafeMem = ppc_minSafeMem
     getDefaultKernel = ppc_getDefaultKernel
+    checkBuffer = ppc_checkBuffer
     configDefaults = ppc_ParavirtDefaults
 else:
     raise ValueError, "Unknown architecture!"
#8 lore raw

PATCH 8/10 Ignore generated .test files

In reply to a message not in the archive

Ignore generated .test files.

---

.hgignore | 1 +

1 file changed, 1 insertion(+)
.hgignore +1 -0
@@ -193,6 +193,7 @@
 ^tools/xm-test/.*/Makefile(.in)*$
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
+^tools/xm-test/tests/.*\.test$
 ^xen/BLOG$
 ^xen/TAGS$
 ^xen/arch/x86/asm-offsets\.s$
#9 lore raw

PATCH 9/10 Default to appending to "extra" in XenConfig

In reply to a message not in the archive

Default to appending to "extra" in XenConfig.

PowerPC needs console information from the command line. Resetting the whole command line causes false failures.

---

tools/xm-test/lib/XmTestLib/XenDomain.py | 3 +++

1 file changed, 3 insertions(+)
tools/xm-test/lib/XmTestLib/XenDomain.py +3 -0
@@ -97,6 +97,9 @@ class XenConfig:
         if name in self.opts.keys() and isinstance(self.opts[name] ,
                                         list) and not isinstance(value, list):
                 self.opts[name] = [value]
+        # "extra" is special so append to it.
+        elif name == "extra" and name in self.opts.keys():
+            self.opts[name] += " %s" % (value)
         else:
             self.opts[name] = value
#10 lore raw

PATCH 10/10 Fix Memory assumptions in the create tests

In reply to a message not in the archive

Fix Memory assumptions in the create tests.

Use the architecture specified idea of minimum memory.

---

tools/xm-test/tests/create/11_create_concurrent_pos.py        |    2 -
tools/xm-test/tests/create/12_create_concurrent_stress_pos.py |   11 +++++++--
tools/xm-test/tests/create/14_create_blockroot_pos.py         |   11 ++-------
tools/xm-test/tests/create/15_create_smallmem_pos.py          |    4 +--
tools/xm-test/tests/create/16_create_smallmem_neg.py          |   12 +++++-----
5 files changed, 21 insertions(+), 19 deletions(-)
tools/xm-test/tests/create/11_create_concurrent_pos.py +1 -1
@@ -16,7 +16,7 @@ else:
     MAX_DOMS = 50
 
 MIN_DOMS    = 5
-MEM_PER_DOM = 24
+MEM_PER_DOM = minSafeMem()
 
 domains = []
 console = []
tools/xm-test/tests/create/12_create_concurrent_stress_pos.py +9 -2
diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/12_create_concurrent_stress_pos.py
@@ -8,10 +8,17 @@ import time
 import time
 
 DOMS=5
-MEM=32
+MEM=minSafeMem()
 DUR=60
 
 domains = []
+
+free_mem = int(getInfo("free_memory"))
+NUM_DOMS = int(free_mem / MEM)
+
+if NUM_DOMS < DOMS:
+    SKIP("Need %i MB of RAM to start %i@%iMB domains! (%i MB avail)" %
+         (DOMS * MEM, DOMS, MEM, free_mem))
 
 for i in range(0,DOMS):
     dom = XmTestDomain(extraConfig={"memory" : MEM})
@@ -44,7 +51,7 @@ for d, c in domains:
 
     if verbose:
         print "Testing domain %s..." % d.getName()
-    
+
     run = c.runCmd("ls")
 
     if run["return"] != 0:
tools/xm-test/tests/create/14_create_blockroot_pos.py +3 -8
diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/14_create_blockroot_pos.py
@@ -18,17 +18,12 @@ rdpath = getRdPath()
 #     print "Using %s" % output
 
 if ENABLE_HVM_SUPPORT:
-    domain = XmTestDomain(name="14_create_blockroot")
+    config = None
 else:
-    config = {"memory" : "64",
-              "root"   : "/dev/hda1",
-              "name"   : "14_create_blockroot",
-              "kernel" : getDefaultKernel(),
+    config = {"root"   : "/dev/hda1",
               "disk"   : "file:%s/initrd.img,hda1,w" % rdpath
               }
-    domConfig = XenConfig()
-    domConfig.setOpts(config)
-    domain = XenDomain(name=domConfig.getOpt("name"), config=domConfig)
+domain = XmTestDomain(name="14_create_blockroot", extraConfig=config)
 
 try:
     console = domain.start()
tools/xm-test/tests/create/15_create_smallmem_pos.py +2 -2
diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/15_create_smallmem_pos.py
@@ -5,8 +5,8 @@
 
 from XmTestLib import *
 
-# 32MBs is the default lower limit for creating domains, it should work
-MEM = 32
+# Create a domain with the minimum memory allocation
+MEM = minSafeMem()
 
 domain = XmTestDomain(extraConfig={"memory": MEM,
                                    "extra" :"mem=%iM" % MEM})
tools/xm-test/tests/create/16_create_smallmem_neg.py +6 -6
diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/16_create_smallmem_neg.py
@@ -3,11 +3,11 @@
 # Copyright (C) International Business Machines Corp., 2005
 # Author: Dan Smith <[email protected]>
 
+import re
 from XmTestLib import *
 
-# This is under the default lower limit of 32 and we expect this test
-# to fail. 16MBs isn't enough for the -xen kernel.
-MEM = 16
+# Create a domaain without enough memory.
+MEM = minSafeMem() - 1
 
 domain = XmTestDomain(extraConfig={"memory": MEM,
                                    "extra" :"mem=%iM" % MEM})
@@ -16,13 +16,13 @@ try:
     console = domain.start()
     console.runCmd("ls")
 except DomainError, e:
-    FAIL("Unable to start a domain with %i MB" % MEM)
+    if not re.search('^Error: Domain memory must be at least \d+ KB', e.extra):
+        FAIL("Unable to start a domain with %i MB" % MEM)
 except ConsoleError, e:
     if e.reason == RUNAWAY:
         print "Domain with %i MB has runaway console as expected" % MEM
-    else:
-        print "Starting a domain with %i MB failed as expected" % MEM
 else:
     FAIL("Starting a console with %i MB passed, expected test to fail" % MEM)
 
+print "Starting a domain with %i MB failed as expected" % MEM
 domain.destroy()
#11 lore raw

Re: [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests

Quoted 14 lines · Tony Breeds

Fix Memory assumptions in the create tests.

Use the architecture specified idea of minimum memory.

---

[Snip]

diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/16_create_smallmem_neg.py

tools/xm-test/tests/create/16_create_smallmem_neg.py +0 -0
@@ -3,11 +3,11 @@
 # Copyright (C) International Business Machines Corp., 2005

tools/xm-test/tests/create/16_create_smallmem_neg.py line 10

Quoted 10 lines
tools/xm-test/tests/create/16_create_smallmem_neg.py +3 -3
 # Author: Dan Smith <[email protected]>
 
+import re
 from XmTestLib import *
 
-# This is under the default lower limit of 32 and we expect this test
-# to fail. 16MBs isn't enough for the -xen kernel.
-MEM = 16
+# Create a domaain without enough memory.
+MEM = minSafeMem() - 1

I'm not convinced by this one. Just because 32 MiB is known to be safe, that doesn't mean that 31 MiB will cause the domain to crash. The 16 MiB value is deliberately _far_ too small, so that the OOM killer kicks in, and the console runaway is detected.

I don't want this test to intermittently succeed, even if it is a negative test -- it makes the results hard to analyse.

Is the 16 MiB value a problem for PPC, or were you deliberately trying to test that 63 MiB failed on that platform?

We could add another arch-specific option -- tooLittleMem() or something -- or we could just leave this value at 16 MiB.

Ewan.

#12 lore raw

Re: [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests

Quoted 4 lines · Ewan Mellor

I'm not convinced by this one. Just because 32 MiB is known to be safe, that doesn't mean that 31 MiB will cause the domain to crash. The 16 MiB value is deliberately _far_ too small, so that the OOM killer kicks in, and the console runaway is detected.

Okay, that makes more sense.

Quoted 5 lines

I don't want this test to intermittently succeed, even if it is a negative test -- it makes the results hard to analyse.

Is the 16 MiB value a problem for PPC, or were you deliberately trying to test that 63 MiB failed on that platform?

PPC will fail for any memory value < 64M, so 16 or 63 makes little difference. I probably should haev said this in the commit message but I changed this test to use minSafeMem() to be consistent with the other changes I made.

Quoted 2 lines

We could add another arch-specific option -- tooLittleMem() or something -- or we could just leave this value at 16 MiB.

Okay leaving it set at 16MiB, is probably the right thing. If we get to a state the an architecture or OS needs to vary it we can look at something like tooLittleMem() then.

Yours Tony

linux.conf.au http://linux.conf.au/ || http://lca2007.linux.org.au/
Jan 15-20 2007 The Australian Linux Technical Conference!

#13 lore raw

Re: [Xen-devel] [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests

Quoted 3 lines · Tony Breeds

Okay leaving it set at 16MiB, is probably the right thing. If we get to a state the an architecture or OS needs to vary it we can look at something like tooLittleMem() then.

OK, I've taken the most of the patch, but with the 16MiB low limit left in. What's this bit though (I haven't taken this yet)?

tools/xm-test/tests/create/14_create_blockroot_pos.py +3 -8
diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/14_create_blockroot_pos.py
@@ -18,17 +18,12 @@ rdpath = getRdPath()
 #     print "Using %s" % output
 
 if ENABLE_HVM_SUPPORT:
-    domain = XmTestDomain(name="14_create_blockroot")
+    config = None
 else:
-    config = {"memory" : "64",
-              "root"   : "/dev/hda1",
-              "name"   : "14_create_blockroot",
-              "kernel" : getDefaultKernel(),
+    config = {"root"   : "/dev/hda1",
               "disk"   : "file:%s/initrd.img,hda1,w" % rdpath
               }
-    domConfig = XenConfig()
-    domConfig.setOpts(config)
-    domain = XenDomain(name=domConfig.getOpt("name"), config=domConfig)
+domain = XmTestDomain(name="14_create_blockroot", extraConfig=config)
 
 try:
     console = domain.start()

Ewan.

#14 lore raw

Re: [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests

Quoted 1 line · Ewan Mellor

OK, I've taken the most of the patch, but with the 16MiB low limit left in.

Great.

Quoted 1 line

What's this bit though (I haven't taken this yet)?

Essentially the XenDomain class does not respect the arch defaults where as XmTestDomain does. This part of the patch forces both HVM and non-HVM tests to use XmTestDomain. With appropriate changes to the extraConfig arg.

On PPC we need to use the arch defaults to get the console setup correctly.

I chose not to include the arch defaults in XenDomain as this gives us flexibility for the future.

Quoted 14 lines

diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/14_create_blockroot_pos.py

tools/xm-test/tests/create/14_create_blockroot_pos.py +1 -5
@@ -18,17 +18,12 @@ rdpath = getRdPath()
 #     print "Using %s" % output
 
 if ENABLE_HVM_SUPPORT:
-    domain = XmTestDomain(name="14_create_blockroot")
+    config = None
 else:
-    config = {"memory" : "64",
-              "root"   : "/dev/hda1",
-              "name"   : "14_create_blockroot",
-              "kernel" : getDefaultKernel(),

tools/xm-test/tests/create/14_create_blockroot_pos.py rdpath = getRdPath() · line 29

Quoted 10 lines
tools/xm-test/tests/create/14_create_blockroot_pos.py +2 -3
+    config = {"root"   : "/dev/hda1",
               "disk"   : "file:%s/initrd.img,hda1,w" % rdpath
               }
-    domConfig = XenConfig()
-    domConfig.setOpts(config)
-    domain = XenDomain(name=domConfig.getOpt("name"), config=domConfig)
+domain = XmTestDomain(name="14_create_blockroot", extraConfig=config)
 
 try:
     console = domain.start()

Yours Tony

linux.conf.au http://linux.conf.au/ || http://lca2007.linux.org.au/
Jan 15-20 2007 The Australian Linux Technical Conference!

#15 lore raw

Re: [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests

Quoted 3 lines · Tony Breeds

tools/xm-test/tests/create/14_create_blockroot_pos.py rdpath = getRdPath() · line 21

Quoted 3 lines

if ENABLE_HVM_SUPPORT:

tools/xm-test/tests/create/14_create_blockroot_pos.py +1 -1
-    domain = XmTestDomain(name="14_create_blockroot")
+    config = None

On a differernt note does block-attch/detach work on HVM?

I see:
---
if ENABLE_HVM_SUPPORT:
SKIP("Block-attch not supported on HVM domains")
---
in some of the block-* tests?

Yours Tony

linux.conf.au http://linux.conf.au/ || http://lca2007.linux.org.au/
Jan 15-20 2007 The Australian Linux Technical Conference!

#16 lore raw

Re: [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests

In reply to Ewan Mellor
Quoted 2 lines · Ewan Mellor

OK, I've taken the most of the patch, but with the 16MiB low limit left in. What's this bit though (I haven't taken this yet)?

Hi Ewan,
What are the outstanding issues with this patch? I'm keen to
get it merged if you're happy with it.

Yours Tony

linux.conf.au http://linux.conf.au/ || http://lca2007.linux.org.au/
Jan 15-20 2007 The Australian Linux Technical Conference!

#17 lore raw

Re: [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests

Quoted 8 lines · Tony Breeds
Quoted 2 lines · Ewan Mellor

OK, I've taken the most of the patch, but with the 16MiB low limit left in. What's this bit though (I haven't taken this yet)?

Hi Ewan,
What are the outstanding issues with this patch? I'm keen to
get it merged if you're happy with it.

Nothing wrong with it -- I just forgot about it. Applied now.

Thanks,

Ewan.