📄 01_shutdown_basic_pos.py
字号:
#!/usr/bin/python# Copyright (C) International Business Machines Corp., 2005# Author: Paul Larson <pl@us.ibm.com># Description:# Positive Tests:# Test for xm shutdown# 1) Create domain, verify it's up with console# 2) shut down the domain, verify it's downimport timeimport commandsfrom XmTestLib import *# Create a domain (default XmTestDomain, with our ramdisk)domain = XmTestDomain()# Start ittry: console = domain.start()except DomainError, e: if verbose: print "Failed to create test domain because:" print e.extra FAIL(str(e))try: # Make sure a command succeeds run = console.runCmd("ls /bin")except ConsoleError, e: FAIL(str(e))# Close the consoledomain.closeConsole()# Stop the domain (nice shutdown)status, output = traceCommand("xm shutdown %s" % domain.getName())if status != 0: FAIL("good xm shutdown exited with bad %i != 0" % status)# Verify the domain is gonetime.sleep(10)if isDomainRunning(domain.getName()): traceCommand("xm list") if isDomainRunning(domain.getName()): FAIL("Guest domain failed to shutdown") else: FAIL("I had to run an xm list to update xend state!")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -