The networking_cisco.tests.unit.ml2.drivers.cisco.ucsm.test_cisco_ucsm_driver Module

class networking_cisco.tests.unit.ml2.drivers.cisco.ucsm.test_cisco_ucsm_driver.FakeNetworkContext(segments)

Bases: neutron.plugins.ml2.driver_api.NetworkContext

Network context for testing purposes only.

current
network_segments
original
class networking_cisco.tests.unit.ml2.drivers.cisco.ucsm.test_cisco_ucsm_driver.FakePortContext(name, port_id, vnic_type, profile, network_context)

Bases: object

Port context for testing purposes only.

bottom_bound_segment
current
network
original
segment
set_binding(segment_id, vif_type, vif_details, status=None)
class networking_cisco.tests.unit.ml2.drivers.cisco.ucsm.test_cisco_ucsm_driver.FakeServer(server)

Bases: object

Name()
class networking_cisco.tests.unit.ml2.drivers.cisco.ucsm.test_cisco_ucsm_driver.FakeServiceProfile(service_profile)

Bases: object

Fake Service Profile class for testing only.

Name()
next()
class networking_cisco.tests.unit.ml2.drivers.cisco.ucsm.test_cisco_ucsm_driver.FakeServiceProfileList

Bases: object

class networking_cisco.tests.unit.ml2.drivers.cisco.ucsm.test_cisco_ucsm_driver.FakeUcsmHandle(port_profile=None)

Bases: object

Ucsm connection handle for testing purposes only.

CompleteTransaction()
ConfigResolveClass(classId, inFilter, inHierarchical=False, dumpXml=None)
GetManagedObject(class_path, class_id, pp_dict)
Logout()
RemoveManagedObject(p_profile)
StartTransaction()
class networking_cisco.tests.unit.ml2.drivers.cisco.ucsm.test_cisco_ucsm_driver.TestCiscoUcsmMechDriver(*args, **kwds)

Bases: neutron.tests.unit.testlib_api.SqlTestCase, networking_cisco.tests.unit.ml2.drivers.cisco.ucsm.test_cisco_ucsm_common.ConfigMixin

Unit tests for Cisco ML2 UCS Manager MD.

setUp()

Sets up mock Ucs Sdk.

test_add_sp_template_config_to_db(*args, **kwargs)

Verifies the SP template dict has been created properly.

test_bad_ucsm_host_config(*args, **kwargs)

Verifies malformed ucsm_host_list raises an error.

test_bind_port_active(*args, **kwargs)

Verifies bind_port sets the port status as active.

test_check_segment_vlan(*args, **kwargs)

Verifies VLAN network segments are supported.

test_check_segment_vxlan(*args, **kwargs)

Verifies VXLAN network segments are not supported.

test_generic_create_profile(*args, **kwargs)

Test to verify duplicate creation exceptions.

This is a generic test to mimic the behavior of any UCS Manager driver function that creates a profile on the UCS Manager. The first time the profile is created, the create succeeds if all parameters are correct. If we attempt to create it any number of times after that, UCS Manager throws an exception. This test code mimics that behavior by using counter to keep track of how many times ‘update_serviceprofile’ is being called. counter == 0 -> Simulates invalid input, so raise an exception. counter == 1 -> Simulates valid inputs and 1st creation request. counter > 1 -> Simulates duplicate creation request and results in UCS Manager throwing a duplicate creation request.

test_get_physnet(*args, **kwargs)
test_get_ucsm_ip_for_host_failure(*args, **kwargs)

Tests that case where UCSM does not control this host.

test_get_ucsm_ip_for_host_success(*args, **kwargs)

Verfies that ucsm_ip to Service Profile mapping is successful.

test_host_id_to_hostname(*args, **kwargs)
test_learn_sp_and_template_for_host_error(*args, **kwargs)

Tests case where learning config from UCSM gives diff host.`

test_learn_sp_and_template_for_host_exp(*args, **kwargs)

Tests case where reading config from UCSM generates exception.

test_learn_sp_and_template_for_host_success(*args, **kwargs)

Tests case where learning config from UCSM gives correct host.`

test_normal_vnic_type(*args, **kwargs)

Verifies NORMAL vnic type is not supported.

test_parse_pci_vendor_config(*args, **kwargs)

Verifies parsing of both good and bad pci vendor config.

test_parse_ucsm_host_config(*args, **kwargs)

Verifies parsing of Hostname:Service Profile config.

test_parse_virtio_eth_ports(*args, **kwargs)
test_parsing_of_single_ucsm_config(*args, **kwargs)
test_port_profile_delete_on_ucsm(*args, **kwargs)

Verifies that the PP delete retry logic.

test_port_profile_delete_table_add(*args, **kwargs)

Verifies that add and get of 1 PP to delete table works.

test_port_supported_deviceowner(*args, **kwargs)

Verifies detection of supported set of device owners for ports.

test_port_supported_status(*args, **kwargs)

Verifies detection of supported status values for ports.

test_port_unsupported_deviceowner(*args, **kwargs)

Verifies detection of unsupported device owners for ports.

test_port_unsupported_status(*args, **kwargs)

Verifies detection of unsupported status values for ports.

test_pp_delete_table_add_multiple(*args, **kwargs)

Verifies that add and get of multiple PPs to delete table works.

test_remove_non_existent_port_profile_from_table(*args, **kwargs)
test_remove_port_profile_from_table(*args, **kwargs)

Verifies that removing entry from PP delete table works.

test_sriov_update_port_precommit(*args, **kwargs)

Verifies MD does not create Port Profiles for SR-IOV ports.

test_sriov_vnic_type_and_vendor_info(*args, **kwargs)

Verifies SR-IOV port and MACVTAP vnic_type are supported.

test_ucs_manager_disconnect_fail(*args, **kwargs)

Verifies UCS Manager driver is called with correct parameters.

test_ucsm_host_config_with_path(*args, **kwargs)

Verifies that ucsm_host_list can contain SP paths.

test_unsupported_vnic_type_and_vendor_info(*args, **kwargs)

Verifies unsupported pci vendor is rejected.

test_update_port_postcommit_direct(*args, **kwargs)

Verifies UCS Manager driver is called with correct parameters.

test_update_port_postcommit_failure(*args, **kwargs)

Verifies duplicate Port Profiles are not being created.

test_update_port_postcommit_macvtap(*args, **kwargs)

Verifies UCS Manager driver is called with correct parameters.

test_update_port_postcommit_normal(*args, **kwargs)

Verifies UCS Manager driver is called with correct parameters.

test_update_port_postcommit_success(*args, **kwargs)

Verifies duplicate Port Profiles are not being created.

test_update_port_postcommit_vnic_template(*args, **kwargs)

Verifies UCSM driver works correcly with VNIC Templates.

test_validate_vm_fex_port_bad(*args, **kwargs)

Verifies unsupported pci vendor is not VM-FEX capable.

test_validate_vm_fex_port_cisco(*args, **kwargs)

Verifies port’s pci vendor info makes it VM-FEX capable.

test_validate_vm_fex_port_sriov(*args, **kwargs)

Verifies valid SR-IOV port is not VM-FEX capable.

test_virtio_update_port_precommit(*args, **kwargs)

Verifies MD adds VNIC Template to DB for Neutron virtio ports.

test_vmfex_update_port_precommit(*args, **kwargs)

Verifies MD saves relevant info for VM-FEX ports into DB.

test_vmfex_vnic_type_and_vendor_info(*args, **kwargs)

Verifies VM-FEX port is recognized as a supported vendor.

test_vnic_template_db_methods(*args, **kwargs)

Verifies VNIC Template DB methods.