|
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 | |
|---|
| 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 < 128: |
|---|
| 23 | SKIP("This test needs 128 MB of free memory (%i MB avail)" % mem) |
|---|
| 24 | |
|---|
| 25 | #create a domain with mem=128 |
|---|
| 26 | config={"memory": 128} |
|---|
| 27 | domain_mem128=XmTestDomain(extraConfig=config) |
|---|
| 28 | |
|---|
| 29 | #start it |
|---|
| 30 | try: |
|---|
| 31 | domain_mem128.start(noConsole=True) |
|---|
| 32 | except 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 | |
|---|
| 40 | eyecatcher1 = str(isDomainRunning(domain_mem128.getName())) |
|---|
| 41 | if eyecatcher1 != "True": |
|---|
| 42 | FAIL("Failed to verify that a 128MB domain started") |
|---|
| 43 | |
|---|
| 44 | eyecatcher2 = getDomMem(domain_mem128.getName()) |
|---|
| 45 | if 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) |
|---|
| 49 | domain_mem128.stop() |
|---|
Note: See
TracBrowser
for help on using the repository browser.