# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222152975 25200
# Node ID a85126ffa88f5fe6f9c11c1c84909df220963947
# Parent 529b767f1bb57a6e8079623168bf01bb7a5182e1
[TEST] Add check_sblim function to verify if sblim base provider is installed
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 529b767f1bb5 -r a85126ffa88f suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Mon Sep 22 23:54:42 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Mon Sep 22 23:56:15 2008 -0700
@@ -38,7 +38,8 @@ from VirtLib.live import diskpool_list,
from VirtLib.live import diskpool_list, virsh_version, net_list, domain_list
from XenKvmLib.vxml import PoolXML, NetXML
from XenKvmLib.enumclass import getInstance
-from VirtLib import utils
+from VirtLib import utils
+from CimTest import Globals
from XenKvmLib.const import default_pool_name, default_network_name
disk_file = '/etc/libvirt/diskpool.conf'
@@ -476,4 +477,21 @@ def libvirt_cached_data_poll(ip, virt, d
sleep(1)
- return cs
+ return cs
+
+def check_sblim(server):
+ status = FAIL
+ Globals.CIM_NS = 'root/cimv2'
+ keys = ['Name', 'CreationClassName']
+ try:
+ linux_cs = enumclass.enumerate(server, 'ComputerSystem', keys,
'Linux')
+ if len(linux_cs) == 1:
+ status = PASS
+ else:
+ logger.info("sblim base provider is not installed")
+ except Exception, detail:
+ logger.error(CIM_ERROR_ENUMERATE, 'Linux_ComputerSystem')
+ logger.error("Exception: %s", detail)
+
+ Globals.CIM_NS = 'root/virt'
+ return status, linux_cs