# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222409147 25200
# Node ID f0bc2872b93607b69e32aed0e34e4aea2d45107b
# Parent 61a90c7c9141a64af825e6d4e5645723879df078
[TEST] #4 Fix HostSystem-01 with sblim base provider installed
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 61a90c7c9141 -r f0bc2872b936 suites/libvirt-cim/cimtest/HostSystem/01_enum.py
--- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Wed Sep 24 20:27:48 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Thu Sep 25 23:05:47 2008 -0700
@@ -30,6 +30,7 @@ from XenKvmLib.classes import get_typed_
from XenKvmLib.classes import get_typed_class
from VirtLib import live
from VirtLib import utils
+from XenKvmLib.common_util import check_sblim
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
from XenKvmLib.const import do_main
from CimTest.ReturnCodes import PASS, FAIL
@@ -43,10 +44,29 @@ def main():
status = FAIL
keys = ['Name', 'CreationClassName']
+ name = get_typed_class(options.virt, 'HostSystem')
+
+ net, linux_cs = check_sblim(options.ip, options.virt)
try:
hs = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)
- name = get_typed_class(options.virt, 'HostSystem')
-
+ except Exception, details:
+ logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details))
+ status = FAIL
+
+ if net == PASS:
+ if len(hs) != 0:
+ logger.error("Unexpected instance returned")
+ return FAIL
+ else:
+ if linux_cs.CreationClassName != 'Linux_ComputerSystem'\
+ or linux_cs.Name != host:
+ logger.error("Exp Linux_ComputerSystem, got %s" \
+ % linux_cs.CreationClassName)
+ logger.error("Exp %s, got %s" % (host, system.Name))
+ return FAIL
+ else:
+ return PASS
+ else:
if len(hs) != 1:
logger.error("Expected 1 %s instance returned" % name)
return FAIL
@@ -61,10 +81,6 @@ def main():
logger.info("%s is %s" % (name, host))
status = PASS
- except Exception, details:
- logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details))
- status = FAIL
-
return status
if __name__ == "__main__":