# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1243587710 25200
# Node ID fe2f7e27210c2437d410484bd8f16a0714994321
# Parent 1420ff7756e0d69ed1eda45c1065079c36d8e92c
[TEST] Modifying RPCS/04_CreateChildResourcePool.py and
RPCS/07_DeleteChildResourcePool.py
Modifying RPCS/04_CreateChildResourcePool.py and RPCS/07_DeleteChildResourcePool.py to
align with
the changes to create_pool() and verify_pool() changes of pool.py.
Update:
-------
Added the missing DCO.
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 1420ff7756e0 -r fe2f7e27210c
suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py
---
a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Thu
May 28 22:48:30 2009 -0700
+++
b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Fri
May 29 02:01:50 2009 -0700
@@ -54,7 +54,7 @@
from XenKvmLib.const import do_main, platform_sup
from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import destroy_netpool
-from XenKvmLib.pool import create_netpool, verify_pool, undefine_netpool
+from XenKvmLib.pool import create_pool, verify_pool, undefine_netpool
test_pool = "testpool"
@@ -76,15 +76,17 @@
"IPRangeStart" : range_addr_start,
"IPRangeEnd" : range_addr_end
}
- for item in range(0, 3):
- status = create_netpool(options.ip, options.virt,
- test_pool, pool_attr, mode_type=item)
+ net_type = ["isolated", "nat", "route"]
+ for item in range(0, len(net_type)):
+ logger.info("Creating '%s' type network", net_type[item])
+ status = create_pool(options.ip, options.virt,
+ test_pool, pool_attr, mode_type=item)
if status != PASS:
logger.error("Error in networkpool creation")
return status
- status = verify_pool(options.ip, options.virt, np,
- test_pool, pool_attr, mode_type=item)
+ status = verify_pool(options.ip, options.virt,
+ test_pool, pool_attr, mode_type=item)
if status != PASS:
logger.error("Error in networkpool verification")
destroy_netpool(options.ip, options.virt, test_pool)
@@ -96,11 +98,6 @@
logger.error("Unable to destroy networkpool %s", test_pool)
return status
- status = undefine_netpool(options.ip, options.virt, test_pool)
- if status != PASS:
- logger.error("Unable to undefine networkpool %s", test_pool)
- return status
-
status = PASS
return status
diff -r 1420ff7756e0 -r fe2f7e27210c
suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py
---
a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Thu
May 28 22:48:30 2009 -0700
+++
b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Fri
May 29 02:01:50 2009 -0700
@@ -52,7 +52,7 @@
from XenKvmLib.enumclass import EnumInstances, EnumNames
from XenKvmLib.classes import get_typed_class
from XenKvmLib.common_util import destroy_netpool
-from XenKvmLib.pool import create_netpool, verify_pool
+from XenKvmLib.pool import create_pool, verify_pool
cim_errno = pywbem.CIM_ERR_NOT_SUPPORTED
cim_mname = "DeleteResourcePool"
@@ -71,7 +71,8 @@
rpcs_conn.DeleteResourcePool()
except pywbem.CIMError, (err_no, desc):
if err_no == cim_errno :
- logger.info("Got expected exception for '%s' service",
cim_mname)
+ logger.info("Got expected exception for '%s' service",
+ cim_mname)
logger.info("Errno is '%s' ", err_no)
logger.info("Error string is '%s'", desc)
return PASS
@@ -87,21 +88,22 @@
"IPRangeEnd" : "192.168.0.15",
"ForwardMode" : "nat"
}
- np = get_typed_class(options.virt, 'NetworkPool')
- np_id = "NetworkPool/%s" % test_pool
- status = create_netpool(options.ip, options.virt, test_pool, pool_attr)
+ status = create_pool(options.ip, options.virt, test_pool, pool_attr)
if status != PASS:
logger.error("Error in networkpool creation")
return status
- status = verify_pool(options.ip, options.virt, np,
- test_pool, pool_attr)
+ status = verify_pool(options.ip, options.virt,
+ test_pool, pool_attr)
+
if status != PASS:
logger.error("Error in networkpool verification")
destroy_netpool(options.ip, options.virt, test_pool)
return status
+ np = get_typed_class(options.virt, 'NetworkPool')
+ np_id = "NetworkPool/%s" % test_pool
netpool = EnumNames(options.ip, np)
for i in range(0, len(netpool)):
ret_pool = netpool[i].keybindings['InstanceID']
diff -r 1420ff7756e0 -r fe2f7e27210c suites/libvirt-cim/lib/XenKvmLib/pool.py
--- a/suites/libvirt-cim/lib/XenKvmLib/pool.py Thu May 28 22:48:30 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/pool.py Fri May 29 02:01:50 2009 -0700
@@ -150,7 +150,7 @@
cmd = "virsh -c %s net-undefine %s" % (virt2uri(virt), network)
ret, out = run_remote(server, cmd)
-
+
return ret
def undefine_netpool(server, virt, net_name):