From: Tony Breeds <tony@bakeyournoodle.com>
To: Xen-Devel <xen-devel@lists.xensource.com>
Cc: XenPPC-devel <xen-ppc-devel@lists.xensource.com>
Subject: [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests
Date: Fri, 20 Oct 2006 13:22:31 +1000 [thread overview]
Message-ID: <20061020032225.GQ27551@bakeyournoodle.com> (raw)
In-Reply-To: <patchbomb.1161308910@localhost.localdomain>
Fix Memory assumptions in the create tests.
Use the architecture specified idea of minimum memory.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
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(-)
--- a/tools/xm-test/tests/create/11_create_concurrent_pos.py Thu Oct 19 17:01:02 2006 +1000
+++ b/tools/xm-test/tests/create/11_create_concurrent_pos.py Thu Oct 19 17:02:40 2006 +1000
@@ -16,7 +16,7 @@ else:
MAX_DOMS = 50
MIN_DOMS = 5
-MEM_PER_DOM = 24
+MEM_PER_DOM = minSafeMem()
domains = []
console = []
diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/12_create_concurrent_stress_pos.py
--- a/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py Thu Oct 19 17:01:02 2006 +1000
+++ b/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py Thu Oct 19 17:02:40 2006 +1000
@@ -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:
diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/14_create_blockroot_pos.py
--- a/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu Oct 19 17:01:02 2006 +1000
+++ b/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu Oct 19 17:02:40 2006 +1000
@@ -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()
diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/15_create_smallmem_pos.py
--- a/tools/xm-test/tests/create/15_create_smallmem_pos.py Thu Oct 19 17:01:02 2006 +1000
+++ b/tools/xm-test/tests/create/15_create_smallmem_pos.py Thu Oct 19 17:02:40 2006 +1000
@@ -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})
diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/16_create_smallmem_neg.py
--- a/tools/xm-test/tests/create/16_create_smallmem_neg.py Thu Oct 19 17:01:02 2006 +1000
+++ b/tools/xm-test/tests/create/16_create_smallmem_neg.py Thu Oct 19 17:02:40 2006 +1000
@@ -3,11 +3,11 @@
# Copyright (C) International Business Machines Corp., 2005
# Author: Dan Smith <danms@us.ibm.com>
+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()
next prev parent reply other threads:[~2006-10-20 3:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <patchbomb.1161308910@localhost.localdomain>
2006-10-20 3:20 ` [PATCH 1/10][TOOLS][XM-TEST] Update to use uClibc buildroot-snapshot Tony Breeds
2006-10-20 3:20 ` [PATCH 2/10][TOOLS][XM-TEST] Remove hard coded reference to i386 Tony Breeds
2006-10-20 3:20 ` [PATCH 3/10][TOOLS][XM-TEST] Rename buildroot -> buildroot-i386 Tony Breeds
2006-10-20 3:21 ` [PATCH 4/10][TOOLS][XM-TEST] Update .hgignore to remove artifacts of ramdisk build Tony Breeds
2006-10-20 3:21 ` [PATCH 5/10][TOOLS][XM-TEST] Refactor code to encapsulate architecture decisions in one place Tony Breeds
2006-10-20 3:21 ` [PATCH 6/10][TOOLS][XM-TEST] Add configuration data for powerpc Tony Breeds
2006-10-20 3:21 ` [PATCH 7/10][TOOLS][XM-TEST] Add ability to inspect messages from domain for arbitrary strings Tony Breeds
2006-10-20 3:21 ` [PATCH 8/10][TOOLS][XM-TEST] Ignore generated .test files Tony Breeds
2006-10-20 3:22 ` [PATCH 9/10][TOOLS][XM-TEST] Default to appending to "extra" in XenConfig Tony Breeds
2006-10-20 3:22 ` Tony Breeds [this message]
2006-10-23 10:55 ` [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests Ewan Mellor
2006-10-23 23:45 ` Tony Breeds
2006-10-24 13:54 ` [Xen-devel] " Ewan Mellor
2006-10-24 23:50 ` Tony Breeds
2006-10-25 1:16 ` Tony Breeds
2006-10-31 2:16 ` Tony Breeds
2006-11-01 15:54 ` Ewan Mellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061020032225.GQ27551@bakeyournoodle.com \
--to=tony@bakeyournoodle.com \
--cc=xen-devel@lists.xensource.com \
--cc=xen-ppc-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.