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=256. |
---|
9 | |
---|
10 | import sys |
---|
11 | import re |
---|
12 | import time |
---|
13 | |
---|
14 | from XmTestLib import * |
---|
15 | |
---|
16 | rdpath = os.environ.get("RD_PATH") |
---|
17 | if not rdpath: |
---|
18 | rdpath = "../ramdisk" |
---|
19 | |
---|
20 | #get current free memory info |
---|
21 | mem = int(getInfo("free_memory")) |
---|
22 | if mem < 256: |
---|
23 | SKIP("This test needs 256 MB of free memory (%i MB avail)" % mem) |
---|
24 | |
---|
25 | #create a domain with mem=256 |
---|
26 | config = {"memory": 256} |
---|
27 | domain_mem256=XmTestDomain(extraConfig=config) |
---|
28 | |
---|
29 | #start it |
---|
30 | try: |
---|
31 | domain_mem256.start(noConsole=True) |
---|
32 | except DomainError, e: |
---|
33 | if verbose: |
---|
34 | print "Failed to create test domain_mem256 because:" |
---|
35 | print e.extra |
---|
36 | FAIL(str(e)) |
---|
37 | |
---|
38 | #verify it is running with 256MB mem |
---|
39 | |
---|
40 | eyecatcher1 = str(isDomainRunning(domain_mem256.getName())) |
---|
41 | if eyecatcher1 != "True": |
---|
42 | FAIL("Failed to verify that a 256MB domain started") |
---|
43 | |
---|
44 | eyecatcher2 = getDomMem(domain_mem256.getName()) |
---|
45 | if eyecatcher2 not in range(254, 257): |
---|
46 | FAIL("Started domain with 256MB, but it got %i MB" % eyecatcher2) |
---|
47 | |
---|
48 | #stop the domain (nice shutdown) |
---|
49 | domain_mem256.stop() |
---|
Note: See
TracBrowser
for help on using the repository browser.