# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1220244653 25200
# Node ID 1269f456c0fe62ba198a858b67b623c26818da3e
# Parent 946fd46b96866adaab356876f9c8bbf937f0b3d6
[TEST] Update tests to reflect computersystem.py changes
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 946fd46b9686 -r 1269f456c0fe
suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py
--- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Thu Aug 28 14:07:25 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Sun Aug 31 21:50:53 2008
-0700
@@ -44,7 +44,6 @@
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, CIM_ERROR_ASSOCIATORS
from CimTest.Globals import do_main
from XenKvmLib import enumclass
-from XenKvmLib import computersystem
from XenKvmLib import assoc
from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib.test_doms import destroy_and_undefine_all
diff -r 946fd46b9686 -r 1269f456c0fe
suites/libvirt-cim/cimtest/HostedDependency/01_forward.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Thu Aug 28 14:07:25 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/01_forward.py Sun Aug 31 21:50:53 2008
-0700
@@ -47,7 +47,6 @@
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
@@ -85,8 +84,9 @@
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 946fd46b9686 -r 1269f456c0fe
suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Thu Aug 28 14:07:25 2008
-0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Sun Aug 31 21:50:53 2008
-0700
@@ -44,7 +44,6 @@
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, do_main
@@ -79,8 +78,9 @@
else:
# 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 946fd46b9686 -r 1269f456c0fe
suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py
--- a/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Thu Aug 28 14:07:25
2008 -0700
+++ b/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Sun Aug 31 21:50:53
2008 -0700
@@ -34,10 +34,9 @@
from time import sleep
from VirtLib import utils
from XenKvmLib import vxml
-from XenKvmLib import computersystem
from XenKvmLib import assoc
from XenKvmLib.common_util import get_host_info
-from XenKvmLib.classes import get_class_basename
+from XenKvmLib.classes import get_class_basename, get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORS, \
CIM_ERROR_GETINSTANCE
from CimTest.Globals import do_main
@@ -70,7 +69,7 @@
try:
for i in range(1, (timeout + 1)):
sleep(1)
- cs = computersystem.get_cs_class(virt)
+ cs = get_typed_class(virt, 'ComputerSystem')
dom_cs = cs(server, name=test_dom)
if dom_cs.EnabledState == "" or dom_cs.CreationClassName ==
"" or \
dom_cs.Name == "" or dom_cs.RequestedState == "":
diff -r 946fd46b9686 -r 1269f456c0fe
suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py
--- a/suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py Thu Aug 28 14:07:25 2008
-0700
+++ b/suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py Sun Aug 31 21:50:53 2008
-0700
@@ -27,7 +27,6 @@
import sys
from VirtLib import utils
from XenKvmLib import vxml
-from XenKvmLib import computersystem
from XenKvmLib import assoc
from XenKvmLib import devices
from CimTest.Globals import logger, do_main
@@ -37,6 +36,11 @@
test_dom = "test_domain"
test_mac = "00:11:22:33:44:55"
+
+def system_of(server, iname):
+ t = eval(iname["CreationClassName"])
+
+ return t(server, iname["Name"])
@do_main(sup_types)
def main():
@@ -92,7 +96,7 @@
cxml.undefine(options.ip)
return FAIL
- system = computersystem.system_of(options.ip, systems[0])
+ system = system_of(options.ip, systems[0])
if system.Name == test_dom:
status = PASS
diff -r 946fd46b9686 -r 1269f456c0fe
suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Thu
Aug 28 14:07:25 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Sun
Aug 31 21:50:53 2008 -0700
@@ -29,7 +29,6 @@
from VirtLib import utils
from XenKvmLib import vxml
from XenKvmLib.common_util import poll_for_state_change
-from XenKvmLib import computersystem
from XenKvmLib import vsmigrations
from XenKvmLib.vsmigrations import check_possible_host_migration, migrate_guest_to_host,
check_migration_job
from XenKvmLib import enumclass
diff -r 946fd46b9686 -r 1269f456c0fe
suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py
--- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Thu
Aug 28 14:07:25 2008 -0700
+++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Sun
Aug 31 21:50:53 2008 -0700
@@ -27,7 +27,6 @@
from VirtLib import utils
from XenKvmLib import vxml
from XenKvmLib.common_util import poll_for_state_change
-from XenKvmLib import computersystem
from XenKvmLib import vsmigrations
from XenKvmLib.vsmigrations import check_possible_host_migration, \
migrate_guest_to_host, check_migration_job
diff -r 946fd46b9686 -r 1269f456c0fe
suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py
---
a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Thu
Aug 28 14:07:25 2008 -0700
+++
b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Sun
Aug 31 21:50:53 2008 -0700
@@ -25,7 +25,6 @@
from pywbem.cim_obj import CIMInstanceName
from VirtLib import utils
from XenKvmLib import vxml
-from XenKvmLib import computersystem
from XenKvmLib import vsmigrations
from CimTest.Globals import logger, do_main
from CimTest.ReturnCodes import PASS, FAIL, XFAIL