# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1222153227 25200
# Node ID a22ec4af9d96154d80abf3c9240ec5f054a5fb50
# Parent 98aff030dd48b0a1e08b90f6719d47c630b4d424
[TEST] Fix HostSystem-01_enum with sblim base provider installed
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 98aff030dd48 -r a22ec4af9d96 suites/libvirt-cim/cimtest/HostSystem/01_enum.py
--- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Mon Sep 22 23:58:55 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Tue Sep 23 00:00:27 2008 -0700
@@ -27,6 +27,7 @@
import sys
from XenKvmLib import enumclass
+from XenKvmLib.common_util import check_sblim
from XenKvmLib.classes import get_typed_class
from VirtLib import live
from VirtLib import utils
@@ -43,27 +44,34 @@ def main():
status = FAIL
keys = ['Name', 'CreationClassName']
- try:
- hs = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)
- name = get_typed_class(options.virt, 'HostSystem')
+
+ status, linux_cs = check_sblim(options.ip)
+ if status == PASS:
+ name = 'Linux_ComputerSystem'
+ system = linux_cs[0]
+ else:
+ try:
+ hs = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)
+ name = get_typed_class(options.virt, 'HostSystem')
- if len(hs) != 1:
- logger.error("Expected 1 %s instance returned" % name)
- return FAIL
+ if len(hs) != 1:
+ logger.error("Expected 1 %s instance returned" % name)
+ return FAIL
- system = hs[0]
+ system = hs[0]
+ except Exception, details:
+ logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details))
+ status = FAIL
- if system.CreationClassName != name or system.Name != host:
- logger.error("Exp %s, got %s" % (name, system.CreationClassName))
- logger.error("Exp %s, got %s" % (host, system.Name))
- status = FAIL
- else:
- logger.info("%s is %s" % (name, host))
- status = PASS
- except Exception, details:
- logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details))
+ if system.CreationClassName != name or system.Name != host:
+ logger.error("Exp %s, got %s" % (name, system.CreationClassName))
+ logger.error("Exp %s, got %s" % (host, system.Name))
status = FAIL
+ else:
+ logger.info("%s is %s" % (name, host))
+ status = PASS
+
return status