# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1219823887 25200
# Node ID 868a63afd7a8089124a3fc1b94aefbd5d958947b
# Parent 9c6b62d1feca39dc45b47e8ac0619f98227df78b
[TEST] Make hostsystem.py related changes to all tests
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Wed Aug 27 00:26:24
2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Wed Aug 27 00:58:07
2008 -0700
@@ -24,7 +24,7 @@ from VirtLib import utils
from VirtLib import utils
from VirtLib import live
from XenKvmLib import assoc
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from CimTest.Globals import do_main, logger, CIM_ERROR_ASSOCIATORNAMES, \
@@ -60,9 +60,9 @@ def main():
options = main.options
server = options.ip
virt = options.virt
-
+ keys = ['Name', 'CreationClassName']
try:
- host_sys = hostsystem.enumerate(server, virt)[0]
+ host_sys = enumclass.enumerate(server, 'HostSystem', keys, virt)[0]
except Exception:
logger.error(CIM_ERROR_ENUMERATE, get_typed_class(virt, 'HostSystem'))
return FAIL
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py Wed Aug 27 00:26:24
2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py Wed Aug 27 00:58:07
2008 -0700
@@ -25,7 +25,7 @@ from VirtLib import utils
from VirtLib import utils
from VirtLib import live
from XenKvmLib import assoc
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib import vsms
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORNAMES
@@ -64,8 +64,9 @@ def verify_host(inst_list, ip, virt="Xen
return status
inst = list[0]
+ keys = ['Name', 'CreationClassName']
try:
- host_sys = hostsystem.enumerate(ip, virt)[0]
+ host_sys = enumclass.enumerate(ip, 'HostSystem', keys, virt)[0]
except Exception:
logger.error(CIM_ERROR_ENUMERATE, 'HostSystem')
return FAIL
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Wed Aug 27
00:26:24 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Wed Aug 27
00:58:07 2008 -0700
@@ -24,7 +24,7 @@ import pywbem
import pywbem
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib import assoc
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from CimTest.Globals import logger, do_main
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Wed Aug 27 00:26:24 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Wed Aug 27 00:58:07 2008
-0700
@@ -43,7 +43,7 @@ from CimTest import Globals
from CimTest import Globals
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS
from CimTest.Globals import do_main
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib import computersystem
from XenKvmLib import assoc
from XenKvmLib.test_doms import destroy_and_undefine_all
@@ -105,10 +105,10 @@ def main():
return FAIL
inst_list.append(sys)
-
+ keys = ['Name', 'CreationClassName']
try:
#Getting the hostname, to verify with the value returned by the assoc.
- host_sys = hostsystem.enumerate(options.ip, options.virt)
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)
if len(host_sys) < 1:
logger.error("ERROR: Enumerate returned 0 host instances")
diff -r 9c6b62d1feca -r 868a63afd7a8 suites/libvirt-cim/cimtest/HostSystem/01_enum.py
--- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Wed Aug 27 00:26:24 2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Wed Aug 27 00:58:07 2008 -0700
@@ -26,7 +26,7 @@
# and verifies the hostname returned by the provider
import sys
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib.classes import get_typed_class
from VirtLib import live
from VirtLib import utils
@@ -41,8 +41,9 @@ def main():
host = live.hostname(options.ip)
status = FAIL
+ keys = ['Name', 'CreationClassName']
try:
- hs = hostsystem.enumerate(options.ip, options.virt)
+ hs = enumclass.enumerate(options.ip, 'HostSystem', keys, options.virt)
name = get_typed_class(options.virt, 'HostSystem')
if len(hs) != 1:
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/HostedDependency/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Wed Aug 27 00:26:24 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Wed Aug 27 00:58:07 2008
-0700
@@ -49,7 +49,7 @@ from XenKvmLib import vxml
from XenKvmLib import vxml
from XenKvmLib import computersystem
from XenKvmLib import assoc
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib.classes import get_class_basename
from CimTest import Globals
from CimTest.Globals import do_main
@@ -75,9 +75,9 @@ def main():
Globals.logger.error("Failed to Create the dom: %s", test_dom)
status = FAIL
return status
-
+ keys = ['Name', 'CreationClassName']
try:
- host = hostsystem.enumerate(options.ip, options.virt)[0]
+ host = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)[0]
except Exception,detail:
Globals.logger.error(Globals.CIM_ERROR_ENUMERATE, 'Hostsystem')
Globals.logger.error("Exception: %s", detail)
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Wed Aug 27 00:26:24 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Wed Aug 27 00:58:07 2008
-0700
@@ -43,7 +43,7 @@ import sys
import sys
from VirtLib import utils
from XenKvmLib import vxml
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib import computersystem
from XenKvmLib import assoc
from XenKvmLib.classes import get_class_basename
@@ -71,9 +71,9 @@ def main():
logger.error("ERROR: Failed to Create the dom: %s" % test_dom)
status = FAIL
return status
-
+ keys = ['Name', 'CreationClassName']
try:
- host_sys = hostsystem.enumerate(options.ip, options.virt)
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)
if host_sys[0].Name == "":
raise Exception("HostName seems to be empty")
else:
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Wed Aug 27 00:26:24 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Wed Aug 27 00:58:07 2008
-0700
@@ -25,7 +25,7 @@
import sys
from XenKvmLib import assoc
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from CimTest import Globals
from CimTest.Globals import logger
from CimTest.ReturnCodes import PASS, FAIL
@@ -37,8 +37,9 @@ def main():
def main():
options = main.options
status = FAIL
+ keys = ['Name', 'CreationClassName']
try:
- host_sys = hostsystem.enumerate(options.ip, options.virt)[0]
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)[0]
except Exception:
host_cn = get_typed_class(options.virt, "HostSystem")
logger.error(Globals.CIM_ERROR_ENUMERATE % host_cn)
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Wed Aug 27 00:26:24 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Wed Aug 27 00:58:07 2008
-0700
@@ -24,7 +24,7 @@
import sys
from XenKvmLib import assoc
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from CimTest import Globals
from CimTest.Globals import logger
from CimTest.ReturnCodes import PASS, FAIL
@@ -36,8 +36,9 @@ def main():
def main():
options = main.options
status = PASS
+ keys = ['Name', 'CreationClassName']
try:
- host_sys = hostsystem.enumerate(options.ip, options.virt)[0]
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)[0]
except Exception:
host_cn = get_typed_class(options.virt, "HostSystem")
logger.error(Globals.CIM_ERROR_ENUMERATE % host_cn)
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/HostedResourcePool/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/HostedResourcePool/03_forward_errs.py Wed Aug 27 00:26:24
2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedResourcePool/03_forward_errs.py Wed Aug 27 00:58:07
2008 -0700
@@ -24,7 +24,7 @@ import sys
import sys
import pywbem
from XenKvmLib import assoc
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib.common_util import try_assoc
from CimTest import Globals
from CimTest.Globals import logger
@@ -41,9 +41,9 @@ def main():
def main():
options = main.options
status = PASS
-
+ keys = ['Name', 'CreationClassName']
try:
- host_sys = hostsystem.enumerate(options.ip, options.virt)[0]
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)[0]
except Exception:
host_cn = get_typed_class(options.virt, "HostSystem")
logger.error(Globals.CIM_ERROR_ENUMERATE % host_cn)
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/HostedService/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedService/01_forward.py Wed Aug 27 00:26:24 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedService/01_forward.py Wed Aug 27 00:58:07 2008
-0700
@@ -24,7 +24,7 @@ import sys
import sys
from VirtLib import utils
from XenKvmLib import assoc
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from CimTest.Globals import do_main
@@ -36,8 +36,9 @@ sup_types = ['Xen', 'XenFV', 'KVM', 'LXC
@do_main(sup_types)
def main():
options = main.options
+ keys = ['Name', 'CreationClassName']
try:
- host_sys = hostsystem.enumerate(options.ip, options.virt)[0]
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)[0]
except Exception:
logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.name)
return FAIL
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/HostedService/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Wed Aug 27 00:26:24 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedService/02_reverse.py Wed Aug 27 00:58:07 2008
-0700
@@ -24,7 +24,7 @@ import sys
import sys
from VirtLib import utils
from XenKvmLib import assoc
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from CimTest.Globals import do_main
@@ -36,8 +36,9 @@ sup_types = ['Xen', 'XenFV', 'KVM', 'LXC
@do_main(sup_types)
def main():
options = main.options
+ keys = ['Name', 'CreationClassName']
try:
- host_sys = hostsystem.enumerate(options.ip, options.virt)[0]
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)[0]
except Exception:
logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.CreationClassName)
return FAIL
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Wed Aug 27 00:26:24 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedService/03_forward_errs.py Wed Aug 27 00:58:07 2008
-0700
@@ -24,7 +24,7 @@ import pywbem
import pywbem
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib import assoc
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from CimTest.Globals import logger, do_main
@@ -39,9 +39,9 @@ def main():
options = main.options
rc = -1
status = FAIL
-
+ keys = ['Name', 'CreationClassName']
try:
- host_sys = hostsystem.enumerate(options.ip, options.virt)[0]
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)[0]
except Exception:
logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.name)
return FAIL
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py
--- a/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Wed Aug 27 00:26:24 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedService/04_reverse_errs.py Wed Aug 27 00:58:07 2008
-0700
@@ -24,7 +24,7 @@ import pywbem
import pywbem
from pywbem.cim_obj import CIMInstanceName
from XenKvmLib import assoc
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib.classes import get_typed_class
from CimTest import Globals
from CimTest.Globals import logger, do_main
@@ -39,9 +39,9 @@ def main():
options = main.options
rc = -1
status = FAIL
-
+ keys = ['Name', 'CreationClassName']
try:
- host_sys = hostsystem.enumerate(options.ip, options.virt)[0]
+ host_sys = enumclass.enumerate(options.ip, 'HostSystem', keys,
options.virt)[0]
except Exception:
logger.error(Globals.CIM_ERROR_ENUMERATE % host_sys.name)
return FAIL
diff -r 9c6b62d1feca -r 868a63afd7a8
suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py
--- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Wed Aug 27
00:26:24 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Wed Aug 27
00:58:07 2008 -0700
@@ -23,7 +23,7 @@
#
import sys
-from XenKvmLib import hostsystem
+from XenKvmLib import enumclass
from XenKvmLib import rpcs
from CimTest import Globals
from CimTest.ReturnCodes import PASS, FAIL
@@ -38,8 +38,9 @@ def main():
options = main.options
server = options.ip
classname = get_typed_class(options.virt,
"ResourcePoolConfigurationService")
+ keys = ['Name', 'CreationClassName']
try:
- host_sys = hostsystem.enumerate(server, options.virt)[0]
+ host_sys = enumclass.enumerate(server, 'HostSystem', keys,
options.virt)[0]
except Exception:
host_cn = get_typed_class(options.virt, "HostSystem")
logger.error(Globals.CIM_ERROR_ENUMERATE % host_cn)