def test_command_add_vlan(self, t): enable(t) t.write("conf t") t.read("my_arista(config)#") t.write("vlan 123") t.read("my_arista(config-vlan-123)#") t.write("name shizzle") t.read("my_arista(config-vlan-123)#") t.write("exit") t.read("my_arista(config)#") t.write("exit") t.read("my_arista#") t.write("show vlan 123") t.readln("VLAN Name Status Ports") t.readln( "----- -------------------------------- --------- -------------------------------" ) t.readln("123 shizzle active") t.readln("") t.read("my_arista#") remove_vlan(t, "123") t.write("show vlan 123") t.readln("% VLAN 123 not found in current VLAN database") t.read("my_arista#")
def test_running_config_via_api(self, t, api): enable(t) create_vlan(t, "299") create_interface_vlan(t, "299") configuring_interface_vlan(t, "299", do="ip helper-address 1.1.1.1") configuring_interface_vlan(t, "299", do="ip helper-address 2.2.2.2") result = api.enable("show running-config interfaces Vlan299", strict=True, encoding="text") assert_that( result, is_([{ "command": "show running-config interfaces Vlan299", "encoding": "text", "response": { "output": "interface Vlan299\n ip helper-address 1.1.1.1\n ip helper-address 2.2.2.2\n" }, "result": { "output": "interface Vlan299\n ip helper-address 1.1.1.1\n ip helper-address 2.2.2.2\n" } }])) remove_interface_vlan(t, "299") remove_vlan(t, "299")
def test_switchport_trunk_allowed_vlan_add_errors(self, t): enable(t) t.write("configure terminal") t.read("my_arista(config)#") t.write("interface Ethernet 1") t.read("my_arista(config-if-Et1)#") t.write("switchport trunk allowed vlan add") t.readln("% Incomplete command") t.read("my_arista(config-if-Et1)#") t.write("switchport trunk allowed vlan add 1 2") t.readln("% Invalid input") t.read("my_arista(config-if-Et1)#") t.write("switchport trunk allowed vlan add patate") t.readln("% Invalid input") t.read("my_arista(config-if-Et1)#") t.write( "no switchport trunk allowed vlan whatever this is ignored past mode" ) t.read("my_arista(config-if-Et1)#") t.write("exit") t.read("my_arista(config)#") t.write("exit") t.read("my_arista#")
def test_overlapping_ips(self, t): enable(t) create_vlan(t, "1000") create_interface_vlan(t, "1000") create_vlan(t, "2000") create_interface_vlan(t, "2000") configuring_interface_vlan(t, "1000", do="ip address 2.2.2.2/24") configuring_interface_vlan(t, "1000", do="ip address 3.3.3.3/24 secondary") t.write("configure terminal") t.read("my_arista(config)#") t.write("interface vlan2000") t.read("my_arista(config-if-Vl2000)#") t.write("ip address 2.2.2.75/25") t.readln("% Subnet 2.2.2.0 overlaps with existing subnet 2.2.2.0 of interface Vlan1000") t.read("my_arista(config-if-Vl2000)#") t.write("exit") t.read("my_arista(config)#") t.write("exit") t.read("my_arista#") remove_interface_vlan(t, "2000") remove_vlan(t, "2000") remove_interface_vlan(t, "1000") remove_vlan(t, "1000")
def test_interface_vlan_name_parsing(self, t): enable(t) create_vlan(t, "299") t.write("conf t") t.read("my_arista(config)#") t.write("interface vlan") t.readln("% Incomplete command") t.read("my_arista(config)#") t.write("interface vlan -1") t.readln("% Invalid input") t.read("my_arista(config)#") t.write("interface vlan 4095") t.readln("% Invalid input") t.read("my_arista(config)#") t.write("interface vlan wat") t.readln("% Invalid input") t.read("my_arista(config)#") t.write("interface vlan 123") t.read("my_arista(config-if-Vl123)#") t.write("no interface vlan0123") t.read("my_arista(config)#") t.write("exit") t.read("my_arista#") remove_vlan(t, "299")
def test_switchport_trunk_mode_errors(self, t): enable(t) t.write("configure terminal") t.read("my_arista(config)#") t.write("interface Ethernet 1") t.read("my_arista(config-if-Et1)#") t.write("switchport mode") t.readln("% Incomplete command") t.read("my_arista(config-if-Et1)#") t.write("switchport mode trunk trunk") t.readln("% Invalid input") t.read("my_arista(config-if-Et1)#") t.write("switchport mode waatt") t.readln("% Invalid input") t.read("my_arista(config-if-Et1)#") t.write("no switchport mode whatever this is ignored past mode") t.read("my_arista(config-if-Et1)#") t.write("exit") t.read("my_arista(config)#") t.write("exit") t.read("my_arista#")
def test_interface_with_no_mpls_ip(self, t): enable(t) configuring_interface_vlan(t, "299", do="no mpls ip") assert_interface_configuration(t, "Vlan299", ["interface Vlan299", " no mpls ip"])
def test_remove_unknown_interface_vlan_doesnt_care(self, t): enable(t) t.write("configure terminal") t.read("my_arista(config)#") t.write("no interface vlan 123") t.read("my_arista(config)#")
def test_command_show_vlan_empty(self, t): enable(t) t.write("terminal length 0") t.read("Pagination disabled.") t.read("my_arista#") t.write("show vlan 123") t.readln("% VLAN 123 not found in current VLAN database") t.read("my_arista#")
def test_interface_with_incomplete_command(self, t): enable(t) t.write("configure terminal") t.read("my_arista(config)#") t.write("interface vlan {}".format(self.vlan)) t.read("my_arista(config-if-Vl{})#".format(self.vlan)) t.write("load-interval") t.readln("% Incomplete command")
def test_write_memory_with_commit_delay(self, t): t.child.timeout = 10 enable(t) start_time = time() t.write("write memory") t.readln("Copy completed successfully.") t.read("my_arista#") end_time = time() assert_that((end_time - start_time), greater_than(COMMIT_DELAY))
def test_show_interfaces_switchport_trunk_vlans(self, t): enable(t) create_vlan(t, "13") create_vlan(t, "14") configuring_interface(t, "Et1", do="switchport mode trunk") configuring_interface(t, "Et1", do="switchport trunk allowed vlan 13-14") t.write("show interfaces et1 switchport") t.readln("Name: Et1") t.readln("Switchport: Enabled") t.readln("Administrative Mode: trunk") t.readln("Operational Mode: trunk") t.readln("MAC Address Learning: enabled") t.readln("Dot1q ethertype/TPID: 0x8100 (active)") t.readln("Dot1q Vlan Tag Required (Administrative/Operational): No/No") t.readln("Access Mode VLAN: 1 (default)") t.readln("Trunking Native Mode VLAN: 1 (default)") t.readln("Administrative Native VLAN tagging: disabled") t.readln("Trunking VLANs Enabled: 13-14") t.readln("Static Trunk Groups:") t.readln("Dynamic Trunk Groups:") t.readln("Source interface filtering: enabled") t.readln("") t.read("my_arista#") configuring_interface(t, "Et1", do="switchport trunk allowed vlan none") t.write("show interfaces ethernet 1 switchport") t.readln("Name: Et1") t.readln("Switchport: Enabled") t.readln("Administrative Mode: trunk") t.readln("Operational Mode: trunk") t.readln("MAC Address Learning: enabled") t.readln("Dot1q ethertype/TPID: 0x8100 (active)") t.readln("Dot1q Vlan Tag Required (Administrative/Operational): No/No") t.readln("Access Mode VLAN: 1 (default)") t.readln("Trunking Native Mode VLAN: 1 (default)") t.readln("Administrative Native VLAN tagging: disabled") t.readln("Trunking VLANs Enabled: NONE") t.readln("Static Trunk Groups:") t.readln("Dynamic Trunk Groups:") t.readln("Source interface filtering: enabled") t.readln("") t.read("my_arista#") remove_vlan(t, "13") remove_vlan(t, "14")
def test_interface_with_invalid_load_interval(self, t): enable(t) t.write("configure terminal") t.read("my_arista(config)#") t.write("interface vlan {}".format(self.vlan)) t.read("my_arista(config-if-Vl{})#".format(self.vlan)) t.write("load-interval 800") t.readln("% Invalid input") t.read("my_arista(config-if-Vl{})#".format(self.vlan)) t.write("load-interval a") t.readln("% Invalid input")
def test_setup_in_running_config(self, t): enable(t) create_vlan(t, "299") create_interface_vlan(t, "299") configuring_interface_vlan(t, "299", do="ip helper-address 1.1.1.1") assert_interface_configuration( t, "Vlan299", ["interface Vlan299", " ip helper-address 1.1.1.1"]) configuring_interface_vlan(t, "299", do="ip helper-address one.one.one.one") configuring_interface_vlan(t, "299", do="ip helper-address one-one-one-one") assert_interface_configuration(t, "Vlan299", [ "interface Vlan299", " ip helper-address 1.1.1.1", " ip helper-address one.one.one.one", " ip helper-address one-one-one-one", ]) configuring_interface_vlan(t, "299", do="no ip helper-address one.one.one.one") assert_interface_configuration(t, "Vlan299", [ "interface Vlan299", " ip helper-address 1.1.1.1", " ip helper-address one-one-one-one", ]) configuring_interface_vlan(t, "299", do="ip helper-address 1.1.1.1") assert_interface_configuration(t, "Vlan299", [ "interface Vlan299", " ip helper-address 1.1.1.1", " ip helper-address one-one-one-one", ]) configuring_interface_vlan(t, "299", do="no ip helper-address") assert_interface_configuration(t, "Vlan299", ["interface Vlan299"]) remove_interface_vlan(t, "299") remove_vlan(t, "299")
def test_interface_with_valid_ranges(self, t): enable(t) t.write("configure terminal") t.read("my_arista(config)#") t.write("interface vlan {}".format(self.vlan)) t.read("my_arista(config-if-Vl{})#".format(self.vlan)) t.write("load-interval 0") t.read("my_arista(config-if-Vl{})#".format(self.vlan)) t.write("load-interval 600") t.read("my_arista(config-if-Vl{})#".format(self.vlan)) t.write("load-interval 30") t.read("my_arista(config-if-Vl{})#".format(self.vlan))
def test_running_config_all(self, t): enable(t) t.write("show running-config all") t.readln("! Command: show running-config all") t.readln("! device: my_arista (vEOS, EOS-4.20.8M)") t.readln("!") t.readln("! boot system flash:/vEOS-lab.swi") t.readln("!") t.readln("vlan 1") t.readln(" name default") t.readln(" mac address learning") t.readln(" state active") t.readln("!") t.readln("end") t.read("my_arista#")
def test_configure_trunk_port_by_removing_one_vlan_shows_all_others( self, t): enable(t) configuring_interface(t, "Et1", do="switchport trunk allowed vlan remove 100") assert_interface_configuration(t, "Ethernet1", [ "interface Ethernet1", " switchport trunk allowed vlan 1-99,101-4094" ]) configuring_interface(t, "Et1", do="no switchport trunk allowed vlan") assert_interface_configuration(t, "Ethernet1", ["interface Ethernet1"])
def test_switchport_trunk_allowed_vlan_none_errors(self, t): enable(t) t.write("configure terminal") t.read("my_arista(config)#") t.write("interface Ethernet 1") t.read("my_arista(config-if-Et1)#") t.write("switchport trunk allowed vlan none patate") t.readln("% Invalid input") t.read("my_arista(config-if-Et1)#") t.write("exit") t.read("my_arista(config)#") t.write("exit") t.read("my_arista#")
def test_running_config_multiple_interfaces(self, t, api): enable(t) create_vlan(t, "1000") create_interface_vlan(t, "1000") create_vlan(t, "2000") create_interface_vlan(t, "2000") configuring_interface_vlan(t, "1000", do="ip address 1.1.1.1/27") configuring_interface_vlan(t, "2000", do="ip address 2.2.2.2/27") configuring_interface(t, "Et1", do="switchport trunk allowed vlan 123-124,127") configuring_interface(t, "Et2", do="switchport mode trunk") t.write("show running-config interfaces Et2 vla 2000 ETHERNET 1 vlan 1000") t.readln("interface Ethernet1") t.readln(" switchport trunk allowed vlan 123-124,127") t.readln("interface Ethernet2") t.readln(" switchport mode trunk") t.readln("interface Vlan1000") t.readln(" ip address 1.1.1.1/27") t.readln("interface Vlan2000") t.readln(" ip address 2.2.2.2/27") t.read("my_arista#") result = api.get_config(params="interfaces Vlan1000 Ethernet2 Ethernet1 Vlan2000") assert_that(result, is_([ "interface Ethernet1", " switchport trunk allowed vlan 123-124,127", "interface Ethernet2", " switchport mode trunk", "interface Vlan1000", " ip address 1.1.1.1/27", "interface Vlan2000", " ip address 2.2.2.2/27", "" ])) configuring_interface(t, "Et1", do="no switchport trunk allowed vlan") configuring_interface(t, "Et2", do="no switchport mode") remove_interface_vlan(t, "1000") remove_vlan(t, "1000") remove_interface_vlan(t, "2000") remove_vlan(t, "2000")
def test_removing_ip_address_special_cases(self, t): enable(t) create_vlan(t, "299") t.write("configure terminal") t.read("my_arista(config)#") t.write("interface vlan 299") t.read("my_arista(config-if-Vl299)#") t.write("ip address 1.1.1.1/21") t.read("my_arista(config-if-Vl299)#") t.write("ip address 2.2.2.2/22 secondary") t.read("my_arista(config-if-Vl299)#") t.write("no ip address 2.2.2.2/22") t.readln("% Address 2.2.2.2/22 does not match primary address 1.1.1.1/21") t.read("my_arista(config-if-Vl299)#") t.write("no ip address 2.2.2.2 255.255.252.0") t.readln("% Address 2.2.2.2/22 does not match primary address 1.1.1.1/21") t.read("my_arista(config-if-Vl299)#") t.write("no ip address 1.1.1.1/21") t.readln("% Primary address cannot be deleted before secondary") t.read("my_arista(config-if-Vl299)#") t.write("no ip address 1.1.1.1/21 secondary") t.readln("! Address 1.1.1.1/21 was not found for deletion") t.read("my_arista(config-if-Vl299)#") t.write("no ip address 2.2.2.2/22 secondary") t.read("my_arista(config-if-Vl299)#") t.write("no ip address 1.1.1.1/21") t.read("my_arista(config-if-Vl299)#") t.write("no interface vlan 299") t.read("my_arista(config)#") t.write("exit") t.read("my_arista#") remove_vlan(t, "299")
def test_new_interface_vlan_has_no_internet_address(self, t, api): enable(t) create_vlan(t, "299") create_interface_vlan(t, "299") t.write("show interfaces Vlan299") t.readln("Vlan299 is up, line protocol is up (connected)") t.readln(" Hardware is Vlan, address is 0000.0000.0000 (bia 0000.0000.0000)") t.readln(" IP MTU 1500 bytes") t.readln(" Up 0 minutes, 0 seconds") t.read("my_arista#") result = api.enable("show interfaces Vlan299") assert_that(result, is_([ { "command": "show interfaces Vlan299", "encoding": "json", "result": { "sourceDetail": "", "interfaces": { "Vlan299": { "lastStatusChangeTimestamp": 0.0, "name": "Vlan299", "interfaceStatus": "connected", "burnedInAddress": "00:00:00:00:00:00", "mtu": 1500, "hardware": "vlan", "bandwidth": 0, "forwardingModel": "routed", "lineProtocolStatus": "up", "interfaceAddress": [], "physicalAddress": "00:00:00:00:00:00", "description": "" } } } } ])) remove_interface_vlan(t, "299") remove_vlan(t, "299")
def test_show_ip_helper_address_invalid_values(self, t): enable(t) create_vlan(t, "299") t.write("configure terminal") t.read("my_arista(config)#") t.write("interface vlan 299") t.read("my_arista(config-if-Vl299)#") t.write("ip helper-address") t.readln("% Incomplete command") t.read("my_arista(config-if-Vl299)#") t.write("ip helper-address oh oh") t.readln("% Invalid input") t.read("my_arista(config-if-Vl299)#") t.write("ip helper-address oh;oh") t.readln("% Invalid input") t.read("my_arista(config-if-Vl299)#") t.write("ip helper-address oh_oh") t.readln("% Invalid input") t.read("my_arista(config-if-Vl299)#") t.write( "ip helper-address 1234567890123456789012345678901234567890123456789012345678901234" ) t.read("my_arista(config-if-Vl299)#") t.write( "ip helper-address 12345678901234567890123456789012345678901234567890123456789012345" ) t.readln( "% Host name is invalid. Host name must contain only alphanumeric characters, '.' and '-'." ) t.readln("It must begin and end with an alphanumeric character.") t.readln("Maximum characters in hostname is 64.") t.read("my_arista(config-if-Vl299)#") remove_interface_vlan(t, "299") remove_vlan(t, "299")
def test_show_vlan(self, t): enable(t) create_vlan(t, "123") create_vlan(t, "3333", "some-name") create_vlan(t, "2222", "your-name-is-way-too-long-for-this-pretty-printed-interface-man") t.write("show vlan") t.readln("VLAN Name Status Ports") t.readln("----- -------------------------------- --------- -------------------------------") t.readln("1 default active") t.readln("123 VLAN0123 active") t.readln("2222 your-name-is-way-too-long-for-th active") t.readln("3333 some-name active") t.readln("") t.read("my_arista#") remove_vlan(t, "123") remove_vlan(t, "2222") remove_vlan(t, "3333")
def test_running_config_with_load_interval_via_api(self, t, api): enable(t) configuring_interface_vlan(t, "299", do="load-interval 30") result = api.enable("show running-config interfaces Vlan299", strict=True, encoding="text") assert_that( result, is_([{ "command": "show running-config interfaces Vlan299", "encoding": "text", "response": { "output": "interface Vlan299\n load-interval 30\n" }, "result": { "output": "interface Vlan299\n load-interval 30\n" } }]))
def test_command_add_vlan_errors(self, t): enable(t) t.write("conf t") t.read("my_arista(config)#") t.write("vlan shizzle") t.readln("% Invalid input") t.read("my_arista(config)#") t.write("vlan -1") t.readln("% Invalid input") t.read("my_arista(config)#") t.write("vlan 0") t.readln("% Incomplete command") t.read("my_arista(config)#") t.write("vlan 4095") t.readln("% Invalid input") t.read("my_arista(config)#") t.write("exit") t.read("my_arista#")
def cleanup_vlan(self, t): enable(t) remove_interface_vlan(t, self.vlan) remove_vlan(t, self.vlan)
def test_no_such_command_return_to_prompt(self, t): enable(t) t.write("shizzle") t.readln("% Invalid input") t.read("my_arista#")
def test_write_memory(self, t): enable(t) t.write("write memory") t.readln("Copy completed successfully.") t.read("my_arista#")
def test_show_interfaces(self, t, api): enable(t) create_vlan(t, "299") create_interface_vlan(t, "299") configuring_interface_vlan(t, "299", do="ip address 1.1.1.2/24") create_vlan(t, "777") create_interface_vlan(t, "777") configuring_interface_vlan(t, "777", do="ip address 7.7.7.7/24") t.write("show interfaces") t.readln("Ethernet1 is up, line protocol is up (connected)") t.readln(" Hardware is Ethernet, address is 0000.0000.0000 (bia 0000.0000.0000)") t.readln(" Ethernet MTU 9214 bytes") t.readln(" Full-duplex, Unconfigured, auto negotiation: off, uni-link: n/a") t.readln(" Up 0 minutes, 0 seconds") t.readln(" Loopback Mode : None") t.readln(" 0 link status changes since last clear") t.readln(" Last clearing of \"show interface\" counters never") t.readln(" 0 minutes input rate 0 bps (- with framing overhead), 0 packets/sec") t.readln(" 0 minutes output rate 0 bps (- with framing overhead), 0 packets/sec") t.readln(" 0 packets input, 0 bytes") t.readln(" Received 0 broadcasts, 0 multicast") t.readln(" 0 runts, 0 giants") t.readln(" 0 input errors, 0 CRC, 0 alignment, 0 symbol, 0 input discards") t.readln(" 0 PAUSE input") t.readln(" 0 packets output, 0 bytes") t.readln(" Sent 0 broadcasts, 0 multicast") t.readln(" 0 output errors, 0 collisions") t.readln(" 0 late collision, 0 deferred, 0 output discards") t.readln(" 0 PAUSE output") t.readln("Ethernet2 is up, line protocol is up (connected)") t.readln(" Hardware is Ethernet, address is 0000.0000.0000 (bia 0000.0000.0000)") t.readln(" Ethernet MTU 9214 bytes") t.readln(" Full-duplex, Unconfigured, auto negotiation: off, uni-link: n/a") t.readln(" Up 0 minutes, 0 seconds") t.readln(" Loopback Mode : None") t.readln(" 0 link status changes since last clear") t.readln(" Last clearing of \"show interface\" counters never") t.readln(" 0 minutes input rate 0 bps (- with framing overhead), 0 packets/sec") t.readln(" 0 minutes output rate 0 bps (- with framing overhead), 0 packets/sec") t.readln(" 0 packets input, 0 bytes") t.readln(" Received 0 broadcasts, 0 multicast") t.readln(" 0 runts, 0 giants") t.readln(" 0 input errors, 0 CRC, 0 alignment, 0 symbol, 0 input discards") t.readln(" 0 PAUSE input") t.readln(" 0 packets output, 0 bytes") t.readln(" Sent 0 broadcasts, 0 multicast") t.readln(" 0 output errors, 0 collisions") t.readln(" 0 late collision, 0 deferred, 0 output discards") t.readln(" 0 PAUSE output") t.readln("Vlan299 is up, line protocol is up (connected)") t.readln(" Hardware is Vlan, address is 0000.0000.0000 (bia 0000.0000.0000)") t.readln(" Internet address is 1.1.1.2/24") t.readln(" Broadcast address is 255.255.255.255") t.readln(" IP MTU 1500 bytes") t.readln(" Up 0 minutes, 0 seconds") t.readln("Vlan777 is up, line protocol is up (connected)") t.readln(" Hardware is Vlan, address is 0000.0000.0000 (bia 0000.0000.0000)") t.readln(" Internet address is 7.7.7.7/24") t.readln(" Broadcast address is 255.255.255.255") t.readln(" IP MTU 1500 bytes") t.readln(" Up 0 minutes, 0 seconds") t.read("my_arista#") result = api.enable("show interfaces") expected = [ { "command": "show interfaces", "encoding": "json", "result": { "sourceDetail": "", "interfaces": { "Ethernet1": { "lastStatusChangeTimestamp": 0.0, "name": "Ethernet1", "interfaceStatus": "connected", "autoNegotiate": "unknown", "burnedInAddress": "00:00:00:00:00:00", "loopbackMode": "loopbackNone", "interfaceStatistics": { "inBitsRate": 0.0, "inPktsRate": 0.0, "outBitsRate": 0.0, "updateInterval": 0.0, "outPktsRate": 0.0 }, "mtu": 9214, "hardware": "ethernet", "duplex": "duplexFull", "bandwidth": 0, "forwardingModel": "bridged", "lineProtocolStatus": "up", "interfaceCounters": { "outBroadcastPkts": 0, "outUcastPkts": 0, "totalOutErrors": 0, "inMulticastPkts": 0, "counterRefreshTime": 0.0, "inBroadcastPkts": 0, "outputErrorsDetail": { "deferredTransmissions": 0, "txPause": 0, "collisions": 0, "lateCollisions": 0 }, "inOctets": 0, "outDiscards": 0, "outOctets": 0, "inUcastPkts": 0, "inTotalPkts": 0, "inputErrorsDetail": { "runtFrames": 0, "rxPause": 0, "fcsErrors": 0, "alignmentErrors": 0, "giantFrames": 0, "symbolErrors": 0 }, "linkStatusChanges": 5, "outMulticastPkts": 0, "totalInErrors": 0, "inDiscards": 0 }, "interfaceAddress": [], "physicalAddress": "00:00:00:00:00:00", "description": "" }, "Ethernet2": { "lastStatusChangeTimestamp": 0.0, "name": "Ethernet2", "interfaceStatus": "connected", "autoNegotiate": "unknown", "burnedInAddress": "00:00:00:00:00:00", "loopbackMode": "loopbackNone", "interfaceStatistics": { "inBitsRate": 0.0, "inPktsRate": 0.0, "outBitsRate": 0.0, "updateInterval": 0.0, "outPktsRate": 0.0 }, "mtu": 9214, "hardware": "ethernet", "duplex": "duplexFull", "bandwidth": 0, "forwardingModel": "bridged", "lineProtocolStatus": "up", "interfaceCounters": { "outBroadcastPkts": 0, "outUcastPkts": 0, "totalOutErrors": 0, "inMulticastPkts": 0, "counterRefreshTime": 0.0, "inBroadcastPkts": 0, "outputErrorsDetail": { "deferredTransmissions": 0, "txPause": 0, "collisions": 0, "lateCollisions": 0 }, "inOctets": 0, "outDiscards": 0, "outOctets": 0, "inUcastPkts": 0, "inTotalPkts": 0, "inputErrorsDetail": { "runtFrames": 0, "rxPause": 0, "fcsErrors": 0, "alignmentErrors": 0, "giantFrames": 0, "symbolErrors": 0 }, "linkStatusChanges": 5, "outMulticastPkts": 0, "totalInErrors": 0, "inDiscards": 0 }, "interfaceAddress": [], "physicalAddress": "00:00:00:00:00:00", "description": "" }, "Vlan299": { "bandwidth": 0, "burnedInAddress": "00:00:00:00:00:00", "description": "", "forwardingModel": "routed", "hardware": "vlan", "interfaceAddress": [ { "broadcastAddress": "255.255.255.255", "dhcp": False, "primaryIp": { "address": "1.1.1.2", "maskLen": 24 }, "secondaryIps": {}, "secondaryIpsOrderedList": [], "virtualIp": { "address": "0.0.0.0", "maskLen": 0 }, "virtualSecondaryIps": {}, "virtualSecondaryIpsOrderedList": [] } ], "interfaceStatus": "connected", "lastStatusChangeTimestamp": 0.0, "lineProtocolStatus": "up", "mtu": 1500, "name": "Vlan299", "physicalAddress": "00:00:00:00:00:00" }, "Vlan777": { "bandwidth": 0, "burnedInAddress": "00:00:00:00:00:00", "description": "", "forwardingModel": "routed", "hardware": "vlan", "interfaceAddress": [ { "broadcastAddress": "255.255.255.255", "dhcp": False, "primaryIp": { "address": "7.7.7.7", "maskLen": 24 }, "secondaryIps": {}, "secondaryIpsOrderedList": [], "virtualIp": { "address": "0.0.0.0", "maskLen": 0 }, "virtualSecondaryIps": {}, "virtualSecondaryIpsOrderedList": [] } ], "interfaceStatus": "connected", "lastStatusChangeTimestamp": 0.0, "lineProtocolStatus": "up", "mtu": 1500, "name": "Vlan777", "physicalAddress": "00:00:00:00:00:00" } } } } ] assert_that(result, is_(expected), "actual={}\nexpected={}".format(json.dumps(result), json.dumps(expected))) remove_interface_vlan(t, "299") remove_vlan(t, "299") remove_interface_vlan(t, "777") remove_vlan(t, "777")
def test_mpls_raise_error_with_unsupported_command(self, t): enable(t) t.write("mpls ldp") t.readln("% Invalid input")