The networking_cisco.tests.unit.ml2.drivers.cisco.nexus.test_cisco_nexus_events_vxlan
Module¶
-
class
networking_cisco.tests.unit.ml2.drivers.cisco.nexus.test_cisco_nexus_events_vxlan.
TestCiscoNexusVxlanDevice
(*args, **kwds)¶ Bases:
networking_cisco.tests.unit.ml2.drivers.cisco.nexus.test_cisco_nexus_base.TestCiscoNexusBase
,networking_cisco.tests.unit.ml2.drivers.cisco.nexus.test_cisco_nexus_events_vxlan.TestCiscoNexusVxlanDeviceConfig
Unit tests for Cisco ML2 VXLAN Nexus device driver.
-
setUp
()¶ Sets up mock ncclient, and switch and credentials dictionaries.
-
test_create_nve_member_failure
(*args, **kwargs)¶ Verifies exception during create nve member driver.
-
test_delete_nve_member_failure
(*args, **kwargs)¶ Verifies exception during delete nve member driver.
-
test_disable_vxlan_feature_failure
(*args, **kwargs)¶ Verifies exception during disable VXLAN driver.
-
test_enable_vxlan_feature_failure
(*args, **kwargs)¶ Verifies exception during enable VXLAN driver.
-
test_nexus_missing_vxlan_fields
(*args, **kwargs)¶ Test handling of a VXLAN NexusMissingRequiredFields exception.
Test the Cisco NexusMissingRequiredFields exception by using empty VNI and mcast address values during port update event.
-
test_nexus_vxlan_bind_port
(*args, **kwargs)¶ Test VXLAN bind_port method processing.
Verify the bind_port method allocates the VLAN segment correctly.
-
test_nexus_vxlan_bind_port_no_dynamic_segment
(*args, **kwargs)¶ Test VXLAN bind_port processing.
Verify that the continue_binding() method is not called when the vlan dynamic segment wasn’t allocated.
-
test_nexus_vxlan_bind_port_no_physnet
(*args, **kwargs)¶ Test VXLAN bind_port error processing.
Verify that continue_binding() method is not called when no ‘physnet’ key is present in the nexus switch dictionary.
-
test_nexus_vxlan_one_network
(*args, **kwargs)¶ Test processing for creating one VXLAN segment.
-
test_nexus_vxlan_one_network_two_hosts
(*args, **kwargs)¶ Tests creation and deletion of two new virtual Ports.
-
test_nexus_vxlan_two_network
(*args, **kwargs)¶ Test processing for creating one VXLAN segment.
-
-
class
networking_cisco.tests.unit.ml2.drivers.cisco.nexus.test_cisco_nexus_events_vxlan.
TestCiscoNexusVxlanDeviceConfig
¶ Bases:
object
Config Data for Cisco ML2 VXLAN Nexus device driver.
-
test_configs
= OrderedDict([(‘test_vxlan_config1’, TestConfigObj(nexus_ip_addr=‘1.1.1.1’, host_name=’testhost1’, nexus_port=’ethernet:1/10’, instance_id=’testvm1’, vlan_id=267, vxlan_id=70000, mcast_group=‘255.1.1.1’, device_owner=’compute:test’, profile={}, dns_name=None, vnic_type=u’normal’)), (‘test_vxlan_config2’, TestConfigObj(nexus_ip_addr=‘1.1.1.1’, host_name=’testhost2’, nexus_port=’ethernet:1/20’, instance_id=’testvm2’, vlan_id=267, vxlan_id=70000, mcast_group=‘255.1.1.1’, device_owner=’compute:test’, profile={}, dns_name=None, vnic_type=u’normal’)), (‘test_vxlan_config3’, TestConfigObj(nexus_ip_addr=‘6.6.6.6’, host_name=’testhost3’, nexus_port=’ethernet:1/10’, instance_id=’testvm1’, vlan_id=267, vxlan_id=70000, mcast_group=‘255.1.1.1’, device_owner=’compute:test’, profile={}, dns_name=None, vnic_type=u’normal’)), (‘test_vxlan_config4’, TestConfigObj(nexus_ip_addr=‘7.7.7.7’, host_name=’testhost3’, nexus_port=‘1/2,1/3’, instance_id=’testvm1’, vlan_id=267, vxlan_id=70000, mcast_group=‘255.1.1.1’, device_owner=’compute:test’, profile={}, dns_name=None, vnic_type=u’normal’)), (‘test_vxlan_config5’, TestConfigObj(nexus_ip_addr=‘8.8.8.8’, host_name=’testhost4’, nexus_port=’ethernet:1/10’, instance_id=’testvm1’, vlan_id=267, vxlan_id=70000, mcast_group=‘255.1.1.1’, device_owner=’compute:test’, profile={}, dns_name=None, vnic_type=u’normal’)), (‘test_vxlan_config6’, TestConfigObj(nexus_ip_addr=‘8.8.8.8’, host_name=’testhost5’, nexus_port=’ethernet:1/20’, instance_id=’testvm1’, vlan_id=265, vxlan_id=70001, mcast_group=‘255.1.1.1’, device_owner=’compute:test’, profile={}, dns_name=None, vnic_type=u’normal’))])¶
-
-
class
networking_cisco.tests.unit.ml2.drivers.cisco.nexus.test_cisco_nexus_events_vxlan.
TestCiscoNexusVxlanResults
¶ Bases:
networking_cisco.tests.unit.ml2.drivers.cisco.nexus.test_cisco_nexus_base.TestCiscoNexusBaseResults
Unit tests driver results for Cisco ML2 Nexus.
-
test_results
= {‘add_port2_driver_result’: [‘configure\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>267[ -~]+\s+[ -~]+\s+\<vn-segment\>\s+\<vlan-vnsegment\>70000’, ‘\<ethernet\>\s+\<interface\>1\/20\<\/interface\>\s+[ -~]+\s+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<add\>\s+\<vlan_id\>267’], ‘delete_port2_driver_result’: [‘\<ethernet\>\s+\<interface\>1\/20\<\/interface\>\s+[ -~\s]+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<remove\>\s+\<vlan\>267’], ‘add_port_driver_result4’: [‘\<interface\>\s+\<nve\>nve1\<\/nve\>\s+[ -~]+\s+\<member\>member vni 70000 mcast-group 255.1.1.1’, ‘configure\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>267[ -~]+\s+[ -~]+\s+\<vn-segment\>\s+\<vlan-vnsegment\>70000’, ‘\<ethernet\>\s+\<interface\>1\/10\<\/interface\>\s+[ -~]+\s+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<add\>\s+\<vlan_id\>267’], ‘add_port_driver_result’: [‘\<interface\>\s+\<nve\>nve1\<\/nve\>\s+[ -~]+\s+\<member\>member vni 70000 mcast-group 255.1.1.1’, ‘configure\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>267[ -~]+\s+[ -~]+\s+\<vn-segment\>\s+\<vlan-vnsegment\>70000’, ‘\<ethernet\>\s+\<interface\>1\/10\<\/interface\>\s+[ -~]+\s+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<add\>\s+\<vlan_id\>267’], ‘add_port_driver_result2’: [‘\<interface\>\s+\<nve\>nve1\<\/nve\>\s+[ -~]+\s+\<member\>member vni 70001 mcast-group 255.1.1.1’, ‘configure\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>265[ -~]+\s+[ -~]+\s+\<vn-segment\>\s+\<vlan-vnsegment\>70001’, ‘\<ethernet\>\s+\<interface\>1\/20\<\/interface\>\s+[ -~]+\s+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<add\>\s+\<vlan_id\>265’], ‘delete_port_driver_result2’: [‘\<interface\>\s+\<nve\>nve1\<\/nve\>\s+[ -~]+\s+\<member\>no member vni 70001’, ‘\<ethernet\>\s+\<interface\>1\/20\<\/interface\>\s+[ -~\s]+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<remove\>\s+\<vlan\>265’, ‘\<no\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>265’], ‘delete_port_driver_result3’: [‘\<interface\>\s+\<nve\>nve1\<\/nve\>\s+[ -~]+\s+\<member\>no member vni 70000’, ‘\<interface\>\s+\<nve\>nve1\<\/nve\>\s+[ -~]+\s+\<member\>no member vni 70000’, ‘\<ethernet\>\s+\<interface\>1\/10\<\/interface\>\s+[ -~\s]+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<remove\>\s+\<vlan\>267’, ‘\<no\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>267’, ‘\<ethernet\>\s+\<interface\>1\/2\<\/interface\>\s+[ -~\s]+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<remove\>\s+\<vlan\>267’, ‘\<no\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>267’, ‘\<ethernet\>\s+\<interface\>1\/3\<\/interface\>\s+[ -~\s]+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<remove\>\s+\<vlan\>267’], ‘delete_port_driver_result4’: [‘\<interface\>\s+\<nve\>nve1\<\/nve\>\s+[ -~]+\s+\<member\>no member vni 70000’, ‘\<ethernet\>\s+\<interface\>1\/10\<\/interface\>\s+[ -~\s]+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<remove\>\s+\<vlan\>267’, ‘\<no\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>267’], ‘add_port_driver_result3’: [‘\<interface\>\s+\<nve\>nve1\<\/nve\>\s+[ -~]+\s+\<member\>member vni 70000 mcast-group 255.1.1.1’, ‘\<interface\>\s+\<nve\>nve1\<\/nve\>\s+[ -~]+\s+\<member\>member vni 70000 mcast-group 255.1.1.1’, ‘configure\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>267[ -~]+\s+[ -~]+\s+\<vn-segment\>\s+\<vlan-vnsegment\>70000’, ‘\<ethernet\>\s+\<interface\>1\/10\<\/interface\>\s+[ -~]+\s+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<add\>\s+\<vlan_id\>267’, ‘configure\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>267[ -~]+\s+[ -~]+\s+\<vn-segment\>\s+\<vlan-vnsegment\>70000’, ‘\<ethernet\>\s+\<interface\>1\/2\<\/interface\>\s+[ -~]+\s+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<add\>\s+\<vlan_id\>267’, ‘configure\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>267[ -~]+\s+[ -~]+\s+\<vn-segment\>\s+\<vlan-vnsegment\>70000’, ‘\<ethernet\>\s+\<interface\>1\/3\<\/interface\>\s+[ -~]+\s+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<add\>\s+\<vlan_id\>267’], ‘delete_port_driver_result’: [‘\<interface\>\s+\<nve\>nve1\<\/nve\>\s+[ -~]+\s+\<member\>no member vni 70000’, ‘\<ethernet\>\s+\<interface\>1\/10\<\/interface\>\s+[ -~\s]+\<switchport\>\s+\<trunk\>\s+\<allowed\>\s+\<vlan\>\s+\<remove\>\s+\<vlan\>267’, ‘\<no\>\s+\<vlan\>\s+<vlan-id-create-delete\>\s+\<__XML__PARAM_value\>267’]}¶
-