diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_arp.txt b/test/unit/mocked_data/SG350X-48P-K9/show_arp.txt new file mode 100644 index 0000000..7c568c4 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_arp.txt @@ -0,0 +1,18 @@ + +Total number of entries: 10 + + + VLAN Interface IP address HW address status +--------------------- --------------- ------------------- --------------- +vlan 852 te1/0/1 19.51.0.1 00:00:0c:07:ac:01 dynamic +vlan 852 te1/0/1 19.51.0.2 e4:c7:22:fe:e0:43 dynamic +vlan 852 te1/0/1 19.51.0.5 bc:ea:fa:b4:15:aa dynamic +vlan 852 te1/0/1 19.51.0.3 bc:ea:fa:b4:14:6f dynamic +vlan 852 te1/0/1 19.51.0.1 5c:8a:38:2e:bd:c0 dynamic +vlan 852 te1/0/1 19.51.0.8 5c:8a:38:2e:fd:e0 dynamic +vlan 852 te1/0/1 19.51.1.4 00:50:56:93:19:b7 dynamic +vlan 852 te1/0/1 19.51.1.5 00:50:56:92:2f:cb dynamic +vlan 852 19.51.1.2 00:50:56:9e:51:f3 dynamic +vlan 852 19.51.14.5 a4:4c:c8:7d:37:03 dynamic + + diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_hosts.txt b/test/unit/mocked_data/SG350X-48P-K9/show_hosts.txt new file mode 100644 index 0000000..438eec4 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_hosts.txt @@ -0,0 +1,33 @@ + +Name/address lookup is enabled +Domain Timeout: 2 seconds +Domain Retry: 1 times +Domain Polling Interval: 8 seconds + + +Default Domain Table + + Domain Source Interface Preference +-------------------------------------------- ------- --------- ---------- +Domain name is not configured + + +Name Server Table + + IP Address Source Interface Preference +-------------------------------------------- ------- --------- ---------- +Name server is not configured + + +Cache Table +Flags: (STA/DYN, OK/NE/??) +STA - Static, DYN - Dynamic +OK - Okay, NE - Negative Cache, ?? - No Response + + Remaining + Host Addresses Type State TTL +------------------------- ------------------------ ---- ------ ---------- +No hostname is mapped to an IP address + + + diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_interface_description.txt b/test/unit/mocked_data/SG350X-48P-K9/show_interface_description.txt new file mode 100644 index 0000000..ecc6d39 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_interface_description.txt @@ -0,0 +1,65 @@ +Port Description +------- ----------- +gi1/0/1 3B10 +gi1/0/2 3A9 +gi1/0/3 3E2 +gi1/0/4 3F1 +gi1/0/5 2A2 +gi1/0/6 Lobby +gi1/0/7 +gi1/0/8 +gi1/0/9 +gi1/0/10 +gi1/0/11 +gi1/0/12 +gi1/0/13 +gi1/0/14 +gi1/0/15 Dk +gi1/0/16 Dc +gi1/0/17 Dct +gi1/0/18 DPC +gi1/0/19 Dr +gi1/0/20 Dr +gi1/0/21 Dr +gi1/0/22 +gi1/0/23 +gi1/0/24 +gi1/0/25 2B2 +gi1/0/26 2E2 +gi1/0/27 2F2 +gi1/0/28 1A2 +gi1/0/29 1B2 +gi1/0/30 +gi1/0/31 +gi1/0/32 +gi1/0/33 +gi1/0/34 +gi1/0/35 MV +gi1/0/36 MV +gi1/0/37 MP +gi1/0/38 MV + P +gi1/0/39 MV +gi1/0/40 +gi1/0/41 +gi1/0/42 +gi1/0/43 +gi1/0/44 +gi1/0/45 S2 +gi1/0/46 Ce +gi1/0/47 +gi1/0/48 +te1/0/1 T1 +te1/0/2 +te1/0/3 T2 +te1/0/4 T3 + +Ch Description +------- ----------- +Po1 +Po2 +Po3 +Po4 +Po5 +Po6 +Po7 +Po8 diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_interface_status.txt b/test/unit/mocked_data/SG350X-48P-K9/show_interface_status.txt new file mode 100644 index 0000000..d37ffe1 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_interface_status.txt @@ -0,0 +1,67 @@ + Flow Link Back Mdix +Port Type Duplex Speed Neg ctrl State Pressure Mode +-------- ------------ ------ ----- -------- ---- ----------- -------- ------- +gi1/0/1 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/2 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/3 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/4 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/5 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/6 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/7 1G-Copper -- -- -- -- Down -- -- +gi1/0/8 1G-Copper -- -- -- -- Down -- -- +gi1/0/9 1G-Copper -- -- -- -- Down -- -- +gi1/0/10 1G-Copper -- -- -- -- Down -- -- +gi1/0/11 1G-Copper -- -- -- -- Down -- -- +gi1/0/12 1G-Copper -- -- -- -- Down -- -- +gi1/0/13 1G-Copper -- -- -- -- Down -- -- +gi1/0/14 1G-Copper -- -- -- -- Down -- -- +gi1/0/15 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/16 1G-Copper Full 100 Enabled Off Up Disabled On +gi1/0/17 1G-Copper -- -- -- -- Down -- -- +gi1/0/18 1G-Copper -- -- -- -- Down -- -- +gi1/0/19 1G-Copper -- -- -- -- Down -- -- +gi1/0/20 1G-Copper -- -- -- -- Down -- -- +gi1/0/21 1G-Copper -- -- -- -- Down -- -- +gi1/0/22 1G-Copper -- -- -- -- Down -- -- +gi1/0/23 1G-Copper -- -- -- -- Down -- -- +gi1/0/24 1G-Copper -- -- -- -- Down -- -- +gi1/0/25 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/26 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/27 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/28 1G-Copper -- -- -- -- Down -- -- +gi1/0/29 1G-Copper -- -- -- -- Down -- -- +gi1/0/30 1G-Copper -- -- -- -- Down -- -- +gi1/0/31 1G-Copper -- -- -- -- Down -- -- +gi1/0/32 1G-Copper -- -- -- -- Down -- -- +gi1/0/33 1G-Copper -- -- -- -- Down -- -- +gi1/0/34 1G-Copper -- -- -- -- Down -- -- +gi1/0/35 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/36 1G-Copper Full 100 Enabled Off Up Disabled Off +gi1/0/37 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/38 1G-Copper -- -- -- -- Down -- -- +gi1/0/39 1G-Copper Full 100 Enabled Off Up Disabled On +gi1/0/40 1G-Copper -- -- -- -- Down -- -- +gi1/0/41 1G-Copper -- -- -- -- Down -- -- +gi1/0/42 1G-Copper -- -- -- -- Down -- -- +gi1/0/43 1G-Copper -- -- -- -- Down -- -- +gi1/0/44 1G-Copper -- -- -- -- Down -- -- +gi1/0/45 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/46 1G-Copper Full 100 Enabled Off Up Disabled Off +gi1/0/47 1G-Copper -- -- -- -- Down -- -- +gi1/0/48 1G-Copper -- -- -- -- Down -- -- +te1/0/1 10G-Combo-F Full 1000 Disabled Off Up Disabled Off +te1/0/2 10G-Combo-C -- -- -- -- Down -- -- +te1/0/3 10G-Fiber Full 1000 Disabled Off Up Disabled Off +te1/0/4 10G-Fiber Full 10000 Disabled Off Up Disabled Off + + Flow Link +Ch Type Duplex Speed Neg control State +-------- ------- ------ ----- -------- ------- ----------- +Po1 -- -- -- -- -- Not Present +Po2 -- -- -- -- -- Not Present +Po3 -- -- -- -- -- Not Present +Po4 -- -- -- -- -- Not Present +Po5 -- -- -- -- -- Not Present +Po6 -- -- -- -- -- Not Present +Po7 -- -- -- -- -- Not Present +Po8 -- -- -- -- -- Not Present diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_inventory.txt b/test/unit/mocked_data/SG350X-48P-K9/show_inventory.txt new file mode 100644 index 0000000..01eb58b --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_inventory.txt @@ -0,0 +1,16 @@ + +NAME: "1" DESCR: "SG350X-48P 48-Port Gigabit PoE Stackable Managed Switch" +PID: SG350X-48P-K9 VID: V04 SN: AAA00000BBB + + +NAME: "TengigabitEthernet1/0/1" DESCR: "SFP-1000Base-LX" +PID: GLC-LH-SMD VID: V01 SN: IAB8888888 + + +NAME: "TengigabitEthernet1/0/3" DESCR: "SFP-1000Base-SX" +PID: SFP-1000-SX VID: Information Unavailable SN: A888666 + + +NAME: "TengigabitEthernet1/0/4" DESCR: "SFP-10Gbase-CX1" +PID: SFP-H10G-CU1M VID: Information Unavailable SN: AB0B000B0AB000B + diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_ip_interface.txt b/test/unit/mocked_data/SG350X-48P-K9/show_ip_interface.txt new file mode 100644 index 0000000..301113a --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_ip_interface.txt @@ -0,0 +1,8 @@ + + + IP Address I/F I/F Status Type Directed Prec Redirect Status + admin/oper Broadcast +------------------ --------- ---------- ------- --------- ---- -------- ------ +198.51.100.1/16 vlan 852 UP/UP Static disable No enable Valid +198.51.100.2/24 vlan 1 UP/UP Static disable No enable Valid + diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_ip_route.txt b/test/unit/mocked_data/SG350X-48P-K9/show_ip_route.txt new file mode 100644 index 0000000..b451b48 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_ip_route.txt @@ -0,0 +1,9 @@ +Maximum Parallel Paths: 1 (1 after reset) +IP Forwarding: disabled +Codes: > - best, C - connected, S - static + + +S 198.51.100.1/8 [1/4] via 198.51.100.2, 00:37:12, vlan 852 +C 198.51.100.0/16 is directly connected, vlan 852 +C 198.51.100.2/24 is directly connected, vlan 1 + diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_lldp_neighbors.txt b/test/unit/mocked_data/SG350X-48P-K9/show_lldp_neighbors.txt new file mode 100644 index 0000000..fb27e93 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_lldp_neighbors.txt @@ -0,0 +1,12 @@ + +System capability legend: +B - Bridge; R - Router; W - Wlan Access Point; T - telephone; +D - DOCSIS Cable Device; H - Host; r - Repeater; +TP - Two Ports MAC Relay; S - S-VLAN; C - C-VLAN; O - Other + + Port Device ID Port ID System Name Capabilities TTL +--------- ----------------- ----------------- ----------------- ------------ ----- +gi1/0/37 b0:b8:67:c2:32:aa b0:b8:67:c2:32:aa AM W 110 +te1/0/3 00:8e:73:24:5d:e2 gi28 sw1 B, R 116 +te1/0/4 sw2 te1/0/4 sw2 B, R 100 + diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_lldp_neighbors_INT.txt b/test/unit/mocked_data/SG350X-48P-K9/show_lldp_neighbors_INT.txt new file mode 100644 index 0000000..5049749 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_lldp_neighbors_INT.txt @@ -0,0 +1,19 @@ + +Device ID: sw2 +Port ID: te1/0/4 +Capabilities: Bridge, Router +System Name: sw2 +System description: +Port description: +Management Address: 198.51.100.1 +Management Address: fe80::6eb:40ff:fed9:ba7b +Time To Live: 100 + + +802.1 PVID: 1 +802.1 PPVID: +802.1 VLAN: +802.1 Protocol: + + + diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_running-config.txt b/test/unit/mocked_data/SG350X-48P-K9/show_running-config.txt new file mode 100644 index 0000000..a9d1793 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_running-config.txt @@ -0,0 +1,264 @@ +config-file-header +switch1 +v2.4.5.71 / RTESLA2.4.5_930_181_144 +CLI v1.0 +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink te +unit-type unit 2 network gi uplink te +unit-type unit 3 network gi uplink te +unit-type unit 4 network gi uplink te +unit-type-control-end +! +spanning-tree mode mst +port jumbo-frame +vlan database +vlan 5,7,852 +exit +voice vlan oui-table add 0001e3 Siemens_AG_phone________ +voice vlan oui-table add 00036b Cisco_phone_____________ +voice vlan oui-table add 00096e Avaya___________________ +voice vlan oui-table add 000fe2 H3C_Aolynk______________ +voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone +voice vlan oui-table add 00d01e Pingtel_phone___________ +voice vlan oui-table add 00e075 Polycom/Veritel_phone___ +voice vlan oui-table add 00e0bb 3Com_phone______________ +errdisable recovery cause loopback-detection +errdisable recovery cause port-security +errdisable recovery cause dot1x-src-address +errdisable recovery cause acl-deny +errdisable recovery cause stp-bpdu-guard +errdisable recovery cause stp-loopback-guard +errdisable recovery cause udld +errdisable recovery cause storm-control +link-flap prevention disable +no ip routing +system resources vlan-mapping-entries 4 +bonjour interface range vlan 1 +hostname switch1 +line console +exec-timeout 120 +exit +line ssh +exec-timeout 120 +exit +line telnet +exec-timeout 120 +exit +no passwords complexity enable +username admin password encrypted 00000000000000000000aaaaaaaaaaaaaaaaaaaa privilege 15 +username adm02 password encrypted aaaaaaaaaaaaaaaaaaaa00000000000000000000 privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +snmp-server server +snmp-server location SW Location +snmp-server community SOMe rw view Default +ip http timeout-policy 86400 +clock timezone " " +1 +clock summer-time web recurring eu +sntp server 198.51.100.1 +sntp server 198.51.100.2 +no sntp server time-a.timefreq.bldrdoc.gov +no sntp server time-b.timefreq.bldrdoc.gov +no sntp server time-c.timefreq.bldrdoc.gov +ip telnet server +! +interface vlan 1 + name Vlan1 + ip address 198.51.100.3 255.255.255.0 + no ip address dhcp +! +interface vlan 5 + name Vlan5 +! +interface vlan 7 + name Vlan7 +! +interface vlan 852 + name Vlan852 + ip address 198.51.100.4 255.255.128.0 +! +interface GigabitEthernet1/0/1 + description "3B10" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/2 + description "3A9" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/3 + description "3E2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/4 + description "3F1" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/5 + description "2A2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/6 + description "Lobby" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/11 + switchport access vlan 5 +! +interface GigabitEthernet1/0/12 + switchport access vlan 5 +! +interface GigabitEthernet1/0/13 + switchport access vlan 5 +! +interface GigabitEthernet1/0/14 + switchport access vlan 5 +! +interface GigabitEthernet1/0/15 + description "Dk" +! +interface GigabitEthernet1/0/16 + description "Dc" +! +interface GigabitEthernet1/0/17 + description "Dct" +! +interface GigabitEthernet1/0/18 + description "DPC" +! +interface GigabitEthernet1/0/19 + description "Dr" +! +interface GigabitEthernet1/0/20 + description "Dr" +! +interface GigabitEthernet1/0/21 + description "Dr" +! +interface GigabitEthernet1/0/25 + description "2B2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/26 + description "2E2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/27 + description "2F2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/28 + description "1A2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/29 + description "1B2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/30 + switchport access vlan 5 +! +interface GigabitEthernet1/0/31 + switchport access vlan 5 +! +interface GigabitEthernet1/0/32 + switchport access vlan 5 +! +interface GigabitEthernet1/0/33 + switchport access vlan 5 +! +interface GigabitEthernet1/0/34 + switchport access vlan 5 +! +interface GigabitEthernet1/0/35 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/36 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/37 + description "MP" + switchport mode trunk + switchport access vlan 852 + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/38 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/39 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/40 + switchport access vlan 5 +! +interface GigabitEthernet1/0/41 + switchport access vlan 5 +! +interface GigabitEthernet1/0/42 + switchport access vlan 5 +! +interface GigabitEthernet1/0/43 + switchport access vlan 5 +! +interface GigabitEthernet1/0/44 + switchport access vlan 5 +! +interface GigabitEthernet1/0/45 + description "S2" +! +interface GigabitEthernet1/0/46 + description "Ce" +! +interface TengigabitEthernet1/0/1 + description "T1" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface TengigabitEthernet1/0/3 + description "T1" + switchport mode trunk +! +interface TengigabitEthernet1/0/4 + description "T2" + switchport mode trunk +! +exit +macro auto disabled diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_sntp_status.txt b/test/unit/mocked_data/SG350X-48P-K9/show_sntp_status.txt new file mode 100644 index 0000000..dc38569 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_sntp_status.txt @@ -0,0 +1,30 @@ + +Clock is synchronized, stratum 3, reference is 198.51.100.1, unicast + +Unicast servers: + +Server : 198.51.100.2 + Source : Static + Stratum : 255 + Status : down + Last Response : 00:00:00.0 Jan 1 1900 + Offset : 0.0000000 mSec + Delay : 0 mSec + +Server : 198.51.100.1 + Source : Static + Stratum : 3 + Status : up + Last Response : 08:53:15.0 web Oct 16 2020 + Offset : 1404.8796860 mSec + Delay : 0 mSec + + + +Anycast server: + + + +Broadcast: + + diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_startup-config.txt b/test/unit/mocked_data/SG350X-48P-K9/show_startup-config.txt new file mode 100644 index 0000000..a9d1793 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_startup-config.txt @@ -0,0 +1,264 @@ +config-file-header +switch1 +v2.4.5.71 / RTESLA2.4.5_930_181_144 +CLI v1.0 +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink te +unit-type unit 2 network gi uplink te +unit-type unit 3 network gi uplink te +unit-type unit 4 network gi uplink te +unit-type-control-end +! +spanning-tree mode mst +port jumbo-frame +vlan database +vlan 5,7,852 +exit +voice vlan oui-table add 0001e3 Siemens_AG_phone________ +voice vlan oui-table add 00036b Cisco_phone_____________ +voice vlan oui-table add 00096e Avaya___________________ +voice vlan oui-table add 000fe2 H3C_Aolynk______________ +voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone +voice vlan oui-table add 00d01e Pingtel_phone___________ +voice vlan oui-table add 00e075 Polycom/Veritel_phone___ +voice vlan oui-table add 00e0bb 3Com_phone______________ +errdisable recovery cause loopback-detection +errdisable recovery cause port-security +errdisable recovery cause dot1x-src-address +errdisable recovery cause acl-deny +errdisable recovery cause stp-bpdu-guard +errdisable recovery cause stp-loopback-guard +errdisable recovery cause udld +errdisable recovery cause storm-control +link-flap prevention disable +no ip routing +system resources vlan-mapping-entries 4 +bonjour interface range vlan 1 +hostname switch1 +line console +exec-timeout 120 +exit +line ssh +exec-timeout 120 +exit +line telnet +exec-timeout 120 +exit +no passwords complexity enable +username admin password encrypted 00000000000000000000aaaaaaaaaaaaaaaaaaaa privilege 15 +username adm02 password encrypted aaaaaaaaaaaaaaaaaaaa00000000000000000000 privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +snmp-server server +snmp-server location SW Location +snmp-server community SOMe rw view Default +ip http timeout-policy 86400 +clock timezone " " +1 +clock summer-time web recurring eu +sntp server 198.51.100.1 +sntp server 198.51.100.2 +no sntp server time-a.timefreq.bldrdoc.gov +no sntp server time-b.timefreq.bldrdoc.gov +no sntp server time-c.timefreq.bldrdoc.gov +ip telnet server +! +interface vlan 1 + name Vlan1 + ip address 198.51.100.3 255.255.255.0 + no ip address dhcp +! +interface vlan 5 + name Vlan5 +! +interface vlan 7 + name Vlan7 +! +interface vlan 852 + name Vlan852 + ip address 198.51.100.4 255.255.128.0 +! +interface GigabitEthernet1/0/1 + description "3B10" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/2 + description "3A9" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/3 + description "3E2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/4 + description "3F1" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/5 + description "2A2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/6 + description "Lobby" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/11 + switchport access vlan 5 +! +interface GigabitEthernet1/0/12 + switchport access vlan 5 +! +interface GigabitEthernet1/0/13 + switchport access vlan 5 +! +interface GigabitEthernet1/0/14 + switchport access vlan 5 +! +interface GigabitEthernet1/0/15 + description "Dk" +! +interface GigabitEthernet1/0/16 + description "Dc" +! +interface GigabitEthernet1/0/17 + description "Dct" +! +interface GigabitEthernet1/0/18 + description "DPC" +! +interface GigabitEthernet1/0/19 + description "Dr" +! +interface GigabitEthernet1/0/20 + description "Dr" +! +interface GigabitEthernet1/0/21 + description "Dr" +! +interface GigabitEthernet1/0/25 + description "2B2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/26 + description "2E2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/27 + description "2F2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/28 + description "1A2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/29 + description "1B2" + switchport mode trunk + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/30 + switchport access vlan 5 +! +interface GigabitEthernet1/0/31 + switchport access vlan 5 +! +interface GigabitEthernet1/0/32 + switchport access vlan 5 +! +interface GigabitEthernet1/0/33 + switchport access vlan 5 +! +interface GigabitEthernet1/0/34 + switchport access vlan 5 +! +interface GigabitEthernet1/0/35 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/36 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/37 + description "MP" + switchport mode trunk + switchport access vlan 852 + switchport trunk allowed vlan remove 2-4,6-4094 +! +interface GigabitEthernet1/0/38 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/39 + description "MV" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface GigabitEthernet1/0/40 + switchport access vlan 5 +! +interface GigabitEthernet1/0/41 + switchport access vlan 5 +! +interface GigabitEthernet1/0/42 + switchport access vlan 5 +! +interface GigabitEthernet1/0/43 + switchport access vlan 5 +! +interface GigabitEthernet1/0/44 + switchport access vlan 5 +! +interface GigabitEthernet1/0/45 + description "S2" +! +interface GigabitEthernet1/0/46 + description "Ce" +! +interface TengigabitEthernet1/0/1 + description "T1" + switchport mode trunk + switchport access vlan 852 + switchport trunk native vlan 852 + switchport trunk allowed vlan remove 1-6,8-851,853-4094 +! +interface TengigabitEthernet1/0/3 + description "T1" + switchport mode trunk +! +interface TengigabitEthernet1/0/4 + description "T2" + switchport mode trunk +! +exit +macro auto disabled diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_system.txt b/test/unit/mocked_data/SG350X-48P-K9/show_system.txt new file mode 100644 index 0000000..976f6c5 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_system.txt @@ -0,0 +1,21 @@ +System Description: SG350X-48P 48-Port Gigabit PoE Stackable Managed Switch +System Up Time (days,hour:min:sec): 14,06:29:28 +System Contact: +System Name: switch1 +System Location: SW location +System MAC Address: 04:eb:40:e3:91:7f +System Object ID: 1.3.6.1.4.1.9.6.1.94.48.5 + +Unit Type +---- ---------------------- + 1 SG350X-48P + + +Unit Fans Status +---- ------------------------------------- + 1 FANs OK + +Unit Temperature (Celsius) Status +---- --------------------- ---------- + 1 30 OK + diff --git a/test/unit/mocked_data/SG350X-48P-K9/show_version.txt b/test/unit/mocked_data/SG350X-48P-K9/show_version.txt new file mode 100644 index 0000000..6433144 --- /dev/null +++ b/test/unit/mocked_data/SG350X-48P-K9/show_version.txt @@ -0,0 +1,10 @@ +Active-image: flash://system/images/image_tesla_hybrid_2.4.5.71_release_cisco_signed.bin + Version: 2.4.5.71 + MD5 Digest: 2dff89efdb2a0ec2f9a2c414ff7d401c + Date: 04-Nov-2018 + Time: 19:46:16 +Inactive-image: flash://system/images/image1.bin + Version: 2.4.0.94 + MD5 Digest: 6f5be217100f34929986f2e93dd2d5e9 + Date: 31-May-2018 + Time: 02:39:58 diff --git a/test/unit/mocked_data/commands.txt b/test/unit/mocked_data/commands.txt new file mode 100644 index 0000000..cfaf6c8 --- /dev/null +++ b/test/unit/mocked_data/commands.txt @@ -0,0 +1,32 @@ +If you want to help with unit test, please take look at tested devices and in case you do not find device type you own, send us output of these commands: + +# setup terminal +terminal datadump +terminal width 0 +terminal no prompt + +show inventory +show version +show system +show interfaces status +show interfaces description + +# choose any physical interface on your device +show lldp local GigabitEthernet1 +show lldp local GigabitEthernet1/1 +show lldp local GigabitEthernet1/0/1 + +show ip interface +show ip route +show lldp neighbors + +# choose any interface with attached neighbor +show lldp neighbor GigabitEthernet1 + +show sntp status +show hosts +show arp +show startup-config +show running-config + + diff --git a/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/expected_result.json b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/expected_result.json new file mode 100644 index 0000000..97fa3e3 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/expected_result.json @@ -0,0 +1,71 @@ +{ + "fqdn" : "switch1.", + "hostname" : "switch1", + "interface_list" : [ + "gi1/0/1", + "gi1/0/2", + "gi1/0/3", + "gi1/0/4", + "gi1/0/5", + "gi1/0/6", + "gi1/0/7", + "gi1/0/8", + "gi1/0/9", + "gi1/0/10", + "gi1/0/11", + "gi1/0/12", + "gi1/0/13", + "gi1/0/14", + "gi1/0/15", + "gi1/0/16", + "gi1/0/17", + "gi1/0/18", + "gi1/0/19", + "gi1/0/20", + "gi1/0/21", + "gi1/0/22", + "gi1/0/23", + "gi1/0/24", + "gi1/0/25", + "gi1/0/26", + "gi1/0/27", + "gi1/0/28", + "gi1/0/29", + "gi1/0/30", + "gi1/0/31", + "gi1/0/32", + "gi1/0/33", + "gi1/0/34", + "gi1/0/35", + "gi1/0/36", + "gi1/0/37", + "gi1/0/38", + "gi1/0/39", + "gi1/0/40", + "gi1/0/41", + "gi1/0/42", + "gi1/0/43", + "gi1/0/44", + "gi1/0/45", + "gi1/0/46", + "gi1/0/47", + "gi1/0/48", + "te1/0/1", + "te1/0/2", + "te1/0/3", + "te1/0/4", + "Po1", + "Po2", + "Po3", + "Po4", + "Po5", + "Po6", + "Po7", + "Po8" + ], + "model" : "SG350X-48P 48-Port Gigabit PoE Stackable Managed Switch", + "os_version" : "2.4.5.71", + "serial_number" : "AAA00000BBB ", + "uptime" : 1232968, + "vendor" : "Cisco" +} diff --git a/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_hosts.txt b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_hosts.txt new file mode 100644 index 0000000..438eec4 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_hosts.txt @@ -0,0 +1,33 @@ + +Name/address lookup is enabled +Domain Timeout: 2 seconds +Domain Retry: 1 times +Domain Polling Interval: 8 seconds + + +Default Domain Table + + Domain Source Interface Preference +-------------------------------------------- ------- --------- ---------- +Domain name is not configured + + +Name Server Table + + IP Address Source Interface Preference +-------------------------------------------- ------- --------- ---------- +Name server is not configured + + +Cache Table +Flags: (STA/DYN, OK/NE/??) +STA - Static, DYN - Dynamic +OK - Okay, NE - Negative Cache, ?? - No Response + + Remaining + Host Addresses Type State TTL +------------------------- ------------------------ ---- ------ ---------- +No hostname is mapped to an IP address + + + diff --git a/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_interface_status.txt b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_interface_status.txt new file mode 100644 index 0000000..d37ffe1 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_interface_status.txt @@ -0,0 +1,67 @@ + Flow Link Back Mdix +Port Type Duplex Speed Neg ctrl State Pressure Mode +-------- ------------ ------ ----- -------- ---- ----------- -------- ------- +gi1/0/1 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/2 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/3 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/4 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/5 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/6 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/7 1G-Copper -- -- -- -- Down -- -- +gi1/0/8 1G-Copper -- -- -- -- Down -- -- +gi1/0/9 1G-Copper -- -- -- -- Down -- -- +gi1/0/10 1G-Copper -- -- -- -- Down -- -- +gi1/0/11 1G-Copper -- -- -- -- Down -- -- +gi1/0/12 1G-Copper -- -- -- -- Down -- -- +gi1/0/13 1G-Copper -- -- -- -- Down -- -- +gi1/0/14 1G-Copper -- -- -- -- Down -- -- +gi1/0/15 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/16 1G-Copper Full 100 Enabled Off Up Disabled On +gi1/0/17 1G-Copper -- -- -- -- Down -- -- +gi1/0/18 1G-Copper -- -- -- -- Down -- -- +gi1/0/19 1G-Copper -- -- -- -- Down -- -- +gi1/0/20 1G-Copper -- -- -- -- Down -- -- +gi1/0/21 1G-Copper -- -- -- -- Down -- -- +gi1/0/22 1G-Copper -- -- -- -- Down -- -- +gi1/0/23 1G-Copper -- -- -- -- Down -- -- +gi1/0/24 1G-Copper -- -- -- -- Down -- -- +gi1/0/25 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/26 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/27 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/28 1G-Copper -- -- -- -- Down -- -- +gi1/0/29 1G-Copper -- -- -- -- Down -- -- +gi1/0/30 1G-Copper -- -- -- -- Down -- -- +gi1/0/31 1G-Copper -- -- -- -- Down -- -- +gi1/0/32 1G-Copper -- -- -- -- Down -- -- +gi1/0/33 1G-Copper -- -- -- -- Down -- -- +gi1/0/34 1G-Copper -- -- -- -- Down -- -- +gi1/0/35 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/36 1G-Copper Full 100 Enabled Off Up Disabled Off +gi1/0/37 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/38 1G-Copper -- -- -- -- Down -- -- +gi1/0/39 1G-Copper Full 100 Enabled Off Up Disabled On +gi1/0/40 1G-Copper -- -- -- -- Down -- -- +gi1/0/41 1G-Copper -- -- -- -- Down -- -- +gi1/0/42 1G-Copper -- -- -- -- Down -- -- +gi1/0/43 1G-Copper -- -- -- -- Down -- -- +gi1/0/44 1G-Copper -- -- -- -- Down -- -- +gi1/0/45 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/46 1G-Copper Full 100 Enabled Off Up Disabled Off +gi1/0/47 1G-Copper -- -- -- -- Down -- -- +gi1/0/48 1G-Copper -- -- -- -- Down -- -- +te1/0/1 10G-Combo-F Full 1000 Disabled Off Up Disabled Off +te1/0/2 10G-Combo-C -- -- -- -- Down -- -- +te1/0/3 10G-Fiber Full 1000 Disabled Off Up Disabled Off +te1/0/4 10G-Fiber Full 10000 Disabled Off Up Disabled Off + + Flow Link +Ch Type Duplex Speed Neg control State +-------- ------- ------ ----- -------- ------- ----------- +Po1 -- -- -- -- -- Not Present +Po2 -- -- -- -- -- Not Present +Po3 -- -- -- -- -- Not Present +Po4 -- -- -- -- -- Not Present +Po5 -- -- -- -- -- Not Present +Po6 -- -- -- -- -- Not Present +Po7 -- -- -- -- -- Not Present +Po8 -- -- -- -- -- Not Present diff --git a/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_inventory.txt b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_inventory.txt new file mode 100644 index 0000000..01eb58b --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_inventory.txt @@ -0,0 +1,16 @@ + +NAME: "1" DESCR: "SG350X-48P 48-Port Gigabit PoE Stackable Managed Switch" +PID: SG350X-48P-K9 VID: V04 SN: AAA00000BBB + + +NAME: "TengigabitEthernet1/0/1" DESCR: "SFP-1000Base-LX" +PID: GLC-LH-SMD VID: V01 SN: IAB8888888 + + +NAME: "TengigabitEthernet1/0/3" DESCR: "SFP-1000Base-SX" +PID: SFP-1000-SX VID: Information Unavailable SN: A888666 + + +NAME: "TengigabitEthernet1/0/4" DESCR: "SFP-10Gbase-CX1" +PID: SFP-H10G-CU1M VID: Information Unavailable SN: AB0B000B0AB000B + diff --git a/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_system.txt b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_system.txt new file mode 100644 index 0000000..976f6c5 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_system.txt @@ -0,0 +1,21 @@ +System Description: SG350X-48P 48-Port Gigabit PoE Stackable Managed Switch +System Up Time (days,hour:min:sec): 14,06:29:28 +System Contact: +System Name: switch1 +System Location: SW location +System MAC Address: 04:eb:40:e3:91:7f +System Object ID: 1.3.6.1.4.1.9.6.1.94.48.5 + +Unit Type +---- ---------------------- + 1 SG350X-48P + + +Unit Fans Status +---- ------------------------------------- + 1 FANs OK + +Unit Temperature (Celsius) Status +---- --------------------- ---------- + 1 30 OK + diff --git a/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_version.txt b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_version.txt new file mode 100644 index 0000000..6433144 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG350X-48P-K9/show_version.txt @@ -0,0 +1,10 @@ +Active-image: flash://system/images/image_tesla_hybrid_2.4.5.71_release_cisco_signed.bin + Version: 2.4.5.71 + MD5 Digest: 2dff89efdb2a0ec2f9a2c414ff7d401c + Date: 04-Nov-2018 + Time: 19:46:16 +Inactive-image: flash://system/images/image1.bin + Version: 2.4.0.94 + MD5 Digest: 6f5be217100f34929986f2e93dd2d5e9 + Date: 31-May-2018 + Time: 02:39:58 diff --git a/test/unit/mocked_data/test_get_interfaces/SG350X-48P-K9/show_interface_status.txt b/test/unit/mocked_data/test_get_interfaces/SG350X-48P-K9/show_interface_status.txt new file mode 100644 index 0000000..d37ffe1 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG350X-48P-K9/show_interface_status.txt @@ -0,0 +1,67 @@ + Flow Link Back Mdix +Port Type Duplex Speed Neg ctrl State Pressure Mode +-------- ------------ ------ ----- -------- ---- ----------- -------- ------- +gi1/0/1 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/2 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/3 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/4 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/5 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/6 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/7 1G-Copper -- -- -- -- Down -- -- +gi1/0/8 1G-Copper -- -- -- -- Down -- -- +gi1/0/9 1G-Copper -- -- -- -- Down -- -- +gi1/0/10 1G-Copper -- -- -- -- Down -- -- +gi1/0/11 1G-Copper -- -- -- -- Down -- -- +gi1/0/12 1G-Copper -- -- -- -- Down -- -- +gi1/0/13 1G-Copper -- -- -- -- Down -- -- +gi1/0/14 1G-Copper -- -- -- -- Down -- -- +gi1/0/15 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/16 1G-Copper Full 100 Enabled Off Up Disabled On +gi1/0/17 1G-Copper -- -- -- -- Down -- -- +gi1/0/18 1G-Copper -- -- -- -- Down -- -- +gi1/0/19 1G-Copper -- -- -- -- Down -- -- +gi1/0/20 1G-Copper -- -- -- -- Down -- -- +gi1/0/21 1G-Copper -- -- -- -- Down -- -- +gi1/0/22 1G-Copper -- -- -- -- Down -- -- +gi1/0/23 1G-Copper -- -- -- -- Down -- -- +gi1/0/24 1G-Copper -- -- -- -- Down -- -- +gi1/0/25 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/26 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/27 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/0/28 1G-Copper -- -- -- -- Down -- -- +gi1/0/29 1G-Copper -- -- -- -- Down -- -- +gi1/0/30 1G-Copper -- -- -- -- Down -- -- +gi1/0/31 1G-Copper -- -- -- -- Down -- -- +gi1/0/32 1G-Copper -- -- -- -- Down -- -- +gi1/0/33 1G-Copper -- -- -- -- Down -- -- +gi1/0/34 1G-Copper -- -- -- -- Down -- -- +gi1/0/35 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/36 1G-Copper Full 100 Enabled Off Up Disabled Off +gi1/0/37 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/38 1G-Copper -- -- -- -- Down -- -- +gi1/0/39 1G-Copper Full 100 Enabled Off Up Disabled On +gi1/0/40 1G-Copper -- -- -- -- Down -- -- +gi1/0/41 1G-Copper -- -- -- -- Down -- -- +gi1/0/42 1G-Copper -- -- -- -- Down -- -- +gi1/0/43 1G-Copper -- -- -- -- Down -- -- +gi1/0/44 1G-Copper -- -- -- -- Down -- -- +gi1/0/45 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/0/46 1G-Copper Full 100 Enabled Off Up Disabled Off +gi1/0/47 1G-Copper -- -- -- -- Down -- -- +gi1/0/48 1G-Copper -- -- -- -- Down -- -- +te1/0/1 10G-Combo-F Full 1000 Disabled Off Up Disabled Off +te1/0/2 10G-Combo-C -- -- -- -- Down -- -- +te1/0/3 10G-Fiber Full 1000 Disabled Off Up Disabled Off +te1/0/4 10G-Fiber Full 10000 Disabled Off Up Disabled Off + + Flow Link +Ch Type Duplex Speed Neg control State +-------- ------- ------ ----- -------- ------- ----------- +Po1 -- -- -- -- -- Not Present +Po2 -- -- -- -- -- Not Present +Po3 -- -- -- -- -- Not Present +Po4 -- -- -- -- -- Not Present +Po5 -- -- -- -- -- Not Present +Po6 -- -- -- -- -- Not Present +Po7 -- -- -- -- -- Not Present +Po8 -- -- -- -- -- Not Present diff --git a/test/unit/mocked_data/test_is_alive/normal/expected_result.json b/test/unit/mocked_data/test_is_alive/normal/expected_result.json new file mode 100644 index 0000000..22d3fb2 --- /dev/null +++ b/test/unit/mocked_data/test_is_alive/normal/expected_result.json @@ -0,0 +1,3 @@ +{ + "is_alive": true +}