ia64/xen-unstable

view tools/xm-test/tests/create/01_create_basic_pos.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
line source
1 #!/usr/bin/python
3 # Copyright (C) International Business Machines Corp., 2005
4 # Author: Dan Smith <danms@us.ibm.com>
6 import sys
7 import re
8 import time
10 from XmTestLib import *
12 # Create a domain (default XmTestDomain, with our ramdisk)
13 domain = XmTestDomain()
15 if int(getInfo("free_memory")) < domain.config.getOpt("memory"):
16 SKIP("This test needs %i MB of free memory (%i MB avail)" %
17 (domain.config.getOpt("memory"), int(getInfo("free_memory"))))
19 # Start it
20 try:
21 console = domain.start()
22 except DomainError, e:
23 if verbose:
24 print "Failed to create test domain because:"
25 print e.extra
26 FAIL(str(e))
28 try:
29 # Run 'ls'
30 run = console.runCmd("ls")
31 except ConsoleError, e:
32 saveLog(console.getHistory())
33 FAIL(str(e))
35 # Save a transcript for human review
36 saveLog(console.getHistory())
38 # Close the console
39 domain.closeConsole()
41 # Stop the domain (nice shutdown)
42 domain.stop()
44 # Check the output of 'ls'
46 if not re.search("proc", run["output"]):
47 if verbose:
48 print run["output"]
49 FAIL("'ls' output looks wrong (didn't see /proc)")