02_reboot_badopt_neg.py

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

PY
33
字号
#!/usr/bin/python# Copyright (C) International Business Machines Corp., 2005# Author: Li Ge <lge@us.ibm.com>import timeimport refrom XmTestLib import *domain = XmTestDomain()try:    domain.start(noConsole=True)except DomainError, e:    if verbose:        print "Failed to create test domain because:"        print e.extra    FAIL(str(e))status, output = traceCommand("xm reboot -x %s" % domain.getName())eyecatcher = "Error"where = output.find(eyecatcher)if status == 0:    domain.destroy()    FAIL("xm reboot returned invalid %i == 0" % status )elif where == -1:    domain.destroy()    FAIL("xm reboot failed to report error for bad arg")domain.destroy()

⌨️ 快捷键说明

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