Files
xen/tools/xm-test/tests/memset/04_memset_smallmem_pos.py
T
Keir Fraser ccb359dbfc xm-test: Adapt memory setting to up-to-date kernel memory consumption
The attached patch fixes xm-test memset 04 that it can be used with up
to date kernels.  The old version sets the memory to 15MByte which is
too low for modern kernels: the oom-killer in this case kills the
login shell of the test-case and init.  Increased the size to 18M
which gives the userspace about 2.5 MByte memory.

Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-08-05 13:37:26 +01:00

56 lines
1.4 KiB
Python

#!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Dan Smith <danms@us.ibm.com>
from XmTestLib import *
if ENABLE_HVM_SUPPORT:
SKIP("Mem-set not supported for HVM domains")
domain = XmTestDomain()
try:
console = domain.start()
except DomainError, e:
if verbose:
print "Failed to start domain: "
print e.extra
FAIL(str(e))
try:
# Make sure it's alive before we proceed
console.runCmd("ls")
except ConsoleError, e:
FAIL(str(e))
status, output = traceCommand("xm mem-set %s %i" %
(domain.getName(), 18))
if status != 0:
FAIL("xm mem-set %s %i returned invalid %i != 0" %
(domain.getName(), domain.minSafeMem(), status))
console.setLimit(65536)
try:
# See if this hits the byte limit
console.runCmd("ls")
except ConsoleError, e:
if e.reason == RUNAWAY:
# Need to stop the domain before we restart the console daemon
domain.destroy()
if isConsoleDead():
print "*** Attempting restart of xenconsoled"
s, o = traceCommand("killall xenconsoled")
s, o = traceCommand("xenconsoled")
if s != 0:
print "*** Starting xenconsoled failed: %i" % s
FAIL("Bug #380: I crashed the console system")
else:
FAIL("Bug #145: Ballooning DomU too low caused run-away")
else:
FAIL(str(e))
domain.destroy()