# HG changeset patch
# User Zhengang Li <lizg(a)cn.ibm.com>
# Date 1208333452 -28800
# Node ID e54b31ce89af19ca0d4c40ce4b097685e34aa2c7
# Parent 32614eca2a5579389cc5b262eff8243b0ca2da82
[TEST] Add KVM support for Profile.03
Signe-off-by: Zhengang Li <lizg(a)cn.ibm.com>
diff -r 32614eca2a55 -r e54b31ce89af
suites/libvirt-cim/cimtest/Profile/03_rprofile_gi_errs.py
--- a/suites/libvirt-cim/cimtest/Profile/03_rprofile_gi_errs.py Wed Apr 16 15:58:55 2008
+0800
+++ b/suites/libvirt-cim/cimtest/Profile/03_rprofile_gi_errs.py Wed Apr 16 16:10:52 2008
+0800
@@ -52,12 +52,13 @@ import pywbem
import pywbem
from VirtLib import utils
from XenKvmLib import assoc
+from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import try_getinstance
from CimTest.ReturnCodes import PASS, FAIL
from CimTest import Globals
from CimTest.Globals import do_main
-sup_types = ['Xen']
+sup_types = ['Xen', 'KVM']
expr_values = {
"invalid_instid_keyvalue" : { 'rc' :
pywbem.CIM_ERR_NOT_FOUND, \
@@ -74,31 +75,35 @@ def main():
prev_namespace = Globals.CIM_NS
Globals.CIM_NS = 'root/interop'
- classname = 'Xen_RegisteredProfile'
+ classname = get_typed_class(options.virt, 'RegisteredProfile')
status = PASS
- conn = assoc.myWBEMConnection('http://%s' % options.ip, ( \
- Globals.CIM_USER, Globals.CIM_PASS), Globals.CIM_NS)
+ conn = assoc.myWBEMConnection('http://%s' % options.ip,
+ (Globals.CIM_USER, Globals.CIM_PASS),
+ Globals.CIM_NS)
- inst_id = ["CIM:DSP1042-SystemVirtualization-1.0.0",
"CIM:DSP1057-VirtualSystem-1.0.0a"]
+ inst_id = ["CIM:DSP1042-SystemVirtualization-1.0.0",
+ "CIM:DSP1057-VirtualSystem-1.0.0a"]
# 1) Test by passing Invalid InstanceID Key Value
field = 'INVALID_Instid_KeyValue'
keys = { 'InstanceID' : field }
- ret_value = try_getinstance(conn, classname, keys, field_name=field, \
-
expr_values=expr_values['invalid_instid_keyvalue'], bug_no="")
+ ret_value = try_getinstance(conn, classname, keys, field_name=field,
+
expr_values=expr_values['invalid_instid_keyvalue'],
+ bug_no="")
if ret_value != PASS:
- Globals.logger.error("------ FAILED: Invalid InstanceID Key
Value.------")
+ Globals.logger.error("--- FAILED: Invalid InstanceID Key Value.---")
status = ret_value
# 2) Test by giving Invalid InstanceID Key Name
for i in range(len(inst_id)):
field = 'INVALID_Instid_KeyName'
keys = { field : inst_id[i] }
- ret_value = try_getinstance(conn, classname, keys, field_name=field, \
-
expr_values=expr_values['invalid_instid_keyname'], bug_no="")
+ ret_value = try_getinstance(conn, classname, keys, field_name=field,
+
expr_values=expr_values['invalid_instid_keyname'],
+ bug_no="")
if ret_value != PASS:
- Globals.logger.error("------ FAILED: Invalid InstanceID Key
Name.------")
+ Globals.logger.error("--- FAILED: Invalid InstanceID Key
Name.---")
status = ret_value
Globals.CIM_NS = prev_namespace