aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xm-test/tests
diff options
context:
space:
mode:
authorEwan Mellor <ewan@xensource.com>2006-10-24 14:52:20 +0100
committerEwan Mellor <ewan@xensource.com>2006-10-24 14:52:20 +0100
commit9a4180837b7946d4c89db094185036876485cb15 (patch)
treef6be7511a4b0933d511796b1c3c426df2fe64e9b /tools/xm-test/tests
parent3cce2a03932efdf2b5243bf93d1ed97ebe750e5f (diff)
downloadxen-9a4180837b7946d4c89db094185036876485cb15.tar.gz
xen-9a4180837b7946d4c89db094185036876485cb15.tar.bz2
xen-9a4180837b7946d4c89db094185036876485cb15.zip
Fix Memory assumptions in the create tests.
Use the architecture specified idea of minimum memory. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Diffstat (limited to 'tools/xm-test/tests')
-rw-r--r--tools/xm-test/tests/create/11_create_concurrent_pos.py2
-rw-r--r--tools/xm-test/tests/create/12_create_concurrent_stress_pos.py9
-rw-r--r--tools/xm-test/tests/create/15_create_smallmem_pos.py4
-rw-r--r--tools/xm-test/tests/create/16_create_smallmem_neg.py8
4 files changed, 16 insertions, 7 deletions
diff --git a/tools/xm-test/tests/create/11_create_concurrent_pos.py b/tools/xm-test/tests/create/11_create_concurrent_pos.py
index ad5f297719..fd8f4dd3bf 100644
--- a/tools/xm-test/tests/create/11_create_concurrent_pos.py
+++ b/tools/xm-test/tests/create/11_create_concurrent_pos.py
@@ -16,7 +16,7 @@ else:
MAX_DOMS = 50
MIN_DOMS = 5
-MEM_PER_DOM = 24
+MEM_PER_DOM = minSafeMem()
domains = []
console = []
diff --git a/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py b/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py
index 06b125083f..5235491d88 100644
--- a/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py
+++ b/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py
@@ -8,11 +8,18 @@ from XmTestLib import *
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})
diff --git a/tools/xm-test/tests/create/15_create_smallmem_pos.py b/tools/xm-test/tests/create/15_create_smallmem_pos.py
index faca03336b..d7797c6bd2 100644
--- a/tools/xm-test/tests/create/15_create_smallmem_pos.py
+++ b/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})
diff --git a/tools/xm-test/tests/create/16_create_smallmem_neg.py b/tools/xm-test/tests/create/16_create_smallmem_neg.py
index 9990add78c..6a3f417fe9 100644
--- a/tools/xm-test/tests/create/16_create_smallmem_neg.py
+++ b/tools/xm-test/tests/create/16_create_smallmem_neg.py
@@ -3,6 +3,7 @@
# 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
@@ -16,13 +17,14 @@ 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):
+ # PPC gracefully fails like this, rather than crashing.
+ 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()