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

📄 06_create_mem_neg.py

📁 xen虚拟机源代码安装包
💻 PY
字号:
#!/usr/bin/python# Copyright (C) International Business Machines Corp., 2005# Author: Li Ge <lge@us.ibm.com># Test Description:# Negative Tests:# Test 1: Test for creating domain with mem=0. Verify fail# Test 2: Test for creating domain with mem>sys_mem. Verify failimport sysimport reimport timefrom XmTestLib import *rdpath = os.environ.get("RD_PATH")if not rdpath:    rdpath = "../ramdisk"# Test 1: create a domain with mem=0config1 = {"memory": 0}domain1=XmTestDomain(extraConfig=config1)try:    domain1.start(noConsole=True)    eyecatcher1 = "Created"except DomainError, e:    eyecatcher1 = "Fail"if eyecatcher1 != "Fail":    domain1.stop()    FAIL("xm create let me create a domain with 0 memory")# Test 2: create a domain with mem>sys_memmem = int(getInfo("total_memory"))extreme_mem = mem + 100config2 = {"memory": extreme_mem}domain2=XmTestDomain(extraConfig=config2)try:    domain2.start(noConsole=True)    eyecatcher2 = "Created"except DomainError, e:    eyecatcher2 = "Fail"if eyecatcher2 != "Fail":    domain2.stop()    FAIL("xm create let me create a domain with mem > sys_mem")

⌨️ 快捷键说明

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