source: trunk/packages/xen-3.1/xen-3.1/tools/xm-test/tests/memset/04_memset_smallmem_pos.py @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

  • Property svn:mime-type set to text/script
File size: 1.4 KB
Line 
1#!/usr/bin/python
2
3# Copyright (C) International Business Machines Corp., 2005
4# Author: Dan Smith <danms@us.ibm.com>
5
6from XmTestLib import *
7
8if ENABLE_HVM_SUPPORT:
9    SKIP("Mem-set not supported for HVM domains")
10
11domain = XmTestDomain()
12
13try:
14    console = domain.start()
15except DomainError, e:
16    if verbose:
17        print "Failed to start domain: "
18        print e.extra
19    FAIL(str(e))
20
21try:
22    # Make sure it's alive before we proceed
23    console.runCmd("ls")
24except ConsoleError, e:
25    FAIL(str(e))
26
27status, output = traceCommand("xm mem-set %s %i" %
28                              (domain.getName(), 15))
29
30if status != 0:
31    FAIL("xm mem-set %s %i returned invalid %i != 0" %
32         (domain.getName(), domain.minSafeMem(), status))
33
34console.setLimit(65536)
35
36try:
37    # See if this hits the byte limit
38    console.runCmd("ls")
39except ConsoleError, e:
40    if e.reason == RUNAWAY:
41        # Need to stop the domain before we restart the console daemon
42        domain.destroy()
43        if isConsoleDead():
44            print "*** Attempting restart of xenconsoled"
45            s, o = traceCommand("killall xenconsoled")
46            s, o = traceCommand("xenconsoled")
47            if s != 0:
48                print "*** Starting xenconsoled failed: %i" % s
49            FAIL("Bug #380: I crashed the console system")
50        else:
51            FAIL("Bug #145: Ballooning DomU too low caused run-away")
52    else:
53        FAIL(str(e))
54
55domain.destroy()
Note: See TracBrowser for help on using the repository browser.