Add controller RASD's to various tests.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
.../cimtest/HostSystem/02_hostsystem_to_rasd.py | 4 +++-
suites/libvirt-cim/cimtest/SystemDevice/01_forward.py | 9 ++++++++-
suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py | 8 ++++++--
.../VirtualSystemSettingDataComponent/02_reverse.py | 14 +++++++++++++-
4 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py
b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py
index 48f0d2f..828dd9f 100644
--- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py
+++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py
@@ -58,7 +58,7 @@ CIM_ERROR_ASSOCIATORS
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
verify_diskrasd_values, verify_memrasd_values, verify_displayrasd_values, \
-rasd_init_list, verify_inputrasd_values
+rasd_init_list, verify_inputrasd_values, verify_controllerrasd_values
libvirt_bug = "00009"
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
@@ -183,6 +183,8 @@ def verify_RASD_values(server, sd_assoc_info, vsxml,
virt="Xen"):
status = verify_memrasd_values(assoc_info[index], rasd)
elif 'GraphicsResourceAllocationSettingData' in CCName:
status = verify_displayrasd_values(assoc_info[index], rasd)
+ elif 'ControllerResourceAllocationSettingData' in CCName:
+ status = verify_controllerrasd_values(assoc_info[index], rasd)
elif 'InputResourceAllocationSettingData' in CCName:
status = verify_inputrasd_values(assoc_info[index], rasd)
if status != PASS and virt == 'LXC':
diff --git a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py
b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py
index 15a4ff5..d363895 100644
--- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py
+++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py
@@ -36,6 +36,7 @@ from CimTest.ReturnCodes import PASS, FAIL
sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
input_graphics_pool_rev = 757
+controller_rev = 1310
test_dom = "test_domain"
test_mac = "00:11:22:33:44:55"
@@ -106,6 +107,7 @@ def main():
disk_cn = get_typed_class(virt, "LogicalDisk")
exp_pllist[disk_cn] = [ '%s/%s' % (test_dom, test_disk)]
+ curr_cim_rev, changeset = get_provider_version(virt, server)
if virt != 'LXC':
net_cn = get_typed_class(virt, "NetworkPort")
exp_pllist[net_cn] = ['%s/%s' % (test_dom, test_mac)]
@@ -115,11 +117,16 @@ def main():
for i in range(test_cpu):
exp_pllist[proc_cn].append( '%s/%s' % (test_dom, i))
- curr_cim_rev, changeset = get_provider_version(virt, server)
if curr_cim_rev >= input_graphics_pool_rev:
graphics_cn = get_typed_class(virt, "DisplayController")
exp_pllist[graphics_cn] = ['%s/vnc' % test_dom]
+ # Need a version check too
+ if curr_cim_rev >= controller_rev and virt == 'KVM':
+ controller_cn = get_typed_class(virt, "Controller")
+ exp_pllist[controller_cn] = []
+ exp_pllist[controller_cn].append('%s/controller:pci:0' % test_dom)
+ exp_pllist[controller_cn].append('%s/controller:usb:0' % test_dom)
try:
res_pllist = {}
diff --git a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py
b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py
index 04b0b6e..bac0876 100755
--- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py
+++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py
@@ -54,7 +54,7 @@ from XenKvmLib.classes import get_typed_class
from XenKvmLib import rasd
from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \
verify_diskrasd_values, verify_memrasd_values, verify_displayrasd_values, \
-rasd_init_list, verify_inputrasd_values
+rasd_init_list, verify_inputrasd_values, verify_controllerrasd_values
from XenKvmLib.const import default_network_name
libvirt_bug = "00009"
@@ -172,6 +172,7 @@ def verify_rasd_values(rasd_values_info, server):
diskrasd = rasd_values_list['%s' %in_list['disk']]
memrasd = rasd_values_list['%s' %in_list['mem']]
displayrasd = rasd_values_list['%s' %in_list['display']]
+ controllerrasd = rasd_values_list['%s' %in_list['controller']]
inputrasd = rasd_values_list['%s' %in_list['point']]
try:
@@ -187,6 +188,9 @@ def verify_rasd_values(rasd_values_info, server):
status = verify_memrasd_values(rasd_instance, memrasd)
elif 'GraphicsResourceAllocationSettingData' in CCName :
status = verify_displayrasd_values(rasd_instance, displayrasd)
+ elif 'ControllerResourceAllocationSettingData' in CCName :
+ status = verify_controllerrasd_values(rasd_instance,
+ controllerrasd)
elif 'InputResourceAllocationSettingData' in CCName:
status = verify_inputrasd_values(rasd_instance, inputrasd)
if status != PASS and virt== 'LXC':
@@ -194,7 +198,7 @@ def verify_rasd_values(rasd_values_info, server):
else:
status = FAIL
if status != PASS:
- logger.error("Mistmatching %s values", CCName )
+ logger.error("Mismatching %s values", CCName )
break
except Exception, detail :
logger.error("Exception in verify_rasd_values function: %s", detail)
diff --git a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py
b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py
index 1a2218b..2f0bdd4 100644
--- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py
+++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py
@@ -52,7 +52,7 @@ from XenKvmLib.test_doms import destroy_and_undefine_all
from XenKvmLib import vxml
from XenKvmLib.classes import get_typed_class
from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORS
-from XenKvmLib.const import do_main
+from XenKvmLib.const import do_main, get_provider_version
from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC
bug_libvirt = "00009"
@@ -63,6 +63,8 @@ test_vcpus = 1
test_mem = 128
test_mac = "00:11:22:33:44:aa"
+controller_rev = 1310
+
def assoc_values(ip, assoc_info, virt="Xen"):
"""
The association info of
@@ -87,6 +89,12 @@ def assoc_values(ip, assoc_info, virt="Xen"):
}
+ curr_cim_rev, changeset = get_provider_version(virt, ip)
+ if curr_cim_rev >= controller_rev and virt == 'KVM':
+ # Add controllers too ... will need a cim/cimtest version check
+ rasd_list.update({"pci_rasd":"%s/controller:pci:0" %
test_dom})
+ rasd_list.update({"usb_rasd":"%s/controller:usb:0" %
test_dom})
+
expect_rasds = len(rasd_list)
try:
@@ -101,8 +109,12 @@ def assoc_values(ip, assoc_info, virt="Xen"):
mem_cn = get_typed_class(virt, 'MemResourceAllocationSettingData')
input_cn = get_typed_class(virt, 'InputResourceAllocationSettingData')
grap_cn = get_typed_class(virt, 'GraphicsResourceAllocationSettingData')
+ ctl_cn = get_typed_class(virt,
'ControllerResourceAllocationSettingData')
+ # REVISIT - VERSION CHECK?
rasd_cns = [proc_cn, net_cn, disk_cn, mem_cn, input_cn, grap_cn]
+ if curr_cim_rev >= controller_rev and virt == 'KVM':
+ rasd_cns.append(ctl_cn)
# Iterate over the rasds, looking for the expected InstanceID
# listed in the rasd_list dictionary for the same classname in
--
1.8.5.3