# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1208943021 -19800
# Node ID 064614c4b678b5d38e831548154cdf6b3234b19b
# Parent 113ac4b0bb4b7b1e29f3aae585ecf7b89958f60e
[TEST] #3 Updating 04_forward_vsmsdata.py tc in SettingsDefineCapabilities
1) To support KVM and XenFV.
2) To adapt to the new infrastructure changes.
3) Rebased with the latest test source.
4) Moved the print_error from tc to common_util.py and imported the same in the tc.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 113ac4b0bb4b -r 064614c4b678
suites/libvirt-cim/cimtest/SettingsDefineCapabilities/04_forward_vsmsdata.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/04_forward_vsmsdata.py Tue Apr
22 15:16:28 2008 +0530
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/04_forward_vsmsdata.py Wed Apr
23 15:00:21 2008 +0530
@@ -20,7 +20,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# This tc is used to verify the Classname and InstanceID of
-# Xen_SettingsDefineCapabilities association with Xen_VirtualSystemMigrationSettingData
+# Xen_SettingsDefineCapabilities association with
+# Xen_VirtualSystemMigrationSettingData
# Command
# -------
# wbemcli ai -ac Xen_SettingsDefineCapabilities \
@@ -35,44 +36,36 @@
# Date : 05-03-2008
import sys
-from VirtLib import utils
from XenKvmLib import assoc
-from CimTest.Globals import CIM_ERROR_ASSOCIATORS, logger, do_main
+from CimTest.Globals import CIM_ERROR_ASSOCIATORS, logger
from CimTest.ReturnCodes import PASS, FAIL
+from CimTest.Globals import do_main, platform_sup
+from XenKvmLib.classes import get_typed_class
+from XenKvmLib.common_util import print_field_error
-sup_types = ['Xen']
-
-def print_error(fieldname, ret_value, exp_value):
- logger.error("%s Mismatch", fieldname)
- logger.error("Returned %s instead of %s", ret_value, exp_value)
-
-
-@do_main(sup_types)
+@do_main(platform_sup)
def main():
- (options, args) = parser.parse_args()
- if not options.ip:
- parser.print_help()
- return 1
+ options = main.options
status = PASS
server = options.ip
- an = 'Xen_SettingsDefineCapabilities'
- cn = 'Xen_VirtualSystemMigrationSettingData'
- qcn = 'Xen_VirtualSystemMigrationCapabilities'
+
+ an = get_typed_class(options.virt, 'SettingsDefineCapabilities')
+ cn = get_typed_class(options.virt, 'VirtualSystemMigrationSettingData')
+ qcn = get_typed_class(options.virt, 'VirtualSystemMigrationCapabilities')
instid = 'MigrationSettingData'
try:
- assoc_info = assoc.Associators(server, \
- an, \
- cn, \
- InstanceID = instid)
+ assoc_info = assoc.Associators(server, an, cn, InstanceID = instid,
+ virt=options.virt)
if len(assoc_info) != 1:
logger.error("%s returned %i %s objects", an, len(assoc_info),
qcn)
return FAIL
verify_assoc = assoc_info[0]
if verify_assoc.classname != qcn:
- print_error('Classname', verify_assoc.classname, qcn)
+ print_field_error('Classname', verify_assoc.classname, qcn)
status = FAIL
if verify_assoc['InstanceID'] != 'MigrationCapabilities':
- print_error('InstanceID', verify_assoc['InstanceID'],
'MigrationCapabilities')
+ print_field_error('InstanceID', verify_assoc['InstanceID'],
+ 'MigrationCapabilities')
status = FAIL
except Exception, detail:
logger.error(CIM_ERROR_ASSOCIATORS, an)