# Path: neutron/plugins/ml2/drivers/mech_sriov/agent/pci_lib.py
# LOG = logging.getLogger(__name__)
# class LinkState(enum.Enum):
# class PciDeviceIPWrapper(ip_lib.IPWrapper):
#     def __init__(self, dev_name):
#     def get_assigned_macs(self, vf_list):
#     def get_vf_state(self, vf_index):
#     def set_vf_state(self, vf_index, state, auto=False):
#     def set_vf_spoofcheck(self, vf_index, enabled):
#     def set_vf_rate(self, vf_index, rates):


from unittest import mock
from neutron.agent.linux import ip_lib
from neutron.plugins.ml2.drivers.mech_sriov.agent import pci_lib
from neutron.tests import base
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.




class TestPciLib(base.BaseTestCase):
    DEV_NAME = "p7p1"

    VF_INDEX = 1
    VFS_LIST = {0: {'mac': 'fa:16:3e:b4:81:ac', 'link_state': 2},
                1: {'mac': '00:00:00:00:00:11', 'link_state': 1},
                2: {'mac': 'fa:16:3e:68:4e:79', 'link_state': 0}}

    MAC_MAPPING = {
        0: "fa:16:3e:b4:81:ac",
        1: "00:00:00:00:00:11",
        2: "fa:16:3e:68:4e:79",
    }

    STATE_MAPPING = {  # VF index: state (string), according to VFS_LIST
        0: pci_lib.LinkState.disable.name,
        1: pci_lib.LinkState.enable.name,
        2: pci_lib.LinkState.auto.name,
    }

    def setUp(self):
        super(TestPciLib, self).setUp()

# Path: neutron/plugins/ml2/drivers/mech_sriov/agent/pci_lib.py
# LOG = logging.getLogger(__name__)
# class LinkState(enum.Enum):
# class PciDeviceIPWrapper(ip_lib.IPWrapper):
#     def __init__(self, dev_name):
#     def get_assigned_macs(self, vf_list):
#     def get_vf_state(self, vf_index):
#     def set_vf_state(self, vf_index, state, auto=False):
#     def set_vf_spoofcheck(self, vf_index, enabled):
#     def set_vf_rate(self, vf_index, rates):


# Path: neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_pci_lib.py
from unittest import mock
from neutron.agent.linux import ip_lib
from neutron.plugins.ml2.drivers.mech_sriov.agent import pci_lib
from neutron.tests import base

# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.




class TestPciLib(base.BaseTestCase):
    DEV_NAME = "p7p1"

    VF_INDEX = 1
    VFS_LIST = {0: {'mac': 'fa:16:3e:b4:81:ac', 'link_state': 2},
                1: {'mac': '00:00:00:00:00:11', 'link_state': 1},
                2: {'mac': 'fa:16:3e:68:4e:79', 'link_state': 0}}

    MAC_MAPPING = {
        0: "fa:16:3e:b4:81:ac",
        1: "00:00:00:00:00:11",
        2: "fa:16:3e:68:4e:79",
    }

    STATE_MAPPING = {  # VF index: state (string), according to VFS_LIST
        0: pci_lib.LinkState.disable.name,
        1: pci_lib.LinkState.enable.name,
        2: pci_lib.LinkState.auto.name,
    }

    def setUp(self):
        super(TestPciLib, self).setUp()

        self.pci_wrapper = pci_lib.PciDeviceIPWrapper(self.DEV_NAME)