[PATCH] [TEST] Add type tag to LXC domain
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1221255312 25200
# Node ID c6645bb2763676c1051684a689cdbdaeb7000ccd
# Parent 12931170a223bf6194177be33dfad154d7cb21e9
[TEST] Add type tag to LXC domain.
Due to the recent LXC changes in libvirt, this new tag is required.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 12931170a223 -r c6645bb27636 suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Sep 10 18:58:22 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Fri Sep 12 14:35:12 2008 -0700
@@ -699,6 +699,7 @@
def _os(self, os_init):
os = self.get_node('/domain/os')
self.add_sub_node(os, 'init', os_init)
+ self.add_sub_node(os, 'type', 'exe')
def _devices(self, net_mac, net_type, net_name, tty_set):
devices = self.get_node('/domain/devices')
16 years, 3 months
[PATCH] [TEST] Updating 01_forward.py of ECTP
by Deepti B. Kalakeri
# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1221481998 25200
# Node ID c8703e572857045a8fa75e695cf08575d57f0cd3
# Parent 12931170a223bf6194177be33dfad154d7cb21e9
[TEST] Updating 01_forward.py of ECTP.
Changes:
--------
Updated the tc to align with the modifications for "Central Class to profile" and "Update migration profile version" changes.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 12931170a223 -r c8703e572857 suites/libvirt-cim/cimtest/ElementConforms/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Wed Sep 10 18:58:22 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Mon Sep 15 05:33:18 2008 -0700
@@ -6,6 +6,7 @@
# Guolian Yun <yunguol(a)cn.ibm.com>
# Kaitlin Rupert <karupert(a)us.ibm.com>
# Veerendra Chandrappa <vechandr(a)in.ibm.com>
+# Deepti B. Kalakeri<deeptik(a)linux.vnet.ibm.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
@@ -24,13 +25,18 @@
# This tc is used to verify the EnabledState, HealthState, EnabledDefault and
# the Classname are set appropriately for the results returned by the
-# Xen_ElementConformsToProfile association for the Xen_RegisteredProfile class
-# and Xen_ManagedElement Class
+# ElementConformsToProfile association for the RegisteredProfile class
+# and ManagedElement Class
#
# "CIM:DSP1042-SystemVirtualization-1.0.0" ,
# "CIM:DSP1057-VirtualSystem-1.0.0a"
+# "CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0_d"
+# "CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0_n"
+# "CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0_p"
+# "CIM:DSP1045-MemoryResourceVirtualization-1.0.0"
+# "CIM:DSP1081-VirtualSystemMigration-0.8.1"
#
-# Date : 04-12-2007
+# Date : 04-12-2007
import sys
from VirtLib import utils, live
@@ -39,120 +45,198 @@ from XenKvmLib.classes import get_typed_
from XenKvmLib.classes import get_typed_class
from XenKvmLib import vxml
from CimTest import Globals
-from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORS
+from XenKvmLib.common_util import print_field_error
+from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORS, CIM_ERROR_ENUMERATE
from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
+from XenKvmLib.enumclass import enumerate
+from XenKvmLib.const import default_network_name, default_pool_name
+
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
test_dom = "domU"
-def verify_cs(item, id):
- if item['EnabledState'] != 2 and \
- item['EnabledDefault'] != 2 and \
- item['RequestedState'] != 12 :
- logger.error("Values not set properly for VSP(ComputerSystem)")
+def pool_init(verify_list, pool_cn, pool_name, virt):
+ ccn = get_typed_class(virt, pool_cn)
+ instid = '%s/%s' %(pool_cn, pool_name)
+ verify_list[ccn] = {
+ 'InstanceID' : instid,
+ 'PoolID' : instid
+ }
+ return verify_list
+
+def init_vs_pool_values(server, virt):
+ verify_ectp_list = { }
+ hs_ccn = get_typed_class(virt, 'HostSystem')
+ host = live.hostname(server)
+ cs_fields = {
+ 'EnabledState' : 5,
+ 'RequestedState' : 12,
+ 'EnabledDefault' : 2,
+ 'TransitioningToState' : 12,
+ 'CreationClassName' : hs_ccn,
+ 'Name' : host
+ }
+
+ verify_ectp_list[hs_ccn] = cs_fields
+
+ cs_ccn = get_typed_class(virt, 'ComputerSystem')
+ verify_ectp_list[cs_ccn] = cs_fields.copy()
+ verify_ectp_list[cs_ccn]['EnabledState'] = 2
+ verify_ectp_list[cs_ccn]['RequestedState'] = 0
+ verify_ectp_list[cs_ccn]['HealthState'] = 5
+ verify_ectp_list[cs_ccn]['CreationClassName'] = cs_ccn
+ verify_ectp_list[cs_ccn]['Name'] = test_dom
+ verify_ectp_list[cs_ccn]['ElementName'] = test_dom
+
+ vs_ccn = get_typed_class(virt, 'VirtualSystemMigrationService')
+ verify_ectp_list[vs_ccn] = cs_fields.copy()
+ verify_ectp_list[vs_ccn]['CreationClassName'] = vs_ccn
+ verify_ectp_list[vs_ccn]['SystemCreationClassName'] = hs_ccn
+ verify_ectp_list[vs_ccn]['SystemName'] = host
+ verify_ectp_list[vs_ccn]['Name'] = 'MigrationService'
+
+ verify_ectp_list = pool_init(verify_ectp_list, 'DiskPool',
+ default_pool_name, virt)
+ verify_ectp_list = pool_init(verify_ectp_list, 'NetworkPool',
+ default_network_name, virt)
+ verify_ectp_list = pool_init(verify_ectp_list, 'ProcessorPool', 0, virt)
+ verify_ectp_list = pool_init(verify_ectp_list, 'MemoryPool', 0, virt)
+
+
+ return verify_ectp_list
+
+def verify_fields(assoc_val, pllst_index, vs_pool_values):
+ try:
+ field_names = vs_pool_values[pllst_index].keys()
+ values = vs_pool_values[pllst_index]
+ for field in field_names:
+ if values[field] != assoc_val[field]:
+ print_field_error(field, assoc_val[field], values[field])
+ return FAIL
+ except Exception, details:
+ logger.error("Exception: In fn verify_fields() %s", details)
+ return FAIL
+
+ return PASS
+
+def verify_cs_hs_mig_fields(assoc_info, vs_pool_values):
+ try:
+ pllst_index = assoc_info[0]['CreationClassName']
+ assoc_val = None
+ if 'HostSystem' in pllst_index or \
+ 'VirtualSystemMigrationService' in pllst_index:
+ if len(assoc_info) != 1:
+ logger.error("'%s' returned '%d' records, expected 1",
+ pllst_index, len(assoc_info))
+ return FAIL
+ assoc_val = assoc_info[0]
+ else:
+ # For ComputerSystem info
+ for inst in assoc_info:
+ if inst['Name'] == test_dom:
+ assoc_val = inst
+ break
+ except Exception, details:
+ logger.error("Exception: In fn verify_cs_hs_mig_fields() %s", details)
return FAIL
- else:
- logger.info("1. Property values for %s and domain %s is " %
- (id, item['Name']))
- logger.info("EnabState = %d EnabDefault = %d ReqSt = %d" %
- (item['EnabledState'], item['EnabledDefault'],
- item['RequestedState'] ))
+ if assoc_val == None:
+ return FAIL
- return PASS
+ return verify_fields(assoc_val, pllst_index, vs_pool_values)
-def verify_host(item, id):
- if item['EnabledState'] != 5 and \
- item['EnabledDefault'] != 2 and \
- item['RequestedState'] != 12 :
- logger.error("Values not set properly for the the SVP (HostSystem)")
- return FAIL
+def get_proflist(server, reg_classname, virt):
+ proflist = []
+ status = PASS
+ try:
+ key_list = ["InstanceID"]
+ proflist = enumerate(server, reg_classname, key_list, virt)
+ if len(proflist) < 7:
+ logger.error("'%s' returned '%d' '%s' objects, expected atleast 7",
+ reg_classname, len(proflist), 'Profile')
+ status = FAIL
- else:
- logger.info("2. Values for %s and host %s is" %
- (id, item['Name']))
- logger.info("EnabState = %d EnabDefault = %d ReqSt = %d" %
- (item['EnabledState'], item['EnabledDefault'],
- item['RequestedState'] ))
+ except Exception, detail:
+ logger.error(CIM_ERROR_ENUMERATE, reg_classname)
+ logger.error("Exception: %s", detail)
+ status = FAIL
- return PASS
+ if status != PASS:
+ return status, proflist
+
+ profiles_instid_list = [ profile.InstanceID for profile in proflist ]
+
+ return status, profiles_instid_list
+
+
+def verify_ectp_assoc(server, virt):
+ reg_classname = "RegisteredProfile"
+ an = "ElementConformsToProfile"
+
+ status, inst_lst = get_proflist(server, reg_classname, virt)
+ if status != PASS:
+ return status
+
+ verify_ectp_list = init_vs_pool_values(server, virt)
+ for devid in inst_lst :
+ logger.info("Verifying '%s' with '%s'", an, devid)
+ try:
+ assoc_info = assoc.Associators(server,
+ an,
+ reg_classname,
+ virt,
+ InstanceID = devid)
+ if len(assoc_info) < 1:
+ status = FAIL
+ logger.error(" '%s' returned (%d) '%s' objects", an,
+ len(assoc_info), reg_classname)
+ break
+
+ if 'DSP1059' in devid or 'DSP1045' in devid:
+ instid = assoc_info[0]['InstanceID']
+ index, other = instid.split("/")
+ cn = get_typed_class(virt, index)
+ status = verify_fields(assoc_info[0], cn, verify_ectp_list)
+ else:
+ ccn = assoc_info[0]['CreationClassName']
+ status = verify_cs_hs_mig_fields(assoc_info, verify_ectp_list)
+
+ if status != PASS:
+ break
+
+ except Exception, detail:
+ logger.error(CIM_ERROR_ASSOCIATORS, an)
+ logger.error("Exception: %s" % detail)
+ status = FAIL
+ return status
@do_main(sup_types)
def main():
options = main.options
-
+ server = options.ip
+ virt = options.virt
+
status = PASS
destroy_and_undefine_all(options.ip, options.virt)
virt_xml = vxml.get_class(options.virt)
cxml = virt_xml(test_dom)
- ret = cxml.define(options.ip)
+ ret = cxml.cim_define(server)
+ ret = cxml.start(server)
if not ret:
- logger.error('Unable to define domain %s' % test_dom)
+ logger.error('Unable to start domain %s' % test_dom)
return FAIL
+
prev_namespace = Globals.CIM_NS
Globals.CIM_NS = 'root/interop'
- host = live.hostname(options.ip)
- inst_lst = {
- "InstID1" : "CIM:DSP1042-SystemVirtualization-1.0.0" ,
- "InstID2" : "CIM:DSP1057-VirtualSystem-1.0.0a"
- }
- hs = get_typed_class(options.virt, "HostSystem")
- cs = get_typed_class(options.virt, "ComputerSystem")
+ status = verify_ectp_assoc(server, virt)
- devlist = [
- hs , \
- cs
- ]
-
- for args, devid in inst_lst.items() :
- try:
- assoc_info = assoc.Associators(options.ip,
- "ElementConformsToProfile",
- "RegisteredProfile",
- options.virt,
- InstanceID = devid)
- if len(assoc_info) < 1:
- status = FAIL
- logger.error("ElementConformsToProfile returned %i\
- RegisteredProfile objects" % len(assoc_info))
- break
-
- count = 0
- for info in assoc_info:
- if info['CreationClassName'] == cs :
- if info['Name'] == 'domU' :
- count = count + 1
- verify_cs(info, devid)
-
- elif info['CreationClassName'] == hs and \
- info['Name'] == host:
- count = count + 1
- verify_host(info, devid)
-
- else:
- status = FAIL
- logger.error("CreationClassName Mismatch")
- logger.error("Returned %s instead of %s or %s" % \
- (item['CreationClassName'], devlist[0], devlist[1]))
-
- exp_count = 1
- if count != exp_count:
- status = FAIL
- logger.error("Expected to verify %d instances, not %d." %
- exp_count, count)
-
-
- except Exception, detail:
- logger.error(CIM_ERROR_ASSOCIATORS, 'ElementConformsToProfile')
- logger.error("Exception: %s" % detail)
- status = FAIL
-
- cxml.undefine(options.ip)
Globals.CIM_NS = prev_namespace
+ cxml.destroy(server)
+ cxml.undefine(server)
return status
if __name__ == "__main__":
16 years, 3 months
[PATCH] [TEST] #3 Fix LogicalDisk - 02_nodevs.py
by yunguol@cn.ibm.com
# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1221184469 25200
# Node ID 7efdd4ae22828154d19c0daf53dd5ee5d8942eb2
# Parent 12931170a223bf6194177be33dfad154d7cb21e9
[TEST] #3 Fix LogicalDisk - 02_nodevs.py
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 12931170a223 -r 7efdd4ae2282 suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py
--- a/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Wed Sep 10 18:58:22 2008 -0700
+++ b/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Thu Sep 11 18:54:29 2008 -0700
@@ -25,7 +25,8 @@
import sys
import pywbem
-from VirtLib import live
+from time import sleep
+from XenKvmLib import enumclass
from XenKvmLib import devices
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
from XenKvmLib.const import do_main
@@ -35,17 +36,18 @@
test_dom = "test_domain"
def clean_system(host, virt='Xen'):
- l = live.domain_list(host, virt)
-
- if virt == "XenFV" or virt == "Xen":
- if len(l) > 1:
- return False
+ timer_count = 10
+ for count in range(0, timer_count):
+ keys = ['Name', 'CreationClassName']
+ l = enumclass.enumerate(host, 'ComputerSystem', keys, virt)
+ if virt == "XenFV" or virt == "Xen":
+ if len(l) == 0:
+ return True
+ sleep(1)
+ if count == 9 and len(l) != 0:
+ return SKIP
else:
return True
- elif len(l) > 0:
- return False
- else:
- return True
@do_main(sup_types)
def main():
16 years, 3 months
[PATCH] Add RedirectionService to HostSystem support to HostedService
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1221511302 25200
# Node ID d0f24426b9bfa5488f64666788e0d41e4c95b06c
# Parent 8f75fc91697b91ec1b633f69f5d0e8bc6f81c60a
Add RedirectionService to HostSystem support to HostedService.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 8f75fc91697b -r d0f24426b9bf src/Makefile.am
--- a/src/Makefile.am Mon Sep 15 13:39:10 2008 -0700
+++ b/src/Makefile.am Mon Sep 15 13:41:42 2008 -0700
@@ -167,9 +167,9 @@
libVirt_ElementAllocatedFromPool_la_SOURCES = Virt_ElementAllocatedFromPool.c
libVirt_ElementAllocatedFromPool_la_LIBADD = -lVirt_DevicePool -lVirt_Device
-libVirt_HostedService_la_DEPENDENCIES = libVirt_VirtualSystemManagementService.la libVirt_ResourcePoolConfigurationService.la libVirt_VSMigrationService.la libVirt_HostSystem.la
+libVirt_HostedService_la_DEPENDENCIES = libVirt_VirtualSystemManagementService.la libVirt_ResourcePoolConfigurationService.la libVirt_VSMigrationService.la libVirt_HostSystem.la libVirt_RedirectionService.la
libVirt_HostedService_la_SOURCES = Virt_HostedService.c
-libVirt_HostedService_la_LIBADD = -lVirt_VirtualSystemManagementService -lVirt_ResourcePoolConfigurationService -lVirt_VSMigrationService -lVirt_HostSystem
+libVirt_HostedService_la_LIBADD = -lVirt_VirtualSystemManagementService -lVirt_ResourcePoolConfigurationService -lVirt_VSMigrationService -lVirt_HostSystem -lVirt_RedirectionService
libVirt_ElementSettingData_la_DEPENDENCIES = libVirt_VSSD.la libVirt_RASD.la
libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c
diff -r 8f75fc91697b -r d0f24426b9bf src/Virt_HostedService.c
--- a/src/Virt_HostedService.c Mon Sep 15 13:39:10 2008 -0700
+++ b/src/Virt_HostedService.c Mon Sep 15 13:41:42 2008 -0700
@@ -34,6 +34,7 @@
#include "Virt_VirtualSystemManagementService.h"
#include "Virt_ResourcePoolConfigurationService.h"
#include "Virt_VSMigrationService.h"
+#include "Virt_RedirectionService.h"
const static CMPIBroker *_BROKER;
@@ -52,6 +53,8 @@
s = get_rpcs(ref, &inst, _BROKER, context, true);
} else if (STREQC(classname, "VirtualSystemMigrationService")) {
s = get_migration_service(ref, &inst, _BROKER, context, true);
+ } else if (STREQC(classname, "RedirectionService")) {
+ s = get_rs(ref, &inst, _BROKER, context, true);
}
free(classname);
@@ -112,6 +115,12 @@
if (!CMIsNullObject(inst))
inst_list_add(list, inst);
+ s = get_rs(ref, &inst, _BROKER, info->context, false);
+ if (s.rc != CMPI_RC_OK)
+ return s;
+ if (!CMIsNullObject(inst))
+ inst_list_add(list, inst);
+
return s;
}
@@ -128,12 +137,15 @@
"Xen_ResourcePoolConfigurationService",
"Xen_VirtualSystemManagementService",
"Xen_VirtualSystemMigrationService",
+ "Xen_RedirectionService",
"KVM_ResourcePoolConfigurationService",
"KVM_VirtualSystemManagementService",
"KVM_VirtualSystemMigrationService",
+ "KVM_RedirectionService",
"LXC_ResourcePoolConfigurationService",
"LXC_VirtualSystemManagementService",
"LXC_VirtualSystemMigrationService",
+ "LXC_RedirectionService",
NULL
};
16 years, 3 months
[PATCH] Remove MemoryAllocationCapabilities from EC
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1221512660 25200
# Node ID f741e37085fd8f155fcdbbc45abd2f5e280b4101
# Parent d0f24426b9bfa5488f64666788e0d41e4c95b06c
Remove MemoryAllocationCapabilities from EC.
This class doesn't exist. Also remove the virtual_system_management_capabilities struct. It's now identically to the host_caps struct.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r d0f24426b9bf -r f741e37085fd src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Mon Sep 15 13:41:42 2008 -0700
+++ b/src/Virt_ElementCapabilities.c Mon Sep 15 14:04:20 2008 -0700
@@ -391,16 +391,6 @@
NULL
};
-static char* virtual_system_management_capabilities[] = {
- "Xen_VirtualSystemManagementCapabilities",
- "Xen_VirtualSystemMigrationCapabilities",
- "KVM_VirtualSystemManagementCapabilities",
- "KVM_VirtualSystemMigrationCapabilities",
- "LXC_VirtualSystemManagementCapabilities",
- "LXC_VirtualSystemMigrationCapabilities",
- NULL,
-};
-
static char *host_caps[] = {
"Xen_VirtualSystemManagementCapabilities",
"Xen_VirtualSystemMigrationCapabilities",
@@ -408,9 +398,6 @@
"KVM_VirtualSystemMigrationCapabilities",
"LXC_VirtualSystemManagementCapabilities",
"LXC_VirtualSystemMigrationCapabilities",
- "Xen_MemoryAllocationCapabilities",
- "KVM_MemoryAllocationCapabilities",
- "LXC_MemoryAllocationCapabilities",
NULL,
};
@@ -428,7 +415,7 @@
};
static struct std_assoc vsm_cap_to_sys_or_service = {
- .source_class = (char**)&virtual_system_management_capabilities,
+ .source_class = (char**)&host_caps,
.source_prop = "Capabilities",
.target_class = (char**)&host_sys_and_service,
@@ -454,7 +441,7 @@
.source_class = (char**)&service,
.source_prop = "ManagedElement",
- .target_class = (char**)&virtual_system_management_capabilities,
+ .target_class = (char**)&host_caps,
.target_prop = "Capabilities",
.assoc_class = (char**)&assoc_classname,
16 years, 3 months