⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 02_block-list_attachbd_pos.py

📁 xen虚拟机源代码安装包
💻 PY
字号:
#!/usr/bin/python# Copyright (C) International Business Machines Corp., 2005# Author: Li Ge <lge@us.ibm.com)# Positive Test: create domain, attach block device, verify listfrom XmTestLib import *from XmTestLib.block_utils import block_attachif ENABLE_HVM_SUPPORT:    SKIP("Block-list not supported for HVM domains")domain = XmTestDomain()try:    console = domain.start()except DomainError, e:    if verbose:        print e.extra    FAIL("Unable to create domain")#Attach one virtual block device to domainUblock_attach(domain, "phy:/dev/ram0", "xvda1")#Verify block-list on Domain0status, output = traceCommand("xm block-list %s" % domain.getId())eyecatcher = "51713"where = output.find(eyecatcher)if status != 0:    FAIL("xm block-list returned bad status, expected 0, status is %i" % status)elif where < 0 :    FAIL("Fail to list block device")#Verify attached block device on DomainUtry:    run = console.runCmd("cat /proc/partitions | grep xvda1")except ConsoleError, e:    saveLog(console.getHistory())    FAIL(str(e))domain.stop()if run["return"] != 0:    FAIL("Failed to verify that block dev is attached on DomainU")

⌨️ 快捷键说明

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