mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
in XenDomain. The devices we will add, like network, will need to run console commands when a domain is started. So I have made console be a part of domain object, which it's tied to anyway. Signed-off-by: Daniel Stekloff <dsteklof@us.ibm.com>
41 lines
891 B
Python
41 lines
891 B
Python
#!/usr/bin/python
|
|
|
|
# Copyright (C) International Business Machines Corp., 2005
|
|
# Author: Dan Smith <danms@us.ibm.com>
|
|
|
|
from XmTestLib import *
|
|
|
|
import time
|
|
|
|
if ENABLE_HVM_SUPPORT:
|
|
SKIP("Sysrq not supported for HVM domains")
|
|
|
|
domain = XmTestDomain()
|
|
|
|
try:
|
|
console = domain.start()
|
|
except DomainError, e:
|
|
if verbose:
|
|
print "Failed to create domain:"
|
|
print e.extra
|
|
FAIL(str(e))
|
|
|
|
status, output = traceCommand("xm reboot %s" % domain.getName())
|
|
if status != 0:
|
|
FAIL("reboot %s failed with %i != 0" % (domain.getName(), status))
|
|
|
|
# Wait for the reboot to finish
|
|
time.sleep(20)
|
|
|
|
status, output = traceCommand("xm sysrq %s s" % domain.getName())
|
|
if status != 0:
|
|
FAIL("sysrq failed with %i != 0" % status)
|
|
|
|
try:
|
|
run = console.runCmd("dmesg | grep -i reboot")
|
|
except ConsoleError, e:
|
|
FAIL(str(e))
|
|
|
|
if run == 0:
|
|
FAIL("reboot/sysrq resulted in reboot!")
|