|
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.2 KB
|
| Line | |
|---|
| 1 | #!/usr/bin/python |
|---|
| 2 | |
|---|
| 3 | # Copyright (C) International Business Machines Corp., 2005 |
|---|
| 4 | # Author: Paul Larson <pl@us.ibm.com> |
|---|
| 5 | |
|---|
| 6 | # Description: |
|---|
| 7 | # Positive Tests: |
|---|
| 8 | # Test for xm shutdown |
|---|
| 9 | # 1) Create domain, verify it's up with console |
|---|
| 10 | # 2) shut down the domain, verify it's down |
|---|
| 11 | |
|---|
| 12 | import time |
|---|
| 13 | import commands |
|---|
| 14 | |
|---|
| 15 | from XmTestLib import * |
|---|
| 16 | |
|---|
| 17 | # Create a domain (default XmTestDomain, with our ramdisk) |
|---|
| 18 | domain = XmTestDomain() |
|---|
| 19 | |
|---|
| 20 | # Start it |
|---|
| 21 | try: |
|---|
| 22 | console = domain.start() |
|---|
| 23 | except DomainError, e: |
|---|
| 24 | if verbose: |
|---|
| 25 | print "Failed to create test domain because:" |
|---|
| 26 | print e.extra |
|---|
| 27 | FAIL(str(e)) |
|---|
| 28 | |
|---|
| 29 | try: |
|---|
| 30 | # Make sure a command succeeds |
|---|
| 31 | run = console.runCmd("ls /bin") |
|---|
| 32 | except ConsoleError, e: |
|---|
| 33 | FAIL(str(e)) |
|---|
| 34 | |
|---|
| 35 | # Close the console |
|---|
| 36 | domain.closeConsole() |
|---|
| 37 | |
|---|
| 38 | # Stop the domain (nice shutdown) |
|---|
| 39 | status, output = traceCommand("xm shutdown %s" % domain.getName()) |
|---|
| 40 | if status != 0: |
|---|
| 41 | FAIL("good xm shutdown exited with bad %i != 0" % status) |
|---|
| 42 | |
|---|
| 43 | # Verify the domain is gone |
|---|
| 44 | time.sleep(10) |
|---|
| 45 | |
|---|
| 46 | if isDomainRunning(domain.getName()): |
|---|
| 47 | |
|---|
| 48 | traceCommand("xm list") |
|---|
| 49 | if isDomainRunning(domain.getName()): |
|---|
| 50 | FAIL("Guest domain failed to shutdown") |
|---|
| 51 | else: |
|---|
| 52 | FAIL("I had to run an xm list to update xend state!") |
|---|
| 53 | |
|---|
| 54 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.