~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/xm-test/tests/sysrq/03_sysrq_withreboot_pos.py

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
# Copyright (C) International Business Machines Corp., 2005
 
4
# Author: Dan Smith <danms@us.ibm.com>
 
5
 
 
6
from XmTestLib import *
 
7
 
 
8
import time
 
9
 
 
10
if ENABLE_HVM_SUPPORT:
 
11
    SKIP("Sysrq not supported for HVM domains")
 
12
 
 
13
domain = XmTestDomain()
 
14
 
 
15
try:
 
16
    console = domain.start()
 
17
except DomainError, e:
 
18
    if verbose:
 
19
        print "Failed to create domain:"
 
20
    print e.extra
 
21
    FAIL(str(e))
 
22
 
 
23
status, output = traceCommand("xm reboot %s" % domain.getName())
 
24
if status != 0:
 
25
    FAIL("reboot %s failed with %i != 0" % (domain.getName(), status))
 
26
 
 
27
# Wait for the reboot to finish
 
28
time.sleep(20)
 
29
 
 
30
status, output = traceCommand("xm sysrq %s s" % domain.getName())
 
31
if status != 0:
 
32
    FAIL("sysrq failed with %i != 0" % status)
 
33
 
 
34
try:
 
35
    run = console.runCmd("dmesg | grep -i reboot")
 
36
except ConsoleError, e:
 
37
    FAIL(str(e))
 
38
 
 
39
if run == 0:
 
40
    FAIL("reboot/sysrq resulted in reboot!")