03_restore_badfilename_neg.py
来自「xen 3.2.2 源码」· Python 代码 · 共 29 行
PY
29 行
#!/usr/bin/python# Copyright (C) International Business Machines Corp., 2005# Author: Li Ge <lge@us.ibm.com> # Test description:# Negative Test:# Test for restoring domain with non existent file.# Verify fail.import refrom XmTestLib import *if ENABLE_HVM_SUPPORT: SKIP("Restore currently not supported for HVM domains")status, output = traceCommand("xm restore /tmp/NON_EXIST")eyecatcher1 = "Error:"eyecatcher2 = "Traceback"where1 = output.find(eyecatcher1)where2 = output.find(eyecatcher2)if status == 0: FAIL("xm restore returned bad status, expected non 0, status is: %i" % status)elif where2 == 0: FAIL("xm restore returned a stack dump, expected nice error message") elif where1 == -1: FAIL("xm restore returned bad output, expected Error:, output is: %s" % output)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?