[PATCH 0/2] cimtest support for consoles

This series extends the KVM cimtests with the verification of the console instrumentation. If the tested libvirt-cim provider has the necessary release level, the test domains are instantiated with a console. The other patch deals with the fact that certain device types (like graphics) are supported on s390. I ran the tests on an x86 system as well seeing no regressions, but an independent test run would be welcome... Viktor Mihajlovski (2): cimtest: Adding support for ConsoleRASD cimtest: Fix s390 failures .../cimtest/ElementSettingData/01_forward.py | 8 +++-- .../cimtest/HostSystem/02_hostsystem_to_rasd.py | 2 ++ .../cimtest/HostSystem/04_hs_to_EAPF.py | 24 +++++++++---- .../cimtest/HostedAccessPoint/01_forward.py | 5 +++ .../cimtest/HostedAccessPoint/02_reverse.py | 5 +++ .../cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py | 5 +++ .../cimtest/KVMRedirectionSAP/02_ipv6_support.py | 5 +++ .../02_guest_add_mod_rem_rasd_ind.py | 9 +++-- .../RedirectionService/03_RedirectionSAP_errs.py | 5 +++ .../ResourceAllocationFromPool/01_forward.py | 3 ++ .../ResourceAllocationFromPool/02_reverse.py | 3 ++ .../cimtest/ServiceAccessBySAP/01_forward.py | 5 +++ .../cimtest/ServiceAccessBySAP/02_reverse.py | 6 ++++ .../cimtest/ServiceAffectsElement/01_forward.py | 6 ++-- .../cimtest/ServiceAffectsElement/02_reverse.py | 12 ++++--- .../libvirt-cim/cimtest/SystemDevice/01_forward.py | 16 +++++++-- suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py | 11 ++++-- suites/libvirt-cim/cimtest/VSSD/07_autostart.py | 5 +++ .../01_forward.py | 4 ++- .../02_reverse.py | 9 +++-- suites/libvirt-cim/lib/XenKvmLib/devices.py | 6 ++++ suites/libvirt-cim/lib/XenKvmLib/pool.py | 4 ++- suites/libvirt-cim/lib/XenKvmLib/rasd.py | 21 ++++++++++- suites/libvirt-cim/lib/XenKvmLib/vsms.py | 36 +++++++++++++++++++ suites/libvirt-cim/lib/XenKvmLib/vxml.py | 38 ++++++++++++++------ 25 files changed, 215 insertions(+), 38 deletions(-) -- 1.7.9.5

