ia64/xen-unstable

view tools/xm-test/tests/create/06_create_mem_neg.py @ 11960:fd5140c2854f

Fix Memory assumptions in the create tests.

Use the architecture specified idea of minimum memory.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Oct 24 14:52:20 2006 +0100 (2006-10-24)
parents bef7f5fcf207
children 7869f58ff551
line source
1 #!/usr/bin/python
3 # Copyright (C) International Business Machines Corp., 2005
4 # Author: Li Ge <lge@us.ibm.com>
6 # Test Description:
7 # Negative Tests:
8 # Test 1: Test for creating domain with mem=0. Verify fail
9 # Test 2: Test for creating domain with mem>sys_mem. Verify fail
11 import sys
12 import re
13 import time
15 from XmTestLib import *
17 rdpath = os.environ.get("RD_PATH")
18 if not rdpath:
19 rdpath = "../ramdisk"
21 # Test 1: create a domain with mem=0
22 config1 = {"memory": 0}
23 domain1=XmTestDomain(extraConfig=config1)
25 try:
26 domain1.start(noConsole=True)
27 eyecatcher1 = "Created"
28 except DomainError, e:
29 eyecatcher1 = "Fail"
31 if eyecatcher1 != "Fail":
32 domain1.stop()
33 FAIL("xm create let me create a domain with 0 memory")
36 # Test 2: create a domain with mem>sys_mem
38 mem = int(getInfo("total_memory"))
39 extreme_mem = mem + 100
41 config2 = {"memory": extreme_mem}
42 domain2=XmTestDomain(extraConfig=config2)
44 try:
45 domain2.start(noConsole=True)
46 eyecatcher2 = "Created"
47 except DomainError, e:
48 eyecatcher2 = "Fail"
50 if eyecatcher2 != "Fail":
51 domain2.stop()
52 FAIL("xm create let me create a domain with mem > sys_mem")