ia64/xen-unstable

view tools/xm-test/tests/unpause/01_unpause_basic_pos.py @ 7685:40f3ce3516cb

1. Unmark the 07 and 08 tests of block_attach as XFAIL
2. Change the MEM_PER_DOM amount in 11_create_concurrent to 24MB, so
that the test will run on x86_64.
3. Increase the number of DomUs created in 12_create_concurrent to 5
4. Fix a logic error in 01_unpause
5. Add a test 06_help that checks all xm commands with 0-10 arguments
to make sure none of them traceback with varying argument counts.

Signed-off-by: Dan Smith <danms@us.ibm.com>
author emellor@leeni.uk.xensource.com
date Tue Nov 08 11:56:55 2005 +0100 (2005-11-08)
parents ecb5997f7b25
children 3c21a174e8fc
line source
1 #!/usr/bin/python
3 # Copyright (C) International Business Machines Corp., 2005
4 # Author: Paul Larson <pl@us.ibm.com>
6 # Description:
7 # Positive Tests:
8 # Tests for xm unpause
9 # 1) Create domain, verify it's up with console
10 # 2) randomly pause and unpause the domain
11 # 3) unpause it one last time
12 # 4) verify it's still alive with console
14 import time
15 import commands
16 from random import *
18 from XmTestLib import *
20 # Create a domain (default XmTestDomain, with our ramdisk)
21 domain = XmTestDomain()
23 # Start it
24 try:
25 domain.start()
26 except DomainError, e:
27 if verbose:
28 print "Failed to create test domain because:"
29 print e.extra
30 FAIL(str(e))
32 # Attach a console to it
33 try:
34 console = XmConsole(domain.getName(), historySaveCmds=True)
35 except ConsoleError, e:
36 FAIL(str(e))
38 try:
39 # Activate the console
40 console.sendInput("foo")
41 # Make sure a command succeeds
42 run = console.runCmd("ls")
43 except ConsoleError, e:
44 FAIL(str(e))
46 # Close the console
47 console.closeConsole()
49 seed(time.time())
51 for i in range(100):
52 pauseit = randint(0,1)
53 if(pauseit):
54 # Pause the domain
55 status, output = traceCommand("xm pause %s" % domain.getName())
56 if status != 0:
57 FAIL("xm pause returned invalid %i != 0", status)
58 else:
59 # Unpause the domain
60 status, output = traceCommand("xm unpause %s" % domain.getName())
61 if status != 0:
62 FAIL("xm unpause returned invalud %i != 0", status)
65 # Make sure the domain is unpaused before we finish up
66 status, output = traceCommand("xm unpause %s" % domain.getName())
67 if status != 0:
68 FAIL("xm unpause returned invalid %i != 0", status)
70 # Are we still alive after all that?
71 try:
72 console = XmConsole(domain.getName(), historySaveCmds=True)
73 except ConsoleError, e:
74 FAIL(str(e))
75 try:
76 run = console.runCmd("ls")
77 except ConsoleError, e:
78 pass
80 # Close the console
81 console.closeConsole()
83 if run["return"] != 0:
84 FAIL("console failed to attach to supposedly unpaused domain")
86 # Stop the domain (nice shutdown)
87 domain.stop()