debuggers.hg

view tools/xm-test/tests/sysrq/02_sysrq_sync_pos.py @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
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 if ENABLE_HVM_SUPPORT:
13 SKIP("Sysrq not supported for HVM domains")
15 # Create a domain (default XmTestDomain, with our ramdisk)
16 domain = XmTestDomain()
18 # Start it
19 try:
20 console = domain.start()
21 except DomainError, e:
22 if verbose:
23 print "Failed to create test domain because:"
24 print e.extra
25 FAIL(str(e))
27 status, output = traceCommand("xm sysrq %s s" % domain.getName())
29 if status != 0:
30 FAIL("Good sysrq failed with: %i != 0", status)
32 # -- CHECK OUTPUT
34 # Run 'ls'
35 try:
36 # Check the dmesg output on the domU
37 run = console.runCmd("dmesg | grep Emerg\n")
38 except ConsoleError, e:
39 FAIL(str(e))
41 # Close the console
42 domain.closeConsole()
44 # Stop the domain (nice shutdown)
45 domain.stop()
47 # Save a transcript for human review
48 # saveLog(console.getHistory())
50 # Check dmesg for the sysrq notice
51 if not re.search("Emergency", run["output"]):
52 FAIL("Sync SysRq not delivered")