# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1247619180 25200
# Node ID 2daf5abc8b907906380fa9b911a0711d23aaa19f
# Parent b2eb25caa1c8b2736418c39e448b6f228fc153bc
[TEST] 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.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r b2eb25caa1c8 -r 2daf5abc8b90
suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py
---
a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/19_definenetwork_ers.py Tue
Jul 14 16:14:07 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":
+ expected_values['empty']['network'] = "no network with
matching name"
+ expected_values['invalid']['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')"
+
+ expected_values['invalid']['bridge'] = inv_br_str
+
+ else:
+ expected_values['empty']['network'] = "Network not
found"
+ expected_values['invalid']['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']['bridge'] = inv_br_str
+
tc_scen = {
'invalid' : 'invalid',
'empty' : '',