02_shutdown_badparm_neg.py

来自「xen 3.2.2 源码」· Python 代码 · 共 40 行

PY
40
字号
#!/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# 2) call xm shutdown with a bad parameter, expect failureimport commandsfrom XmTestLib import *eyecatcher = "Error:"# Create a domain (default XmTestDomain, with our ramdisk)domain = XmTestDomain()# Start ittry:    domain.start(noConsole=True)except DomainError, e:    if verbose:        print "Failed to create test domain because:"        print e.extra    FAIL(str(e))ret, output = traceCommand("xm shutdown -x %s" % domain.getName())where = output.find(eyecatcher)if (ret == 0):    FAIL("xm shutdown returned invalid %i == 0" % ret)elif where == -1:    FAIL("xm shutdown failed to report error for bad arg")# Stop the domain (nice shutdown)domain.stop()

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?