The test domains are now defined with a ConsoleRASD if the tested libvirt-cim does support those. A few testcases had to be adjusted to properly handle the newly encountered instances and associations. Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> --- .../cimtest/ElementSettingData/01_forward.py | 5 ++- .../cimtest/HostSystem/02_hostsystem_to_rasd.py | 2 ++ .../ResourceAllocationFromPool/01_forward.py | 3 ++ .../ResourceAllocationFromPool/02_reverse.py | 3 ++ .../libvirt-cim/cimtest/SystemDevice/01_forward.py | 5 +++ suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py | 11 ++++-- .../02_reverse.py | 9 +++-- suites/libvirt-cim/lib/XenKvmLib/devices.py | 6 ++++ suites/libvirt-cim/lib/XenKvmLib/rasd.py | 21 ++++++++++- suites/libvirt-cim/lib/XenKvmLib/vsms.py | 35 ++++++++++++++++++ suites/libvirt-cim/lib/XenKvmLib/vxml.py | 38 ++++++++++++++------ 11 files changed, 122 insertions(+), 16 deletions(-) diff --git a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py index 8c2a556..8b57b8f 100755 --- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py +++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py @@ -59,6 +59,7 @@ from XenKvmLib.const import do_main, get_provider_version sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] input_graphics_pool_rev = 757 +console_rev = 1276 test_dom = "esd_dom" vmac = "00:11:22:33:44:aa" @@ -148,7 +149,9 @@ def main(): if curr_cim_rev >= input_graphics_pool_rev: keys['InputResourceAllocationSettingData'] = input_device keys['GraphicsResourceAllocationSettingData'] = "%s/vnc" % test_dom - + if curr_cim_rev >= console_rev: + keys['ConsoleResourceAllocationSettingData'] = "%s/charconsole:0" % test_dom + ret = cxml.cim_define(options.ip) if not ret: logger.error("Failed to define the dom: %s", test_dom) 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 fe0f2cc..78433e7 100644 --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py @@ -182,6 +182,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 'ConsoleResourceAllocationSettingData' in CCName: + status = verify_displayrasd_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/ResourceAllocationFromPool/01_forward.py b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py index a7d9c35..ec47c44 100644 --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py @@ -75,6 +75,9 @@ def init_rasd_list(virt, ip, guest_name): logger.error("Enum RASDs failed") return rasd_insts, status + if rasds.has_key(get_typed_class(virt, 'ConsoleResourceAllocationSettingData')): + del rasds[get_typed_class(virt, 'ConsoleResourceAllocationSettingData')] + for rasd_cn, rasd_list in rasds.iteritems(): if virt == "LXC" and rasd_cn == disk_rasd_cn: continue diff --git a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py index bef114d..430d33f 100644 --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py @@ -171,6 +171,9 @@ def main(): if status != PASS: raise Exception("Unable to build pool instance list") + if rasds.has_key(get_typed_class(options.virt, 'ConsoleResourceAllocationSettingData')): + del rasds[get_typed_class(options.virt, 'ConsoleResourceAllocationSettingData')] + if len(rasds) != len(pools): raise Exception("%d RASD insts != %d pool insts" % (len(rasds), len(pools))) diff --git a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py index 15a4ff5..f956621 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 +console_dev_rev = 1276 test_dom = "test_domain" test_mac = "00:11:22:33:44:55" @@ -120,6 +121,10 @@ def main(): graphics_cn = get_typed_class(virt, "DisplayController") exp_pllist[graphics_cn] = ['%s/vnc' % test_dom] + if curr_cim_rev >= console_dev_rev: + console_cn = get_typed_class(virt, "ConsoleDisplayController") + exp_pllist[console_cn] = ['%s/charconsole: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..bdd91a8 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_consolerasd_values from XenKvmLib.const import default_network_name libvirt_bug = "00009" @@ -173,6 +173,10 @@ def verify_rasd_values(rasd_values_info, server): memrasd = rasd_values_list['%s' %in_list['mem']] displayrasd = rasd_values_list['%s' %in_list['display']] inputrasd = rasd_values_list['%s' %in_list['point']] + if 'console' in in_list: + consolerasd = rasd_values_list['%s' %in_list['console']] + else: + consolerasd = [] try: for rasd_instance in rasd_values_info: @@ -186,7 +190,10 @@ def verify_rasd_values(rasd_values_info, server): elif 'MemResourceAllocationSettingData' in CCName : status = verify_memrasd_values(rasd_instance, memrasd) elif 'GraphicsResourceAllocationSettingData' in CCName : - status = verify_displayrasd_values(rasd_instance, displayrasd) + if not 'console' in rasd_instance['InstanceID']: + status = verify_displayrasd_values(rasd_instance, displayrasd) + elif 'ConsoleResourceAllocationSettingData' in CCName : + status = verify_consolerasd_values(rasd_instance, consolerasd) elif 'InputResourceAllocationSettingData' in CCName: status = verify_inputrasd_values(rasd_instance, inputrasd) if status != PASS and virt== 'LXC': diff --git a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py index 3a13b2a..24e8440 100644 --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py @@ -95,7 +95,8 @@ def assoc_values(ip, assoc_info, virt="Xen"): "disk_rasd" : '%s/%s' %(test_dom, test_disk), "mem_rasd" : '%s/%s' %(test_dom, "mem"), "input_rasd": '%s/%s' %(test_dom, input_device), - "grap_rasd" : '%s/%s' %(test_dom, "vnc") + "grap_rasd" : '%s/%s' %(test_dom, "vnc"), + "cons_rasd" : '%s/%s' %(test_dom, "charconsole:0") } @@ -110,6 +111,7 @@ 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') + cons_cn = get_typed_class(virt, 'ConsoleResourceAllocationSettingData') for inst in assoc_info: if inst.classname == proc_cn: @@ -132,8 +134,11 @@ def assoc_values(ip, assoc_info, virt="Xen"): elif inst.classname == grap_cn: status = check_rasd_values(inst['InstanceID'], rasd_list['grap_rasd']) + elif inst.classname == cons_cn: + status = check_rasd_values(inst['InstanceID'], + rasd_list['cons_rasd']) else: - logger.error("Unexpected RASD instance type" ) + logger.error("Unexpected RASD instance type %s", inst.classname ) status = FAIL if status == FAIL: diff --git a/suites/libvirt-cim/lib/XenKvmLib/devices.py b/suites/libvirt-cim/lib/XenKvmLib/devices.py index 0ddccbb..275acad 100755 --- a/suites/libvirt-cim/lib/XenKvmLib/devices.py +++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py @@ -33,6 +33,7 @@ from XenKvmLib.enumclass import EnumInstances graphics_dev_rev = 725 input_dev_rev = 745 +console_dev_rev = 1276 def get_class(classname): return eval(classname) @@ -95,6 +96,8 @@ def dev_cn_to_rasd_cn(dev_cn, virt): return get_typed_class(virt, "DiskResourceAllocationSettingData") elif dev_cn.find('Memory') >= 0: return get_typed_class(virt, "MemResourceAllocationSettingData") + elif dev_cn.find('ConsoleDisplayController') >= 0: + return get_typed_class(virt, "ConsoleResourceAllocationSettingData") elif dev_cn.find('DisplayController') >= 0: return get_typed_class(virt, "GraphicsResourceAllocationSettingData") elif dev_cn.find('PointingDevice') >= 0: @@ -112,6 +115,9 @@ def enum_dev(virt, ip): if curr_cim_rev >= input_dev_rev: dev_list.append('PointingDevice') + if curr_cim_rev >= console_dev_rev: + dev_list.append('ConsoleDisplayController') + dev_insts = {} try: diff --git a/suites/libvirt-cim/lib/XenKvmLib/rasd.py b/suites/libvirt-cim/lib/XenKvmLib/rasd.py index 4d4240a..3675015 100644 --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py @@ -50,9 +50,11 @@ memcn = 'Memory' netcn = 'NetworkPort' diskcn = 'LogicalDisk' dccn = 'DisplayController' +cccn = 'ConsoleDisplayController' pdcn = 'PointingDevice' libvirt_rasd_storagepool_changes = 934 +vsms_console_sup = 1276 def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): """ @@ -65,6 +67,7 @@ def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): disk_cn = get_typed_class(virt, diskcn) dc_cn = get_typed_class(virt, dccn) pd_cn = get_typed_class(virt, pdcn) + cc_cn = None in_list = { 'proc' : proc_cn, 'mem' : mem_cn, @@ -75,6 +78,11 @@ def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): } try: + curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev >= vsms_console_sup: + cc_cn = get_typed_class(virt, cccn) + in_list['console'] = cc_cn + disk_path = vsxml.xml_get_disk_source() if virt == 'LXC': disk_path = '/var/lib/libvirt/images/lxc_files' @@ -116,7 +124,11 @@ def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): pd_cn : { "InstanceID" : point_device } - } + } + if cc_cn != None: + rasd_values[cc_cn] = { + "InstanceID" : "%s/%s" %(t_dom, "charconsole:0") + } except Exception, details: logger.error("Exception: In fn rasd_init_list %s", details) return FAIL, rasd_values, in_list @@ -150,6 +162,13 @@ def verify_displayrasd_values(assoc_info, displayrasd_list): status = FAIL return status +def verify_consolerasd_values(assoc_info, consolerasd_list): + status = PASS + if assoc_info['InstanceID'] != consolerasd_list['InstanceID']: + InstId_err(assoc_info, consolerasd_list) + status = FAIL + return status + def verify_inputrasd_values(assoc_info, inputrasd_list): status = PASS if assoc_info['InstanceID'] != inputrasd_list['InstanceID']: diff --git a/suites/libvirt-cim/lib/XenKvmLib/vsms.py b/suites/libvirt-cim/lib/XenKvmLib/vsms.py index d7f33f9..955026f 100755 --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py @@ -28,6 +28,7 @@ from CimTest import Globals from XenKvmLib import const from XenKvmLib.classes import get_typed_class, get_class_type, virt_types +RASD_TYPE_OTHER = 1 RASD_TYPE_PROC = 3 RASD_TYPE_MEM = 4 RASD_TYPE_NET_ETHER = 10 @@ -259,6 +260,40 @@ class LXC_MemResourceAllocationSettingData(CIM_MemResourceAllocationSettingData) def get_masd_class(virt): pass +class CIM_ConsoleResourceAllocationSettingData(CIMClassMOF): + def __init__(self, name, source_type=2, target_type="virtio", + source_path=None, connect_URL=None, bind_URL=None): + self.InstanceID = '%s/charconsole:0' %name + self.ResourceType = RASD_TYPE_OTHER + self.OtherResourceType = 'console' + + if source_type != None: + self.SourceType = source_type + + if target_type != None: + self.TargetType = target_type + + if source_path != None: + self.SourcePath = source_path + + if bind_URL != None: + self.BindURL = bind_URL + + if connect_URL != None: + self.ConnectURL = connect_URL + +class Xen_ConsoleResourceAllocationSettingData(CIM_ConsoleResourceAllocationSettingData): + pass + +class KVM_ConsoleResourceAllocationSettingData(CIM_ConsoleResourceAllocationSettingData): + pass + +class LXC_ConsoleResourceAllocationSettingData(CIM_ConsoleResourceAllocationSettingData): + pass + +@eval_cls('ConsoleResourceAllocationSettingData') +def get_casd_class(virt): + pass class CIM_GraphicsResourceAllocationSettingData(CIMClassMOF): def __init__(self, name, res_sub_type="vnc", ip=None, ipv6_flag=None, diff --git a/suites/libvirt-cim/lib/XenKvmLib/vxml.py b/suites/libvirt-cim/lib/XenKvmLib/vxml.py index 74c4f23..9489a5c 100644 --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py @@ -50,9 +50,11 @@ from CimTest.ReturnCodes import SKIP, PASS, FAIL from XenKvmLib.classes import virt_types, get_typed_class from XenKvmLib.enumclass import GetInstance from XenKvmLib.const import get_provider_version +from XenKvmLib.xm_virt_util import host_cpu_model vsms_graphics_sup = 763 vsms_inputdev_sup = 771 +vsms_console_sup = 1276 class XMLClass: xml_string = "" @@ -598,7 +600,8 @@ class VirtCIM: def __init__(self, virt, dom_name, uuid, pae, acpi, apic, disk_dev, disk_source, net_type, net_name, net_mac, vcpus, mem, mem_allocunits, emu_type, grstype, ip, - is_ipv6_only, port_num, kmap, irstype, btype, vnc_passwd): + is_ipv6_only, port_num, kmap, irstype, btype, vnc_passwd, + con_source_type, con_target_type): self.virt = virt self.domain_name = dom_name self.err_rc = None @@ -623,6 +626,9 @@ class VirtCIM: ipv6_flag=is_ipv6_only, lport=port_num, keymap=kmap, vnc_passwd=vnc_passwd) + self.casd = vsms.get_casd_class(virt)(name=dom_name, + source_type=con_source_type, + target_type=con_target_type) self.masd = vsms.get_masd_class(virt)(megabytes=mem, mallocunits=mem_allocunits, name=dom_name) @@ -655,9 +661,14 @@ class VirtCIM: res_settings.append(str(self.gasd)) if curr_cim_rev >= vsms_inputdev_sup: - if self.iasd is not None: + if self.iasd is not None and \ + not str(host_cpu_model(ip, self.virt)).startswith('s390'): res_settings.append(str(self.iasd)) + if curr_cim_rev >= vsms_console_sup: + if ref_conf is None and self.casd is not None: + res_settings.append(str(self.casd)) + if ref_conf is None: ref_conf = ' ' @@ -808,6 +819,8 @@ class VirtCIM: self.dasd = rasd elif cn.find("NetResourceAllocationSettingData") >= 0: self.nasd = rasd + elif cn.find("ConsoleResourceAllocationSettingData") >=0: + self.casd = rasd elif cn.find("GraphicsResourceAllocationSettingData") >= 0: self.gasd = rasd @@ -849,7 +862,8 @@ class XenXML(VirtXML, VirtCIM): emu_type=None, grstype="vnc", address=None, is_ipv6_only=None, port_num='-1', keymap="en-us", irstype="mouse", - btype="xen", vnc_passwd=None): + btype="xen", vnc_passwd=None, + con_source_type=0, con_target_type="virtio"): if not (os.path.exists(const.Xen_kernel_path) \ and os.path.exists(const.Xen_init_path)): logger.error('ERROR: Either the kernel image ' @@ -863,7 +877,7 @@ class XenXML(VirtXML, VirtCIM): disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, is_ipv6_only, port_num, keymap, irstype, btype, - vnc_passwd) + vnc_passwd, con_source_type, con_target_type) def _os(self, os_kernel, os_initrd): os = self.get_node('/domain/os') @@ -920,7 +934,8 @@ class KVMXML(VirtXML, VirtCIM): emu_type=None, grstype="vnc", address=None, is_ipv6_only=None, port_num='-1', keymap="en-us", irstype="mouse", - btype="ps2", vnc_passwd=None): + btype="ps2", vnc_passwd=None, + con_source_type=0, con_target_type="virtio"): if not os.path.exists(disk_file_path): logger.error('Error: Disk image %s does not exist', disk_file_path) sys.exit(1) @@ -929,7 +944,7 @@ class KVMXML(VirtXML, VirtCIM): disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, is_ipv6_only, port_num, keymap, irstype, btype, - vnc_passwd) + vnc_passwd, con_source_type, con_target_type) self._os() self._devices(const.KVM_default_emulator, ntype, disk_file_path, disk, mac, net_name) @@ -983,7 +998,8 @@ class XenFVXML(VirtXML, VirtCIM): emu_type=None, grstype="vnc", address=None, is_ipv6_only=None, port_num='-1', keymap="en-us", - irstype="mouse", btype="ps2", vnc_passwd=None): + irstype="mouse", btype="ps2", vnc_passwd=None, + con_source_type=0, con_target_type="virtio"): if not os.path.exists(disk_file_path): logger.error('Error: Disk image %s does not exist', disk_file_path) sys.exit(1) @@ -992,7 +1008,8 @@ class XenFVXML(VirtXML, VirtCIM): disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, is_ipv6_only, port_num, - keymap, irstype, btype, vnc_passwd) + keymap, irstype, btype, vnc_passwd, + con_source_type, con_target_type) self._os(const.XenFV_default_loader) self._devices(const.XenFV_default_emulator, ntype, mac, net_name, disk_file_path, disk) @@ -1036,7 +1053,8 @@ class LXCXML(VirtXML, VirtCIM): tty=const.LXC_default_tty, grstype="vnc", address=None, is_ipv6_only=None, port_num='-1', keymap="en-us", - irstype="mouse", btype="usb", vnc_passwd=None): + irstype="mouse", btype="usb", vnc_passwd=None, + con_source_type=0, con_target_type="virtio"): VirtXML.__init__(self, 'lxc', test_dom, set_uuid(), mem, vcpus) # pae, acpi and apic parameters doesn't make sense here, so we # statically set them to False (a.k.a. ignore them) @@ -1045,7 +1063,7 @@ class LXCXML(VirtXML, VirtCIM): ntype, net_name, mac, vcpus, mem, const.default_mallocunits, None, grstype, address, is_ipv6_only, port_num, keymap, irstype, - btype, vnc_passwd) + btype, vnc_passwd, con_source_type, con_target_type) self._os(const.LXC_init_path) self._devices(const.LXC_default_emulator, mac, ntype, net_name, const.LXC_default_tty) self.create_lxc_file(CIM_IP, const.LXC_init_path) -- 1.7.9.5

On 10/11/2013 07:09 AM, Viktor Mihajlovski wrote:
The test domains are now defined with a ConsoleRASD if the tested libvirt-cim does support those. A few testcases had to be adjusted to properly handle the newly encountered instances and associations.
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> --- .../cimtest/ElementSettingData/01_forward.py | 5 ++- .../cimtest/HostSystem/02_hostsystem_to_rasd.py | 2 ++ .../ResourceAllocationFromPool/01_forward.py | 3 ++ .../ResourceAllocationFromPool/02_reverse.py | 3 ++ .../libvirt-cim/cimtest/SystemDevice/01_forward.py | 5 +++ suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py | 11 ++++-- .../02_reverse.py | 9 +++-- suites/libvirt-cim/lib/XenKvmLib/devices.py | 6 ++++ suites/libvirt-cim/lib/XenKvmLib/rasd.py | 21 ++++++++++- suites/libvirt-cim/lib/XenKvmLib/vsms.py | 35 ++++++++++++++++++ suites/libvirt-cim/lib/XenKvmLib/vxml.py | 38 ++++++++++++++------ 11 files changed, 122 insertions(+), 16 deletions(-)
diff --git a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py index 8c2a556..8b57b8f 100755 --- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py +++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py @@ -59,6 +59,7 @@ from XenKvmLib.const import do_main, get_provider_version
sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] input_graphics_pool_rev = 757 +console_rev = 1276
test_dom = "esd_dom" vmac = "00:11:22:33:44:aa" @@ -148,7 +149,9 @@ def main(): if curr_cim_rev >= input_graphics_pool_rev: keys['InputResourceAllocationSettingData'] = input_device keys['GraphicsResourceAllocationSettingData'] = "%s/vnc" % test_dom - + if curr_cim_rev >= console_rev: + keys['ConsoleResourceAllocationSettingData'] = "%s/charconsole:0" % test_dom + ret = cxml.cim_define(options.ip) if not ret: logger.error("Failed to define the dom: %s", test_dom) 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 fe0f2cc..78433e7 100644 --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py @@ -182,6 +182,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 'ConsoleResourceAllocationSettingData' in CCName: + status = verify_displayrasd_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/ResourceAllocationFromPool/01_forward.py b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py index a7d9c35..ec47c44 100644 --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py @@ -75,6 +75,9 @@ def init_rasd_list(virt, ip, guest_name): logger.error("Enum RASDs failed") return rasd_insts, status
+ if rasds.has_key(get_typed_class(virt, 'ConsoleResourceAllocationSettingData')): + del rasds[get_typed_class(virt, 'ConsoleResourceAllocationSettingData')] + for rasd_cn, rasd_list in rasds.iteritems(): if virt == "LXC" and rasd_cn == disk_rasd_cn: continue diff --git a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py index bef114d..430d33f 100644 --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py @@ -171,6 +171,9 @@ def main(): if status != PASS: raise Exception("Unable to build pool instance list")
+ if rasds.has_key(get_typed_class(options.virt, 'ConsoleResourceAllocationSettingData')): + del rasds[get_typed_class(options.virt, 'ConsoleResourceAllocationSettingData')] + if len(rasds) != len(pools): raise Exception("%d RASD insts != %d pool insts" % (len(rasds), len(pools))) diff --git a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py index 15a4ff5..f956621 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 +console_dev_rev = 1276
test_dom = "test_domain" test_mac = "00:11:22:33:44:55" @@ -120,6 +121,10 @@ def main(): graphics_cn = get_typed_class(virt, "DisplayController") exp_pllist[graphics_cn] = ['%s/vnc' % test_dom]
+ if curr_cim_rev >= console_dev_rev: + console_cn = get_typed_class(virt, "ConsoleDisplayController") + exp_pllist[console_cn] = ['%s/charconsole: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..bdd91a8 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_consolerasd_values from XenKvmLib.const import default_network_name
libvirt_bug = "00009" @@ -173,6 +173,10 @@ def verify_rasd_values(rasd_values_info, server): memrasd = rasd_values_list['%s' %in_list['mem']] displayrasd = rasd_values_list['%s' %in_list['display']] inputrasd = rasd_values_list['%s' %in_list['point']] + if 'console' in in_list: + consolerasd = rasd_values_list['%s' %in_list['console']] + else: + consolerasd = []
try: for rasd_instance in rasd_values_info: @@ -186,7 +190,10 @@ def verify_rasd_values(rasd_values_info, server): elif 'MemResourceAllocationSettingData' in CCName : status = verify_memrasd_values(rasd_instance, memrasd) elif 'GraphicsResourceAllocationSettingData' in CCName : - status = verify_displayrasd_values(rasd_instance, displayrasd) + if not 'console' in rasd_instance['InstanceID']: + status = verify_displayrasd_values(rasd_instance, displayrasd) + elif 'ConsoleResourceAllocationSettingData' in CCName : + status = verify_consolerasd_values(rasd_instance, consolerasd)
Hmm... 'console', 'cons_rasd', 'charconsole:0' - it's all so confusing at least to me! Perhaps this is where the two consoles using serial is coming from.
elif 'InputResourceAllocationSettingData' in CCName: status = verify_inputrasd_values(rasd_instance, inputrasd) if status != PASS and virt== 'LXC': diff --git a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py index 3a13b2a..24e8440 100644 --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py @@ -95,7 +95,8 @@ def assoc_values(ip, assoc_info, virt="Xen"): "disk_rasd" : '%s/%s' %(test_dom, test_disk), "mem_rasd" : '%s/%s' %(test_dom, "mem"), "input_rasd": '%s/%s' %(test_dom, input_device), - "grap_rasd" : '%s/%s' %(test_dom, "vnc") + "grap_rasd" : '%s/%s' %(test_dom, "vnc"), + "cons_rasd" : '%s/%s' %(test_dom, "charconsole:0")
}
@@ -110,6 +111,7 @@ 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') + cons_cn = get_typed_class(virt, 'ConsoleResourceAllocationSettingData')
for inst in assoc_info: if inst.classname == proc_cn: @@ -132,8 +134,11 @@ def assoc_values(ip, assoc_info, virt="Xen"): elif inst.classname == grap_cn: status = check_rasd_values(inst['InstanceID'], rasd_list['grap_rasd']) + elif inst.classname == cons_cn: + status = check_rasd_values(inst['InstanceID'], + rasd_list['cons_rasd']) else: - logger.error("Unexpected RASD instance type" ) + logger.error("Unexpected RASD instance type %s", inst.classname ) status = FAIL
if status == FAIL: diff --git a/suites/libvirt-cim/lib/XenKvmLib/devices.py b/suites/libvirt-cim/lib/XenKvmLib/devices.py index 0ddccbb..275acad 100755 --- a/suites/libvirt-cim/lib/XenKvmLib/devices.py +++ b/suites/libvirt-cim/lib/XenKvmLib/devices.py @@ -33,6 +33,7 @@ from XenKvmLib.enumclass import EnumInstances
graphics_dev_rev = 725 input_dev_rev = 745 +console_dev_rev = 1276
def get_class(classname): return eval(classname) @@ -95,6 +96,8 @@ def dev_cn_to_rasd_cn(dev_cn, virt): return get_typed_class(virt, "DiskResourceAllocationSettingData") elif dev_cn.find('Memory') >= 0: return get_typed_class(virt, "MemResourceAllocationSettingData") + elif dev_cn.find('ConsoleDisplayController') >= 0: + return get_typed_class(virt, "ConsoleResourceAllocationSettingData") elif dev_cn.find('DisplayController') >= 0: return get_typed_class(virt, "GraphicsResourceAllocationSettingData") elif dev_cn.find('PointingDevice') >= 0: @@ -112,6 +115,9 @@ def enum_dev(virt, ip): if curr_cim_rev >= input_dev_rev: dev_list.append('PointingDevice')
+ if curr_cim_rev >= console_dev_rev: + dev_list.append('ConsoleDisplayController') +
So this will I think upset some test which says it expects 6 device but got 7 (I forget which one).
dev_insts = {}
try: diff --git a/suites/libvirt-cim/lib/XenKvmLib/rasd.py b/suites/libvirt-cim/lib/XenKvmLib/rasd.py index 4d4240a..3675015 100644 --- a/suites/libvirt-cim/lib/XenKvmLib/rasd.py +++ b/suites/libvirt-cim/lib/XenKvmLib/rasd.py @@ -50,9 +50,11 @@ memcn = 'Memory' netcn = 'NetworkPort' diskcn = 'LogicalDisk' dccn = 'DisplayController' +cccn = 'ConsoleDisplayController' pdcn = 'PointingDevice'
libvirt_rasd_storagepool_changes = 934 +vsms_console_sup = 1276
def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): """ @@ -65,6 +67,7 @@ def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): disk_cn = get_typed_class(virt, diskcn) dc_cn = get_typed_class(virt, dccn) pd_cn = get_typed_class(virt, pdcn) + cc_cn = None
in_list = { 'proc' : proc_cn, 'mem' : mem_cn, @@ -75,6 +78,11 @@ def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): } try:
+ curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev >= vsms_console_sup: + cc_cn = get_typed_class(virt, cccn) + in_list['console'] = cc_cn + disk_path = vsxml.xml_get_disk_source() if virt == 'LXC': disk_path = '/var/lib/libvirt/images/lxc_files' @@ -116,7 +124,11 @@ def rasd_init_list(vsxml, virt, t_disk, t_dom, t_mac, t_mem, server): pd_cn : { "InstanceID" : point_device } - } + } + if cc_cn != None: + rasd_values[cc_cn] = { + "InstanceID" : "%s/%s" %(t_dom, "charconsole:0") + }
Hmm.. no setting of the ResourceType value (nor anything else). Furthermore it seems that rather than hardcoded numbers, then RASD_TYPE_* constants should be used from XenKvmLib.vsms, right? That includes the settings in the fields above. It certainly would make things more clear...
except Exception, details: logger.error("Exception: In fn rasd_init_list %s", details) return FAIL, rasd_values, in_list @@ -150,6 +162,13 @@ def verify_displayrasd_values(assoc_info, displayrasd_list): status = FAIL return status
+def verify_consolerasd_values(assoc_info, consolerasd_list): + status = PASS + if assoc_info['InstanceID'] != consolerasd_list['InstanceID']: + InstId_err(assoc_info, consolerasd_list) + status = FAIL + return status + def verify_inputrasd_values(assoc_info, inputrasd_list): status = PASS if assoc_info['InstanceID'] != inputrasd_list['InstanceID']: diff --git a/suites/libvirt-cim/lib/XenKvmLib/vsms.py b/suites/libvirt-cim/lib/XenKvmLib/vsms.py index d7f33f9..955026f 100755 --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py @@ -28,6 +28,7 @@ from CimTest import Globals from XenKvmLib import const from XenKvmLib.classes import get_typed_class, get_class_type, virt_types
+RASD_TYPE_OTHER = 1
Should this be 32769? I'm assuming they roughly follow CIM_RES_TYPE* values in libvirt-cim
RASD_TYPE_PROC = 3 RASD_TYPE_MEM = 4 RASD_TYPE_NET_ETHER = 10 @@ -259,6 +260,40 @@ class LXC_MemResourceAllocationSettingData(CIM_MemResourceAllocationSettingData) def get_masd_class(virt): pass
+class CIM_ConsoleResourceAllocationSettingData(CIMClassMOF): + def __init__(self, name, source_type=2, target_type="virtio", + source_path=None, connect_URL=None, bind_URL=None): + self.InstanceID = '%s/charconsole:0' %name + self.ResourceType = RASD_TYPE_OTHER + self.OtherResourceType = 'console' + + if source_type != None: + self.SourceType = source_type
source_type defaults to 2 or passed generally as 0, so None probably doesn't work here, right?
+ + if target_type != None: + self.TargetType = target_type
target_type defaults to "virtio", so is None ever possible?
+ + if source_path != None: + self.SourcePath = source_path + + if bind_URL != None: + self.BindURL = bind_URL + + if connect_URL != None: + self.ConnectURL = connect_URL + +class Xen_ConsoleResourceAllocationSettingData(CIM_ConsoleResourceAllocationSettingData): + pass + +class KVM_ConsoleResourceAllocationSettingData(CIM_ConsoleResourceAllocationSettingData): + pass + +class LXC_ConsoleResourceAllocationSettingData(CIM_ConsoleResourceAllocationSettingData): + pass + +@eval_cls('ConsoleResourceAllocationSettingData') +def get_casd_class(virt): + pass
class CIM_GraphicsResourceAllocationSettingData(CIMClassMOF): def __init__(self, name, res_sub_type="vnc", ip=None, ipv6_flag=None, diff --git a/suites/libvirt-cim/lib/XenKvmLib/vxml.py b/suites/libvirt-cim/lib/XenKvmLib/vxml.py index 74c4f23..9489a5c 100644 --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py @@ -50,9 +50,11 @@ from CimTest.ReturnCodes import SKIP, PASS, FAIL from XenKvmLib.classes import virt_types, get_typed_class from XenKvmLib.enumclass import GetInstance from XenKvmLib.const import get_provider_version +from XenKvmLib.xm_virt_util import host_cpu_model
vsms_graphics_sup = 763 vsms_inputdev_sup = 771 +vsms_console_sup = 1276
class XMLClass: xml_string = "" @@ -598,7 +600,8 @@ class VirtCIM: def __init__(self, virt, dom_name, uuid, pae, acpi, apic, disk_dev, disk_source, net_type, net_name, net_mac, vcpus, mem, mem_allocunits, emu_type, grstype, ip, - is_ipv6_only, port_num, kmap, irstype, btype, vnc_passwd): + is_ipv6_only, port_num, kmap, irstype, btype, vnc_passwd, + con_source_type, con_target_type): self.virt = virt self.domain_name = dom_name self.err_rc = None @@ -623,6 +626,9 @@ class VirtCIM: ipv6_flag=is_ipv6_only, lport=port_num, keymap=kmap, vnc_passwd=vnc_passwd) + self.casd = vsms.get_casd_class(virt)(name=dom_name, + source_type=con_source_type, + target_type=con_target_type) self.masd = vsms.get_masd_class(virt)(megabytes=mem, mallocunits=mem_allocunits, name=dom_name) @@ -655,9 +661,14 @@ class VirtCIM: res_settings.append(str(self.gasd))
if curr_cim_rev >= vsms_inputdev_sup: - if self.iasd is not None: + if self.iasd is not None and \ + not str(host_cpu_model(ip, self.virt)).startswith('s390'):
This probably should be in patch 2/2...
res_settings.append(str(self.iasd))
+ if curr_cim_rev >= vsms_console_sup: + if ref_conf is None and self.casd is not None: + res_settings.append(str(self.casd)) + if ref_conf is None: ref_conf = ' '
@@ -808,6 +819,8 @@ class VirtCIM: self.dasd = rasd elif cn.find("NetResourceAllocationSettingData") >= 0: self.nasd = rasd + elif cn.find("ConsoleResourceAllocationSettingData") >=0: + self.casd = rasd elif cn.find("GraphicsResourceAllocationSettingData") >= 0: self.gasd = rasd
@@ -849,7 +862,8 @@ class XenXML(VirtXML, VirtCIM): emu_type=None, grstype="vnc", address=None, is_ipv6_only=None, port_num='-1', keymap="en-us", irstype="mouse", - btype="xen", vnc_passwd=None): + btype="xen", vnc_passwd=None, + con_source_type=0, con_target_type="virtio"): if not (os.path.exists(const.Xen_kernel_path) \ and os.path.exists(const.Xen_init_path)): logger.error('ERROR: Either the kernel image ' @@ -863,7 +877,7 @@ class XenXML(VirtXML, VirtCIM): disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, is_ipv6_only, port_num, keymap, irstype, btype, - vnc_passwd) + vnc_passwd, con_source_type, con_target_type)
def _os(self, os_kernel, os_initrd): os = self.get_node('/domain/os') @@ -920,7 +934,8 @@ class KVMXML(VirtXML, VirtCIM): emu_type=None, grstype="vnc", address=None, is_ipv6_only=None, port_num='-1', keymap="en-us", irstype="mouse", - btype="ps2", vnc_passwd=None): + btype="ps2", vnc_passwd=None, + con_source_type=0, con_target_type="virtio"): if not os.path.exists(disk_file_path): logger.error('Error: Disk image %s does not exist', disk_file_path) sys.exit(1) @@ -929,7 +944,7 @@ class KVMXML(VirtXML, VirtCIM): disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, is_ipv6_only, port_num, keymap, irstype, btype, - vnc_passwd) + vnc_passwd, con_source_type, con_target_type) self._os() self._devices(const.KVM_default_emulator, ntype, disk_file_path, disk, mac, net_name) @@ -983,7 +998,8 @@ class XenFVXML(VirtXML, VirtCIM): emu_type=None, grstype="vnc", address=None, is_ipv6_only=None, port_num='-1', keymap="en-us", - irstype="mouse", btype="ps2", vnc_passwd=None): + irstype="mouse", btype="ps2", vnc_passwd=None, + con_source_type=0, con_target_type="virtio"): if not os.path.exists(disk_file_path): logger.error('Error: Disk image %s does not exist', disk_file_path) sys.exit(1) @@ -992,7 +1008,8 @@ class XenFVXML(VirtXML, VirtCIM): disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, is_ipv6_only, port_num, - keymap, irstype, btype, vnc_passwd) + keymap, irstype, btype, vnc_passwd, + con_source_type, con_target_type) self._os(const.XenFV_default_loader) self._devices(const.XenFV_default_emulator, ntype, mac, net_name, disk_file_path, disk) @@ -1036,7 +1053,8 @@ class LXCXML(VirtXML, VirtCIM): tty=const.LXC_default_tty, grstype="vnc", address=None, is_ipv6_only=None, port_num='-1', keymap="en-us", - irstype="mouse", btype="usb", vnc_passwd=None): + irstype="mouse", btype="usb", vnc_passwd=None, + con_source_type=0, con_target_type="virtio"): VirtXML.__init__(self, 'lxc', test_dom, set_uuid(), mem, vcpus) # pae, acpi and apic parameters doesn't make sense here, so we # statically set them to False (a.k.a. ignore them) @@ -1045,7 +1063,7 @@ class LXCXML(VirtXML, VirtCIM): ntype, net_name, mac, vcpus, mem, const.default_mallocunits, None, grstype, address, is_ipv6_only, port_num, keymap, irstype, - btype, vnc_passwd) + btype, vnc_passwd, con_source_type, con_target_type) self._os(const.LXC_init_path) self._devices(const.LXC_default_emulator, mac, ntype, net_name, const.LXC_default_tty) self.create_lxc_file(CIM_IP, const.LXC_init_path)

