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

📄 08_create_mem128_pos.py

📁 xen虚拟机源代码安装包
💻 PY
字号:
#!/usr/bin/python# Copyright (C) International Business Machines Corp., 2005# Author: Li Ge <lge@us.ibm.com># Test Description:# Positive Test# Test for creating domain with mem=.import sysimport reimport timefrom XmTestLib import *rdpath = os.environ.get("RD_PATH")if not rdpath:    rdpath = "../ramdisk"#get current free memory infomem = int(getInfo("free_memory"))if mem < 128:    SKIP("This test needs 128 MB of free memory (%i MB avail)" % mem)#create a domain with mem=128config={"memory": 128}domain_mem128=XmTestDomain(extraConfig=config)#start ittry:    domain_mem128.start(noConsole=True)except DomainError, e:    if verbose:        print "Failed to create test domain_mem128 because:"        print e.extra    FAIL(str(e))#verify it is running with 128MB memeyecatcher1 = str(isDomainRunning(domain_mem128.getName()))if eyecatcher1 != "True":    FAIL("Failed to verify that a 128MB domain started")eyecatcher2 = getDomMem(domain_mem128.getName())if eyecatcher2 not in range(126, 129):    FAIL("Started domain with 128MB, but it got %i MB" % eyecatcher2)#stop the domain (nice shutdown)domain_mem128.stop()

⌨️ 快捷键说明

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