# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1220236263 25200
# Node ID db9789b5145f4cb219d4fcdfaa242e346d8b9c4d
# Parent 946fd46b96866adaab356876f9c8bbf937f0b3d6
[TEST] Update CS to call enumclass.py instead of computersystem.py
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 946fd46b9686 -r db9789b5145f suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py Thu Aug 28 14:07:25 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py Sun Aug 31 19:31:03 2008 -0700
@@ -24,7 +24,7 @@
import sys
from XenKvmLib.const import do_main
-from XenKvmLib import computersystem
+from XenKvmLib import enumclass
from VirtLib import live
from VirtLib import utils
from CimTest import Globals
@@ -37,8 +37,9 @@
options = main.options
status = PASS
+ keys = ['Name', 'CreationClassName']
try:
- cs = computersystem.enumerate(options.ip, options.virt)
+ cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys,
options.virt)
live_cs = live.domain_list(options.ip, options.virt)
for system in cs:
name = system.name
diff -r 946fd46b9686 -r db9789b5145f
suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Thu Aug 28 14:07:25 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Sun Aug 31 19:31:03 2008
-0700
@@ -24,7 +24,7 @@
import sys
import pywbem
-from XenKvmLib import computersystem
+from XenKvmLib import enumclass
from VirtLib import live
from VirtLib import utils
from CimTest.Globals import logger, CIM_ERROR_ENUMERATE
@@ -49,9 +49,9 @@
return SKIP
cn = "%s_ComputerSystem" % options.virt
-
+ keys = ['Name', 'CreationClassName']
try:
- cs = computersystem.enumerate(options.ip, options.virt)
+ cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys,
options.virt)
except Exception, details:
logger.error(CIM_ERROR_ENUMERATE, cn)
diff -r 946fd46b9686 -r db9789b5145f
suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Thu Aug 28 14:07:25 2008
-0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Sun Aug 31 19:31:03 2008
-0700
@@ -27,7 +27,7 @@
# 26-Sep-2007
import sys
-from XenKvmLib import computersystem
+from XenKvmLib import enumclass
from XenKvmLib import vxml
from XenKvmLib.classes import get_typed_class
from VirtLib import utils
@@ -48,9 +48,9 @@
if not rc:
Globals.logger.error(VIRSH_ERROR_DEFINE % test_dom)
return status
-
+ keys = ['Name', 'CreationClassName']
try:
- cs = computersystem.enumerate(options.ip, options.virt)
+ cs = enumclass.enumerate(options.ip, 'ComputerSystem', keys,
options.virt)
if len(cs) == 0:
raise Exception('No cs instance returned')
for dom in cs:
diff -r 946fd46b9686 -r db9789b5145f
suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Thu Aug 28 14:07:25
2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Sun Aug 31 19:31:03
2008 -0700
@@ -32,7 +32,7 @@
import sys
from time import sleep
from XenKvmLib import vxml
-from XenKvmLib import computersystem
+from XenKvmLib import enumclass
from CimTest import Globals
from XenKvmLib.classes import get_typed_class
from XenKvmLib.const import do_main
@@ -62,8 +62,8 @@
# otherwise.
for i in range(1, (timeout + 1)):
sleep(1)
- cs = computersystem.get_cs_class(options.virt)(options.ip,
- test_dom)
+ cs = get_typed_class(options.virt, 'ComputerSystem')\
+ (options.ip, test_dom
if cs.Name != test_dom:
Globals.logger.error("VS %s is not defined" % test_dom)
break
diff -r 946fd46b9686 -r db9789b5145f
suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py Thu Aug 28
14:07:25 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py Sun Aug 31
19:31:03 2008 -0700
@@ -42,8 +42,8 @@
# Date : 17-10-2007
import sys
-from XenKvmLib import computersystem
from XenKvmLib import vxml
+from XenKvmLib.classes import get_typed_class
from VirtLib import utils
from CimTest.Globals import logger
from XenKvmLib.const import do_main
@@ -73,7 +73,8 @@
logger.error("ERROR: VS %s was not defined" % test_dom)
return status
- cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom)
+ cs = get_typed_class(options.virt, 'ComputerSystem')\
+ (options.ip, test_dom)
if cs.Name == test_dom:
from_State = cs.EnabledState
else:
@@ -95,7 +96,8 @@
#Get the value of the EnabledState property and RequestedState property.
try:
- cs = computersystem.get_cs_class(options.virt)(options.ip, test_dom)
+ cs = get_typed_class(options.virt, 'ComputerSystem')\
+ (options.ip, test_dom)
if cs.Name == test_dom:
to_RequestedState = cs.RequestedState
enabledState = cs.EnabledState
diff -r 946fd46b9686 -r db9789b5145f
suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Thu Aug 28 14:07:25
2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Sun Aug 31 19:31:03
2008 -0700
@@ -29,7 +29,6 @@
# Date: 14-12-2007
import sys
-from XenKvmLib import computersystem
from VirtLib import utils
from XenKvmLib import vxml
from XenKvmLib.test_doms import destroy_and_undefine_domain
diff -r 946fd46b9686 -r db9789b5145f
suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py
--- a/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Thu Aug 28
14:07:25 2008 -0700
+++ b/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Sun Aug 31
19:31:03 2008 -0700
@@ -58,7 +58,6 @@
import sys
from VirtLib import utils
-from XenKvmLib import computersystem
from XenKvmLib.vxml import get_class
from XenKvmLib.classes import get_typed_class
from XenKvmLib.test_doms import destroy_and_undefine_all