[PATCH 0 of 2] Add new test case for recent acpi, apic, and pae support

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1258580960 28800 # Node ID 3e6d9522f2e1240a67bdcae6c09743de0f155753 # Parent 4747be9dd1dedd9acc45ebbff7793724f76ad604 [TEST] Add VSMS24 to verify users can enable pae, acpi, and apic during a define Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 4747be9dd1de -r 3e6d9522f2e1 suites/libvirt-cim/lib/XenKvmLib/vsms.py --- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Nov 16 14:47:32 2009 -0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Wed Nov 18 13:49:20 2009 -0800 @@ -91,7 +91,8 @@ # classes to define VSSD parameters class CIM_VirtualSystemSettingData(CIMClassMOF): - def __init__(self, name, virt, uuid=None, bldr=None, emulator=None): + def __init__(self, name, virt, uuid=None, bldr=None, emulator=None, + pae=False, acpi=False, apic=False): type = get_class_type(self.__class__.__name__) self.InstanceID = '%s:%s' % (type, name) self.Caption = self.Description = 'Virtual System' @@ -119,6 +120,10 @@ if uuid is not None: self.UUID = uuid + self.EnablePAE = pae + self.EnableACPI = acpi + self.EnableAPIC = apic + class Xen_VirtualSystemSettingData(CIM_VirtualSystemSettingData): pass @@ -128,9 +133,11 @@ class LXC_VirtualSystemSettingData(CIM_VirtualSystemSettingData): pass -def get_vssd_mof(virt, dom_name, uuid=None, bldr=None): +def get_vssd_mof(virt, dom_name, uuid=None, bldr=None, pae=False, acpi=False, + apic=False): vssd_cn = eval(get_typed_class(virt, "VirtualSystemSettingData")) - vssd = vssd_cn(dom_name, virt, uuid=uuid, bldr=bldr) + vssd = vssd_cn(dom_name, virt, uuid=uuid, bldr=bldr, pae=pae, acpi=acpi, + apic=apic) return vssd.mof() # classes to define RASD parameters diff -r 4747be9dd1de -r 3e6d9522f2e1 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Mon Nov 16 14:47:32 2009 -0800 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Nov 18 13:49:20 2009 -0800 @@ -1,4 +1,3 @@ -# # Copyright 2008 IBM Corp. # # Authors: @@ -473,6 +472,18 @@ def xml_get_vcpu(self): pass + @_x2str('/domain/features/pae') + def xml_get_pae(self): + pass + + @_x2str('/domain/features/acpi') + def xml_get_acpi(self): + pass + + @_x2str('/domain/features/apic') + def xml_get_apic(self): + pass + @_x2str('/domain/devices/disk/@type') def xml_get_disk_type(self): pass @@ -555,15 +566,16 @@ class VirtCIM: - def __init__(self, virt, dom_name, uuid, disk_dev, disk_source, - net_type, net_name, net_mac, vcpus, mem, + 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, port_num, kmap, irstype, btype, vnc_passwd): self.virt = virt self.domain_name = dom_name self.err_rc = None self.err_desc = None - self.vssd = vsms.get_vssd_mof(virt, dom_name, uuid=uuid) + self.vssd = vsms.get_vssd_mof(virt, dom_name, uuid=uuid, pae=pae, + acpi=acpi, apic=apic) self.nasd = vsms.get_nasd_class(virt)(type=net_type, mac=net_mac, name=dom_name, @@ -790,6 +802,9 @@ def __init__(self, test_dom=const.default_domname, uuid=None, + pae=False, + acpi=False, + apic=False, mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, @@ -810,10 +825,10 @@ self._os(const.Xen_kernel_path, const.Xen_init_path) self._devices(disk_file_path, disk, ntype, mac, net_name) - VirtCIM.__init__(self, 'Xen', test_dom, uuid, disk, disk_file_path, - ntype, net_name, mac, vcpus, mem, mem_allocunits, - emu_type, grstype, address, port_num, keymap, irstype, - btype, vnc_passwd) + VirtCIM.__init__(self, 'Xen', test_dom, uuid, pae, acpi, apic, disk, + disk_file_path, ntype, net_name, mac, vcpus, mem, + mem_allocunits, emu_type, grstype, address, + port_num, keymap, irstype, btype, vnc_passwd) def _os(self, os_kernel, os_initrd): os = self.get_node('/domain/os') @@ -856,6 +871,9 @@ def __init__(self, test_dom=const.default_domname, uuid=None, + pae=False, + acpi=False, + apic=False, mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, @@ -871,8 +889,8 @@ logger.error('Error: Disk image does not exist') sys.exit(1) VirtXML.__init__(self, 'kvm', test_dom, set_uuid(), mem, vcpus) - VirtCIM.__init__(self, 'KVM', test_dom, uuid, disk, disk_file_path, - ntype, net_name, mac, vcpus, mem, + VirtCIM.__init__(self, 'KVM', test_dom, uuid, pae, acpi, apic, disk, + disk_file_path, ntype, net_name, mac, vcpus, mem, mem_allocunits, emu_type, grstype, address, port_num, keymap, irstype, btype, vnc_passwd) self._os() @@ -912,6 +930,9 @@ def __init__(self, test_dom=const.default_domname, uuid=None, + pae=True, + acpi=True, + apic=True, mem=const.default_memory, mem_allocunits=const.default_mallocunits, vcpus=const.default_vcpus, @@ -927,21 +948,14 @@ logger.error('Error: Disk image does not exist') sys.exit(1) VirtXML.__init__(self, 'xenfv', test_dom, set_uuid(), mem, vcpus) - VirtCIM.__init__(self, 'XenFV', test_dom, disk, uuid, disk_file_path, - ntype, net_name, mac, vcpus, mem, mem_allocunits, - emu_type, grstype, address, port_num, keymap, - irstype, btype, vnc_passwd) - self._features() + VirtCIM.__init__(self, 'XenFV', test_dom, disk, uuid, pae, acpi, apic, + disk_file_path, ntype, net_name, mac, vcpus, mem, + mem_allocunits, emu_type, grstype, address, port_num, + keymap, irstype, btype, vnc_passwd) self._os(const.XenFV_default_loader) self._devices(const.XenFV_default_emulator, ntype, mac, net_name, disk_file_path, disk) - def _features(self): - features = self.get_node('/domain/features') - self.add_sub_node(features, 'pae') - self.add_sub_node(features, 'acpi') - self.add_sub_node(features, 'apic') - def _os(self, os_loader): os = self.get_node('/domain/os') self.add_sub_node(os, 'type', 'hvm')

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1258581016 28800 # Node ID 694c0d606e2fd61961d3a64a6e5c601fd30c23c5 # Parent 3e6d9522f2e1240a67bdcae6c09743de0f155753 [TEST] Add new VSMS test for testing new EnableAPCI, EnableAPIC, and ... EnablePAE options in libvirt-cim. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 3e6d9522f2e1 -r 694c0d606e2f suites/libvirt-cim/cimtest/VirtualSystemManagementService/24_define_sys_features.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/24_define_sys_features.py Wed Nov 18 13:50:16 2009 -0800 @@ -0,0 +1,71 @@ +#!/usr/bin/python +# +# Copyright 2009 IBM Corp. +# +# Authors: +# Kaitlin Rupert <karupert@us.ibm.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# This testcase verifies defining and starting domain with bridge interface +# + +import sys +from XenKvmLib import vxml +from CimTest.Globals import logger +from CimTest.ReturnCodes import FAIL, PASS +from XenKvmLib.const import do_main + +sup_types = ['Xen', 'KVM', 'XenFV'] +default_dom = 'features_domain' + +@do_main(sup_types) +def main(): + options = main.options + + status = FAIL + + cxml = vxml.get_class(options.virt)(default_dom, pae=True, + acpi=True, apic=True) + + try: + ret = cxml.cim_define(options.ip) + if not ret: + raise Exception("Failed to define the dom: %s" % default_dom) + + cxml.dumpxml(options.ip) + + if cxml.xml_get_pae() == None: + raise Exception("Failed to set pae for dom: %s" % default_dom) + + if cxml.xml_get_acpi() == None: + raise Exception("Failed to set acpi for dom: %s" % default_dom) + + if cxml.xml_get_apic() == None: + raise Exception("Failed to set apic for dom: %s" % default_dom) + + status = PASS + + except Exception, details: + logger.error(details) + status = FAIL + + cxml.cim_destroy(options.ip) + + return status + +if __name__ == "__main__": + sys.exit(main()) +

+1 On 11/18/2009 07:50 PM, Kaitlin Rupert wrote:
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Richard Maciel, MSc IBM Linux Technology Center rmaciel@linux.vnet.ibm.com
participants (2)
-
Kaitlin Rupert
-
Richard Maciel