[Libvirt-cim] [PATCH] [TEST] #3 Updating 01_forward.py of SDC

Deepti B. Kalakeri deeptik at linux.vnet.ibm.com
Thu May 15 13:07:52 UTC 2008


# HG changeset patch
# User Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>
# Date 1210856837 25200
# Node ID fa608cfd2be35b4170e14620253f95a9b0e016ed
# Parent  3c476a21c4b4f95f5ff783a199a6feab9d9c66b1
[TEST] #3 Updating 01_forward.py of SDC.

To use the storage pool present on the machine.
This tc will now pass on latest libvirt-cim for KVM.
This tc will require virsh_version() and diskpool_list() and create_diskpool() function
changes to work.
Update the cleanup_restore() function parameters.

Signed-off-by: Deepti B. Kalakeri <deeptik at linux.vnet.ibm.com>

diff -r 3c476a21c4b4 -r fa608cfd2be3 suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py
--- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py	Thu May 15 06:05:20 2008 -0700
+++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py	Thu May 15 06:07:17 2008 -0700
@@ -57,19 +57,16 @@ from distutils.file_util import move_fil
 from distutils.file_util import move_file
 from XenKvmLib import assoc
 from XenKvmLib import enumclass
-from XenKvmLib.test_xml import netxml 
-from XenKvmLib.test_doms import create_vnet 
-from VirtLib.live import net_list
+from VirtLib.live import virsh_version
 from CimTest.ReturnCodes import PASS, FAIL, SKIP
 from CimTest.Globals import do_main, platform_sup, logger, \
 CIM_ERROR_GETINSTANCE, CIM_ERROR_ASSOCIATORS
 from XenKvmLib.classes import get_typed_class
-from XenKvmLib.common_util import cleanup_restore, test_dpath, \
-create_diskpool_file
+from XenKvmLib.common_util import cleanup_restore, create_diskpool_conf, \
+create_netpool_conf
 from XenKvmLib.common_util import print_field_error
 from XenKvmLib.const import CIM_REV
 
-diskid = "%s/%s" % ("DiskPool", test_dpath)
 memid = "%s/%s" % ("MemoryPool", 0)
 procid = "%s/%s" % ("ProcessorPool", 0)
 libvirtcim_sdc_rasd_rev = 571
@@ -86,7 +83,7 @@ def get_or_bail(virt, ip, id, pool_class
     except Exception, detail:
         logger.error(CIM_ERROR_GETINSTANCE, '%s' % pool_class)
         logger.error("Exception: %s", detail)
-        cleanup_restore()
+        cleanup_restore(ip, virt)
         sys.exit(FAIL)
     return instance
 
@@ -130,22 +127,17 @@ def get_pool_details(virt, server):
 def get_pool_details(virt, server):  
     dpool = npool  = mpool  = ppool = None
     try :
+        status, diskid = create_diskpool_conf(server, virt)
+        if status != PASS:
+            return status,  dpool, npool, mpool, ppool
+
         dpool = get_pool_info(virt, server, diskid, poolname="DiskPool")
         mpool = get_pool_info(virt, server, memid, poolname= "MemoryPool")
         ppool = get_pool_info(virt, server, procid, poolname= "ProcessorPool")
 
-        vir_network = net_list(server, virt)
-        if len(vir_network) > 0:
-            test_network = vir_network[0]
-        else:
-            bridgename   = 'testbridge'
-            test_network = 'default-net'
-            net_xml, bridge = netxml(server, bridgename, test_network)
-            ret = create_vnet(server, net_xml, virt)
-            if not ret:
-                logger.error("Failed to create Virtual Network '%s'",
-                         test_network)
-                return SKIP
+        status, test_network = create_netpool_conf(server, virt)
+        if status != PASS:
+            return status,  dpool, npool, mpool, ppool
 
         netid = "%s/%s" % ("NetworkPool", test_network)
         npool = get_pool_info(virt, server, netid, poolname= "NetworkPool")
@@ -225,19 +217,14 @@ def main():
     server = options.ip
     virt = options.virt
 
-    # Verify DiskPool on machine
-    status = create_diskpool_file()
-    if status != PASS:
-        return status
-
     status, dpool, npool, mpool, ppool = get_pool_details(virt, server)
     if status != PASS or dpool.InstanceID == None or mpool.InstanceID == None \
        or npool.InstanceID == None or ppool.InstanceID == None:
-        cleanup_restore()
+        cleanup_restore(server, virt)
         return FAIL
 
     status = verify_sdc_with_ac(virt, server, dpool, npool, mpool, ppool)
-    cleanup_restore()
+    cleanup_restore(server, virt)
     return status
     
 if __name__ == "__main__":




More information about the Libvirt-cim mailing list