[PATCH] [TEST]Fixing 01_memory.py tc to accomdate the memory changes

# HG changeset patch # User Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> # Date 1211214682 25200 # Node ID 1650b84084a49965c2088f56248d6018b470e60c # Parent 80682d57c067810c97a92fce162c29dab2ea5451 [TEST]Fixing 01_memory.py tc to accomdate the memory changes. Tested with KVM, XenFV, Xen with latest and rpm libvirt-cim. Signed-off-by: Deepti B. Kalakeri <deeptik@linux.vnet.ibm.com> diff -r 80682d57c067 -r 1650b84084a4 suites/libvirt-cim/cimtest/Memory/01_memory.py --- a/suites/libvirt-cim/cimtest/Memory/01_memory.py Mon May 19 08:36:16 2008 -0700 +++ b/suites/libvirt-cim/cimtest/Memory/01_memory.py Mon May 19 09:31:22 2008 -0700 @@ -31,11 +31,13 @@ from XenKvmLib.vxml import XenXML, KVMXM from XenKvmLib.vxml import XenXML, KVMXML, get_class from CimTest.Globals import logger from CimTest.Globals import do_main +from XenKvmLib.const import CIM_REV sup_types = ['Xen', 'KVM', 'XenFV'] test_dom = "test_domain" mem = 256 #MB +mem_change_version=585 @do_main(sup_types) def main(): @@ -43,7 +45,11 @@ def main(): vsxml = get_class(options.virt)(test_dom, mem) vsxml.define(options.ip) - + if CIM_REV >= mem_change_version: + alloc_mem = int(vsxml.xml_get_mem()) + else: + alloc_mem = int(vsxml.xml_get_mem())/1024 + devid = "%s/mem" % test_dom key_list = { 'DeviceID' : devid, 'CreationClassName' : get_typed_class(options.virt, "Memory"), @@ -60,8 +66,8 @@ def main(): capacity = dev.ConsumableBlocks * dev.BlockSize / 1024 - if capacity != mem: - logger.error("Capacity should be %i MB instead of %i MB" % (mem, capacity)) + if capacity != alloc_mem: + logger.error("Capacity should be %i MB instead of %i MB" % (alloc_mem, capacity)) status = 1 if status == 0:
participants (1)
-
Deepti B. Kalakeri