

@with_protocol
def test_switchport_mode(self, t):
    enable(t)
    configuring_vlan(t, 1264)
    configuring_vlan(t, 1265)
    assert_interface_configuration(t, 'ethernet 1/g1', [''])
    configuring_interface(t, 'ethernet 1/g1', do='switchport mode access')
    assert_interface_configuration(t, 'ethernet 1/g1', [''])
    configuring_a_vlan_on_interface(t, 'ethernet 1/g1', do='switchport access vlan 1264')
    assert_interface_configuration(t, 'ethernet 1/g1', ['switchport access vlan 1264'])
    configuring_interface(t, 'ethernet 1/g1', do='switchport mode access')
    assert_interface_configuration(t, 'ethernet 1/g1', ['switchport access vlan 1264'])
    configuring_interface(t, 'ethernet 1/g1', do='switchport mode general')
    assert_interface_configuration(t, 'ethernet 1/g1', ['switchport mode general'])
    configuring_interface(t, 'ethernet 1/g1', do='switchport general pvid 1264')
    assert_interface_configuration(t, 'ethernet 1/g1', ['switchport mode general', 'switchport general pvid 1264'])
    configuring_a_vlan_on_interface(t, 'ethernet 1/g1', do='switchport general allowed vlan add 1265')
    assert_interface_configuration(t, 'ethernet 1/g1', ['switchport mode general', 'switchport general pvid 1264', 'switchport general allowed vlan add 1265'])
    configuring_interface(t, 'ethernet 1/g1', do='switchport mode trunk')
    assert_interface_configuration(t, 'ethernet 1/g1', ['switchport mode trunk'])
    configuring_a_vlan_on_interface(t, 'ethernet 1/g1', do='switchport trunk allowed vlan add 1265')
    assert_interface_configuration(t, 'ethernet 1/g1', ['switchport mode trunk', 'switchport trunk allowed vlan add 1265'])
    configuring_interface(t, 'ethernet 1/g1', do='switchport mode access')
    assert_interface_configuration(t, 'ethernet 1/g1', [''])
    unconfigure_vlan(t, 1265)
    unconfigure_vlan(t, 1264)

dataset/ETHPy150Open internap/fake-switches/tests/dell/test_configure_interface.py DellConfigureInterfaceTest.test_switchport_mode/original