# Path: netman/core/objects/port_modes.py
# ACCESS = "ACCESS"
# 
# TRUNK = "TRUNK"


from hamcrest import equal_to, assert_that, has_length, is_, none
from netaddr import IPNetwork, IPAddress
from netman.core.objects.access_groups import IN, OUT
from netman.core.objects.exceptions import UnknownVlan, UnknownInterface, \
    UnknownResource
from netman.core.objects.interface_states import OFF, ON
from netman.core.objects.port_modes import ACCESS, TRUNK
from tests.adapters.configured_test_case import ConfiguredTestCase, skip_on_switches

        # TODO(jprovost) Unify switch adapters to raise the same exception
        # Dell 10G raises UnknownInterface
        # other raises UnknownVlan
        with self.assertRaises(UnknownResource):
            self.client.add_trunk_vlan('42/9999', 2999)

        # TODO(jprovost) Behavior is inconsistent across switch adapters
        # Brocade raises UnknownInterface
        # Dell 10G raises NativeVlanNotSet
        # Cisco does not raise
        try:
            self.client.unset_interface_native_vlan(self.test_port)
        except UnknownResource:
            pass

        self.client.add_vlan(2999, name="my-test-vlan")

        with self.assertRaises(UnknownInterface):
            self.client.set_access_vlan('42/9999', 2999)

        # TODO(jprovost) Unify switch adapters to raise the same exception
        # Dell 10G raises UnknownInterface
        # other raises TrunkVlanNotSet
        with self.assertRaises(UnknownResource):
            self.client.remove_trunk_vlan('42/9999', 2999)

        with self.assertRaises(UnknownInterface):
            self.client.set_interface_native_vlan('42/9999', 2999)


# Path: netman/core/objects/port_modes.py
# ACCESS = "ACCESS"
# 
# TRUNK = "TRUNK"


# Path: tests/adapters/unified_tests/vlan_management_test.py
from hamcrest import equal_to, assert_that, has_length, is_, none
from netaddr import IPNetwork, IPAddress
from netman.core.objects.access_groups import IN, OUT
from netman.core.objects.exceptions import UnknownVlan, UnknownInterface, \
    UnknownResource
from netman.core.objects.interface_states import OFF, ON
from netman.core.objects.port_modes import ACCESS, TRUNK
from tests.adapters.configured_test_case import ConfiguredTestCase, skip_on_switches


        # TODO(jprovost) Unify switch adapters to raise the same exception
        # Dell 10G raises UnknownInterface
        # other raises UnknownVlan
        with self.assertRaises(UnknownResource):
            self.client.add_trunk_vlan('42/9999', 2999)

        # TODO(jprovost) Behavior is inconsistent across switch adapters
        # Brocade raises UnknownInterface
        # Dell 10G raises NativeVlanNotSet
        # Cisco does not raise
        try:
            self.client.unset_interface_native_vlan(self.test_port)
        except UnknownResource:
            pass

        self.client.add_vlan(2999, name="my-test-vlan")

        with self.assertRaises(UnknownInterface):
            self.client.set_access_vlan('42/9999', 2999)

        # TODO(jprovost) Unify switch adapters to raise the same exception
        # Dell 10G raises UnknownInterface
        # other raises TrunkVlanNotSet
        with self.assertRaises(UnknownResource):
            self.client.remove_trunk_vlan('42/9999', 2999)

        with self.assertRaises(UnknownInterface):
            self.client.set_interface_native_vlan('42/9999', 2999)


    @skip_on_switches("juniper", "juniper_qfx_copper", "dell", "dell_telnet", "dell10g", "dell10g_telnet", "juniper_mx", "arista_http")