# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1220494058 25200
# Node ID 0ada4b341b79e61c0385012b5fde7ae37a053579
# Parent 3c04faaa67e001ecaf578a13da75f88235257576
[TEST]Update HostedDependency.01~03 to call enumclass.py instead of computersystem.py
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 3c04faaa67e0 -r 0ada4b341b79
suites/libvirt-cim/cimtest/HostedDependency/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Tue Sep 02 23:10:52 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Wed Sep 03 19:07:38 2008
-0700
@@ -47,7 +47,6 @@ import pywbem
import pywbem
from VirtLib import utils
from XenKvmLib import vxml
-from XenKvmLib import computersystem
from XenKvmLib import assoc
from XenKvmLib import enumclass
from XenKvmLib.classes import get_class_basename
@@ -84,9 +83,10 @@ def main():
status = FAIL
cxml.undefine(options.ip)
return status
-
+
+ keys = ['Name', 'CreationClassName']
try:
- cs = computersystem.enumerate(options.ip, options.virt)
+ cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys,
options.virt)
except Exception,detail:
Globals.logger.error(Globals.CIM_ERROR_ENUMERATE, 'ComputerSystem')
Globals.logger.error("Exception: %s", detail)
diff -r 3c04faaa67e0 -r 0ada4b341b79
suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Tue Sep 02 23:10:52 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Wed Sep 03 19:07:38 2008
-0700
@@ -44,7 +44,6 @@ from VirtLib import utils
from VirtLib import utils
from XenKvmLib import vxml
from XenKvmLib import enumclass
-from XenKvmLib import computersystem
from XenKvmLib import assoc
from XenKvmLib.classes import get_class_basename
from CimTest.Globals import logger
@@ -81,7 +80,8 @@ def main():
# Instance of the HostSystem
host_sys = host_sys[0]
- cs = computersystem.enumerate(options.ip, options.virt)
+ keys = ['Name', 'CreationClassName']
+ cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys,
options.virt)
if options.virt == 'Xen' or options.virt == 'XenFV':
# Xen honors additional domain-0
cs_list_len = 2
diff -r 3c04faaa67e0 -r 0ada4b341b79
suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Tue Sep 02 23:10:52
2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Wed Sep 03 19:07:38
2008 -0700
@@ -34,8 +34,9 @@ from time import sleep
from time import sleep
from VirtLib import utils
from XenKvmLib import vxml
-from XenKvmLib import computersystem
+from XenKvmLib import enumclass
from XenKvmLib import assoc
+from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import get_host_info
from XenKvmLib.classes import get_class_basename
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORS, \
@@ -70,8 +71,12 @@ def poll_for_enabledstate_value(server,
try:
for i in range(1, (timeout + 1)):
sleep(1)
- cs = computersystem.get_cs_class(virt)
- dom_cs = cs(server, name=test_dom)
+ ccn = get_typed_class(virt, 'ComputerSystem')
+ keys = {
+ 'Name' : test_dom,
+ 'CreationClassName' : ccn
+ }
+ dom_cs = enumclass.getInstance(server, 'ComputerSystem', keys, virt)
if dom_cs.EnabledState == "" or dom_cs.CreationClassName ==
"" or \
dom_cs.Name == "" or dom_cs.RequestedState == "":
logger.error("Empty EnabledState field.")