[Libvirt-cim] [PATCH 6 of 6] [TEST] Misc test updates - fix related network calls

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Mon Aug 25 14:22:39 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at 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 at 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




More information about the Libvirt-cim mailing list