# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1247619180 25200
# Node ID 69e3ab27d1a8b0e50afa395f72a5c0cdc211c735
# Parent 031cff68b4d3ab0fc1ed9b34127b8f4e27cb27c9
[TEST] #2 Updates to VSMS 19_definenetwork_ers.py
Skip bridge type networks with provider versions that don't support setting the
bridge type via the providers.
Set different expected error messages for Xen guests, and for older versions of
libvirt.
Updates:
-Improve code reuse - in the if Xen / XenFV block
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 031cff68b4d3 -r 69e3ab27d1a8
suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py
---
a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Fri
Jul 17 12:07:44 2009 -0700
+++
b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Tue
Jul 14 17:53:00 2009 -0700
@@ -31,8 +31,9 @@
from XenKvmLib import vxml
from CimTest.Globals import logger
from CimTest.ReturnCodes import FAIL, PASS
-from XenKvmLib.const import default_network_name, do_main
+from XenKvmLib.const import default_network_name, do_main, get_provider_version
from XenKvmLib.common_util import create_netpool_conf, destroy_netpool
+from XenKvmLib.xm_virt_util import virsh_version
sup_types = ['Xen', 'KVM', 'XenFV']
default_dom = 'brgtest_domain'
@@ -40,6 +41,8 @@
npool_name = default_network_name + str(random.randint(1, 100))
brg_name = "br" + str(random.randint(1, 100))
+bridge_support_rev = 900
+
exp_rc = CIM_ERR_FAILED
def verify_error(exp_rc, exp_desc,cxml):
@@ -50,7 +53,11 @@
def main():
options = main.options
- nettypes = ['bridge','network']
+ nettypes = ['network']
+
+ rev, changeset = get_provider_version(options.virt, options.ip)
+ if rev >= bridge_support_rev:
+ nettypes.append('bridge')
expected_values = {
"invalid" : {'bridge' : 'internal error Failed to add tap
interface',
@@ -61,6 +68,27 @@
'network' : "Valid param "}
}
+ if options.virt == "Xen" or options.virt == "XenFV":
+ libvirt_version = virsh_version(options.ip, options.virt)
+ if libvirt_version <= "0.3.3":
+ inv_empty_network = "no network with matching name"
+
+ inv_br_str = "POST operation failed: (xend.err 'Device 0 (vif)
" + \
+ "could not be connected. Could not find bridge " + \
+ "device invalid')"
+
+ else:
+ inv_empty_network = "Network not found"
+
+ inv_br_str = "POST operation failed: xend_post: error from xen " +
\
+ "daemon: (xend.err 'Device 0 (vif) could not be "
+ \
+ "connected. Could not find bridge device
invalid')"
+
+ expected_values['invalid']['network'] = inv_empty_network
+ expected_values['empty']['network'] = inv_empty_network
+
+ expected_values['invalid']['bridge'] = inv_br_str
+
tc_scen = {
'invalid' : 'invalid',
'empty' : '',
Show replies by thread
+1
--
Thanks and Regards,
Deepti B. Kalakeri
IBM Linux Technology Center
deeptik(a)linux.vnet.ibm.com