On 10/11/2013 07:09 AM, Viktor Mihajlovski wrote:
The test domains are now defined with a ConsoleRASD if the tested libvirt-cim does support those. A few testcases had to be adjusted to properly handle the newly encountered instances and associations.
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
<...snip...>
diff --git a/suites/libvirt-cim/lib/XenKvmLib/vxml.py b/suites/libvirt-cim/lib/XenKvmLib/vxml.py index 74c4f23..9489a5c 100644 --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py @@ -50,9 +50,11 @@ from CimTest.ReturnCodes import SKIP, PASS, FAIL from XenKvmLib.classes import virt_types, get_typed_class from XenKvmLib.enumclass import GetInstance from XenKvmLib.const import get_provider_version +from XenKvmLib.xm_virt_util import host_cpu_model
vsms_graphics_sup = 763 vsms_inputdev_sup = 771 +vsms_console_sup = 1276
class XMLClass: xml_string = "" @@ -598,7 +600,8 @@ class VirtCIM: def __init__(self, virt, dom_name, uuid, pae, acpi, apic, disk_dev, disk_source, net_type, net_name, net_mac, vcpus, mem, mem_allocunits, emu_type, grstype, ip, - is_ipv6_only, port_num, kmap, irstype, btype, vnc_passwd): + is_ipv6_only, port_num, kmap, irstype, btype, vnc_passwd, + con_source_type, con_target_type): self.virt = virt self.domain_name = dom_name self.err_rc = None @@ -623,6 +626,9 @@ class VirtCIM: ipv6_flag=is_ipv6_only, lport=port_num, keymap=kmap, vnc_passwd=vnc_passwd) + self.casd = vsms.get_casd_class(virt)(name=dom_name, + source_type=con_source_type, + target_type=con_target_type) self.masd = vsms.get_masd_class(virt)(megabytes=mem, mallocunits=mem_allocunits, name=dom_name) @@ -655,9 +661,14 @@ class VirtCIM: res_settings.append(str(self.gasd))
if curr_cim_rev >= vsms_inputdev_sup: - if self.iasd is not None: + if self.iasd is not None and \ + not str(host_cpu_model(ip, self.virt)).startswith('s390'): res_settings.append(str(self.iasd))
+ if curr_cim_rev >= vsms_console_sup: + if ref_conf is None and self.casd is not None: + res_settings.append(str(self.casd)) +
I've been working on applying the "next set" of Xu Wang's fixes and found that by just adding the four core XenKvmLib/*.py files to a test branch I could core FilterList 03_create.py test rather reliably until I commented out the above 3 lines. The first change applied that caused the failure was the writing of the console xml (#22 in the series). The core was because for some reason the dumping of the xml didn't find the "<filterref>" tag and thus the call to "filterref = test.libvirt_applied_filter_lists(domain_name)[0]" would have an index out of range exception. Also a number of the VirtualSystemManagementService and VSSD tests failed with the "Only the first console can be a serial port..." message. Unfortunately I missed the notification that the system I had borrowed had timed out its lease and thus I've lost usage for a bit. However, I do know without this particular patch, the other changes did run through cimtest. I'm going to try and revive the ability to run on my own f19 system, I have to find a tog-pegasus that works for me.... John

Many of the testcases assume the presence of graphical displays or pointing devices which are not present on s390. These are either adjusted to account for the s390 specifics or skipped where not possible. Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> --- .../cimtest/ElementSettingData/01_forward.py | 4 +++- .../cimtest/HostSystem/04_hs_to_EAPF.py | 24 ++++++++++++++------ .../cimtest/HostedAccessPoint/01_forward.py | 5 ++++ .../cimtest/HostedAccessPoint/02_reverse.py | 5 ++++ .../cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py | 5 ++++ .../cimtest/KVMRedirectionSAP/02_ipv6_support.py | 5 ++++ .../02_guest_add_mod_rem_rasd_ind.py | 9 ++++++-- .../RedirectionService/03_RedirectionSAP_errs.py | 5 ++++ .../cimtest/ServiceAccessBySAP/01_forward.py | 7 +++++- .../cimtest/ServiceAccessBySAP/02_reverse.py | 6 +++++ .../cimtest/ServiceAffectsElement/01_forward.py | 6 +++-- .../cimtest/ServiceAffectsElement/02_reverse.py | 12 ++++++---- .../libvirt-cim/cimtest/SystemDevice/01_forward.py | 11 ++++++--- suites/libvirt-cim/cimtest/VSSD/07_autostart.py | 5 ++++ .../01_forward.py | 4 +++- suites/libvirt-cim/lib/XenKvmLib/pool.py | 4 +++- 16 files changed, 94 insertions(+), 23 deletions(-) diff --git a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py index 8b57b8f..1744c7f 100755 --- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py +++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py @@ -56,6 +56,7 @@ from CimTest.Globals import logger, CIM_ERROR_ASSOCIATORS from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.vxml import get_class from XenKvmLib.const import do_main, get_provider_version +from XenKvmLib.xm_virt_util import host_cpu_model sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] input_graphics_pool_rev = 757 @@ -146,7 +147,8 @@ def main(): keys['NetResourceAllocationSettingData'] = "%s/%s" % (test_dom, vmac) curr_cim_rev, changeset = get_provider_version(options.virt, options.ip) - if curr_cim_rev >= input_graphics_pool_rev: + if curr_cim_rev >= input_graphics_pool_rev and \ + not host_cpu_model(options.ip, options.virt).startswith('s390'): keys['InputResourceAllocationSettingData'] = input_device keys['GraphicsResourceAllocationSettingData'] = "%s/vnc" % test_dom if curr_cim_rev >= console_rev: diff --git a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py index bd9c42b..5a6a8b9 100644 --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py @@ -60,6 +60,7 @@ from CimTest.ReturnCodes import PASS, FAIL, SKIP from XenKvmLib.test_doms import destroy_and_undefine_all from XenKvmLib.logicaldevices import verify_device_values from XenKvmLib.const import get_provider_version +from XenKvmLib.xm_virt_util import host_cpu_model sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -73,7 +74,7 @@ def print_err(err, detail, cn): logger.error(err, cn) logger.error("Exception: %s", detail) -def pool_init_list(virt, pool_assoc, net_name, dp_InstID): +def pool_init_list(virt, server, pool_assoc, net_name, dp_InstID): """ Creating the lists that will be used for comparisons. """ @@ -94,8 +95,10 @@ def pool_init_list(virt, pool_assoc, net_name, dp_InstID): exp_pllist[npool] = '%s/%s' %('NetworkPool', net_name) exp_pllist[ppool] = 'ProcessorPool/0' exp_pllist[mpool] = 'MemoryPool/0' - exp_pllist[gpool] = 'GraphicsPool/0' - exp_pllist[ipool] = 'InputPool/0' + + if not host_cpu_model(server, virt).startswith('s390'): + exp_pllist[gpool] = 'GraphicsPool/0' + exp_pllist[ipool] = 'InputPool/0' for p_inst in pool_assoc: CName = p_inst.classname @@ -105,6 +108,9 @@ def pool_init_list(virt, pool_assoc, net_name, dp_InstID): if exp_pllist[CName] == InstID: in_pllist[CName] = InstID else: + if host_cpu_model(server, virt).startswith('s390') and \ + ('GraphicsPool' in CName or 'InputPool' in CName): + continue if exp_pllist[CName] == InstID: in_pllist[CName] = InstID @@ -160,9 +166,12 @@ def eapf_list(server, virt, test_disk): disk_inst : disk, net_inst : net, mem_inst : mem, - display_inst: display, - point_inst : point } + + if not host_cpu_model(server, virt).startswith('s390'): + eaf_values[display_inst] = display + eaf_values[point_inst] = point + return eaf_values def get_inst_for_dom(assoc_val): @@ -267,12 +276,13 @@ def main(): vsxml.undefine(server) return status - in_pllist = pool_init_list(virt, pool, net_name, default_pool_name) + in_pllist = pool_init_list(virt, server, pool, net_name, default_pool_name) curr_cim_rev, changeset = get_provider_version(virt, server) # One pool for each Device type, hence len should be 4 if virt == 'LXC': exp_len = 1 - elif curr_cim_rev >= libvirt_input_graphics_changeset: + elif curr_cim_rev >= libvirt_input_graphics_changeset and \ + not host_cpu_model(options.ip, options.virt).startswith('s390'): exp_len = 6 else: exp_len = 4 diff --git a/suites/libvirt-cim/cimtest/HostedAccessPoint/01_forward.py b/suites/libvirt-cim/cimtest/HostedAccessPoint/01_forward.py index 9ffd0fd..0b5a4b8 100644 --- a/suites/libvirt-cim/cimtest/HostedAccessPoint/01_forward.py +++ b/suites/libvirt-cim/cimtest/HostedAccessPoint/01_forward.py @@ -30,6 +30,7 @@ from XenKvmLib.const import do_main, get_provider_version from XenKvmLib.common_util import get_host_info from XenKvmLib.enumclass import EnumInstances from XenKvmLib.assoc import compare_all_prop +from XenKvmLib.xm_virt_util import host_cpu_model libvirtcim_hostedAccPnt_changes = 782 @@ -114,6 +115,10 @@ def main(): logger.info("VNC is not supported by LXC, hence skipping the tc ....") return SKIP + if host_cpu_model(options.ip, options.virt).startswith('s390'): + logger.info("Graphics is not supported by s390, hence skipping the tc ....") + return SKIP + status, cxml = setup_env(options.ip, options.virt) if status != PASS: cxml.undefine(options.ip) diff --git a/suites/libvirt-cim/cimtest/HostedAccessPoint/02_reverse.py b/suites/libvirt-cim/cimtest/HostedAccessPoint/02_reverse.py index 2d6daf1..cfa35cc 100644 --- a/suites/libvirt-cim/cimtest/HostedAccessPoint/02_reverse.py +++ b/suites/libvirt-cim/cimtest/HostedAccessPoint/02_reverse.py @@ -30,6 +30,7 @@ from XenKvmLib.const import do_main, get_provider_version from XenKvmLib.common_util import get_host_info from XenKvmLib.enumclass import EnumInstances from XenKvmLib.assoc import compare_all_prop +from XenKvmLib.xm_virt_util import host_cpu_model libvirtcim_hostedAccPnt_changes = 782 @@ -121,6 +122,10 @@ def main(): logger.info("VNC is not supported by LXC, hence skipping the tc ....") return SKIP + if host_cpu_model(options.ip, options.virt).startswith('s390'): + logger.info("Graphics is not supported by s390, hence skipping the tc ....") + return SKIP + status, cxml = setup_env(options.ip, options.virt) if status != PASS: cxml.undefine(options.ip) diff --git a/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py b/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py index af9b5c6..c75c1ad 100644 --- a/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py +++ b/suites/libvirt-cim/cimtest/KVMRedirectionSAP/01_enum_KVMredSAP.py @@ -43,6 +43,7 @@ from CimTest.Globals import logger, CIM_ERROR_ENUMERATE from CimTest.ReturnCodes import PASS, FAIL, SKIP from XenKvmLib.const import KVMRedSAP_proto, CIM_SAP_AVAILABLE_STATE, \ CIM_SAP_INACTIVE_STATE +from XenKvmLib.xm_virt_util import host_cpu_model sup_types = ['Xen', 'KVM', 'LXC'] libvirtcim_redSAP_changes = 716 @@ -104,6 +105,10 @@ def main(): logger.info("VNC is not supported by LXC, hence skipping the tc ....") return SKIP + if host_cpu_model(server, virt).startswith('s390'): + logger.info("Graphics is not supported by s390, hence skipping the tc ....") + return SKIP + vsxml = None action_start = False diff --git a/suites/libvirt-cim/cimtest/KVMRedirectionSAP/02_ipv6_support.py b/suites/libvirt-cim/cimtest/KVMRedirectionSAP/02_ipv6_support.py index 84f98c8..41ddf1a 100644 --- a/suites/libvirt-cim/cimtest/KVMRedirectionSAP/02_ipv6_support.py +++ b/suites/libvirt-cim/cimtest/KVMRedirectionSAP/02_ipv6_support.py @@ -42,6 +42,7 @@ from XenKvmLib.classes import get_typed_class from XenKvmLib.const import do_main, get_provider_version from CimTest.Globals import logger from CimTest.ReturnCodes import PASS, FAIL, SKIP +from XenKvmLib.xm_virt_util import host_cpu_model sup_types = ['Xen', 'KVM', 'XenFV'] libvirtcim_redSAP_changes = 1017 @@ -76,6 +77,10 @@ def main(): classname) return SKIP + if host_cpu_model(server, virt).startswith('s390'): + logger.info("Graphics is not supported by s390, hence skipping the tc ....") + return SKIP + vsxml = None try: diff --git a/suites/libvirt-cim/cimtest/RASDIndications/02_guest_add_mod_rem_rasd_ind.py b/suites/libvirt-cim/cimtest/RASDIndications/02_guest_add_mod_rem_rasd_ind.py index 6d513bd..4807599 100644 --- a/suites/libvirt-cim/cimtest/RASDIndications/02_guest_add_mod_rem_rasd_ind.py +++ b/suites/libvirt-cim/cimtest/RASDIndications/02_guest_add_mod_rem_rasd_ind.py @@ -41,6 +41,7 @@ from XenKvmLib.const import do_main, CIM_DISABLE, get_provider_version from CimTest.ReturnCodes import PASS, FAIL, SKIP from XenKvmLib.common_util import poll_for_state_change from XenKvmLib.indications import sub_ind, handle_request, poll_for_ind +from XenKvmLib.xm_virt_util import host_cpu_model sup_types = ['KVM', 'Xen', 'XenFV'] libvirt_guest_rasd_indication_rev = 980 @@ -107,8 +108,12 @@ def gen_indication(test_dom, s_sysname, virt, cxml, service, ind_name, rasd, nmem_disk) elif ind_name == 'delete': - cn = 'GraphicsResourceAllocationSettingData' - inst_id = '%s/%s' % (test_dom, "vnc") + if host_cpu_model(s_sysname, virt).startswith('s390'): + cn = 'ConsoleResourceAllocationSettingData' + inst_id = '%s/%s' % (test_dom, "charconsole:0") + else: + cn = 'GraphicsResourceAllocationSettingData' + inst_id = '%s/%s' % (test_dom, "vnc") classname = get_typed_class(virt, cn) nrasd = get_rasd_rec(virt, cn, s_sysname, inst_id) diff --git a/suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py b/suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py index 34d7b76..8481e75 100644 --- a/suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py +++ b/suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py @@ -40,6 +40,7 @@ from XenKvmLib.classes import get_typed_class from XenKvmLib import vxml from XenKvmLib.const import do_main, get_provider_version from XenKvmLib.enumclass import EnumInstances, CIM_CimtestClass +from XenKvmLib.xm_virt_util import host_cpu_model test_dom = "demo" test_vcpus = 1 @@ -80,6 +81,10 @@ def main(): logger.info("VNC is not supported by LXC, hence skipping the tc ....") return SKIP + if host_cpu_model(options.ip, options.virt).startswith('s390'): + logger.info("Graphics is not supported by s390, hence skipping the tc ....") + return SKIP + # Getting the VS list and deleting the test_dom if it already exists. cxml = vxml.get_class(options.virt)(test_dom, vcpus=test_vcpus) ret = cxml.cim_define(options.ip) diff --git a/suites/libvirt-cim/cimtest/ServiceAccessBySAP/01_forward.py b/suites/libvirt-cim/cimtest/ServiceAccessBySAP/01_forward.py index 4840522..6b77f52 100644 --- a/suites/libvirt-cim/cimtest/ServiceAccessBySAP/01_forward.py +++ b/suites/libvirt-cim/cimtest/ServiceAccessBySAP/01_forward.py @@ -32,6 +32,7 @@ from XenKvmLib.enumclass import EnumInstances from XenKvmLib.vxml import get_class from XenKvmLib.assoc import AssociatorNames from XenKvmLib.assoc import compare_all_prop +from XenKvmLib.xm_virt_util import host_cpu_model libvirtcim_servaccsap_changes = 784 @@ -131,7 +132,11 @@ def main(): "skipping the tc ....") return SKIP - + if host_cpu_model(server, virt).startswith('s390'): + logger.info("ServiceAccessBySAP not supported on s390, hence " + + "skipping the tc ....") + return SKIP + status, cxml = setup_env(options.ip, options.virt) if status != PASS: cxml.undefine(options.ip) diff --git a/suites/libvirt-cim/cimtest/ServiceAccessBySAP/02_reverse.py b/suites/libvirt-cim/cimtest/ServiceAccessBySAP/02_reverse.py index 14c0db1..214727c 100644 --- a/suites/libvirt-cim/cimtest/ServiceAccessBySAP/02_reverse.py +++ b/suites/libvirt-cim/cimtest/ServiceAccessBySAP/02_reverse.py @@ -31,6 +31,7 @@ from XenKvmLib.enumclass import EnumInstances from XenKvmLib.vxml import get_class from XenKvmLib.assoc import AssociatorNames from XenKvmLib.assoc import compare_all_prop +from XenKvmLib.xm_virt_util import host_cpu_model libvirtcim_servaccsap_changes = 784 @@ -146,6 +147,11 @@ def main(): "skipping the tc ....") return SKIP + if host_cpu_model(server, virt).startswith('s390'): + logger.info("ServiceAccessBySAP not supported on s390, hence " + + "skipping the tc ....") + return SKIP + status, cxml = setup_env(options.ip, options.virt) if status != PASS: cxml.undefine(options.ip) diff --git a/suites/libvirt-cim/cimtest/ServiceAffectsElement/01_forward.py b/suites/libvirt-cim/cimtest/ServiceAffectsElement/01_forward.py index fc1590d..b9d7b27 100644 --- a/suites/libvirt-cim/cimtest/ServiceAffectsElement/01_forward.py +++ b/suites/libvirt-cim/cimtest/ServiceAffectsElement/01_forward.py @@ -57,6 +57,7 @@ from XenKvmLib.enumclass import EnumInstances from XenKvmLib.common_util import parse_instance_id from XenKvmLib.const import do_main, get_provider_version from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.xm_virt_util import host_cpu_model sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] sae_assoc_with_input_graphics_rev = 795 @@ -96,7 +97,8 @@ def get_dom_records(an_cn, assoc_ei_info, assoc_ei_insts): def init_list_for_compare(server, virt): c_list = [ 'ComputerSystem'] curr_cim_rev, changeset = get_provider_version(virt, server) - if curr_cim_rev >= sae_assoc_with_input_graphics_rev: + if curr_cim_rev >= sae_assoc_with_input_graphics_rev and \ + not host_cpu_model(server, virt).startswith('s390'): c_list.append('PointingDevice' ) c_list.append('DisplayController') @@ -119,7 +121,7 @@ def verify_assoc(server, virt, an, assoc_info): raise Exception("Failed to get insts for domain %s" % test_dom) in_list, status = init_list_for_compare(server, virt) - if status != PASS or len(in_list) != 3: + if status != PASS or len(in_list) == 0: raise Exception("Failed to get init_list") in_list_keys = Set(in_list.keys()) diff --git a/suites/libvirt-cim/cimtest/ServiceAffectsElement/02_reverse.py b/suites/libvirt-cim/cimtest/ServiceAffectsElement/02_reverse.py index 391ad42..65b030e 100644 --- a/suites/libvirt-cim/cimtest/ServiceAffectsElement/02_reverse.py +++ b/suites/libvirt-cim/cimtest/ServiceAffectsElement/02_reverse.py @@ -54,6 +54,7 @@ from XenKvmLib.common_util import parse_instance_id from XenKvmLib.const import do_main, get_provider_version from CimTest.ReturnCodes import FAIL, PASS from pywbem.cim_obj import CIMInstance +from XenKvmLib.xm_virt_util import host_cpu_model sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] pd_dev_rev = 746 @@ -93,11 +94,12 @@ def get_dom_records(cn, ei_info): def init_list_for_assoc(server, virt): c_list = [ 'ComputerSystem'] - curr_cim_rev, changeset = get_provider_version(virt, server) - if curr_cim_rev >= pd_dev_rev: - c_list.append('PointingDevice' ) - if curr_cim_rev >= dc_dev_rev: - c_list.append('DisplayController') + if not host_cpu_model(server, virt).startswith('s390'): + curr_cim_rev, changeset = get_provider_version(virt, server) + if curr_cim_rev >= pd_dev_rev: + c_list.append('PointingDevice' ) + if curr_cim_rev >= dc_dev_rev: + c_list.append('DisplayController') key_dict = {} for name in c_list: diff --git a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py index f956621..022173b 100644 --- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py +++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py @@ -33,6 +33,7 @@ from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger from XenKvmLib.const import do_main, get_provider_version from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.xm_virt_util import host_cpu_model sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] input_graphics_pool_rev = 757 @@ -99,10 +100,13 @@ def main(): point_device = "%s/%s" %(test_dom, "mouse:usb") elif virt == 'Xen': point_device = "%s/%s" %(test_dom, "mouse:xen") - else: + elif not host_cpu_model(server, virt).startswith('s390'): point_device = "%s/%s" %(test_dom, "mouse:ps2") + else: + point_device = None - exp_pllist[input_cn] = [point_device] + if point_device != None: + exp_pllist[input_cn] = [point_device] disk_cn = get_typed_class(virt, "LogicalDisk") exp_pllist[disk_cn] = [ '%s/%s' % (test_dom, test_disk)] @@ -117,7 +121,8 @@ def main(): 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: + if curr_cim_rev >= input_graphics_pool_rev and \ + not host_cpu_model(server, virt).startswith('s390'): graphics_cn = get_typed_class(virt, "DisplayController") exp_pllist[graphics_cn] = ['%s/vnc' % test_dom] diff --git a/suites/libvirt-cim/cimtest/VSSD/07_autostart.py b/suites/libvirt-cim/cimtest/VSSD/07_autostart.py index 408f5d0..d621fd1 100644 --- a/suites/libvirt-cim/cimtest/VSSD/07_autostart.py +++ b/suites/libvirt-cim/cimtest/VSSD/07_autostart.py @@ -37,6 +37,7 @@ from XenKvmLib.classes import get_typed_class, inst_to_mof from XenKvmLib.enumclass import GetInstance from XenKvmLib.const import get_provider_version from pywbem.cim_types import Uint16 +from XenKvmLib.xm_virt_util import host_cpu_model sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] default_dom = 'uuid_domain' @@ -69,6 +70,10 @@ def main(): virt = options.virt server = options.ip + if host_cpu_model(server, virt).startswith('s390'): + logger.info("Cannot run autostart test on s390, known endianness bug") + return SKIP + curr_cim_rev, changeset = get_provider_version(virt, server) if curr_cim_rev < autostart_support: logger.info("Need provider version %d or greater to run testcase", diff --git a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py index 96c34d4..f996c60 100644 --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py @@ -61,6 +61,7 @@ from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger from XenKvmLib.const import do_main, get_provider_version from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.xm_virt_util import host_cpu_model sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] input_graphics_pool_rev = 757 @@ -94,7 +95,8 @@ def init_list(test_disk, test_mac, server, virt='Xen'): input_device = "mouse:ps2" curr_cim_rev, changeset = get_provider_version(virt, server) - if curr_cim_rev >= input_graphics_pool_rev: + if curr_cim_rev >= input_graphics_pool_rev and \ + not host_cpu_model(server, virt).startswith('s390'): input = get_typed_class(virt,'InputResourceAllocationSettingData') graphics = get_typed_class(virt,'GraphicsResourceAllocationSettingData') rlist.append(input) diff --git a/suites/libvirt-cim/lib/XenKvmLib/pool.py b/suites/libvirt-cim/lib/XenKvmLib/pool.py index ddbe532..c4ae519 100644 --- a/suites/libvirt-cim/lib/XenKvmLib/pool.py +++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py @@ -38,6 +38,7 @@ from XenKvmLib.vxml import NetXML, PoolXML from XenKvmLib.xm_virt_util import virsh_version, virsh_version_cmp from XenKvmLib.vsms import RASD_TYPE_STOREVOL from XenKvmLib.common_util import destroy_diskpool +from XenKvmLib.xm_virt_util import host_cpu_model cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED cim_mname = "CreateChildResourcePool" @@ -76,7 +77,8 @@ def enum_pools(virt, ip): pool_list = ['ProcessorPool', 'MemoryPool', 'NetworkPool', 'DiskPool'] curr_cim_rev, changeset = get_provider_version(virt, ip) - if curr_cim_rev >= input_graphics_pool_rev: + if curr_cim_rev >= input_graphics_pool_rev \ + and not host_cpu_model(ip, virt).startswith('s390'): pool_list.append('GraphicsPool') pool_list.append('InputPool') -- 1.7.9.5

On 10/11/2013 07:09 AM, Viktor Mihajlovski wrote:
This series extends the KVM cimtests with the verification of the console instrumentation. If the tested libvirt-cim provider has the necessary release level, the test domains are instantiated with a console. The other patch deals with the fact that certain device types (like graphics) are supported on s390.
I ran the tests on an x86 system as well seeing no regressions, but an independent test run would be welcome...
Viktor Mihajlovski (2): cimtest: Adding support for ConsoleRASD cimtest: Fix s390 failures
Not sure how to approach this series. On the one hand things look good; however, when run with Xu Wang's 48 patch series it seems there's assumptions in one set of patches or the other. In particular, there's numerous failures with the libvirt message "Only the first console can be a serial port", which means for some reason there's more than one console in the guest configured to use the serial line. Since patch 1/2 deals with console's I have to assume that it's the reason/cause for what I've seen. I haven't had the time to dig deep on it though, but I guess I'd ask - is the code that seems to add a console to a guest ever (or need to check) whether the guest already has one? Would the 48 patch series somehow "assume" a need to put a console in an others list. Just throwing random ideas out there. It's been a long day. John

On 11/13/2013 01:21 AM, John Ferlan wrote:
On 10/11/2013 07:09 AM, Viktor Mihajlovski wrote:
This series extends the KVM cimtests with the verification of the console instrumentation. If the tested libvirt-cim provider has the necessary release level, the test domains are instantiated with a console. The other patch deals with the fact that certain device types (like graphics) are supported on s390.
I ran the tests on an x86 system as well seeing no regressions, but an independent test run would be welcome...
Viktor Mihajlovski (2): cimtest: Adding support for ConsoleRASD cimtest: Fix s390 failures
Not sure how to approach this series. On the one hand things look good; however, when run with Xu Wang's 48 patch series it seems there's assumptions in one set of patches or the other.
In particular, there's numerous failures with the libvirt message "Only the first console can be a serial port", which means for some reason there's more than one console in the guest configured to use the serial line.
Since patch 1/2 deals with console's I have to assume that it's the reason/cause for what I've seen. I haven't had the time to dig deep on it though, but I guess I'd ask - is the code that seems to add a console to a guest ever (or need to check) whether the guest already has one? Would the 48 patch series somehow "assume" a need to put a console in an others list. Just throwing random ideas out there. It's been a long day.
I'll have to check. It could be that with Xu Wang's patch we see <serial> tags be preserved which have been silently discarded before. Let's take one step at a time... -- Mit freundlichen Grüßen/Kind Regards Viktor Mihajlovski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On 11/13/2013 01:21 AM, John Ferlan wrote:
Not sure how to approach this series. On the one hand things look good; however, when run with Xu Wang's 48 patch series it seems there's assumptions in one set of patches or the other.
In particular, there's numerous failures with the libvirt message "Only the first console can be a serial port", which means for some reason there's more than one console in the guest configured to use the serial line.
Since with the read-only part of your rework of Xu Wang's series, the results remain good, I suggest to try to find out why the assumptions of cimtest don't match the write-back result (once this gets enabled) step by step. This could result in changes to either of the pending libvirt-cim or cimtest patches... -- Mit freundlichen Grüßen/Kind Regards Viktor Mihajlovski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
participants (2)
-
John Ferlan
-
Viktor Mihajlovski