source: trunk/packages/xen-3.1/xen-3.1/tools/xm-test/tests/create/08_create_mem128_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.1 KB
Line 
1#!/usr/bin/python
2
3# Copyright (C) International Business Machines Corp., 2005
4# Author: Li Ge <lge@us.ibm.com>
5
6# Test Description:
7# Positive Test
8# Test for creating domain with mem=.
9
10import sys
11import re
12import time
13
14from XmTestLib import *
15
16rdpath = os.environ.get("RD_PATH")
17if not rdpath:
18    rdpath = "../ramdisk"
19
20#get current free memory info
21mem = int(getInfo("free_memory"))
22if mem < 128:
23    SKIP("This test needs 128 MB of free memory (%i MB avail)" % mem)
24
25#create a domain with mem=128
26config={"memory": 128}
27domain_mem128=XmTestDomain(extraConfig=config)
28
29#start it
30try:
31    domain_mem128.start(noConsole=True)
32except DomainError, e:
33    if verbose:
34        print "Failed to create test domain_mem128 because:"
35        print e.extra
36    FAIL(str(e))
37
38#verify it is running with 128MB mem
39
40eyecatcher1 = str(isDomainRunning(domain_mem128.getName()))
41if eyecatcher1 != "True":
42    FAIL("Failed to verify that a 128MB domain started")
43
44eyecatcher2 = getDomMem(domain_mem128.getName())
45if eyecatcher2 not in range(126, 129):
46    FAIL("Started domain with 128MB, but it got %i MB" % eyecatcher2)
47
48#stop the domain (nice shutdown)
49domain_mem128.stop()
Note: See TracBrowser for help on using the repository browser.