[PATCH 0 of 6] [TEST] Setup network pool for tests to use before tests begin running

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1219444183 25200 # Node ID b445b3731ab95f0a00b0e9076f3be6adbb426562 # Parent 6fe50a81ce144056f1223f6af5f10804e915af37 [TEST] Add network pool name arg to create_netpool_conf() Also, add a check to see if the network pool name supplied is one of the pools currently defined (if any are defined). Change default_network_pool to be a name that isn't likely to be in use (or at least, commonly used). Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 6fe50a81ce14 -r b445b3731ab9 suites/libvirt-cim/lib/XenKvmLib/common_util.py --- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Wed Aug 20 14:28:01 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Aug 22 15:29:43 2008 -0700 @@ -39,6 +39,8 @@ from VirtLib.live import diskpool_list, virsh_version, net_list, domain_list from XenKvmLib.vxml import PoolXML, NetXML from XenKvmLib.enumclass import getInstance +from VirtLib import utils +from XenKvmLib import const test_dpath = "foo" disk_file = '/etc/libvirt/diskpool.conf' @@ -373,7 +375,8 @@ return status, diskid -def create_netpool_conf(server, virt, use_existing=False): +def create_netpool_conf(server, virt, use_existing=False, + net_name=const.default_network_name): status = PASS test_network = None try: @@ -383,7 +386,14 @@ test_network = vir_network[0] if test_network == None: - net_name = "default-net" + str(random.randint(1, 100)) + cmd = "virsh -c %s net-list --all | grep %s" % \ + (utils.virt2uri(virt), net_name) + ret, out = utils.run_remote(server, cmd) + if out != "": + logger.error("Network pool with name '%s' already exists", + net_name) + return FAIL, "Unknown" + netxml = NetXML(server, virt=virt, networkname=net_name) ret = netxml.create_vnet() if not ret: diff -r 6fe50a81ce14 -r b445b3731ab9 suites/libvirt-cim/lib/XenKvmLib/const.py --- a/suites/libvirt-cim/lib/XenKvmLib/const.py Wed Aug 20 14:28:01 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Fri Aug 22 15:29:43 2008 -0700 @@ -27,7 +27,7 @@ # vxml.NetXML default_bridge_name = 'testbridge' -default_network_name = 'default-net' +default_network_name = 'cimtest-networkpool' default_net_type = 'network' #vxml.PoolXML

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1219444184 25200 # Node ID 254abd366384a00a88b3042201c65bbb99d85a1f # Parent b445b3731ab95f0a00b0e9076f3be6adbb426562 [TEST] Create a network pool before tests are run. This ensures a network pool is available for the tests to use. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r b445b3731ab9 -r 254abd366384 suites/libvirt-cim/main.py --- a/suites/libvirt-cim/main.py Fri Aug 22 15:29:43 2008 -0700 +++ b/suites/libvirt-cim/main.py Fri Aug 22 15:29:44 2008 -0700 @@ -34,6 +34,9 @@ sys.path.append('./lib') from XenKvmLib.reporting import gen_report, send_report from VirtLib import utils +from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib import const +from XenKvmLib.common_util import create_netpool_conf, destroy_netpool parser = OptionParser() parser.add_option("-i", "--ip", dest="ip", default="localhost", @@ -122,6 +125,22 @@ return addr, relay +def setup_env(ip, virt): + status, netpool = create_netpool_conf(ip, virt, + net_name=const.default_network_name) + if status != PASS: + print "\nUnable to create network pool %s" % const.default_network_name + return status + + return PASS + +def cleanup_env(ip, virt): + status = destroy_netpool(ip, virt, const.default_network_name) + if status != PASS: + print "Unable to destroy network pool %s." % const.default_network_name + return status + + return PASS def main(): (options, args) = parser.parse_args() @@ -173,6 +192,11 @@ else: dbg = "" + status = setup_env(options.ip, options.virt) + if status != PASS: + print "Please check your environment.\n" + return 1 + print "\nTesting " + options.virt + " hypervisor" for test in test_list: @@ -192,6 +216,10 @@ testsuite.debug("%s\n" % div) testsuite.finish() + status = cleanup_env(options.ip, options.virt) + if status != PASS: + print "Unable to clean up. Please check your environment.\n" + msg_body, heading = gen_report(options.virt, options.ip, testsuite.log_file) if options.report:

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1219433898 25200 # Node ID 1c707cb7dff491a986f74157d1ab698032e32975 # Parent 254abd366384a00a88b3042201c65bbb99d85a1f [TEST] Remove network pool creation from vxml. A network pool is now created before any of the tests run. If an additonal pool is needed, it can be created by the test itself, instead of the XML class creating it. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 254abd366384 -r 1c707cb7dff4 suites/libvirt-cim/lib/XenKvmLib/vxml.py --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Fri Aug 22 15:29:44 2008 -0700 +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Fri Aug 22 12:38:18 2008 -0700 @@ -441,21 +441,8 @@ return br - def _set_vbridge(self, ip, virt_type): - network_list = live.net_list(ip, virt=virt_type) - if len(network_list) > 0: - vbr = live.get_bridge_from_network_xml(network_list[0], ip, - virt = virt_type) - else: - logger.info('No virutal network found') - logger.info('Trying to create one ......') - netxml = NetXML(ip, virt=virt_type) - ret = netxml.create_vnet() - if not ret: - logger.error('Failed to create the virtual network "%s"', - netxml.net_name) - sys.exit(SKIP) - vbr = netxml.vbr + def _set_vbridge(self, ip, virt_type, net_name): + vbr = live.get_bridge_from_network_xml(net_name, ip, virt=virt_type) interface = self.get_node('/domain/devices/interface') interface.setAttribute('type', 'bridge') @@ -463,13 +450,14 @@ return vbr - def set_interface_details(self, devices, net_mac, net_type, virt_type): + def set_interface_details(self, devices, net_mac, net_type, net_name, + virt_type): interface = self.add_sub_node(devices, 'interface', type=net_type) self.add_sub_node(interface, 'mac', address=net_mac) if net_type == 'bridge': - self._set_vbridge(CIM_IP, virt_type) + self._set_vbridge(CIM_IP, virt_type, net_name) elif net_type == 'network': - self.set_vnetwork(interface, virt_type) + self.add_sub_node(interface, 'source', network=net_name) elif net_type == 'ethernet': pass elif net_type == 'user': @@ -477,23 +465,6 @@ else: logger.error("%s is not a valid network type", net_type) sys.exit(1) - - def set_vnetwork(self, interface, virt_type): - network_list = live.net_list(CIM_IP, virt_type) - if len(network_list) > 0: - nname = network_list[0] - else: - logger.info('No virutal network found') - logger.info('Trying to create one ......') - netxml = NetXML(CIM_IP, virt=virt_type) - ret = netxml.create_vnet() - if not ret: - logger.error('Failed to create the virtual network "%s"', - netxml.net_name) - sys.exit(SKIP) - nname = netxml.xml_get_netpool_name() - self.add_sub_node(interface, 'source', network=nname) - class VirtCIM: @@ -564,7 +535,8 @@ mac=const.Xen_default_mac, disk_file_path=const.Xen_disk_path, disk=const.Xen_default_disk_dev, - ntype=const.default_net_type): + ntype=const.default_net_type, + net_name=const.default_network_name): if not (os.path.exists(const.Xen_kernel_path) \ and os.path.exists(const.Xen_init_path)): logger.error('ERROR: Either the kernel image ' @@ -572,7 +544,7 @@ sys.exit(1) VirtXML.__init__(self, 'xen', test_dom, set_uuid(), mem, vcpus) self._os(const.Xen_kernel_path, const.Xen_init_path) - self._devices(disk_file_path, disk, ntype, mac) + self._devices(disk_file_path, disk, ntype, mac, net_name) VirtCIM.__init__(self, 'Xen', test_dom, disk, disk_file_path, ntype, mac, vcpus, mem, mem_allocunits) @@ -584,14 +556,14 @@ self.add_sub_node(os, 'initrd', os_initrd) self.add_sub_node(os, 'cmdline', 'TERM=xterm') - def _devices(self, disk_img, disk_dev, net_type, net_mac): + def _devices(self, disk_img, disk_dev, net_type, net_mac, net_name): devices = self.get_node('/domain/devices') disk = self.add_sub_node(devices, 'disk', type='file', device='disk') self.add_sub_node(disk, 'driver', name='file') self.add_sub_node(disk, 'source', file=disk_img) self.add_sub_node(disk, 'target', dev=disk_dev) - self.set_interface_details(devices, net_mac, net_type, virt_type='Xen') + self.set_interface_details(devices, net_mac, net_type, net_name, 'Xen') def set_bootloader(self, ip, gtype=0): bldr = live.bootloader(ip, gtype) @@ -603,9 +575,9 @@ self.nasd.NetworkType = 'bridge' return self._set_bridge(ip) - def set_vbridge(self, ip): + def set_vbridge(self, ip, net_name): self.nasd.NetworkType = 'bridge' - return self._set_vbridge(ip, 'Xen') + return self._set_vbridge(ip, 'Xen', net_name) class KVMXML(VirtXML, VirtCIM): @@ -619,7 +591,8 @@ mac=const.KVM_default_mac, disk_file_path=const.KVM_disk_path, disk=const.KVM_default_disk_dev, - ntype=const.default_net_type): + ntype=const.default_net_type, + net_name=const.default_network_name): if not os.path.exists(disk_file_path): logger.error('Error: Disk image does not exist') sys.exit(1) @@ -628,13 +601,13 @@ ntype, mac, vcpus, mem, mem_allocunits) self._os() self._devices(const.KVM_default_emulator, ntype, - disk_file_path, disk, mac) + disk_file_path, disk, mac, net_name) def _os(self): self.add_sub_node('/domain/os', 'type', 'hvm') - def _devices(self, emu, net_type, disk_img, disk_dev, net_mac): + def _devices(self, emu, net_type, disk_img, disk_dev, net_mac, net_name): devices = self.get_node('/domain/devices') self.add_sub_node(devices, 'emulator', emu) @@ -642,7 +615,7 @@ self.add_sub_node(disk, 'source', file=disk_img) self.add_sub_node(disk, 'target', dev=disk_dev) - self.set_interface_details(devices, net_mac, net_type, virt_type='KVM') + self.set_interface_details(devices, net_mac, net_type, net_name, 'KVM') def set_emulator(self, emu): return self._set_emulator(emu) @@ -650,8 +623,8 @@ def set_bridge(self, ip): return self._set_bridge(ip) - def set_vbridge(self, ip): - return self._set_vbridge(ip, 'KVM') + def set_vbridge(self, ip, net_name): + return self._set_vbridge(ip, 'KVM', net_name) class XenFVXML(VirtXML, VirtCIM): @@ -665,7 +638,8 @@ mac=const.XenFV_default_mac, disk_file_path=const.XenFV_disk_path, disk=const.XenFV_default_disk_dev, - ntype=const.default_net_type): + ntype=const.default_net_type, + net_name=const.default_network_name): if not os.path.exists(disk_file_path): logger.error('Error: Disk image does not exist') sys.exit(1) @@ -675,7 +649,7 @@ self._features() self._os(const.XenFV_default_loader) self._devices(const.XenFV_default_emulator, - ntype, mac, disk_file_path, disk) + ntype, mac, net_name, disk_file_path, disk) def _features(self): features = self.get_node('/domain/features') @@ -689,7 +663,7 @@ self.add_sub_node(os, 'loader', os_loader) self.add_sub_node(os, 'boot', dev='hd') - def _devices(self, emu, net_type, net_mac, disk_img, disk_dev): + def _devices(self, emu, net_type, net_mac, net_name, disk_img, disk_dev): devices = self.get_node('/domain/devices') self.add_sub_node(devices, 'emulator', emu) @@ -699,7 +673,7 @@ disk = self.add_sub_node(devices, 'disk', type='file') self.add_sub_node(disk, 'source', file=disk_img) self.add_sub_node(disk, 'target', dev=disk_dev) - self.set_interface_details(devices, net_mac, net_type, virt_type='XenFV') + self.set_interface_details(devices, net_mac, net_type, net_name, 'Xen') def set_emulator(self, emu): return self._set_emulator(emu) @@ -707,8 +681,8 @@ def set_bridge(self, ip): return self._set_bridge(ip) - def set_vbridge(self, ip): - return self._set_vbridge(ip, 'XenFV') + def set_vbridge(self, ip, net_name): + return self._set_vbridge(ip, 'XenFV', net_name) class LXCXML(VirtXML): @@ -717,19 +691,20 @@ vcpus=const.default_vcpus, mac=const.LXC_default_mac, ntype=const.default_net_type, + net_name=const.default_network_name, tty=const.LXC_default_tty): VirtXML.__init__(self, 'lxc', test_dom, set_uuid(), mem, vcpus) self._os(const.LXC_init_path) - self._devices(mac, ntype, const.LXC_default_tty) + self._devices(mac, ntype, net_name, const.LXC_default_tty) self.create_lxc_file(CIM_IP, const.LXC_init_path) def _os(self, os_init): os = self.get_node('/domain/os') self.add_sub_node(os, 'init', os_init) - def _devices(self, net_mac, net_type, tty_set): + def _devices(self, net_mac, net_type, net_name, tty_set): devices = self.get_node('/domain/devices') - self.set_interface_details(devices, net_mac, net_type, virt_type='LXC') + self.set_interface_details(devices, net_mac, net_type, net_name, 'LXC') interface = self.add_sub_node(devices, 'console', tty = tty_set) def create_lxc_file(self, ip, lxc_file):

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1219433898 25200 # Node ID 055021cae0200442791afada78d07ff3309a791c # Parent 1c707cb7dff491a986f74157d1ab698032e32975 [TEST] Make network related changes to VSMS tests Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 1c707cb7dff4 -r 055021cae020 suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/06_addresource.py Fri Aug 22 12:38:18 2008 -0700 @@ -22,6 +22,7 @@ # import sys +import random import pywbem from pywbem.cim_obj import CIMInstanceName from VirtLib import utils @@ -32,15 +33,15 @@ from CimTest.Globals import do_main from CimTest.ReturnCodes import FAIL, PASS from XenKvmLib import vsms_util -from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.const import default_network_name sup_types = ['Xen', 'KVM', 'XenFV'] default_dom = 'rstest_domain' nmac = '99:aa:bb:cc:ee:ff' ntype = 'network' +npool_name = default_network_name + str(random.randint(1, 100)) -def cleanup_env(ip, virt, cxml, net_name): - destroy_netpool(ip, virt, net_name) +def cleanup_env(ip, virt, cxml): cxml.destroy(ip) cxml.undefine(ip) @@ -67,19 +68,13 @@ 'src_path' : cxml.secondary_disk_path } - status, net_name = create_netpool_conf(options.ip, options.virt, - use_existing=False) - if status != PASS: - logger.error('Unable to create network pool') - return FAIL - nasd = vsms.get_nasd_class(options.virt)(type=ntype, mac=nmac, name=default_dom, - virt_net=net_name) + virt_net=npool_name) net_attr = { 'ntype' : ntype, - 'net_name' : net_name, + 'net_name' : npool_name, 'nmac' : nmac } @@ -97,13 +92,13 @@ ret = cxml.define(options.ip) if not ret: logger.error("Failed to define the dom: %s", default_dom) - cleanup_env(options.ip, options.virt, cxml, net_name) + cleanup_env(options.ip, options.virt, cxml) return FAIL if case == "start": ret = cxml.start(options.ip) if not ret: logger.error("Failed to start the dom: %s", default_dom) - cleanup_env(options.ip, options.virt, cxml, net_name) + cleanup_env(options.ip, options.virt, cxml) return FAIL status = vsms_util.add_disk_res(options.ip, service, cxml, vssd_ref, @@ -116,7 +111,7 @@ if status != PASS: break - cleanup_env(options.ip, options.virt, cxml, net_name) + cleanup_env(options.ip, options.virt, cxml) return status diff -r 1c707cb7dff4 -r 055021cae020 suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/08_modifyresource.py Fri Aug 22 12:38:18 2008 -0700 @@ -32,8 +32,8 @@ from CimTest.Globals import logger from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL -from XenKvmLib.common_util import create_netpool_conf, destroy_netpool from XenKvmLib import vsms_util +from XenKvmLib.const import default_network_name sup_types = ['Xen', 'KVM', 'XenFV'] default_dom = 'rstest_domain' @@ -42,8 +42,7 @@ ncpu = 1 nmem = 256 -def cleanup_env(ip, virt, cxml, net_name): - destroy_netpool(ip, virt, net_name) +def cleanup_env(ip, virt, cxml): cxml.destroy(ip) cxml.undefine(ip) @@ -58,16 +57,10 @@ source=ndpath, name=default_dom) - status, net_name = create_netpool_conf(options.ip, options.virt, - use_existing=False) - if status != PASS: - logger.error('Unable to find a network pool') - return FAIL - nasd = vsms.get_nasd_class(options.virt)(type=ntype, mac=cxml.xml_get_net_mac(), name=default_dom, - virt_net=net_name) + virt_net=default_network_name) masd = vsms.get_masd_class(options.virt)(megabytes=nmem, name=default_dom) pasd = vsms.get_pasd_class(options.virt)(vcpu=ncpu, name=default_dom) @@ -85,13 +78,13 @@ ret = cxml.define(options.ip) if not ret: logger.error("Failed to define the dom: %s", default_dom) - cleanup_env(options.ip, options.virt, cxml, net_name) + cleanup_env(options.ip, options.virt, cxml) return FAIL if case == "start": ret = cxml.start(options.ip) if not ret: logger.error("Failed to start the dom: %s", default_dom) - cleanup_env(options.ip, options.virt, cxml, net_name) + cleanup_env(options.ip, options.virt, cxml) return FAIL status = vsms_util.mod_vcpu_res(options.ip, service, cxml, pasd, ncpu, @@ -112,11 +105,11 @@ break status = vsms_util.mod_net_res(options.ip, service, options.virt, cxml, - nasd, ntype, net_name) + nasd, ntype, default_network_name) if status != PASS: break - cleanup_env(options.ip, options.virt, cxml, net_name) + cleanup_env(options.ip, options.virt, cxml) return status diff -r 1c707cb7dff4 -r 055021cae020 suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py Fri Aug 22 12:38:18 2008 -0700 @@ -30,7 +30,6 @@ from CimTest.Globals import do_main from CimTest.ReturnCodes import FAIL, PASS from XenKvmLib.test_doms import destroy_and_undefine_domain -from XenKvmLib.common_util import create_netpool_conf, destroy_netpool sup_types = ['Xen', 'XenFV', 'KVM'] default_dom = 'rstest_domain' @@ -95,11 +94,6 @@ def main(): options = main.options - status, test_network = create_netpool_conf(options.ip, options.virt, False) - if status != PASS: - return FAIL - - status, vssd, rasd = setup_rasd_mof(options.ip, options.virt) if status != PASS: return status @@ -134,7 +128,6 @@ logger.error(details) status = FAIL - destroy_netpool(options.ip, options.virt, test_network) destroy_and_undefine_domain(default_dom, options.ip, options.virt) return status diff -r 1c707cb7dff4 -r 055021cae020 suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py Fri Aug 22 12:38:18 2008 -0700 @@ -24,8 +24,7 @@ import pywbem from XenKvmLib.common_util import create_using_definesystem, \ call_request_state_change, \ - poll_for_state_change, get_cs_instance, \ - create_netpool_conf, destroy_netpool + poll_for_state_change, get_cs_instance from XenKvmLib import vsms from VirtLib import utils from CimTest.Globals import logger, do_main @@ -119,11 +118,6 @@ options = main.options try: - status, net_name = create_netpool_conf(options.ip, options.virt, False) - if status != PASS: - logger.error('Unable to find a network pool') - return FAIL - status = setup_first_guest(options.ip, options.virt) if status != PASS: raise Exception("Unable to start %s" % test_dom) @@ -164,7 +158,6 @@ logger.error(details) status = FAIL - destroy_netpool(options.ip, options.virt, net_name) destroy_and_undefine_domain(test_dom, options.ip, options.virt) destroy_and_undefine_domain(test_dom2, options.ip, options.virt)

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1219433898 25200 # Node ID 3c32f9334194cc6b8a8d5300f994a71454369a81 # Parent 055021cae0200442791afada78d07ff3309a791c [TEST] Make network related changes to CS tests. Also tidy up import calls. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 055021cae020 -r 3c32f9334194 suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Fri Aug 22 12:38:18 2008 -0700 @@ -50,7 +50,6 @@ from XenKvmLib.common_util import call_request_state_change, \ poll_for_state_change from CimTest.ReturnCodes import PASS, FAIL -from XenKvmLib.common_util import create_netpool_conf, destroy_netpool sup_types = ['Xen', 'KVM', 'XenFV'] test_dom = "DomST1" @@ -67,9 +66,6 @@ virt = options.virt destroy_and_undefine_all(server) - status, test_network = create_netpool_conf(server, virt) - if status != PASS: - return FAIL cxml = vxml.get_class(virt)(test_dom, mem) @@ -88,7 +84,6 @@ if status != PASS: cxml.destroy(server) - destroy_netpool(server, virt, test_network) return status from_State = dom_cs.EnabledState @@ -100,7 +95,6 @@ logger.error("Unable to suspend dom '%s' using RequestedStateChange()", test_dom) cxml.destroy(server) - destroy_netpool(server, virt, test_network) return status #Polling for the value of EnabledState to be set to 9. @@ -111,7 +105,6 @@ if status != PASS: cxml.destroy(server) - destroy_netpool(server, virt, test_network) return status enabledState = dom_cs.EnabledState @@ -133,7 +126,6 @@ status = FAIL cxml.destroy(server) - destroy_netpool(server, virt, test_network) return status if __name__ == "__main__": diff -r 055021cae020 -r 3c32f9334194 suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Fri Aug 22 12:38:18 2008 -0700 @@ -36,8 +36,7 @@ from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.common_util import create_using_definesystem, \ - call_request_state_change, get_cs_instance, \ - create_netpool_conf, destroy_netpool + call_request_state_change, get_cs_instance sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] test_dom = "domgst" @@ -62,17 +61,12 @@ def main(): options = main.options - status, test_network = create_netpool_conf(options.ip, options.virt, False) - if status != PASS: - return FAIL - try: # define the vs status = create_using_definesystem(test_dom, options.ip, virt=options.virt) if status != PASS: logger.error("Unable to define %s using DefineSystem()" % test_dom) - destroy_netpool(options.ip, options.virt, test_network) return status # suspend the vs @@ -95,7 +89,6 @@ logger.error("Error: %s" % detail) status = FAIL - destroy_netpool(options.ip, options.virt, test_network) destroy_and_undefine_domain(test_dom, options.ip, options.virt) return status diff -r 055021cae020 -r 3c32f9334194 suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/23_suspend_suspend.py Fri Aug 22 12:38:18 2008 -0700 @@ -44,11 +44,10 @@ from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.test_doms import destroy_and_undefine_domain -from XenKvmLib.common_util import create_using_definesystem -from XenKvmLib.common_util import call_request_state_change -from XenKvmLib.common_util import try_request_state_change -from XenKvmLib.common_util import poll_for_state_change -from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.common_util import create_using_definesystem, \ + call_request_state_change, \ + try_request_state_change, \ + poll_for_state_change sup_types = ['Xen', 'XenFV', 'KVM'] @@ -65,10 +64,6 @@ options = main.options server = options.ip virt = options.virt - - status, test_network = create_netpool_conf(server, virt, False) - if status != PASS: - return FAIL tc_scen = [('Start', [ACTIVE_STATE, ACTIVE_STATE]), \ ('Suspend', [SUSPND_STATE, SUSPND_STATE])] @@ -106,7 +101,6 @@ status = FAIL if status != PASS: - destroy_netpool(server, virt, test_network) destroy_and_undefine_domain(default_dom, server, virt) return status @@ -116,7 +110,6 @@ rq_state, TIME, err_no, err_desc, virt) - destroy_netpool(server, virt, test_network) destroy_and_undefine_domain(default_dom, server, virt) return status diff -r 055021cae020 -r 3c32f9334194 suites/libvirt-cim/cimtest/ComputerSystem/27_define_suspend_errs.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/27_define_suspend_errs.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/27_define_suspend_errs.py Fri Aug 22 12:38:18 2008 -0700 @@ -42,9 +42,8 @@ from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.test_doms import destroy_and_undefine_domain -from XenKvmLib.common_util import try_request_state_change -from XenKvmLib.common_util import create_using_definesystem -from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.common_util import try_request_state_change, \ + create_using_definesystem sup_types = ['Xen', 'XenFV', 'LXC', 'KVM'] @@ -61,10 +60,6 @@ server = options.ip virt = options.virt status = FAIL - - status, test_network = create_netpool_conf(server, virt, False) - if status != PASS: - return FAIL try: # define the vs @@ -76,7 +71,6 @@ except Exception, details: logger.error("Exception: %s", details) - destroy_netpool(server, virt, test_network) destroy_and_undefine_domain(default_dom, server, virt) return FAIL @@ -87,7 +81,6 @@ if status != PASS: logger.error("Expected Defined -> Suspended state transition to fail") - destroy_netpool(server, virt, test_network) destroy_and_undefine_domain(default_dom, server, virt) return status diff -r 055021cae020 -r 3c32f9334194 suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/32_start_reboot.py Fri Aug 22 12:38:18 2008 -0700 @@ -43,10 +43,9 @@ from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC from XenKvmLib.test_doms import destroy_and_undefine_domain -from XenKvmLib.common_util import create_using_definesystem -from XenKvmLib.common_util import call_request_state_change -from XenKvmLib.common_util import poll_for_state_change -from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.common_util import create_using_definesystem, \ + call_request_state_change, \ + poll_for_state_change sup_types = ['Xen', 'XenFV', 'KVM'] @@ -62,10 +61,6 @@ status = FAIL server = options.ip virt = options.virt - - status, test_network = create_netpool_conf(server, virt, False) - if status != PASS: - return FAIL tc_scen = [('Start', [ACTIVE_STATE, ACTIVE_STATE]), \ ('Reboot', [ACTIVE_STATE, REBOOT_STATE])] @@ -105,7 +100,6 @@ logger.error("Exception: %s", detail) status = FAIL - destroy_netpool(server, virt, test_network) destroy_and_undefine_domain(default_dom, server, virt) return status diff -r 055021cae020 -r 3c32f9334194 suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/33_suspend_reboot.py Fri Aug 22 12:38:18 2008 -0700 @@ -46,11 +46,10 @@ from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL, XFAIL_RC from XenKvmLib.test_doms import destroy_and_undefine_domain -from XenKvmLib.common_util import create_using_definesystem -from XenKvmLib.common_util import call_request_state_change -from XenKvmLib.common_util import poll_for_state_change -from XenKvmLib.common_util import try_request_state_change -from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.common_util import create_using_definesystem, \ + call_request_state_change, \ + poll_for_state_change, \ + try_request_state_change sup_types = ['Xen', 'XenFV', 'KVM'] @@ -68,10 +67,6 @@ status = FAIL server = options.ip virt = options.virt - - status, test_network = create_netpool_conf(server, virt, False) - if status != PASS: - return FAIL tc_scen = [('Start', [ACTIVE_STATE, ACTIVE_STATE]), ('Suspend', [SUSPND_STATE, SUSPND_STATE]), @@ -111,7 +106,6 @@ logger.error("Exception: %s", detail) status = FAIL - destroy_netpool(server, virt, test_network) destroy_and_undefine_domain(default_dom, server, virt) return status diff -r 055021cae020 -r 3c32f9334194 suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/35_start_reset.py Fri Aug 22 12:38:18 2008 -0700 @@ -44,11 +44,9 @@ from CimTest.Globals import do_main, logger from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.test_doms import destroy_and_undefine_domain -from XenKvmLib.common_util import get_cs_instance -from XenKvmLib.common_util import create_using_definesystem -from XenKvmLib.common_util import call_request_state_change -from XenKvmLib.common_util import poll_for_state_change -from XenKvmLib.common_util import create_netpool_conf, destroy_netpool +from XenKvmLib.common_util import get_cs_instance, create_using_definesystem, \ + call_request_state_change, \ + poll_for_state_change sup_types = ['Xen', 'XenFV', 'KVM'] @@ -64,10 +62,6 @@ status = FAIL server = options.ip virt = options.virt - - status, test_network = create_netpool_conf(server, virt, False) - if status != PASS: - return FAIL tc_scen = [('Start', [ACTIVE_STATE, ACTIVE_STATE]), ('Reset', [ACTIVE_STATE, RESET_STATE])] @@ -107,7 +101,6 @@ logger.error("Exception: %s", detail) status = FAIL - destroy_netpool(server, virt, test_network) destroy_and_undefine_domain(default_dom, server, virt) return status diff -r 055021cae020 -r 3c32f9334194 suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/40_RSC_start.py Fri Aug 22 12:38:18 2008 -0700 @@ -55,10 +55,6 @@ virt = options.virt status = FAIL - status, test_network = create_netpool_conf(server, virt, False) - if status != PASS: - return FAIL - try: rc = create_using_definesystem(default_dom, server, virt=virt) @@ -87,7 +83,6 @@ except Exception, detail: logger.error("Exception: %s", detail) - destroy_netpool(server, virt, test_network) destroy_and_undefine_domain(default_dom, server, virt) return status

# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1219433898 25200 # Node ID 622266af7ac6bea051d5694b3bb71846d2a55e75 # Parent 3c32f9334194cc6b8a8d5300f994a71454369a81 [TEST] Misc test updates - fix related network calls Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 3c32f9334194 -r 622266af7ac6 suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py --- a/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Fri Aug 22 12:38:18 2008 -0700 @@ -31,8 +31,7 @@ from CimTest.Globals import do_main from CimTest.Globals import logger, CIM_ERROR_ENUMERATE, platform_sup from CimTest.ReturnCodes import PASS, FAIL -from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ - create_netpool_conf, destroy_netpool +from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -93,23 +92,15 @@ cleanup_restore(options.ip, options.virt) return FAIL - status, test_network = create_netpool_conf(options.ip, options.virt) - if status != PASS: - cleanup_restore(options.ip, options.virt) - destroy_netpool(options.ip, options.virt, test_network) - return FAIL - pools, ac = enum_pools_and_ac(options.ip, options.virt, cn) if len(pools) < 4: logger.error("Only %d pools returned, expected at least 4" % len(pools)) cleanup_restore(options.ip, options.virt) - destroy_netpool(options.ip, options.virt, test_network) return FAIL status = compare_pool_to_ac(ac, pools, cn) cleanup_restore(options.ip, options.virt) - destroy_netpool(options.ip, options.virt, test_network) return status diff -r 3c32f9334194 -r 622266af7ac6 suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py --- a/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Fri Aug 22 12:38:18 2008 -0700 @@ -29,8 +29,7 @@ from CimTest.Globals import do_main from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib.common_util import create_using_definesystem, \ - call_request_state_change, \ - create_netpool_conf, destroy_netpool + call_request_state_change from XenKvmLib.test_doms import destroy_and_undefine_domain from XenKvmLib.classes import get_typed_class from XenKvmLib.indication_tester import CIMIndicationSubscription @@ -144,10 +143,6 @@ options = main.options status = FAIL - status, test_network = create_netpool_conf(options.ip, options.virt) - if status != PASS: - return FAIL - sub_list, ind_names, dict = sub_ind(options.ip, options.virt) ind_list = ["define", "start", "destroy"] @@ -185,7 +180,6 @@ sub.unsubscribe(dict['default_auth']) logger.info("Cancelling subscription for %s" % ind_names[ind]) - destroy_netpool(options.ip, options.virt, test_network) destroy_and_undefine_domain(test_dom, options.ip, options.virt) return status diff -r 3c32f9334194 -r 622266af7ac6 suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py --- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/04_forward_errs.py Fri Aug 22 12:38:18 2008 -0700 @@ -41,6 +41,7 @@ from XenKvmLib.classes import get_typed_class from XenKvmLib.common_util import cleanup_restore, test_dpath, \ create_diskpool_file +from XenKvmLib.const import default_network_name sup_types = ['Xen', 'KVM', 'XenFV'] bug_no = "88651" @@ -507,7 +508,7 @@ if status != PASS: return status - bridge = vsxml.set_vbridge(options.ip) + bridge = vsxml.set_vbridge(options.ip, default_network_name) ret = vsxml.define(options.ip) if not ret: logger.error("Failed to define the dom: %s", test_dom) diff -r 3c32f9334194 -r 622266af7ac6 suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Aug 22 12:38:18 2008 -0700 @@ -59,8 +59,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.common_util import cleanup_restore, \ -create_diskpool_conf, destroy_netpool +from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -249,7 +248,6 @@ if status != PASS: vsxml.undefine(server) cleanup_restore(server, virt=virt) - destroy_netpool(server, virt, net_name) return status in_pllist = pool_init_list(virt, pool, net_name, dpool_name) @@ -259,13 +257,11 @@ if status != PASS: vsxml.undefine(server) cleanup_restore(server, virt=virt) - destroy_netpool(server, virt, net_name) return FAIL status = verify_eafp_values(server, in_pllist, virt, test_disk) vsxml.undefine(server) cleanup_restore(server, virt=virt) - destroy_netpool(server, virt, net_name) return status if __name__ == "__main__": sys.exit(main()) diff -r 3c32f9334194 -r 622266af7ac6 suites/libvirt-cim/cimtest/RASD/02_enum.py --- a/suites/libvirt-cim/cimtest/RASD/02_enum.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/02_enum.py Fri Aug 22 12:38:18 2008 -0700 @@ -39,6 +39,7 @@ from XenKvmLib import rasd from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ verify_diskrasd_values, verify_memrasd_values, rasd_init_list +from XenKvmLib.const import default_network_name sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -128,7 +129,7 @@ else: vsxml = virtxml(test_dom, mem=test_mem, vcpus = test_vcpus, mac = test_mac, disk = test_disk) - vsxml.set_vbridge(server) + vsxml.set_vbridge(server, default_network_name) class_list = [ get_typed_class(virt, rasd.dasd_cn), get_typed_class(virt, rasd.masd_cn), get_typed_class(virt, rasd.pasd_cn), diff -r 3c32f9334194 -r 622266af7ac6 suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py --- a/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/RASD/03_rasd_errs.py Fri Aug 22 12:38:18 2008 -0700 @@ -62,6 +62,7 @@ from XenKvmLib.classes import get_typed_class from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, CIM_ERROR_GETINSTANCE from CimTest.ReturnCodes import PASS, FAIL +from XenKvmLib.const import default_network_name sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -141,7 +142,7 @@ vcpus = test_vcpus, \ mac = test_mac, \ disk = test_disk) - bridge = vsxml.set_vbridge(server) + bridge = vsxml.set_vbridge(server, default_network_name) try: ret = vsxml.define(options.ip) if not ret: diff -r 3c32f9334194 -r 622266af7ac6 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Fri Aug 22 12:38:18 2008 -0700 @@ -32,8 +32,8 @@ from CimTest import Globals from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import PASS, FAIL, XFAIL -from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ -create_netpool_conf, destroy_netpool +from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf +from XenKvmLib.const import default_network_name sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] @@ -41,6 +41,7 @@ test_vcpus = 1 test_mem = 128 test_mac = "00:11:22:33:44:aa" +test_npool = default_network_name def setup_env(server, virt): destroy_and_undefine_all(server) @@ -58,20 +59,19 @@ else: vsxml = virtxml(test_dom, mem=test_mem, vcpus = test_vcpus, mac = test_mac, disk = test_disk, - ntype='network') + ntype='network', net_name = test_npool) - test_network = vsxml.xml_get_net_network() try: ret = vsxml.define(server) if not ret: logger.error("Failed to Define the domain: %s", test_dom) - return FAIL, vsxml, test_disk, test_network + return FAIL, vsxml, test_disk except Exception, details: logger.error("Exception : %s", details) - return FAIL, vsxml, test_disk, test_network + return FAIL, vsxml, test_disk - return PASS, vsxml, test_disk, test_network + return PASS, vsxml, test_disk def get_instance(server, pool, list, virt='Xen'): try: @@ -114,16 +114,14 @@ status = PASS - status, vsxml, test_disk, test_network = setup_env(options.ip, options.virt) + status, vsxml, test_disk = setup_env(options.ip, options.virt) if status != PASS: - destroy_netpool(options.ip, options.virt, test_network) vsxml.undefine(options.ip) return status status, diskid = create_diskpool_conf(options.ip, options.virt) if status != PASS: cleanup_restore(options.ip, options.virt) - destroy_netpool(options.ip, options.virt, test_network) vsxml.undefine(options.ip) return status @@ -135,7 +133,7 @@ "ProcessorPool" : {'InstanceID' : "ProcessorPool/0"}, "DiskPool" : {'InstanceID' : diskid}, "NetworkPool" : {'InstanceID' : "NetworkPool/%s" \ - % test_network }} + % test_npool }} rasd = { "MemoryPool" : "%s/mem" % test_dom, "ProcessorPool" : "%s/proc" % test_dom, "DiskPool" : "%s/%s" %(test_dom, test_disk), @@ -152,7 +150,6 @@ break cleanup_restore(options.ip, options.virt) - destroy_netpool(options.ip, options.virt, test_network) vsxml.undefine(options.ip) return status diff -r 3c32f9334194 -r 622266af7ac6 suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Fri Aug 22 12:38:18 2008 -0700 @@ -33,15 +33,15 @@ from CimTest.Globals import logger, do_main from CimTest.ReturnCodes import PASS, FAIL from XenKvmLib import enumclass -from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ -create_netpool_conf, destroy_netpool - +from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf +from XenKvmLib.const import default_network_name sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] test_dom = "RAFP_dom" test_vcpus = 1 test_mem = 128 test_mac = "00:11:22:33:44:aa" +test_npool = default_network_name def setup_env(server, virt): destroy_and_undefine_all(server) @@ -57,21 +57,20 @@ else: vsxml = virtxml(test_dom, mem=test_mem, vcpus = test_vcpus, mac = test_mac, disk = test_disk, - ntype = 'network') - test_network = vsxml.xml_get_net_network() + ntype = 'network', net_name = test_npool) try: ret = vsxml.define(server) if not ret: logger.error("Failed to Define the domain: %s", test_dom) - return FAIL, vsxml, test_disk, test_network + return FAIL, vsxml, test_disk except Exception, details: logger.error("Exception : %s", details) - return FAIL, vsxml, test_disk, test_network + return FAIL, vsxml, test_disk - return PASS, vsxml, test_disk, test_network + return PASS, vsxml, test_disk -def init_list(test_disk, diskid, test_network, virt='Xen'): +def init_list(test_disk, diskid, virt='Xen'): proc = { 'rasd_id' : '%s/%s' % (test_dom, 'proc'), 'pool_id' : 'ProcessorPool/0' @@ -83,7 +82,7 @@ net = { 'rasd_id' : '%s/%s' % (test_dom, test_mac), - 'pool_id' : 'NetworkPool/%s' %test_network + 'pool_id' : 'NetworkPool/%s' % test_npool } disk = { 'rasd_id' : '%s/%s' % (test_dom, test_disk), @@ -165,19 +164,17 @@ server = options.ip virt = options.virt - status, vsxml, test_disk, test_network = setup_env(server, virt) + status, vsxml, test_disk = setup_env(server, virt) if status != PASS: - destroy_netpool(server, virt, test_network) vsxml.undefine(server) return status status, diskid = create_diskpool_conf(server, virt) if status != PASS: - destroy_netpool(server, virt, test_network) vsxml.undefine(server) return status - cn_id_list = init_list(test_disk, diskid, test_network, options.virt) + cn_id_list = init_list(test_disk, diskid, options.virt) for rasd_cn, id_info in cn_id_list.iteritems(): status = get_rasdinst_verify_pool_from_RAFP(server, virt, vsxml, @@ -186,7 +183,6 @@ return status cleanup_restore(server, virt) - destroy_netpool(server, virt, test_network) vsxml.undefine(server) return status diff -r 3c32f9334194 -r 622266af7ac6 suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Fri Aug 22 12:38:18 2008 -0700 @@ -63,13 +63,14 @@ CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS from XenKvmLib.classes import get_typed_class from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \ -create_netpool_conf, destroy_netpool -from XenKvmLib.common_util import print_field_error + print_field_error +from XenKvmLib.const import default_network_name platform_sup = ['Xen', 'KVM', 'XenFV', 'LXC'] memid = "%s/%s" % ("MemoryPool", 0) procid = "%s/%s" % ("ProcessorPool", 0) +test_npool = default_network_name def get_or_bail(virt, ip, id, pool_class): """ @@ -84,8 +85,7 @@ logger.error("Exception: %s", detail) cleanup_restore(ip, virt) sys.exit(FAIL) - return instance - + return instance def init_list(virt, pool): """ @@ -140,25 +140,20 @@ mpool = get_pool_info(virt, server, memid, poolname= "MemoryPool") ppool = get_pool_info(virt, server, procid, poolname= "ProcessorPool") - status, test_network = create_netpool_conf(server, virt) - if status != PASS: - return status, pool_set, test_network - - netid = "%s/%s" % ("NetworkPool", test_network) + netid = "%s/%s" % ("NetworkPool", test_npool) npool = get_pool_info(virt, server, netid, poolname= "NetworkPool") if dpool.InstanceID == None or mpool.InstanceID == None \ or npool.InstanceID == None or ppool.InstanceID == None: logger.error("Get pool None") cleanup_restore(server, virt) - destroy_netpool(server, virt, test_network) return FAIL else: pool_set = [dpool, mpool, ppool, npool] except Exception, detail: logger.error("Exception: %s", detail) - return FAIL, pool_set, test_network + return FAIL, pool_set - return PASS, pool_set, test_network + return PASS, pool_set def verify_rasd_fields(loop, assoc_info, cllist, rtype, rangelist): for inst in assoc_info: @@ -207,15 +202,14 @@ server = options.ip virt = options.virt - status, pool, test_network = get_pool_details(virt, server) + status, pool = get_pool_details(virt, server) if status != PASS: cleanup_restore(server, virt) - destroy_netpool(server, virt, test_network) return FAIL status = verify_sdc_with_ac(virt, server, pool) + cleanup_restore(server, virt) - destroy_netpool(server, virt, test_network) return status if __name__ == "__main__": diff -r 3c32f9334194 -r 622266af7ac6 suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py --- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Fri Aug 22 12:38:18 2008 -0700 +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Fri Aug 22 12:38:18 2008 -0700 @@ -54,6 +54,7 @@ from XenKvmLib import rasd from XenKvmLib.rasd import verify_procrasd_values, verify_netrasd_values, \ verify_diskrasd_values, verify_memrasd_values, rasd_init_list +from XenKvmLib.const import default_network_name sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] @@ -71,7 +72,7 @@ vsxml_info = virt_xml(test_dom, mem=test_mem, vcpus = test_vcpus, mac = test_mac, disk = test_disk) try: - bridge = vsxml_info.set_vbridge(server) + bridge = vsxml_info.set_vbridge(server, default_network_name) except Exception, details: logger.error("Exception : %s", details) return FAIL, vsxml_info

