Module Import alias Import alias Import alias ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Assign NameStore ListLoad TupleLoad Str Num TupleLoad Str Num TupleLoad Str Num FunctionDef arguments args NameParam defaults body Assign NameStore Dict Str ListLoad Str With Call AttributeLoad NameLoad attr Str keyword Call AttributeLoad NameLoad attr keyword Str keyword Str body With Call AttributeLoad NameLoad attr Str keyword NameLoad body With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Dict Str ListLoad Str With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Assign NameStore ListLoad TupleLoad Str Num TupleLoad Str Num TupleLoad Str Num Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign NameStore Dict Str ListLoad Str With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword ListLoad TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad Call NameLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad Call NameLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str keyword NameLoad body With Call AttributeLoad NameLoad attr Str NameStore body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Dict Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr NameStore body With Call AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str body With Call AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Dict Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str NameStore body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Dict Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults vararg body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list Call AttributeLoad NameLoad attr Str keyword Dict Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults vararg body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str keyword Dict Num NameLoad Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str decorator_list ClassDef bases AttributeLoad NameLoad attr body Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore ListLoad TupleLoad Str Num TupleLoad Str Num TupleLoad Str Num Assign NameStore Dict Num Num Num Str Str Str Assign NameStore Dict Str Str Str Str Str Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign NameStore Call NameLoad With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad With Call AttributeLoad NameLoad attr Str keyword Dict Num AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad Call NameLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad Call NameLoad NameLoad Index Num decorator_list Call AttributeLoad NameLoad attr Str keyword ListLoad TupleLoad NameLoad Num FunctionDef arguments args NameParam defaults vararg body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list Call AttributeLoad NameLoad attr Str keyword NameLoad FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str body With Call AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Num Num decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Num Num decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Num Num decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Num Num decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Num Num decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Num Num decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword Dict Num AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword ListLoad AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr ListComp SubscriptLoad NameLoad Index Num comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Assign NameStore Str Assign NameStore Num Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad Str Str Assign NameStore Dict Str Str Str Str Str Str Assign NameStore ListLoad TupleLoad Str Num TupleLoad Str Num TupleLoad Str Num FunctionDef arguments args NameParam defaults body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list With Call AttributeLoad NameLoad attr Str keyword NameLoad body With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body With Call AttributeLoad NameLoad attr Str keyword NameLoad body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword NameLoad body With Call AttributeLoad NameLoad attr Str keyword ListLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr Str keyword NameLoad body With Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str keyword Call NameLoad FunctionDef arguments args NameParam defaults vararg body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str keyword ListLoad NameLoad Str Call AttributeLoad NameLoad attr Str keyword NameLoad FunctionDef arguments args NameParam NameParam defaults vararg body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str decorator_list Call AttributeLoad NameLoad attr Str keyword ListLoad Str Str Call AttributeLoad NameLoad attr Str keyword NameLoad FunctionDef arguments args NameParam NameParam defaults vararg body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call AttributeLoad NameLoad attr Str keyword Call NameLoad Call AttributeLoad NameLoad attr Str decorator_list
N/A N/A os N/A mock N/A testtools neutron.plugins.ml2.drivers.mech_sriov.agent.common exceptions exc neutron.plugins.ml2.drivers.mech_sriov.agent eswitch_manager esm neutron.tests base TestCreateESwitchManager N/A N/A base BaseTestCase N/A N/A SCANNED_DEVICES N/A N/A 0000:06:00.1 0 N/A 0000:06:00.2 1 N/A 0000:06:00.3 2 test_create_eswitch_mgr_fail N/A N/A self N/A N/A N/A device_mappings N/A physnet1 N/A p6p1 N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.scan_vf_devices side_effect N/A N/A exc InvalidDeviceError dev_name p6p1 reason device not found N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.is_assigned_vf return_value True N/A N/A N/A N/A testtools ExpectedException N/A exc InvalidDeviceError N/A N/A N/A N/A N/A N/A esm ESwitchManager discover_devices device_mappings None N/A test_create_eswitch_mgr_ok N/A N/A self N/A N/A N/A device_mappings N/A physnet1 N/A p6p1 N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.scan_vf_devices return_value N/A self SCANNED_DEVICES N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.is_assigned_vf return_value True N/A N/A N/A N/A N/A N/A esm ESwitchManager discover_devices device_mappings None N/A N/A TestESwitchManagerApi N/A N/A base BaseTestCase N/A N/A SCANNED_DEVICES N/A N/A 0000:06:00.1 0 N/A 0000:06:00.2 1 N/A 0000:06:00.3 2 N/A ASSIGNED_MAC 00:00:00:00:00:66 N/A PCI_SLOT 0000:06:00.1 N/A WRONG_MAC 00:00:00:00:00:67 N/A WRONG_PCI 0000:06:00.6 setUp N/A N/A self N/A N/A N/A N/A N/A N/A super TestESwitchManagerApi self setUp N/A device_mappings N/A physnet1 N/A p6p1 N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.scan_vf_devices return_value N/A self SCANNED_DEVICES N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.is_assigned_vf return_value True N/A N/A N/A self eswitch_mgr N/A N/A esm ESwitchManager N/A N/A N/A N/A self eswitch_mgr discover_devices device_mappings None N/A test_get_assigned_devices_info N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_assigned_devices_info return_value N/A N/A N/A self ASSIGNED_MAC N/A self PCI_SLOT N/A N/A result N/A N/A N/A self eswitch_mgr get_assigned_devices_info N/A N/A N/A self assertIn N/A self ASSIGNED_MAC N/A N/A list result N/A 0 N/A N/A N/A self assertIn N/A self PCI_SLOT N/A N/A list result N/A 0 N/A test_get_device_status_true N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_pci_device return_value N/A self ASSIGNED_MAC N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_device_state return_value True N/A N/A result N/A N/A N/A self eswitch_mgr get_device_state N/A self ASSIGNED_MAC N/A self PCI_SLOT N/A N/A N/A self assertTrue result N/A test_get_device_status_false N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_pci_device return_value N/A self ASSIGNED_MAC N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_device_state return_value False N/A N/A result N/A N/A N/A self eswitch_mgr get_device_state N/A self ASSIGNED_MAC N/A self PCI_SLOT N/A N/A N/A self assertFalse result N/A test_get_device_status_mismatch N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_pci_device return_value N/A self ASSIGNED_MAC N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_device_state return_value True N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.LOG.warning log_mock N/A N/A result N/A N/A N/A self eswitch_mgr get_device_state N/A self WRONG_MAC N/A self PCI_SLOT N/A N/A N/A log_mock assert_called_with device pci mismatch: %(device_mac)s - %(pci_slot)s N/A pci_slot device_mac N/A self PCI_SLOT N/A self WRONG_MAC N/A N/A N/A self assertFalse result N/A test_set_device_status N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_pci_device return_value N/A self ASSIGNED_MAC N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.set_device_state N/A N/A N/A N/A N/A self eswitch_mgr set_device_state N/A self ASSIGNED_MAC N/A self PCI_SLOT True N/A test_set_device_max_rate N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_pci_device return_value N/A self ASSIGNED_MAC get_pci_mock N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.set_device_max_rate set_device_max_rate_mock N/A N/A N/A N/A N/A self eswitch_mgr set_device_max_rate N/A self ASSIGNED_MAC N/A self PCI_SLOT 1000 N/A N/A N/A get_pci_mock assert_called_once_with N/A self PCI_SLOT N/A N/A N/A set_device_max_rate_mock assert_called_once_with N/A self PCI_SLOT 1000 N/A test_set_device_status_mismatch N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_pci_device return_value N/A self ASSIGNED_MAC N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.set_device_state N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.LOG.warning log_mock N/A N/A N/A N/A N/A self eswitch_mgr set_device_state N/A self WRONG_MAC N/A self PCI_SLOT True N/A N/A N/A log_mock assert_called_with device pci mismatch: %(device_mac)s - %(pci_slot)s N/A pci_slot device_mac N/A self PCI_SLOT N/A self WRONG_MAC N/A _mock_device_exists N/A N/A self pci_slot mac_address expected_result N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_pci_device return_value N/A self ASSIGNED_MAC N/A N/A result N/A N/A N/A self eswitch_mgr device_exists mac_address pci_slot N/A N/A N/A self assertEqual expected_result result N/A test_device_exists_true N/A N/A self N/A N/A N/A N/A N/A self _mock_device_exists N/A self PCI_SLOT N/A self ASSIGNED_MAC True N/A test_device_exists_false N/A N/A self N/A N/A N/A N/A N/A self _mock_device_exists N/A self WRONG_PCI N/A self WRONG_MAC False N/A test_device_exists_mismatch N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.get_pci_device return_value N/A self ASSIGNED_MAC N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.LOG.warning log_mock N/A N/A result N/A N/A N/A self eswitch_mgr device_exists N/A self WRONG_MAC N/A self PCI_SLOT N/A N/A N/A log_mock assert_called_with device pci mismatch: %(device_mac)s - %(pci_slot)s N/A pci_slot device_mac N/A self PCI_SLOT N/A self WRONG_MAC N/A N/A N/A self assertFalse result N/A test_clear_max_rate_existing_pci_slot N/A N/A self max_rate_mock N/A args N/A N/A N/A N/A N/A self eswitch_mgr clear_max_rate N/A self PCI_SLOT N/A N/A N/A max_rate_mock assert_called_once_with N/A self PCI_SLOT 0 N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.get_assigned_macs return_value N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.set_device_max_rate test_clear_max_rate_exist_and_assigned_pci N/A N/A self max_rate_mock N/A args N/A N/A N/A N/A N/A self eswitch_mgr clear_max_rate N/A self PCI_SLOT N/A N/A N/A self assertFalse N/A max_rate_mock called N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.get_assigned_macs return_value N/A 0 ASSIGNED_MAC N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.set_device_max_rate test_clear_max_rate_nonexisting_pci_slot N/A N/A self max_rate_mock N/A N/A N/A N/A N/A N/A self eswitch_mgr clear_max_rate N/A self WRONG_PCI N/A N/A N/A self assertFalse N/A max_rate_mock called N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.EmbSwitch.set_device_max_rate N/A TestEmbSwitch N/A N/A base BaseTestCase N/A N/A DEV_NAME eth2 N/A PHYS_NET default N/A ASSIGNED_MAC 00:00:00:00:00:66 N/A PCI_SLOT 0000:06:00.1 N/A WRONG_PCI_SLOT 0000:06:00.4 N/A SCANNED_DEVICES N/A N/A 0000:06:00.1 0 N/A 0000:06:00.2 1 N/A 0000:06:00.3 2 N/A VF_TO_MAC_MAPPING N/A 0 1 2 00:00:00:00:00:11 00:00:00:00:00:22 00:00:00:00:00:33 N/A EXPECTED_MAC_TO_PCI N/A 00:00:00:00:00:11 00:00:00:00:00:22 00:00:00:00:00:33 0000:06:00.1 0000:06:00.2 0000:06:00.3 setUp N/A N/A self N/A N/A N/A N/A N/A N/A super TestEmbSwitch self setUp N/A exclude_devices N/A set N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.scan_vf_devices return_value N/A self SCANNED_DEVICES N/A N/A N/A self emb_switch N/A N/A esm EmbSwitch N/A self PHYS_NET N/A self DEV_NAME exclude_devices N/A test_get_assigned_devices_info N/A N/A self N/A args N/A N/A emb_switch N/A N/A esm EmbSwitch N/A self PHYS_NET N/A self DEV_NAME N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.get_assigned_macs return_value N/A 0 N/A self ASSIGNED_MAC N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.is_assigned_vf return_value True N/A N/A result N/A N/A emb_switch get_assigned_devices_info N/A N/A N/A self assertIn N/A self ASSIGNED_MAC N/A N/A list result N/A 0 N/A N/A N/A self assertIn N/A self PCI_SLOT N/A N/A list result N/A 0 N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.scan_vf_devices return_value N/A N/A PCI_SLOT 0 test_get_assigned_devices_info_multiple_slots N/A N/A self N/A args N/A N/A emb_switch N/A N/A esm EmbSwitch N/A self PHYS_NET N/A self DEV_NAME N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.get_assigned_macs return_value N/A self VF_TO_MAC_MAPPING N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.is_assigned_vf return_value True N/A N/A devices_info N/A N/A emb_switch get_assigned_devices_info N/A device_info devices_info N/A N/A mac N/A device_info N/A 0 N/A pci_slot N/A device_info N/A 1 N/A N/A N/A self assertEqual N/A N/A self EXPECTED_MAC_TO_PCI N/A mac pci_slot N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.scan_vf_devices return_value SCANNED_DEVICES test_get_assigned_devices_empty N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.is_assigned_vf return_value False N/A N/A result N/A N/A N/A self emb_switch get_assigned_devices_info N/A N/A N/A self assertFalse result N/A test_get_device_state_ok N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.get_vf_state return_value False N/A N/A result N/A N/A N/A self emb_switch get_device_state N/A self PCI_SLOT N/A N/A N/A self assertFalse result N/A test_get_device_state_fail N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.get_vf_state return_value False N/A N/A N/A N/A self assertRaises N/A exc InvalidPciSlotError N/A N/A self emb_switch get_device_state N/A self WRONG_PCI_SLOT N/A test_set_device_state_ok N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.set_vf_state N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.LOG.warning log_mock N/A N/A N/A N/A N/A self emb_switch set_device_state N/A self PCI_SLOT True N/A N/A N/A self assertEqual 0 N/A log_mock call_count N/A test_set_device_state_fail N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.set_vf_state N/A N/A N/A N/A self assertRaises N/A exc InvalidPciSlotError N/A N/A self emb_switch set_device_state N/A self WRONG_PCI_SLOT True N/A test_set_device_spoofcheck_ok N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.set_vf_spoofcheck set_vf_spoofcheck_mock N/A N/A N/A N/A N/A self emb_switch set_device_spoofcheck N/A self PCI_SLOT True N/A N/A N/A self assertTrue N/A set_vf_spoofcheck_mock called N/A test_set_device_spoofcheck_fail N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.set_vf_spoofcheck N/A N/A N/A N/A self assertRaises N/A exc InvalidPciSlotError N/A N/A self emb_switch set_device_spoofcheck N/A self WRONG_PCI_SLOT True N/A test_set_device_max_rate_ok N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.set_vf_max_rate pci_lib_mock N/A N/A N/A N/A N/A self emb_switch set_device_max_rate N/A self PCI_SLOT 2000 N/A N/A N/A pci_lib_mock assert_called_with 0 2 N/A test_set_device_max_rate_ok2 N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.set_vf_max_rate pci_lib_mock N/A N/A N/A N/A N/A self emb_switch set_device_max_rate N/A self PCI_SLOT 99 N/A N/A N/A pci_lib_mock assert_called_with 0 1 N/A test_set_device_max_rate_rounded_ok N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.set_vf_max_rate pci_lib_mock N/A N/A N/A N/A N/A self emb_switch set_device_max_rate N/A self PCI_SLOT 2001 N/A N/A N/A pci_lib_mock assert_called_with 0 2 N/A test_set_device_max_rate_rounded_ok2 N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.set_vf_max_rate pci_lib_mock N/A N/A N/A N/A N/A self emb_switch set_device_max_rate N/A self PCI_SLOT 2499 N/A N/A N/A pci_lib_mock assert_called_with 0 2 N/A test_set_device_max_rate_rounded_ok3 N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.set_vf_max_rate pci_lib_mock N/A N/A N/A N/A N/A self emb_switch set_device_max_rate N/A self PCI_SLOT 2500 N/A N/A N/A pci_lib_mock assert_called_with 0 3 N/A test_set_device_max_rate_disable N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.set_vf_max_rate pci_lib_mock N/A N/A N/A N/A N/A self emb_switch set_device_max_rate N/A self PCI_SLOT 0 N/A N/A N/A pci_lib_mock assert_called_with 0 0 N/A test_set_device_max_rate_fail N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.set_vf_max_rate N/A N/A N/A N/A self assertRaises N/A exc InvalidPciSlotError N/A N/A self emb_switch set_device_max_rate N/A self WRONG_PCI_SLOT 1000 N/A test_get_pci_device N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.get_assigned_macs return_value N/A 0 N/A self ASSIGNED_MAC N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.is_assigned_vf return_value True N/A N/A result N/A N/A N/A self emb_switch get_pci_device N/A self PCI_SLOT N/A N/A N/A self assertEqual N/A self ASSIGNED_MAC result N/A test_get_pci_device_fail N/A N/A self N/A N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.get_assigned_macs return_value N/A N/A self ASSIGNED_MAC N/A N/A N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.eswitch_manager.PciOsWrapper.is_assigned_vf return_value True N/A N/A result N/A N/A N/A self emb_switch get_pci_device N/A self WRONG_PCI_SLOT N/A N/A N/A self assertIsNone result N/A test_get_pci_list N/A N/A self N/A N/A N/A result N/A N/A N/A self emb_switch get_pci_slot_list N/A N/A N/A self assertEqual N/A N/A tup N/A 0 N/A tup N/A self SCANNED_DEVICES N/A sorted result N/A N/A TestPciOsWrapper N/A N/A base BaseTestCase N/A N/A DEV_NAME p7p1 N/A VF_INDEX 1 N/A DIR_CONTENTS N/A mlx4_port1 virtfn0 virtfn1 virtfn2 N/A DIR_CONTENTS_NO_MATCH N/A mlx4_port1 mlx4_port1 N/A LINKS N/A virtfn0 virtfn1 virtfn2 ../0000:04:00.1 ../0000:04:00.2 ../0000:04:00.3 N/A PCI_SLOTS N/A N/A 0000:04:00.1 0 N/A 0000:04:00.2 1 N/A 0000:04:00.3 2 test_scan_vf_devices N/A N/A self N/A N/A _get_link N/A N/A file_path N/A N/A N/A file_name N/A N/A N/A os path basename file_path N/A N/A N/A self LINKS N/A file_name N/A N/A N/A N/A mock patch os.path.isdir return_value True N/A N/A N/A N/A mock patch os.listdir return_value N/A self DIR_CONTENTS N/A N/A N/A N/A mock patch os.path.islink return_value True N/A N/A N/A N/A mock patch os.readlink side_effect _get_link N/A N/A result N/A N/A N/A esm PciOsWrapper scan_vf_devices N/A self DEV_NAME N/A N/A N/A self assertEqual N/A self PCI_SLOTS result N/A test_scan_vf_devices_no_dir N/A N/A self N/A N/A N/A N/A N/A mock patch os.path.isdir return_value False N/A N/A N/A N/A self assertRaises N/A exc InvalidDeviceError N/A N/A esm PciOsWrapper scan_vf_devices N/A self DEV_NAME N/A test_scan_vf_devices_no_content N/A N/A self N/A N/A N/A N/A N/A mock patch os.path.isdir return_value True N/A N/A N/A N/A mock patch os.listdir return_value N/A N/A N/A N/A N/A self assertRaises N/A exc InvalidDeviceError N/A N/A esm PciOsWrapper scan_vf_devices N/A self DEV_NAME N/A test_scan_vf_devices_no_match N/A N/A self N/A N/A N/A N/A N/A mock patch os.path.isdir return_value True N/A N/A N/A N/A mock patch os.listdir return_value N/A self DIR_CONTENTS_NO_MATCH N/A N/A N/A N/A self assertRaises N/A exc InvalidDeviceError N/A N/A esm PciOsWrapper scan_vf_devices N/A self DEV_NAME N/A test_is_assigned_vf_true N/A N/A self N/A args N/A N/A N/A N/A self assertTrue N/A N/A N/A esm PciOsWrapper is_assigned_vf N/A self DEV_NAME N/A self VF_INDEX N/A N/A N/A mock patch os.listdir side_effect N/A OSError test_is_assigned_vf_false N/A N/A self N/A args N/A N/A N/A N/A self assertFalse N/A N/A N/A esm PciOsWrapper is_assigned_vf N/A self DEV_NAME N/A self VF_INDEX N/A N/A N/A mock patch os.listdir return_value N/A DEV_NAME eth1 N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.is_macvtap_assigned return_value False test_is_assigned_vf_macvtap N/A N/A self mock_is_macvtap_assigned N/A args N/A N/A N/A N/A N/A esm PciOsWrapper is_assigned_vf N/A self DEV_NAME N/A self VF_INDEX N/A N/A N/A mock_is_macvtap_assigned called_with N/A self VF_INDEX eth0 N/A N/A N/A mock patch os.listdir return_value N/A eth0 eth1 N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.is_macvtap_assigned return_value True test_is_assigned_vf_macvtap_failure N/A N/A self mock_is_macvtap_assigned N/A args N/A N/A N/A N/A N/A esm PciOsWrapper is_assigned_vf N/A self DEV_NAME N/A self VF_INDEX N/A N/A N/A self assertFalse N/A mock_is_macvtap_assigned called N/A N/A N/A mock patch os.listdir side_effect N/A OSError N/A N/A mock patch neutron.plugins.ml2.drivers.mech_sriov.agent.pci_lib.PciDeviceIPWrapper.is_macvtap_assigned N/A