Fix nxos_switchport and unit test (#26131)

* fix nxos_switchport

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* nxos_switchport unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* legacy file

* update unit test

* handle exception
This commit is contained in:
Trishna Guha
2017-07-06 18:58:36 +05:30
committed by GitHub
parent 6af53cf0ef
commit c5fb4bbcc0
6 changed files with 327 additions and 170 deletions

View File

@@ -0,0 +1,97 @@
{
"TABLE_interface": {
"ROW_interface": {
"interface": "Ethernet2/1",
"state": "up",
"admin_state": "up",
"share_state": "Dedicated",
"eth_hw_desc": "Ethernet",
"eth_hw_addr": "fa16.3e00.0001",
"eth_bia_addr": "fa16.3e27.f279",
"desc": "to nxos03",
"eth_ip_addr": "10.0.0.45",
"eth_ip_mask": 30,
"eth_ip_prefix": "10.0.0.44",
"eth_mtu": "1500",
"eth_bw": 1000000,
"eth_dly": 10,
"eth_reliability": "255",
"eth_txload": "1",
"eth_rxload": "1",
"medium": "broadcast",
"eth_mode": "access",
"eth_bundle": 0,
"eth_duplex": "full",
"eth_speed": "1000 Mb/s",
"eth_beacon": "off",
"eth_autoneg": "off",
"eth_in_flowctrl": "off",
"eth_out_flowctrl": "off",
"eth_mdix": "off",
"eth_swt_monitor": "off",
"eth_ethertype": "0x8100",
"eth_eee_state": "n/a",
"eth_link_flapped": "13week(s) 0day(s)",
"eth_clear_counters": "never",
"eth_reset_cntr": 1,
"eth_load_interval1_rx": 0,
"eth_inrate1_bits": 0,
"eth_inrate1_pkts": 0,
"eth_load_interval1_tx": 0,
"eth_outrate1_bits": 0,
"eth_outrate1_pkts": 0,
"eth_inrate1_summary_bits": "0 bps",
"eth_inrate1_summary_pkts": "0 pps",
"eth_outrate1_summary_bits": "0 bps",
"eth_outrate1_summary_pkts": "0 pps",
"eth_load_interval2_rx": 0,
"eth_inrate2_bits": 0,
"eth_inrate2_pkts": 0,
"eth_load_interval2_tx": 0,
"eth_outrate2_bits": 0,
"eth_outrate2_pkts": 0,
"eth_inrate2_summary_bits": "0 bps",
"eth_inrate2_summary_pkts": "0 pps",
"eth_outrate2_summary_bits": "0 bps",
"eth_outrate2_summary_pkts": "0 pps",
"eth_inucast": 0,
"eth_inmcast": 0,
"eth_inbcast": 0,
"eth_inpkts": 0,
"eth_inbytes": 0,
"eth_jumbo_inpkts": 0,
"eth_storm_supp": 0,
"eth_runts": 0,
"eth_giants": 0,
"eth_crc": 0,
"eth_nobuf": 0,
"eth_inerr": 0,
"eth_frame": 0,
"eth_overrun": 0,
"eth_underrun": 0,
"eth_ignored": 0,
"eth_watchdog": 0,
"eth_bad_eth": 0,
"eth_bad_proto": 0,
"eth_in_ifdown_drops": 0,
"eth_dribble": 0,
"eth_indiscard": 0,
"eth_inpause": 0,
"eth_outucast": 0,
"eth_outmcast": 0,
"eth_outbcast": 0,
"eth_outpkts": 0,
"eth_outbytes": 0,
"eth_jumbo_outpkts": 0,
"eth_outerr": 0,
"eth_coll": 0,
"eth_deferred": 0,
"eth_latecoll": 0,
"eth_lostcarrier": 0,
"eth_nocarrier": 0,
"eth_babbles": 0,
"eth_outdiscard": 0,
"eth_outpause": 0
}
}
}

View File

@@ -0,0 +1,14 @@
{
"TABLE_interface": {
"ROW_interface": {
"interface": "Ethernet2/1",
"oper_mode": "access",
"switchport": "Enabled",
"access_vlan": 2,
"access_vlan_name": "VLAN2",
"native_vlan": 10,
"native_vlan_name": "VLAN10",
"trunk_vlans": "1-50"
}
}
}

View File

@@ -0,0 +1,18 @@
{
"TABLE_vlanbrief": {
"ROW_vlanbrief": {
"vlanshowbr-vlanid": 1,
"vlanshowbr-vlanid-utf": 1,
"vlanshowbr-vlanname": "VLAN1",
"vlanshowbr-vlanstate": "active",
"vlanshowbr-shutstate": "noshutdown"
}
},
"TABLE_mtuinfo": {
"ROW_mtuinfo": {
"vlanshowinfo-vlanid": 1,
"vlanshowinfo-media-type": "enet",
"vlanshowinfo-vlanmode": "ce-vlan"
}
}
}