+1 from me! Do you think is it a good idea to create a disk pool before any of the tests run? If so, would you like to cook it up? Otherwise,I'm glad to take it up. Best, Regards Daisy (运国莲) VSM Team, China Systems & Technology Labs (CSTL) E-mail: yunguol@cn.ibm.com TEL: (86)-21-60922403 Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203 Kaitlin Rupert <kaitlin@linux.vnet.ibm.com> Sent by: libvirt-cim-bounces@redhat.com 2008-08-25 22:22 Please respond to List for discussion and development of libvirt CIM <libvirt-cim@redhat.com> To libvirt-cim@redhat.com cc Subject [Libvirt-cim] [PATCH 0 of 6] [TEST] Setup network pool for tests to use before tests begin running _______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim

Guo Lian Yun wrote:
+1 from me!
Do you think is it a good idea to create a disk pool before any of the tests run? If so, would you like to cook it up? Otherwise,I'm glad to take it up.
Thanks for the review! Good call! I was planning to also add a diskpool. This patch set was pretty large, so I wanted the diskpool changes to be separate. If you are interested in working on it, please feel free to take it up. =) -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

libvirt-cim-bounces@redhat.com wrote on 2008-08-28 07:53:20:
Guo Lian Yun wrote:
+1 from me!
Do you think is it a good idea to create a disk pool before any of the
tests run? If so, would you like to cook it up? Otherwise,I'm glad to take it up.
Thanks for the review!
Good call! I was planning to also add a diskpool. This patch set was pretty large, so I wanted the diskpool changes to be separate. If you are interested in working on it, please feel free to take it up. =)
Since it's already in your plan, I'm going to work on other items. On the next, I will start to remove computersystem.py and update related tests. Thanks!
-- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
participants (2)
-
Guo Lian Yun
-
Kaitlin Rupert