diff --git a/test/unit/mocked_data/SG500-28-K9/show_arp.txt b/test/unit/mocked_data/SG500-28-K9/show_arp.txt new file mode 100644 index 0000000..6bd0a8b --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_arp.txt @@ -0,0 +1,9 @@ + +Total number of entries: 2 + + + VLAN Interface IP address HW address status +--------------------- --------------- ------------------- --------------- +vlan 202 10.0.3.1 00:15:17:27:9c:4d dynamic +vlan 202 10.0.3.4 00:50:56:90:23:e8 dynamic + diff --git a/test/unit/mocked_data/SG500-28-K9/show_hosts.txt b/test/unit/mocked_data/SG500-28-K9/show_hosts.txt new file mode 100644 index 0000000..4813cc2 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_hosts.txt @@ -0,0 +1,32 @@ + +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/SG500-28-K9/show_interface_description.txt b/test/unit/mocked_data/SG500-28-K9/show_interface_description.txt new file mode 100644 index 0000000..5d5477b --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_interface_description.txt @@ -0,0 +1,63 @@ +Port Description +------- ----------- +gi1/1/1 +gi1/1/2 +gi1/1/3 +gi1/1/4 +gi1/1/5 +gi1/1/6 +gi1/1/7 +gi1/1/8 +gi1/1/9 +gi1/1/10 +gi1/1/11 +gi1/1/12 +gi1/1/13 +gi1/1/14 +gi1/1/15 +gi1/1/16 +gi1/1/17 +gi1/1/18 +gi1/1/19 +gi1/1/20 +gi1/1/21 +gi1/1/22 +gi1/1/23 +gi1/1/24 +gi1/1/25 +gi1/1/26 + +Ch Description +------- ----------- +Po1 +Po2 +Po3 +Po4 +Po5 +Po6 +Po7 +Po8 +Po9 +Po10 +Po11 +Po12 +Po13 +Po14 +Po15 +Po16 +Po17 +Po18 +Po19 +Po20 +Po21 +Po22 +Po23 +Po24 +Po25 +Po26 +Po27 +Po28 +Po29 +Po30 +Po31 +Po32 diff --git a/test/unit/mocked_data/SG500-28-K9/show_interface_status.txt b/test/unit/mocked_data/SG500-28-K9/show_interface_status.txt new file mode 100644 index 0000000..990d901 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_interface_status.txt @@ -0,0 +1,65 @@ + Flow Link Back Mdix +Port Type Duplex Speed Neg ctrl State Pressure Mode +-------- ------------ ------ ----- -------- ---- ----------- -------- ------- +gi1/1/1 1G-Copper -- -- -- -- Down -- -- +gi1/1/2 1G-Copper -- -- -- -- Down -- -- +gi1/1/3 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/1/4 1G-Copper -- -- -- -- Down -- -- +gi1/1/5 1G-Copper -- -- -- -- Down -- -- +gi1/1/6 1G-Copper -- -- -- -- Down -- -- +gi1/1/7 1G-Copper -- -- -- -- Down -- -- +gi1/1/8 1G-Copper -- -- -- -- Down -- -- +gi1/1/9 1G-Copper -- -- -- -- Down -- -- +gi1/1/10 1G-Copper -- -- -- -- Down -- -- +gi1/1/11 1G-Copper -- -- -- -- Down -- -- +gi1/1/12 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/1/13 1G-Copper -- -- -- -- Down -- -- +gi1/1/14 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/1/15 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/1/16 1G-Copper -- -- -- -- Down -- -- +gi1/1/17 1G-Copper -- -- -- -- Down -- -- +gi1/1/18 1G-Copper -- -- -- -- Down -- -- +gi1/1/19 1G-Copper -- -- -- -- Down -- -- +gi1/1/20 1G-Copper -- -- -- -- Down -- -- +gi1/1/21 1G-Copper -- -- -- -- Down -- -- +gi1/1/22 1G-Copper -- -- -- -- Down -- -- +gi1/1/23 1G-Copper -- -- -- -- Down -- -- +gi1/1/24 1G-Copper -- -- -- -- Down -- -- +gi1/1/25 1G-Combo-C -- -- -- -- Down -- -- +gi1/1/26 1G-Combo-F Full 1000 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 +Po9 -- -- -- -- -- Not Present +Po10 -- -- -- -- -- Not Present +Po11 -- -- -- -- -- Not Present +Po12 -- -- -- -- -- Not Present +Po13 -- -- -- -- -- Not Present +Po14 -- -- -- -- -- Not Present +Po15 -- -- -- -- -- Not Present +Po16 -- -- -- -- -- Not Present +Po17 -- -- -- -- -- Not Present +Po18 -- -- -- -- -- Not Present +Po19 -- -- -- -- -- Not Present +Po20 -- -- -- -- -- Not Present +Po21 -- -- -- -- -- Not Present +Po22 -- -- -- -- -- Not Present +Po23 -- -- -- -- -- Not Present +Po24 -- -- -- -- -- Not Present +Po25 -- -- -- -- -- Not Present +Po26 -- -- -- -- -- Not Present +Po27 -- -- -- -- -- Not Present +Po28 -- -- -- -- -- Not Present +Po29 -- -- -- -- -- Not Present +Po30 -- -- -- -- -- Not Present +Po31 -- -- -- -- -- Not Present +Po32 -- -- -- -- -- Not Present diff --git a/test/unit/mocked_data/SG500-28-K9/show_inventory.txt b/test/unit/mocked_data/SG500-28-K9/show_inventory.txt new file mode 100644 index 0000000..ae69ee6 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_inventory.txt @@ -0,0 +1,3 @@ + +NAME: "1" DESCR: "SG500-28 28-Port Gigabit Stackable Managed Switch" +PID: SG500-28-K9 VID: V02 SN: A1B2C3F4G5 diff --git a/test/unit/mocked_data/SG500-28-K9/show_ip_interface.txt b/test/unit/mocked_data/SG500-28-K9/show_ip_interface.txt new file mode 100644 index 0000000..1293d54 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_ip_interface.txt @@ -0,0 +1,10 @@ + + + IP Address I/F I/F Status Type Status + admin/oper +------------------- ---------- ------------- ----------- ----------- +10.0.3.5/8 vlan 202 UP/UP Static Valid + + + Gateway IP Address Type +----------------------- -------- diff --git a/test/unit/mocked_data/SG500-28-K9/show_ip_route.txt b/test/unit/mocked_data/SG500-28-K9/show_ip_route.txt new file mode 100644 index 0000000..8decd08 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_ip_route.txt @@ -0,0 +1,6 @@ +Maximum Parallel Paths: 1 (1 after reset) +IP Forwarding: disabled +Codes: > - best, C - connected, S - static + + +C 10.0.0.0/8 is directly connected, diff --git a/test/unit/mocked_data/SG500-28-K9/show_lldp_local_gi1-1-1.txt b/test/unit/mocked_data/SG500-28-K9/show_lldp_local_gi1-1-1.txt new file mode 100644 index 0000000..6bc6a35 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_lldp_local_gi1-1-1.txt @@ -0,0 +1,11 @@ + +Device ID: 0c:68:03:9c:39:c1 +Port ID: gi1/1/1 +Capabilities: Bridge +System Name: switch1 + + +802.1 PVID: 488 +802.1 PPVID: +802.1 VLAN: +802.1 Protocol: diff --git a/test/unit/mocked_data/SG500-28-K9/show_lldp_neighbor_gi1-1-26.txt b/test/unit/mocked_data/SG500-28-K9/show_lldp_neighbor_gi1-1-26.txt new file mode 100644 index 0000000..a4f4343 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_lldp_neighbor_gi1-1-26.txt @@ -0,0 +1,16 @@ + +Device ID: d8:84:66:ab:ba:de +Port ID: ge.1.1 +Capabilities: Other +System Name: +System description: +Port description: +Time To Live: 95 + + +802.1 PVID: None +802.1 PPVID: +802.1 VLAN: +802.1 Protocol: + + diff --git a/test/unit/mocked_data/SG500-28-K9/show_lldp_neighbors.txt b/test/unit/mocked_data/SG500-28-K9/show_lldp_neighbors.txt new file mode 100644 index 0000000..69e33a0 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_lldp_neighbors.txt @@ -0,0 +1,13 @@ + +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/1/3 00:23:24:02:66:e4 00:23:24:02:6 pc123.cli H 118 + 6:e4 ents.test.net +gi1/1/14 dc:4a:3e:53:fd:af dc:4a:3e:53:f O 3255 + d:af +gi1/1/26 d8:84:66:ab:ba:cd ge.1.1 O 114 diff --git a/test/unit/mocked_data/SG500-28-K9/show_ports_jumbo_frame.txt b/test/unit/mocked_data/SG500-28-K9/show_ports_jumbo_frame.txt new file mode 100644 index 0000000..4aafdc0 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_ports_jumbo_frame.txt @@ -0,0 +1,3 @@ + + Jumbo frames are disabled + Jumbo frames will be disabled after reset diff --git a/test/unit/mocked_data/SG500-28-K9/show_running-config.txt b/test/unit/mocked_data/SG500-28-K9/show_running-config.txt new file mode 100644 index 0000000..a2c1765 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_running-config.txt @@ -0,0 +1,154 @@ +config-file-header +switch1 +v1.3.5.58 / R750_NIK_1_35_647_358 +CLI v1.0 +set system mode switch queues-mode 4 + +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +vlan database +vlan 10,20,30 +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______________ +hostname switch1 +username cisco password encrypted dddd5d7b474d2c78ebbb833789c4bfd721edf4bf privilege 15 +ip ssh server +ip ssh password-auth +snmp-server server +snmp-server community findit ro view Default +! +interface vlan 10 + ip address 10.0.3.5 255.0.0.0 +! +interface gigabitethernet1/1/1 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/2 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/3 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/4 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/5 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/6 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/7 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/8 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/9 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/10 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/11 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/12 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/13 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/14 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/15 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/16 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/17 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/18 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/19 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/20 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/21 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/22 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/23 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/24 + switchport mode access + switchport access vlan 30 +! +interface gigabitethernet1/1/25 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/26 + spanning-tree disable + spanning-tree link-type point-to-point + switchport trunk allowed vlan add 10,30 + switchport trunk native vlan 20 + macro description switch + !next command is internal. + macro auto smartport dynamic_type switch +! +interface gigabitethernet1/1/27 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/28 + spanning-tree disable + switchport mode access + switchport access vlan 20 +! +exit diff --git a/test/unit/mocked_data/SG500-28-K9/show_sntp_status.txt b/test/unit/mocked_data/SG500-28-K9/show_sntp_status.txt new file mode 100644 index 0000000..6b90b23 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_sntp_status.txt @@ -0,0 +1,13 @@ + +Clock is unsynchronized + +Unicast servers: + + + +Anycast server: + + + +Broadcast: + diff --git a/test/unit/mocked_data/SG500-28-K9/show_startup-config.txt b/test/unit/mocked_data/SG500-28-K9/show_startup-config.txt new file mode 100644 index 0000000..a2c1765 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_startup-config.txt @@ -0,0 +1,154 @@ +config-file-header +switch1 +v1.3.5.58 / R750_NIK_1_35_647_358 +CLI v1.0 +set system mode switch queues-mode 4 + +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +vlan database +vlan 10,20,30 +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______________ +hostname switch1 +username cisco password encrypted dddd5d7b474d2c78ebbb833789c4bfd721edf4bf privilege 15 +ip ssh server +ip ssh password-auth +snmp-server server +snmp-server community findit ro view Default +! +interface vlan 10 + ip address 10.0.3.5 255.0.0.0 +! +interface gigabitethernet1/1/1 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/2 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/3 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/4 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/5 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/6 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/7 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/8 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/9 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/10 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/11 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/12 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/13 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/14 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/15 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/16 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/17 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/18 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/19 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/20 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/21 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/22 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/23 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/24 + switchport mode access + switchport access vlan 30 +! +interface gigabitethernet1/1/25 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/26 + spanning-tree disable + spanning-tree link-type point-to-point + switchport trunk allowed vlan add 10,30 + switchport trunk native vlan 20 + macro description switch + !next command is internal. + macro auto smartport dynamic_type switch +! +interface gigabitethernet1/1/27 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/28 + spanning-tree disable + switchport mode access + switchport access vlan 20 +! +exit diff --git a/test/unit/mocked_data/SG500-28-K9/show_system.txt b/test/unit/mocked_data/SG500-28-K9/show_system.txt new file mode 100644 index 0000000..a921d5c --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_system.txt @@ -0,0 +1,18 @@ + +Unit Type +---- ---------------------- + 1 SG500-28 + +Unit FAN + Status +---- --------- + 1 N/A + +Unit Temperature (Celsius) Temperature Sensor Status +---- ------------------------- ------------------------- + 1 N/A + + +Unit Up time +---- --------------- + 1 00,00:21:27 diff --git a/test/unit/mocked_data/SG500-28-K9/show_version.txt b/test/unit/mocked_data/SG500-28-K9/show_version.txt new file mode 100644 index 0000000..8c3e2f9 --- /dev/null +++ b/test/unit/mocked_data/SG500-28-K9/show_version.txt @@ -0,0 +1,4 @@ + + Unit SW version Boot version HW version +------------------- ------------------- ------------------- ------------------- + 1 1.4.11.5 1.3.5.06 V02 diff --git a/test/unit/mocked_data/test_get_arp_table/SG500-28-K9/expected_result.json b/test/unit/mocked_data/test_get_arp_table/SG500-28-K9/expected_result.json new file mode 100644 index 0000000..62f8007 --- /dev/null +++ b/test/unit/mocked_data/test_get_arp_table/SG500-28-K9/expected_result.json @@ -0,0 +1,4 @@ +[ + {"interface": "vlan 202", "mac": "00:15:17:27:9C:4D", "ip": "10.0.3.1", "age": 0.0}, + {"interface": "vlan 202", "mac": "00:50:56:90:23:E8", "ip": "10.0.3.4", "age": 0.0} +] diff --git a/test/unit/mocked_data/test_get_arp_table/SG500-28-K9/show_arp.txt b/test/unit/mocked_data/test_get_arp_table/SG500-28-K9/show_arp.txt new file mode 100644 index 0000000..6bd0a8b --- /dev/null +++ b/test/unit/mocked_data/test_get_arp_table/SG500-28-K9/show_arp.txt @@ -0,0 +1,9 @@ + +Total number of entries: 2 + + + VLAN Interface IP address HW address status +--------------------- --------------- ------------------- --------------- +vlan 202 10.0.3.1 00:15:17:27:9c:4d dynamic +vlan 202 10.0.3.4 00:50:56:90:23:e8 dynamic + diff --git a/test/unit/mocked_data/test_get_arp_table_with_vrf/SG500-28-K9/expected_result.json b/test/unit/mocked_data/test_get_arp_table_with_vrf/SG500-28-K9/expected_result.json new file mode 100644 index 0000000..62f8007 --- /dev/null +++ b/test/unit/mocked_data/test_get_arp_table_with_vrf/SG500-28-K9/expected_result.json @@ -0,0 +1,4 @@ +[ + {"interface": "vlan 202", "mac": "00:15:17:27:9C:4D", "ip": "10.0.3.1", "age": 0.0}, + {"interface": "vlan 202", "mac": "00:50:56:90:23:E8", "ip": "10.0.3.4", "age": 0.0} +] diff --git a/test/unit/mocked_data/test_get_arp_table_with_vrf/SG500-28-K9/show_arp.txt b/test/unit/mocked_data/test_get_arp_table_with_vrf/SG500-28-K9/show_arp.txt new file mode 100644 index 0000000..6bd0a8b --- /dev/null +++ b/test/unit/mocked_data/test_get_arp_table_with_vrf/SG500-28-K9/show_arp.txt @@ -0,0 +1,9 @@ + +Total number of entries: 2 + + + VLAN Interface IP address HW address status +--------------------- --------------- ------------------- --------------- +vlan 202 10.0.3.1 00:15:17:27:9c:4d dynamic +vlan 202 10.0.3.4 00:50:56:90:23:e8 dynamic + diff --git a/test/unit/mocked_data/test_get_config/SG500-28-K9/expected_result.json b/test/unit/mocked_data/test_get_config/SG500-28-K9/expected_result.json new file mode 100644 index 0000000..82a9705 --- /dev/null +++ b/test/unit/mocked_data/test_get_config/SG500-28-K9/expected_result.json @@ -0,0 +1,5 @@ +{ + "candidate": "", + "running": "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\nvlan database\nvlan 10,20,30\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nhostname switch1\nusername cisco password encrypted dddd5d7b474d2c78ebbb833789c4bfd721edf4bf privilege 15\nip ssh server\nip ssh password-auth\nsnmp-server server\nsnmp-server community findit ro view Default\n!\ninterface vlan 10\n ip address 10.0.3.5 255.0.0.0\n!\ninterface gigabitethernet1/1/1\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/2\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/3\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/4\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/5\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/6\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/7\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/8\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/9\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/10\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/11\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/12\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/13\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/14\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/15\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/16\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/17\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/18\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/19\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/20\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/21\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/22\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/23\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/24\n switchport mode access\n switchport access vlan 30\n!\ninterface gigabitethernet1/1/25\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/26\n spanning-tree disable\n spanning-tree link-type point-to-point\n switchport trunk allowed vlan add 10,30\n switchport trunk native vlan 20\n macro description switch\n !next command is internal.\n macro auto smartport dynamic_type switch\n!\ninterface gigabitethernet1/1/27\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/28\n spanning-tree disable\n switchport mode access\n switchport access vlan 20\n!\nexit", + "startup": "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\nvlan database\nvlan 10,20,30\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nhostname switch1\nusername cisco password encrypted dddd5d7b474d2c78ebbb833789c4bfd721edf4bf privilege 15\nip ssh server\nip ssh password-auth\nsnmp-server server\nsnmp-server community findit ro view Default\n!\ninterface vlan 10\n ip address 10.0.3.5 255.0.0.0\n!\ninterface gigabitethernet1/1/1\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/2\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/3\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/4\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/5\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/6\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/7\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/8\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/9\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/10\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/11\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/12\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/13\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/14\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/15\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/16\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/17\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/18\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/19\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/20\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/21\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/22\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/23\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/24\n switchport mode access\n switchport access vlan 30\n!\ninterface gigabitethernet1/1/25\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/26\n spanning-tree disable\n spanning-tree link-type point-to-point\n switchport trunk allowed vlan add 10,30\n switchport trunk native vlan 20\n macro description switch\n !next command is internal.\n macro auto smartport dynamic_type switch\n!\ninterface gigabitethernet1/1/27\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/28\n spanning-tree disable\n switchport mode access\n switchport access vlan 20\n!\nexit" +} diff --git a/test/unit/mocked_data/test_get_config/SG500-28-K9/show_running_config.txt b/test/unit/mocked_data/test_get_config/SG500-28-K9/show_running_config.txt new file mode 100644 index 0000000..a2c1765 --- /dev/null +++ b/test/unit/mocked_data/test_get_config/SG500-28-K9/show_running_config.txt @@ -0,0 +1,154 @@ +config-file-header +switch1 +v1.3.5.58 / R750_NIK_1_35_647_358 +CLI v1.0 +set system mode switch queues-mode 4 + +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +vlan database +vlan 10,20,30 +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______________ +hostname switch1 +username cisco password encrypted dddd5d7b474d2c78ebbb833789c4bfd721edf4bf privilege 15 +ip ssh server +ip ssh password-auth +snmp-server server +snmp-server community findit ro view Default +! +interface vlan 10 + ip address 10.0.3.5 255.0.0.0 +! +interface gigabitethernet1/1/1 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/2 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/3 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/4 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/5 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/6 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/7 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/8 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/9 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/10 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/11 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/12 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/13 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/14 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/15 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/16 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/17 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/18 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/19 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/20 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/21 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/22 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/23 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/24 + switchport mode access + switchport access vlan 30 +! +interface gigabitethernet1/1/25 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/26 + spanning-tree disable + spanning-tree link-type point-to-point + switchport trunk allowed vlan add 10,30 + switchport trunk native vlan 20 + macro description switch + !next command is internal. + macro auto smartport dynamic_type switch +! +interface gigabitethernet1/1/27 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/28 + spanning-tree disable + switchport mode access + switchport access vlan 20 +! +exit diff --git a/test/unit/mocked_data/test_get_config/SG500-28-K9/show_startup_config.txt b/test/unit/mocked_data/test_get_config/SG500-28-K9/show_startup_config.txt new file mode 100644 index 0000000..a2c1765 --- /dev/null +++ b/test/unit/mocked_data/test_get_config/SG500-28-K9/show_startup_config.txt @@ -0,0 +1,154 @@ +config-file-header +switch1 +v1.3.5.58 / R750_NIK_1_35_647_358 +CLI v1.0 +set system mode switch queues-mode 4 + +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +vlan database +vlan 10,20,30 +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______________ +hostname switch1 +username cisco password encrypted dddd5d7b474d2c78ebbb833789c4bfd721edf4bf privilege 15 +ip ssh server +ip ssh password-auth +snmp-server server +snmp-server community findit ro view Default +! +interface vlan 10 + ip address 10.0.3.5 255.0.0.0 +! +interface gigabitethernet1/1/1 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/2 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/3 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/4 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/5 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/6 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/7 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/8 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/9 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/10 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/11 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/12 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/13 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/14 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/15 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/16 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/17 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/18 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/19 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/20 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/21 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/22 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/23 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/24 + switchport mode access + switchport access vlan 30 +! +interface gigabitethernet1/1/25 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/26 + spanning-tree disable + spanning-tree link-type point-to-point + switchport trunk allowed vlan add 10,30 + switchport trunk native vlan 20 + macro description switch + !next command is internal. + macro auto smartport dynamic_type switch +! +interface gigabitethernet1/1/27 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/28 + spanning-tree disable + switchport mode access + switchport access vlan 20 +! +exit diff --git a/test/unit/mocked_data/test_get_config_filtered/SG500-28-K9/expected_result.json b/test/unit/mocked_data/test_get_config_filtered/SG500-28-K9/expected_result.json new file mode 100644 index 0000000..4b0f49d --- /dev/null +++ b/test/unit/mocked_data/test_get_config_filtered/SG500-28-K9/expected_result.json @@ -0,0 +1,5 @@ +{ + "startup": "", + "running": "", + "candidate": "" +} diff --git a/test/unit/mocked_data/test_get_config_filtered/SG500-28-K9/show_running_config.txt b/test/unit/mocked_data/test_get_config_filtered/SG500-28-K9/show_running_config.txt new file mode 100644 index 0000000..a2c1765 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_filtered/SG500-28-K9/show_running_config.txt @@ -0,0 +1,154 @@ +config-file-header +switch1 +v1.3.5.58 / R750_NIK_1_35_647_358 +CLI v1.0 +set system mode switch queues-mode 4 + +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +vlan database +vlan 10,20,30 +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______________ +hostname switch1 +username cisco password encrypted dddd5d7b474d2c78ebbb833789c4bfd721edf4bf privilege 15 +ip ssh server +ip ssh password-auth +snmp-server server +snmp-server community findit ro view Default +! +interface vlan 10 + ip address 10.0.3.5 255.0.0.0 +! +interface gigabitethernet1/1/1 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/2 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/3 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/4 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/5 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/6 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/7 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/8 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/9 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/10 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/11 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/12 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/13 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/14 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/15 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/16 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/17 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/18 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/19 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/20 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/21 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/22 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/23 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/24 + switchport mode access + switchport access vlan 30 +! +interface gigabitethernet1/1/25 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/26 + spanning-tree disable + spanning-tree link-type point-to-point + switchport trunk allowed vlan add 10,30 + switchport trunk native vlan 20 + macro description switch + !next command is internal. + macro auto smartport dynamic_type switch +! +interface gigabitethernet1/1/27 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/28 + spanning-tree disable + switchport mode access + switchport access vlan 20 +! +exit diff --git a/test/unit/mocked_data/test_get_config_filtered/SG500-28-K9/show_startup_config.txt b/test/unit/mocked_data/test_get_config_filtered/SG500-28-K9/show_startup_config.txt new file mode 100644 index 0000000..a2c1765 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_filtered/SG500-28-K9/show_startup_config.txt @@ -0,0 +1,154 @@ +config-file-header +switch1 +v1.3.5.58 / R750_NIK_1_35_647_358 +CLI v1.0 +set system mode switch queues-mode 4 + +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +vlan database +vlan 10,20,30 +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______________ +hostname switch1 +username cisco password encrypted dddd5d7b474d2c78ebbb833789c4bfd721edf4bf privilege 15 +ip ssh server +ip ssh password-auth +snmp-server server +snmp-server community findit ro view Default +! +interface vlan 10 + ip address 10.0.3.5 255.0.0.0 +! +interface gigabitethernet1/1/1 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/2 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/3 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/4 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/5 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/6 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/7 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/8 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/9 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/10 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/11 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/12 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/13 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/14 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/15 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/16 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/17 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/18 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/19 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/20 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/21 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/22 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/23 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/24 + switchport mode access + switchport access vlan 30 +! +interface gigabitethernet1/1/25 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/26 + spanning-tree disable + spanning-tree link-type point-to-point + switchport trunk allowed vlan add 10,30 + switchport trunk native vlan 20 + macro description switch + !next command is internal. + macro auto smartport dynamic_type switch +! +interface gigabitethernet1/1/27 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/28 + spanning-tree disable + switchport mode access + switchport access vlan 20 +! +exit diff --git a/test/unit/mocked_data/test_get_config_sanitized/SG500-28-K9/expected_result.json b/test/unit/mocked_data/test_get_config_sanitized/SG500-28-K9/expected_result.json new file mode 100644 index 0000000..a59ddbb --- /dev/null +++ b/test/unit/mocked_data/test_get_config_sanitized/SG500-28-K9/expected_result.json @@ -0,0 +1,5 @@ +{ + "candidate": "", + "running": "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\nvlan database\nvlan 10,20,30\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nhostname switch1\nusername cisco password encrypted privilege 15\nip ssh server\nip ssh password-auth\nsnmp-server server\nsnmp-server community \n!\ninterface vlan 10\n ip address 10.0.3.5 255.0.0.0\n!\ninterface gigabitethernet1/1/1\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/2\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/3\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/4\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/5\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/6\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/7\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/8\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/9\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/10\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/11\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/12\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/13\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/14\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/15\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/16\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/17\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/18\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/19\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/20\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/21\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/22\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/23\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/24\n switchport mode access\n switchport access vlan 30\n!\ninterface gigabitethernet1/1/25\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/26\n spanning-tree disable\n spanning-tree link-type point-to-point\n switchport trunk allowed vlan add 10,30\n switchport trunk native vlan 20\n macro description switch\n !next command is internal.\n macro auto smartport dynamic_type switch\n!\ninterface gigabitethernet1/1/27\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/28\n spanning-tree disable\n switchport mode access\n switchport access vlan 20\n!\nexit", + "startup": "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end cb0a3fdb1f3a1af4e4430033719968c0\n!\nvlan database\nvlan 10,20,30\nexit\nvoice vlan oui-table add 0001e3 Siemens_AG_phone________\nvoice vlan oui-table add 00036b Cisco_phone_____________\nvoice vlan oui-table add 00096e Avaya___________________\nvoice vlan oui-table add 000fe2 H3C_Aolynk______________\nvoice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone\nvoice vlan oui-table add 00d01e Pingtel_phone___________\nvoice vlan oui-table add 00e075 Polycom/Veritel_phone___\nvoice vlan oui-table add 00e0bb 3Com_phone______________\nhostname switch1\nusername cisco password encrypted privilege 15\nip ssh server\nip ssh password-auth\nsnmp-server server\nsnmp-server community \n!\ninterface vlan 10\n ip address 10.0.3.5 255.0.0.0\n!\ninterface gigabitethernet1/1/1\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/2\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/3\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/4\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/5\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/6\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/7\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/8\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/9\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/10\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/11\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/12\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/13\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/14\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/15\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/16\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/17\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/18\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/19\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/20\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/21\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/22\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/23\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/24\n switchport mode access\n switchport access vlan 30\n!\ninterface gigabitethernet1/1/25\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/26\n spanning-tree disable\n spanning-tree link-type point-to-point\n switchport trunk allowed vlan add 10,30\n switchport trunk native vlan 20\n macro description switch\n !next command is internal.\n macro auto smartport dynamic_type switch\n!\ninterface gigabitethernet1/1/27\n switchport mode access\n switchport access vlan 20\n!\ninterface gigabitethernet1/1/28\n spanning-tree disable\n switchport mode access\n switchport access vlan 20\n!\nexit" +} diff --git a/test/unit/mocked_data/test_get_config_sanitized/SG500-28-K9/show_running_config.txt b/test/unit/mocked_data/test_get_config_sanitized/SG500-28-K9/show_running_config.txt new file mode 100644 index 0000000..a2c1765 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_sanitized/SG500-28-K9/show_running_config.txt @@ -0,0 +1,154 @@ +config-file-header +switch1 +v1.3.5.58 / R750_NIK_1_35_647_358 +CLI v1.0 +set system mode switch queues-mode 4 + +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +vlan database +vlan 10,20,30 +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______________ +hostname switch1 +username cisco password encrypted dddd5d7b474d2c78ebbb833789c4bfd721edf4bf privilege 15 +ip ssh server +ip ssh password-auth +snmp-server server +snmp-server community findit ro view Default +! +interface vlan 10 + ip address 10.0.3.5 255.0.0.0 +! +interface gigabitethernet1/1/1 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/2 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/3 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/4 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/5 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/6 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/7 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/8 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/9 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/10 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/11 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/12 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/13 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/14 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/15 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/16 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/17 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/18 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/19 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/20 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/21 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/22 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/23 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/24 + switchport mode access + switchport access vlan 30 +! +interface gigabitethernet1/1/25 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/26 + spanning-tree disable + spanning-tree link-type point-to-point + switchport trunk allowed vlan add 10,30 + switchport trunk native vlan 20 + macro description switch + !next command is internal. + macro auto smartport dynamic_type switch +! +interface gigabitethernet1/1/27 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/28 + spanning-tree disable + switchport mode access + switchport access vlan 20 +! +exit diff --git a/test/unit/mocked_data/test_get_config_sanitized/SG500-28-K9/show_startup_config.txt b/test/unit/mocked_data/test_get_config_sanitized/SG500-28-K9/show_startup_config.txt new file mode 100644 index 0000000..a2c1765 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_sanitized/SG500-28-K9/show_startup_config.txt @@ -0,0 +1,154 @@ +config-file-header +switch1 +v1.3.5.58 / R750_NIK_1_35_647_358 +CLI v1.0 +set system mode switch queues-mode 4 + +file SSD indicator encrypted +@ +ssd-control-start +ssd config +ssd file passphrase control unrestricted +no ssd file integrity control +ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0 +! +vlan database +vlan 10,20,30 +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______________ +hostname switch1 +username cisco password encrypted dddd5d7b474d2c78ebbb833789c4bfd721edf4bf privilege 15 +ip ssh server +ip ssh password-auth +snmp-server server +snmp-server community findit ro view Default +! +interface vlan 10 + ip address 10.0.3.5 255.0.0.0 +! +interface gigabitethernet1/1/1 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/2 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/3 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/4 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/5 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/6 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/7 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/8 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/9 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/10 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/11 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/12 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/13 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/14 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/15 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/16 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/17 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/18 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/19 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/20 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/21 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/22 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/23 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/24 + switchport mode access + switchport access vlan 30 +! +interface gigabitethernet1/1/25 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/26 + spanning-tree disable + spanning-tree link-type point-to-point + switchport trunk allowed vlan add 10,30 + switchport trunk native vlan 20 + macro description switch + !next command is internal. + macro auto smartport dynamic_type switch +! +interface gigabitethernet1/1/27 + switchport mode access + switchport access vlan 20 +! +interface gigabitethernet1/1/28 + spanning-tree disable + switchport mode access + switchport access vlan 20 +! +exit diff --git a/test/unit/mocked_data/test_get_facts/SG500-28-K9/expected_result.json b/test/unit/mocked_data/test_get_facts/SG500-28-K9/expected_result.json new file mode 100644 index 0000000..11240c8 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG500-28-K9/expected_result.json @@ -0,0 +1,69 @@ +{ + "fqdn" : "switch1.", + "hostname" : "switch1", + "interface_list" : [ + "gi1/1/1", + "gi1/1/2", + "gi1/1/3", + "gi1/1/4", + "gi1/1/5", + "gi1/1/6", + "gi1/1/7", + "gi1/1/8", + "gi1/1/9", + "gi1/1/10", + "gi1/1/11", + "gi1/1/12", + "gi1/1/13", + "gi1/1/14", + "gi1/1/15", + "gi1/1/16", + "gi1/1/17", + "gi1/1/18", + "gi1/1/19", + "gi1/1/20", + "gi1/1/21", + "gi1/1/22", + "gi1/1/23", + "gi1/1/24", + "gi1/1/25", + "gi1/1/26", + "Po1", + "Po2", + "Po3", + "Po4", + "Po5", + "Po6", + "Po7", + "Po8", + "Po9", + "Po10", + "Po11", + "Po12", + "Po13", + "Po14", + "Po15", + "Po16", + "Po17", + "Po18", + "Po19", + "Po20", + "Po21", + "Po22", + "Po23", + "Po24", + "Po25", + "Po26", + "Po27", + "Po28", + "Po29", + "Po30", + "Po31", + "Po32" + ], + "model" : "SG500-28", + "os_version" : "1.4.11.5", + "serial_number" : "A1B2C3F4G5", + "uptime" : 1232968, + "vendor" : "Cisco" +} diff --git a/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_hosts.txt b/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_hosts.txt new file mode 100644 index 0000000..4813cc2 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_hosts.txt @@ -0,0 +1,32 @@ + +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/SG500-28-K9/show_interface_status.txt b/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_interface_status.txt new file mode 100644 index 0000000..990d901 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_interface_status.txt @@ -0,0 +1,65 @@ + Flow Link Back Mdix +Port Type Duplex Speed Neg ctrl State Pressure Mode +-------- ------------ ------ ----- -------- ---- ----------- -------- ------- +gi1/1/1 1G-Copper -- -- -- -- Down -- -- +gi1/1/2 1G-Copper -- -- -- -- Down -- -- +gi1/1/3 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/1/4 1G-Copper -- -- -- -- Down -- -- +gi1/1/5 1G-Copper -- -- -- -- Down -- -- +gi1/1/6 1G-Copper -- -- -- -- Down -- -- +gi1/1/7 1G-Copper -- -- -- -- Down -- -- +gi1/1/8 1G-Copper -- -- -- -- Down -- -- +gi1/1/9 1G-Copper -- -- -- -- Down -- -- +gi1/1/10 1G-Copper -- -- -- -- Down -- -- +gi1/1/11 1G-Copper -- -- -- -- Down -- -- +gi1/1/12 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/1/13 1G-Copper -- -- -- -- Down -- -- +gi1/1/14 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/1/15 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/1/16 1G-Copper -- -- -- -- Down -- -- +gi1/1/17 1G-Copper -- -- -- -- Down -- -- +gi1/1/18 1G-Copper -- -- -- -- Down -- -- +gi1/1/19 1G-Copper -- -- -- -- Down -- -- +gi1/1/20 1G-Copper -- -- -- -- Down -- -- +gi1/1/21 1G-Copper -- -- -- -- Down -- -- +gi1/1/22 1G-Copper -- -- -- -- Down -- -- +gi1/1/23 1G-Copper -- -- -- -- Down -- -- +gi1/1/24 1G-Copper -- -- -- -- Down -- -- +gi1/1/25 1G-Combo-C -- -- -- -- Down -- -- +gi1/1/26 1G-Combo-F Full 1000 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 +Po9 -- -- -- -- -- Not Present +Po10 -- -- -- -- -- Not Present +Po11 -- -- -- -- -- Not Present +Po12 -- -- -- -- -- Not Present +Po13 -- -- -- -- -- Not Present +Po14 -- -- -- -- -- Not Present +Po15 -- -- -- -- -- Not Present +Po16 -- -- -- -- -- Not Present +Po17 -- -- -- -- -- Not Present +Po18 -- -- -- -- -- Not Present +Po19 -- -- -- -- -- Not Present +Po20 -- -- -- -- -- Not Present +Po21 -- -- -- -- -- Not Present +Po22 -- -- -- -- -- Not Present +Po23 -- -- -- -- -- Not Present +Po24 -- -- -- -- -- Not Present +Po25 -- -- -- -- -- Not Present +Po26 -- -- -- -- -- Not Present +Po27 -- -- -- -- -- Not Present +Po28 -- -- -- -- -- Not Present +Po29 -- -- -- -- -- Not Present +Po30 -- -- -- -- -- Not Present +Po31 -- -- -- -- -- Not Present +Po32 -- -- -- -- -- Not Present diff --git a/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_inventory.txt b/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_inventory.txt new file mode 100644 index 0000000..ae69ee6 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_inventory.txt @@ -0,0 +1,3 @@ + +NAME: "1" DESCR: "SG500-28 28-Port Gigabit Stackable Managed Switch" +PID: SG500-28-K9 VID: V02 SN: A1B2C3F4G5 diff --git a/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_system.txt b/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_system.txt new file mode 100644 index 0000000..a921d5c --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_system.txt @@ -0,0 +1,18 @@ + +Unit Type +---- ---------------------- + 1 SG500-28 + +Unit FAN + Status +---- --------- + 1 N/A + +Unit Temperature (Celsius) Temperature Sensor Status +---- ------------------------- ------------------------- + 1 N/A + + +Unit Up time +---- --------------- + 1 00,00:21:27 diff --git a/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_version.txt b/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_version.txt new file mode 100644 index 0000000..8c3e2f9 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG500-28-K9/show_version.txt @@ -0,0 +1,4 @@ + + Unit SW version Boot version HW version +------------------- ------------------- ------------------- ------------------- + 1 1.4.11.5 1.3.5.06 V02 diff --git a/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/expected_result.json b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/expected_result.json new file mode 100644 index 0000000..80f7864 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/expected_result.json @@ -0,0 +1,236 @@ +{ + "gi1/1/1" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/2" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/3" : { + "description" : "", + "is_enabled" : true, + "is_up" : true, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 1000 + }, + "gi1/1/4" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/5" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/6" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/7" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/8" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/9" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/10" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/11" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/12" : { + "description" : "", + "is_enabled" : true, + "is_up" : true, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 1000 + }, + "gi1/1/13" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/14" : { + "description" : "", + "is_enabled" : true, + "is_up" : true, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 1000 + }, + "gi1/1/15" : { + "description" : "", + "is_enabled" : true, + "is_up" : true, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 1000 + }, + "gi1/1/16" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/17" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/18" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/19" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/20" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/21" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/22" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/23" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/24" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/25" : { + "description" : "", + "is_enabled" : false, + "is_up" : false, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 0 + }, + "gi1/1/26" : { + "description" : "", + "is_enabled" : true, + "is_up" : true, + "last_flapped" : -1.0, + "mac_address" : "0C:68:03:9C:39:C1", + "mtu" : 1518, + "speed" : 1000 + } +} diff --git a/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_interfaces_description.txt b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_interfaces_description.txt new file mode 100644 index 0000000..5d5477b --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_interfaces_description.txt @@ -0,0 +1,63 @@ +Port Description +------- ----------- +gi1/1/1 +gi1/1/2 +gi1/1/3 +gi1/1/4 +gi1/1/5 +gi1/1/6 +gi1/1/7 +gi1/1/8 +gi1/1/9 +gi1/1/10 +gi1/1/11 +gi1/1/12 +gi1/1/13 +gi1/1/14 +gi1/1/15 +gi1/1/16 +gi1/1/17 +gi1/1/18 +gi1/1/19 +gi1/1/20 +gi1/1/21 +gi1/1/22 +gi1/1/23 +gi1/1/24 +gi1/1/25 +gi1/1/26 + +Ch Description +------- ----------- +Po1 +Po2 +Po3 +Po4 +Po5 +Po6 +Po7 +Po8 +Po9 +Po10 +Po11 +Po12 +Po13 +Po14 +Po15 +Po16 +Po17 +Po18 +Po19 +Po20 +Po21 +Po22 +Po23 +Po24 +Po25 +Po26 +Po27 +Po28 +Po29 +Po30 +Po31 +Po32 diff --git a/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_interfaces_status.txt b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_interfaces_status.txt new file mode 100644 index 0000000..990d901 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_interfaces_status.txt @@ -0,0 +1,65 @@ + Flow Link Back Mdix +Port Type Duplex Speed Neg ctrl State Pressure Mode +-------- ------------ ------ ----- -------- ---- ----------- -------- ------- +gi1/1/1 1G-Copper -- -- -- -- Down -- -- +gi1/1/2 1G-Copper -- -- -- -- Down -- -- +gi1/1/3 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/1/4 1G-Copper -- -- -- -- Down -- -- +gi1/1/5 1G-Copper -- -- -- -- Down -- -- +gi1/1/6 1G-Copper -- -- -- -- Down -- -- +gi1/1/7 1G-Copper -- -- -- -- Down -- -- +gi1/1/8 1G-Copper -- -- -- -- Down -- -- +gi1/1/9 1G-Copper -- -- -- -- Down -- -- +gi1/1/10 1G-Copper -- -- -- -- Down -- -- +gi1/1/11 1G-Copper -- -- -- -- Down -- -- +gi1/1/12 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi1/1/13 1G-Copper -- -- -- -- Down -- -- +gi1/1/14 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/1/15 1G-Copper Full 1000 Enabled Off Up Disabled On +gi1/1/16 1G-Copper -- -- -- -- Down -- -- +gi1/1/17 1G-Copper -- -- -- -- Down -- -- +gi1/1/18 1G-Copper -- -- -- -- Down -- -- +gi1/1/19 1G-Copper -- -- -- -- Down -- -- +gi1/1/20 1G-Copper -- -- -- -- Down -- -- +gi1/1/21 1G-Copper -- -- -- -- Down -- -- +gi1/1/22 1G-Copper -- -- -- -- Down -- -- +gi1/1/23 1G-Copper -- -- -- -- Down -- -- +gi1/1/24 1G-Copper -- -- -- -- Down -- -- +gi1/1/25 1G-Combo-C -- -- -- -- Down -- -- +gi1/1/26 1G-Combo-F Full 1000 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 +Po9 -- -- -- -- -- Not Present +Po10 -- -- -- -- -- Not Present +Po11 -- -- -- -- -- Not Present +Po12 -- -- -- -- -- Not Present +Po13 -- -- -- -- -- Not Present +Po14 -- -- -- -- -- Not Present +Po15 -- -- -- -- -- Not Present +Po16 -- -- -- -- -- Not Present +Po17 -- -- -- -- -- Not Present +Po18 -- -- -- -- -- Not Present +Po19 -- -- -- -- -- Not Present +Po20 -- -- -- -- -- Not Present +Po21 -- -- -- -- -- Not Present +Po22 -- -- -- -- -- Not Present +Po23 -- -- -- -- -- Not Present +Po24 -- -- -- -- -- Not Present +Po25 -- -- -- -- -- Not Present +Po26 -- -- -- -- -- Not Present +Po27 -- -- -- -- -- Not Present +Po28 -- -- -- -- -- Not Present +Po29 -- -- -- -- -- Not Present +Po30 -- -- -- -- -- Not Present +Po31 -- -- -- -- -- Not Present +Po32 -- -- -- -- -- Not Present diff --git a/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_ip_int.txt b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_ip_int.txt new file mode 100644 index 0000000..1293d54 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_ip_int.txt @@ -0,0 +1,10 @@ + + + IP Address I/F I/F Status Type Status + admin/oper +------------------- ---------- ------------- ----------- ----------- +10.0.3.5/8 vlan 202 UP/UP Static Valid + + + Gateway IP Address Type +----------------------- -------- diff --git a/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_lldp_local_gi1_1_1.txt b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_lldp_local_gi1_1_1.txt new file mode 100644 index 0000000..6bc6a35 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_lldp_local_gi1_1_1.txt @@ -0,0 +1,11 @@ + +Device ID: 0c:68:03:9c:39:c1 +Port ID: gi1/1/1 +Capabilities: Bridge +System Name: switch1 + + +802.1 PVID: 488 +802.1 PPVID: +802.1 VLAN: +802.1 Protocol: diff --git a/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_ports_jumbo_frame.txt b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_ports_jumbo_frame.txt new file mode 100644 index 0000000..4aafdc0 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG500-28-K9/show_ports_jumbo_frame.txt @@ -0,0 +1,3 @@ + + Jumbo frames are disabled + Jumbo frames will be disabled after reset diff --git a/test/unit/mocked_data/test_get_interfaces_ip/SG500-28-K9/expected_result.json b/test/unit/mocked_data/test_get_interfaces_ip/SG500-28-K9/expected_result.json new file mode 100644 index 0000000..0d90d50 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces_ip/SG500-28-K9/expected_result.json @@ -0,0 +1 @@ +{"vlan 202": {"ipv4": {"10.0.3.5": {"prefix_length": 8}}}} diff --git a/test/unit/mocked_data/test_get_interfaces_ip/SG500-28-K9/show_ip_int.txt b/test/unit/mocked_data/test_get_interfaces_ip/SG500-28-K9/show_ip_int.txt new file mode 100644 index 0000000..1293d54 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces_ip/SG500-28-K9/show_ip_int.txt @@ -0,0 +1,10 @@ + + + IP Address I/F I/F Status Type Status + admin/oper +------------------- ---------- ------------- ----------- ----------- +10.0.3.5/8 vlan 202 UP/UP Static Valid + + + Gateway IP Address Type +----------------------- --------