diff --git a/README.md b/README.md index d18e636..16be5fc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Napalm-s350 -NAPALM driver for Cisco SMB switches (SF3xx, SF5xx, SG3xx, SG5xx, CBS35x). +NAPALM driver for Cisco SMB switches (SF3xx, SF5xx, SG250, SG3xx, SG5xx, CBS35x). ## Status @@ -45,58 +45,58 @@ napalm --user USER --password PASSWORD --vendor s350 --debug HOSTNAME ## Supported devices -This driver initially targets the Cisco SG350 device though other, similar, devices may +This driver initially targets the Cisco SG350 device though other, similar, devices are be supported. -| function | SG300 | SG500 | SG350 | SG550 | stack SG500 | stack SG550 | CBS350 | -| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| **Send commands** | -| cli | x | x | x | x | x | x | x | -| **Config manipulation** | -|get_config | x | x | x | x | | | x | -|get_config (filtered) | x | x | x | x | | | x | -|get_config (sanitized) | x | x | x | x | | | x | -|load_merge_candidate | | | | | | | | -|load_replace_candidate | | | | | | | | -|compare_config | | | | | | | | -|commit_config | | | | | | | | -|confirm_commit | | | | | | | | -|has_pending_commit | | | | | | | | -|rollback | | | | | | | | -|discard_config | | | | | | | | -|compliance_report | | | | | | | | -|load_template | | | | | | | | -| **Get information** | -|get_arp_table | x | x | x | x | | | x | -|get_arp_table (with vrf) | NS | NS | NS | NS | | | NS | -|get_bgp_config | | | | | | | | -|get_bgp_neighbors | | | | | | | | -|get_bgp_neighbors_detail | | | | | | | | -|get_environment | | | | | | | | -|get_facts | x | x | x | x | | | x | -|get_firewall_policies | | | | | | | | -|get_interfaces | x | x | x | x | | | x | -|get_interfaces_counters | | | | | | | | -|get_interfaces_ip | x 4 | x 4 | x 4 | x 4 | | | x 4 | -|get_ipv6_neighbors_table | | | | | | | | -|get_lldp_neighbors | x | x | x | x | | | x | -|get_lldp_neighbors_detail | x | x | x | x | | | x | -|get_mac_address_table | | | | | | | | -|get_network_instances | | | | | | | | -|get_ntp_peers | | | | | | | | -|get_ntp_servers | x | x | x | x | | | x | -|get_ntp_stats | | | | | | | | -|get_optics | | | | | | | | -|get_probes_config | | | | | | | | -|get_probes_results | | | | | | | | -|get_route_to | | | | | | | | -|get_snmp_information | | | | | | | | -|get_users | | | | | | | | -|get_vlans | x | x | x | x | | | x | -| **Other actions** | -|is_alive | | | | | | | | -|ping | | | | | | | | -|traceroute | | | | | | | | +| function | SG250 | SG300 | SG500 | SG350 | SG550 | stack SG500 | stack SG550 | CBS350 | +| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| **Send commands** | +| cli | x | x | x | x | x | x | x | x | +| **Config manipulation** | +|get_config | x | x | x | x | x | | | x | +|get_config (filtered) | x | x | x | x | x | | | x | +|get_config (sanitized) | x | x | x | x | x | | | x | +|load_merge_candidate | | | | | | | | | +|load_replace_candidate | | | | | | | | | +|compare_config | | | | | | | | | +|commit_config | | | | | | | | | +|confirm_commit | | | | | | | | | +|has_pending_commit | | | | | | | | | +|rollback | | | | | | | | | +|discard_config | | | | | | | | | +|compliance_report | | | | | | | | | +|load_template | | | | | | | | | +| **Get information** | +|get_arp_table | x | x | x | x | x | | | x | +|get_arp_table (with vrf) | NS | NS | NS | NS | NS | | | NS | +|get_bgp_config | | | | | | | | | +|get_bgp_neighbors | | | | | | | | | +|get_bgp_neighbors_detail | | | | | | | | | +|get_environment | | | | | | | | | +|get_facts | x | x | x | x | x | | | x | +|get_firewall_policies | | | | | | | | | +|get_interfaces | x | x | x | x | x | | | x | +|get_interfaces_counters | | | | | | | | | +|get_interfaces_ip | x 4 | x 4 | x 4 | x 4 | x 4 | | | x 4 | +|get_ipv6_neighbors_table | | | | | | | | | +|get_lldp_neighbors | x | x | x | x | x | | | x | +|get_lldp_neighbors_detail | x | x | x | x | x | | | x | +|get_mac_address_table | | | | | | | | | +|get_network_instances | | | | | | | | | +|get_ntp_peers | | | | | | | | | +|get_ntp_servers | x | x | x | x | x | | | x | +|get_ntp_stats | | | | | | | | | +|get_optics | | | | | | | | | +|get_probes_config | | | | | | | | | +|get_probes_results | | | | | | | | | +|get_route_to | | | | | | | | | +|get_snmp_information | | | | | | | | | +|get_users | | | | | | | | | +|get_vlans | x | x | x | x | x | | | x | +| **Other actions** | +|is_alive | x | x | x | x | x | x | x | x | +|ping | | | | | | | | | +|traceroute | | | | | | | | | NS - not supported - devices do not have support for that feature diff --git a/test/unit/command_output/SG250-10P/show_arp.txt b/test/unit/command_output/SG250-10P/show_arp.txt new file mode 100644 index 0000000..587fcab --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_arp.txt @@ -0,0 +1,10 @@ +Total number of entries: 5 + + + VLAN Interface IP address HW address status +--------------------- --------------- ------------------- --------------- +vlan 1 gi10 30.70.0.3 00:00:0a:0a:aa:02 dynamic +vlan 1 gi10 30.70.0.3 a0:02:aa:aa:fa:aa dynamic +vlan 1 gi10 30.70.0.3 a0:02:aa:aa:fa:aa dynamic +vlan 1 gi10 30.70.3.33 00:a0:a2:a2:2f:a2 dynamic +vlan 1 gi10 30.70.33.3 aa:a2:a2:aa:fa:2a dynamic diff --git a/test/unit/command_output/SG250-10P/show_hosts.txt b/test/unit/command_output/SG250-10P/show_hosts.txt new file mode 100644 index 0000000..e13ba7f --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_hosts.txt @@ -0,0 +1,38 @@ +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 +-------------------------------------------- ------- --------- ---------- +30.70.3.33 static 1 + + +Cache Table +Flags: (STA/DYN, OK/NE/??) +STA - Static, DYN - Dynamic +OK - Okay, NE - Negative Cache, ?? - No Response + + Remaining + Host Addresses Type State TTL +------------------------- ------------------------ ---- ------ ---------- +tftp 30.70.3.33 IPv4 STA,OK +ntp.examples.com 30.70.3.33 IPv4 DYN,OK 0003:38:43 +ntp.examples.com no resolution IPv6 DYN,?? +ntp.ph.examp.com 30.30.3.33 IPv4 DYN,OK 0003:38:43 +ntp.ph.examp.com no resolution IPv6 DYN,?? +pnpserver.qqq.aa no resolution IPv6 DYN,NE 0020:55:13 +pnpserver.qqq.aa no resolution IPv4 DYN,NE 0020:55:13 +pingu.examples.com 30.70.3.33 IPv4 DYN,OK 0003:38:43 +ns-cb-1.examples.com 30.70.3.300 IPv4 DYN,OK 0003:38:43 +ns-cb-2.examples.com 30.70.3.300 IPv4 DYN,OK 0003:38:43 diff --git a/test/unit/command_output/SG250-10P/show_interface_switchport_gi1.txt b/test/unit/command_output/SG250-10P/show_interface_switchport_gi1.txt new file mode 100644 index 0000000..42a3d03 --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_interface_switchport_gi1.txt @@ -0,0 +1,23 @@ +Gathering information... + +Name: gi1 +Switchport: enable +Administrative Mode: access +Operational Mode: up +Access Mode VLAN: 1 +Trunking Native Mode VLAN: 1 +Trunking VLANs: 1,7-8,10-11,30-31,100,200,480,490-491,1000-1001 + 2-6,9,12-29,32-99,101-199,201-479,481-489,492-999, + 1002-4094 (Inactive) +General PVID: 1 +General VLANs: none +General Egress Tagged VLANs: none +General Forbidden VLANs: none +General Ingress Filtering: enabled +General Acceptable Frame Type: all +General GVRP status: disabled +Customer Mode VLAN: none + + + +Classification rules: diff --git a/test/unit/command_output/SG250-10P/show_interfaces_description.txt b/test/unit/command_output/SG250-10P/show_interfaces_description.txt new file mode 100644 index 0000000..e46ead9 --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_interfaces_description.txt @@ -0,0 +1,19 @@ +Port Description +------- ----------- +gi1 +gi2 +gi3 +gi4 +gi5 +gi6 +gi7 +gi8 +gi9 +gi10 Trunk to switchkuch-1 + +Ch Description +------- ----------- +Po1 +Po2 +Po3 +Po4 diff --git a/test/unit/command_output/SG250-10P/show_interfaces_status.txt b/test/unit/command_output/SG250-10P/show_interfaces_status.txt new file mode 100644 index 0000000..d61d603 --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_interfaces_status.txt @@ -0,0 +1,21 @@ +Flow Link Back Mdix +Port Type Duplex Speed Neg ctrl State Pressure Mode +-------- ------------ ------ ----- -------- ---- ----------- -------- ------- +gi1 1G-Copper Half 10 Enabled Off Up Disabled On +gi2 1G-Copper Half 10 Enabled Off Up Disabled On +gi3 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi4 1G-Copper Full 100 Enabled Off Up Disabled On +gi5 1G-Copper Full 100 Enabled Off Up Disabled On +gi6 1G-Copper Full 100 Enabled Off Up Disabled On +gi7 1G-Copper Half 10 Enabled Off Up Disabled On +gi8 1G-Copper Full 100 Enabled Off Up Disabled Off +gi9 1G-Combo-C -- -- -- -- Down -- -- +gi10 1G-Combo-C Full 100 Enabled 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 diff --git a/test/unit/command_output/SG250-10P/show_inventory.txt b/test/unit/command_output/SG250-10P/show_inventory.txt new file mode 100644 index 0000000..0869d85 --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_inventory.txt @@ -0,0 +1,2 @@ +NAME: "1" DESCR: "SG250-10P 10-Port Gigabit PoE Smart Switch" +PID: SG250-10P-K9 VID: V04 SN: ABC12234XYZ diff --git a/test/unit/command_output/SG250-10P/show_ip_interface.txt b/test/unit/command_output/SG250-10P/show_ip_interface.txt new file mode 100644 index 0000000..cfb8e0a --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_ip_interface.txt @@ -0,0 +1,4 @@ +IP Address I/F I/F Status Type Directed Prec Redirect Status + admin/oper Broadcast +------------------ --------- ---------- ------- --------- ---- -------- ------ +30.70.0.37/17 vlan 1 UP/UP Static disable No enable Valid diff --git a/test/unit/command_output/SG250-10P/show_ipv6_interface_brief.txt b/test/unit/command_output/SG250-10P/show_ipv6_interface_brief.txt new file mode 100644 index 0000000..5f92af4 --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_ipv6_interface_brief.txt @@ -0,0 +1,4 @@ +Interface Interface IPv6 Link Local MLD Number of + State State IPv6 Address Version Global Addresses +---------- --------- --------- ------------------------- ------- ---------------- + vlan 1 up/up enabled fe80::c644:a0ff:fe3b:17d2 2 0 diff --git a/test/unit/command_output/SG250-10P/show_lldp_local_gi10.txt b/test/unit/command_output/SG250-10P/show_lldp_local_gi10.txt new file mode 100644 index 0000000..e4a558c --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_lldp_local_gi10.txt @@ -0,0 +1,28 @@ +Device ID: aa:aa:a0:22:2a:a2 +Port ID: gi10 +Capabilities: Bridge, Router +System Name: switch-no-2548-1 +Management address: 30.70.0.37 +Management address: fe80::c644:a0ff:fe3b:17d2%vlan1 + +802.3 Power Via Mdi: + MDI Power support Port Class: PSE + PSE MDI Power Support: Not supported + PSE MDI Power State: Not enabled + PSE power pair control ability: Not supported + PSE Power Pair: Signal + PSE Power class: 1 + Power Type: Type 2 PD + Power Source: Unknown Power Source + Power Priority: unknown + PSE Allocated Power Value: 0.0 + +4-Pair POE supported: No +Spare Pair Detection/Classification required: No +PD Spare Pair Desired State: Disabled + + +802.1 PVID: 1 +802.1 PPVID: +802.1 VLAN: +802.1 Protocol: diff --git a/test/unit/command_output/SG250-10P/show_lldp_neighbors.txt b/test/unit/command_output/SG250-10P/show_lldp_neighbors.txt new file mode 100644 index 0000000..6cd576d --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_lldp_neighbors.txt @@ -0,0 +1,9 @@ +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 +--------- ----------------- ----------------- ----------------- ------------ ----- +gi3 aa:aa:22:a2:22:2a aa:aa:22:a2:22:2a O 2938 +gi10 00:2a:aa:a2:2a:20 Fa0/22 switchkuch-1 B 102 diff --git a/test/unit/command_output/SG250-10P/show_lldp_neighbors_gi10.txt b/test/unit/command_output/SG250-10P/show_lldp_neighbors_gi10.txt new file mode 100644 index 0000000..3196c7d --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_lldp_neighbors_gi10.txt @@ -0,0 +1,22 @@ +Device ID: 00:2a:aa:a2:2a:20 +Port ID: Fa0/22 +Capabilities: Bridge +System Name: switchkuch-1 +System description: Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(2)SE11, RELEASE SOFTWARE (fc3) +Technical Support: http://www.cisco.com/techsupport +Copyrigh +Port description: FastEthernet0/22 +Management Address: 30.70.0.33 +Time To Live: 91 + + +802.3 MAC/PHY Configuration/Status +Auto-negotiation support: Supported +Auto-negotiation status: Enabled +Auto-negotiation Advertised Capabilities: 100BASE-TX full duplex mode, 100BASE-TX half duplex mode, 10BASE-T full duplex mode, 10BASE-T half duplex mode +Operational MAU type: 100BaseTXFD + +802.1 PVID: 1 +802.1 PPVID: +802.1 VLAN: +802.1 Protocol: diff --git a/test/unit/command_output/SG250-10P/show_ports_jumbo_frame.txt b/test/unit/command_output/SG250-10P/show_ports_jumbo_frame.txt new file mode 100644 index 0000000..7aa3793 --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_ports_jumbo_frame.txt @@ -0,0 +1,2 @@ +Jumbo frames are enabled + Jumbo frames will be enabled after reset diff --git a/test/unit/command_output/SG250-10P/show_running_config.txt b/test/unit/command_output/SG250-10P/show_running_config.txt new file mode 100644 index 0000000..ed0fcf6 --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_running_config.txt @@ -0,0 +1,136 @@ +config-file-header +switch-no-2548-1 +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 ABCD1234abcdABCD1234abcdABCD12c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink none +unit-type-control-end +! +cdp device-id format hostname +spanning-tree mode mst +spanning-tree loopback-guard +port jumbo-frame +vlan database +vlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001 +exit +voice vlan id 7 +voice vlan state disabled +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______________ +no eee enable +link-flap prevention disable +bonjour interface range vlan 1 +hostname switch-no-2548-1 +logging host 30.70.3.33 +logging host 30.73.3.30 port 50001 +logging buffered notifications +logging origin-id hostname +logging console errors +no passwords complexity enable +passwords aging 0 +username admin password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +username cisco password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +crypto key pubkey-chain ssh +user-key admin rsa +key-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L +key-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB +key-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav +key-string row ABCD1234abcdABCD1234abcdABCD12dS +key-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9 +key-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7 +key-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF +key-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv +key-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV +key-string row SWtO0EiL2pTczbwxGw== +exit +exit +snmp-server server +snmp-server location "Something;Somewhere;Somestreet;othersatnice;0;vratnice" +snmp-server community Abcdef rw view DefaultSuper +clock timezone CET +1 +clock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00 +sntp server 30.30.3.33 poll +sntp server 30.70.3.33 poll +sntp server ntp.examples.com poll +sntp server ntp.ph.examp.com poll +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 name-server 30.70.3.33 +ip host tftp 30.70.3.33 +! +interface vlan 1 + name default + ip address 30.70.0.37 333.333.337.0 + no ip address dhcp +! +interface vlan 7 + name VoIP-Phones +! +interface vlan 8 + name INET_DMZ +! +interface vlan 10 + name AD-Clients +! +interface vlan 11 + name VOIP_VoiceTrunk +! +interface vlan 30 + name Alantis_DMZ +! +interface vlan 31 + name Abcdef_DMZ +! +interface vlan 100 + name RAW_Inet_Abcdef +! +interface vlan 200 + name ABC-ADS +! +interface vlan 480 + name ABC-ITMGMT +! +interface vlan 490 + name HOSTNET +! +interface vlan 491 + name TECHNET +! +interface vlan 1000 + name ABC-IT +! +interface vlan 1001 + name CES-MAR +! +interface GigabitEthernet8 + no eee enable + no eee lldp enable + power inline priority critical +! +interface GigabitEthernet9 + switchport trunk native vlan none +! +interface GigabitEthernet10 + description "Trunk to switchkuch-1" +! +exit +ip default-gateway 30.70.0.3 diff --git a/test/unit/command_output/SG250-10P/show_running_config_detailed.txt b/test/unit/command_output/SG250-10P/show_running_config_detailed.txt new file mode 100644 index 0000000..a1ccb4a --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_running_config_detailed.txt @@ -0,0 +1,344 @@ +config-file-header +switch-no-2548-1 +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 ABCD1234abcdABCD1234abcdABCD12c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink none +unit-type-control-end +! +cdp device-id format hostname +spanning-tree mode mst +spanning-tree loopback-guard +port jumbo-frame +vlan database +vlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001 +exit +voice vlan id 7 +voice vlan state disabled +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______________ +no eee enable +link-flap prevention disable +bonjour interface range vlan 1 +hostname switch-no-2548-1 +logging host 30.70.3.33 +logging host 30.73.3.30 port 50001 +logging buffered notifications +logging origin-id hostname +logging console errors +no passwords complexity enable +passwords aging 0 +username admin password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +username cisco password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +crypto key pubkey-chain ssh +user-key admin rsa +key-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L +key-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB +key-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav +key-string row ABCD1234abcdABCD1234abcdABCD12dS +key-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9 +key-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7 +key-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF +key-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv +key-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV +key-string row SWtO0EiL2pTczbwxGw== +exit +exit +snmp-server server +snmp-server location "Something;Somewhere;Somestreet;othersatnice;0;vratnice" +snmp-server community Abcdef rw view DefaultSuper +clock timezone CET +1 +clock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00 +sntp server 30.30.3.33 poll +sntp server 30.70.3.33 poll +sntp server ntp.examples.com poll +sntp server ntp.ph.examp.com poll +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 name-server 30.70.3.33 +ip host tftp 30.70.3.33 +! +interface vlan 1 + name default + ip address 30.70.0.37 333.333.337.0 + no ip address dhcp +! +interface vlan 7 + name VoIP-Phones +! +interface vlan 8 + name INET_DMZ +! +interface vlan 10 + name AD-Clients +! +interface vlan 11 + name VOIP_VoiceTrunk +! +interface vlan 30 + name Alantis_DMZ +! +interface vlan 31 + name Abcdef_DMZ +! +interface vlan 100 + name RAW_Inet_Abcdef +! +interface vlan 200 + name ABC-ADS +! +interface vlan 480 + name ABC-ITMGMT +! +interface vlan 490 + name HOSTNET +! +interface vlan 491 + name TECHNET +! +interface vlan 1000 + name ABC-IT +! +interface vlan 1001 + name CES-MAR +! +interface GigabitEthernet8 + no eee enable + no eee lldp enable + power inline priority critical +! +interface GigabitEthernet9 + switchport trunk native vlan none +! +interface GigabitEthernet10 + description "Trunk to switchkuch-1" +! +exit +ip default-gateway 30.70.0.3 +encrypted ip ssh-client key rsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: RSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u/LrfNpsC+ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12nGmfnMiTzL +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123BLQIyiTXh +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD128sfN3HfTcT +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD122JkvT8qdYc +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD127RLGCjKRGg +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12DUHsuYRcp4 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12ecNyEd+yKG +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD129xA6s+kaKr +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123iQURrQLpf +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qaNplfEtQQ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Fzg1zCmKmm +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12XbJtiivB9P +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qybAVD6G7N +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u+epBMcIsl +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12== +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LOFaFaMAP/ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12X/gDrfYHCu +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Uw== +---- END SSH2 PUBLIC KEY ---- +. +encrypted ip ssh-client key dsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12EQTG4SHh6Z +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FNfTUMF6C6 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12i4B02/IZGI +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12yX7nY+AOPD +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12pL8r4cXujS +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12a6Ut3tCQVy +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FsYD/d5xWs +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lzxObeJ7Z1 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12mOCGodNRAf +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LpzOPWsz6N +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD1248vEoC1X0n +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12SV +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: DSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12cHQnMuaXDn +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qvE1vMH5xv +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lc4rWWCO6b +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12TVuouFfgdF +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12wj/WAxB4Op +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lSIoIAfpkY +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12RqD0MS/9X5 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12m52u4/cBjY +qCqdkBI+B+YqB1jT8w== +---- END SSH2 PUBLIC KEY ---- +. +encrypted crypto key import rsa +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: RSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12HfFN/t6mrn +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12leUuQRAE3r +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12ph+BMV+zoK +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12owcM8eMQc4 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12j0GdaIYymI +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12mBERWZS9yn +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FfZ61pGA0E +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12nFblQwqlLz +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12NFgqqd/Ovu +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12/UyO9GZdrl +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Er8rZ3KXd/ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12OLlaZgNBmp +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12rf6LnXW9zu +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD1254f+8C0+RJ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD126zrXbeUmMy +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12bzpZs3ULkB +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12/wc1tCCcS1 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12BZPI/Ia/+b +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12WEtqDZEZHR +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12d6P2D2+Lyo +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12EXXQVexC6l +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12HiX7SNPQUP +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12ru1XZNqfTb +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12vkcGzLNRsy +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LnjG1C1TC6 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12VJ5QZM7QjA +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12J9hmCQiBBX +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD120IndIWlcr5 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12ObpNMgjA+5 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123Y8m38ZXel +ABCD1234abcdABCD1234abcdABCD12iblPSFnmTkUjmn0F66SXkYr9c= +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12T7spyGafHq +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LZ8NmwUWsX +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD128FXj/KyM8Y +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12dVNDDKQ7b7 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD1289PePpB2hK +wWsR3o31jieUDPuJHiF9ct +---- END SSH2 PUBLIC KEY ---- +. +encrypted crypto key import dsa +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12sJyscnEiqF +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12nz8l/mDHr6 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12stuvbpxf67 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12fUn1luijBA +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12wOfCv2HS8g +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12GFU0/MT5pi +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12RQKxzDD8e3 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD127ShMpjuj+A +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD125gcEo/V3bj +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD120CdOvLaMpp +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12VkLQkD8V5E +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12w5 +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: DSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12bGalP3WyZb +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12uNBpFHaUM/ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD1243Gjb39POS +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123d1y590sjp +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12l49MjUVJMZ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12v5LMRh17hn +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12k7o9FluzLB +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12EMHIERXIpn ++law1StDs94htBVGduq5 +---- END SSH2 PUBLIC KEY ---- +. +encrypted crypto certificate 1 import +-----BEGIN RSA ENCRYPTED PRIVATE KEY----- +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12PqlROt9PbC +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lW2vL9PIdp +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12SCgXBfu2w7 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12mtF5wPhRBn +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12d/tiwCoUbh +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12A0mFgJW/OH +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FC8GAkNDiT +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123VJ2gc5zqj +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12DaXI+i1sRC +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD127rTLOW2GAH +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12XX7rpCPD1l +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD128a3GWquAdS +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12wdjTaOSU2y +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12flkR1VgZE8 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD124hlkl3MyfK +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12== +-----END RSA PRIVATE KEY----- +-----BEGIN RSA PUBLIC KEY----- +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD120lipcLf63E +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD129F8Z6WQyVZ +ABCD1234abcdABCD1234abcdABCD12OR5RC9PeyXAgMBAAE= +-----END RSA PUBLIC KEY----- +-----BEGIN CERTIFICATE----- +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12MAkG +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LjYw +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12WhcN +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12A1UE +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12CwwB +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12SvHJ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12U92A +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Onhj +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12KnGK +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12B5A/ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12jSMG +ABCD1234abcdABCD1234abcdABCD12== +-----END CERTIFICATE----- +. +encrypted crypto certificate 2 import +-----BEGIN RSA ENCRYPTED PRIVATE KEY----- +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qwoM0cJ1ur +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12EWAGogUbim +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12ngr2AFknSH +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12br7QMii/P5 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12WLR7/S951D +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12i8ND7P1D7q +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD1218fUMea+zA +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12+d0a6XJpGq +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12zVcHjtEC1W +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12hCkZzUM/as +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12x3z52g9S9W +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12W1na5HHzNC +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD125ABC+SovX0 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12fvO3F5QqGa +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD126o5mCqPRXU +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12== +-----END RSA PRIVATE KEY----- +-----BEGIN RSA PUBLIC KEY----- +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12YP1syYapXL +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12VbXCsJSAa5 +ABCD1234abcdABCD1234abcdABCD123MSe/TxVSdAgMBAAE= +-----END RSA PUBLIC KEY----- +-----BEGIN CERTIFICATE----- +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12MAkG +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LjYw +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12WhcN +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12A1UE +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12CwwB +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12QcPE +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12onIQ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12AUCT +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12JqOm +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD125Cjl +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD121ySf +ABCD1234abcdABCD1234abcdABCD12== +-----END CERTIFICATE----- +. diff --git a/test/unit/command_output/SG250-10P/show_sntp_status.txt b/test/unit/command_output/SG250-10P/show_sntp_status.txt new file mode 100644 index 0000000..64f9a47 --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_sntp_status.txt @@ -0,0 +1,43 @@ +Clock is synchronized, stratum 2, reference is 30.70.3.33, unicast + +Unicast servers: + +Server : 30.30.3.33 + Source : Static + Stratum : 2 + Status : up + Last Response : 14:45:42.0 CEST Apr 4 2024 + Offset : 1094.3411020 mSec + Delay : 0 mSec + +Server : 30.70.3.33 + Source : Static + Stratum : 2 + Status : up + Last Response : 14:18:57.0 CEST Apr 24 2024 + Offset : 1088.6150517 mSec + Delay : 0 mSec + +Server : ntp.examples.com + Source : Static + Stratum : 255 + Status : down + Last Response : 00:00:00.0 Jan 1 1900 + Offset : 0.0000000 mSec + Delay : 0 mSec + +Server : ntp.ph.examp.com + Source : Static + Stratum : 255 + Status : down + Last Response : 00:00:00.0 Jan 1 1900 + Offset : 0.0000000 mSec + Delay : 0 mSec + + + +Anycast server: + + + +Broadcast: diff --git a/test/unit/command_output/SG250-10P/show_startup_config.txt b/test/unit/command_output/SG250-10P/show_startup_config.txt new file mode 100644 index 0000000..30d0400 --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_startup_config.txt @@ -0,0 +1,192 @@ +config-file-header +switch-no-2548-1 +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 ABCD1234abcdABCD1234abcdABCD12c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink none +unit-type-control-end +! +cdp device-id format hostname +spanning-tree mode mst +spanning-tree loopback-guard +port jumbo-frame +vlan database +vlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001 +exit +voice vlan id 7 +voice vlan state disabled +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______________ +no eee enable +link-flap prevention disable +bonjour interface range vlan 1 +hostname switch-no-2548-1 +logging host 30.70.3.33 +logging host 30.73.3.30 port 50001 +logging buffered notifications +logging origin-id hostname +logging console errors +no passwords complexity enable +passwords aging 0 +username admin password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +username cisco password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +crypto key pubkey-chain ssh +user-key admin rsa +key-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L +key-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB +key-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav +key-string row ABCD1234abcdABCD1234abcdABCD12dS +key-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9 +key-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7 +key-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF +key-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv +key-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV +key-string row SWtO0EiL2pTczbwxGw== +exit +exit +snmp-server server +snmp-server location "Something;Somewhere;Somestreet;othersatnice;0;vratnice" +snmp-server community Abcdef rw view DefaultSuper +clock timezone CET +1 +clock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00 +sntp server 30.30.3.33 poll +sntp server 30.70.3.33 poll +sntp server ntp.examples.com poll +sntp server ntp.ph.examp.com poll +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 name-server 30.70.3.33 +ip host tftp 30.70.3.33 +! +interface vlan 1 + name default + ip address 30.70.0.37 333.333.337.0 + no ip address dhcp +! +interface vlan 7 + name VoIP-Phones +! +interface vlan 8 + name INET_DMZ +! +interface vlan 10 + name AD-Clients +! +interface vlan 11 + name VOIP_VoiceTrunk +! +interface vlan 30 + name Alantis_DMZ +! +interface vlan 31 + name Abcdef_DMZ +! +interface vlan 100 + name RAW_Inet_Abcdef +! +interface vlan 200 + name ABC-ADS +! +interface vlan 480 + name ABC-ITMGMT +! +interface vlan 490 + name HOSTNET +! +interface vlan 491 + name TECHNET +! +interface vlan 1000 + name ABC-IT +! +interface vlan 1001 + name CES-MAR +! +interface GigabitEthernet8 + no eee enable + no eee lldp enable + power inline priority critical +! +interface GigabitEthernet9 + switchport trunk native vlan none +! +interface GigabitEthernet10 + description "Trunk to switchkuch-1" +! +exit +ip default-gateway 30.70.0.3 +encrypted ip ssh-client key rsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: RSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u/LrfNpsC+ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12nGmfnMiTzL +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123BLQIyiTXh +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD128sfN3HfTcT +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD122JkvT8qdYc +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD127RLGCjKRGg +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12DUHsuYRcp4 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12ecNyEd+yKG +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD129xA6s+kaKr +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123iQURrQLpf +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qaNplfEtQQ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Fzg1zCmKmm +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12XbJtiivB9P +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qybAVD6G7N +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u+epBMcIsl +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12== +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LOFaFaMAP/ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12X/gDrfYHCu +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Uw== +---- END SSH2 PUBLIC KEY ---- +. +encrypted ip ssh-client key dsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12EQTG4SHh6Z +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FNfTUMF6C6 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12i4B02/IZGI +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12yX7nY+AOPD +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12pL8r4cXujS +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12a6Ut3tCQVy +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FsYD/d5xWs +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lzxObeJ7Z1 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12mOCGodNRAf +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LpzOPWsz6N +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD1248vEoC1X0n +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12SV +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: DSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12cHQnMuaXDn +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qvE1vMH5xv +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lc4rWWCO6b +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12TVuouFfgdF +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12wj/WAxB4Op +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lSIoIAfpkY +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12RqD0MS/9X5 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12m52u4/cBjY +qCqdkBI+B+YqB1jT8w== +---- END SSH2 PUBLIC KEY ---- +. diff --git a/test/unit/command_output/SG250-10P/show_system.txt b/test/unit/command_output/SG250-10P/show_system.txt new file mode 100644 index 0000000..64f78df --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_system.txt @@ -0,0 +1,21 @@ +System Description: SG250-10P 10-Port Gigabit PoE Smart Switch +System Up Time (days,hour:min:sec): 123,16:39:27 +System Contact: +System Name: switch-no-2548-1 +System Location: Something;Somewhere;Somestreet;others + atnice;0;vratnice +System MAC Address: aa:aa:a0:22:2a:a2 +System Object ID: 2.2.8.4.4.1.9.6.1.97.10.5 + +Unit Type +---- ---------------------- + 1 SG250-10P + + +Unit Fans Status +---- ------------------------------------- + 1 Fans status is N/A + +Unit Temperature (Celsius) Status +---- --------------------- ---------- + 1 65 OK diff --git a/test/unit/command_output/SG250-10P/show_version.txt b/test/unit/command_output/SG250-10P/show_version.txt new file mode 100644 index 0000000..94480c5 --- /dev/null +++ b/test/unit/command_output/SG250-10P/show_version.txt @@ -0,0 +1,10 @@ +Active-image: flash://system/images/sg250_image_tesla_250_2.4.5.71.bin + Version: 2.4.5.71 + MD5 Digest: ABCD1234abcdABCD1234abcdABCD121c + Date: 04-Nov-2018 + Time: 19:46:16 +Inactive-image: flash://system/images/image1.bin + Version: 2.2.8.4 + MD5 Digest: ABCD1234abcdABCD1234abcdABCD12f1 + Date: 21-Dec-2016 + Time: 22:03:09 diff --git a/test/unit/mocked_data/test_get_arp_table/SG250-10P/expected_result.json b/test/unit/mocked_data/test_get_arp_table/SG250-10P/expected_result.json new file mode 100644 index 0000000..7c923e2 --- /dev/null +++ b/test/unit/mocked_data/test_get_arp_table/SG250-10P/expected_result.json @@ -0,0 +1 @@ +[{"interface": "GigabitEthernet10", "mac": "00:00:0A:0A:AA:02", "ip": "30.70.0.3", "age": 0.0}, {"interface": "GigabitEthernet10", "mac": "A0:02:AA:AA:FA:AA", "ip": "30.70.0.3", "age": 0.0}, {"interface": "GigabitEthernet10", "mac": "A0:02:AA:AA:FA:AA", "ip": "30.70.0.3", "age": 0.0}, {"interface": "GigabitEthernet10", "mac": "00:A0:A2:A2:2F:A2", "ip": "30.70.3.33", "age": 0.0}, {"interface": "GigabitEthernet10", "mac": "AA:A2:A2:AA:FA:2A", "ip": "30.70.33.3", "age": 0.0}] diff --git a/test/unit/mocked_data/test_get_arp_table/SG250-10P/show_arp.txt b/test/unit/mocked_data/test_get_arp_table/SG250-10P/show_arp.txt new file mode 100644 index 0000000..587fcab --- /dev/null +++ b/test/unit/mocked_data/test_get_arp_table/SG250-10P/show_arp.txt @@ -0,0 +1,10 @@ +Total number of entries: 5 + + + VLAN Interface IP address HW address status +--------------------- --------------- ------------------- --------------- +vlan 1 gi10 30.70.0.3 00:00:0a:0a:aa:02 dynamic +vlan 1 gi10 30.70.0.3 a0:02:aa:aa:fa:aa dynamic +vlan 1 gi10 30.70.0.3 a0:02:aa:aa:fa:aa dynamic +vlan 1 gi10 30.70.3.33 00:a0:a2:a2:2f:a2 dynamic +vlan 1 gi10 30.70.33.3 aa:a2:a2:aa:fa:2a dynamic diff --git a/test/unit/mocked_data/test_get_arp_table_with_vrf/SG250-10P/expected_result.json b/test/unit/mocked_data/test_get_arp_table_with_vrf/SG250-10P/expected_result.json new file mode 100644 index 0000000..7c923e2 --- /dev/null +++ b/test/unit/mocked_data/test_get_arp_table_with_vrf/SG250-10P/expected_result.json @@ -0,0 +1 @@ +[{"interface": "GigabitEthernet10", "mac": "00:00:0A:0A:AA:02", "ip": "30.70.0.3", "age": 0.0}, {"interface": "GigabitEthernet10", "mac": "A0:02:AA:AA:FA:AA", "ip": "30.70.0.3", "age": 0.0}, {"interface": "GigabitEthernet10", "mac": "A0:02:AA:AA:FA:AA", "ip": "30.70.0.3", "age": 0.0}, {"interface": "GigabitEthernet10", "mac": "00:A0:A2:A2:2F:A2", "ip": "30.70.3.33", "age": 0.0}, {"interface": "GigabitEthernet10", "mac": "AA:A2:A2:AA:FA:2A", "ip": "30.70.33.3", "age": 0.0}] diff --git a/test/unit/mocked_data/test_get_arp_table_with_vrf/SG250-10P/show_arp.txt b/test/unit/mocked_data/test_get_arp_table_with_vrf/SG250-10P/show_arp.txt new file mode 100644 index 0000000..587fcab --- /dev/null +++ b/test/unit/mocked_data/test_get_arp_table_with_vrf/SG250-10P/show_arp.txt @@ -0,0 +1,10 @@ +Total number of entries: 5 + + + VLAN Interface IP address HW address status +--------------------- --------------- ------------------- --------------- +vlan 1 gi10 30.70.0.3 00:00:0a:0a:aa:02 dynamic +vlan 1 gi10 30.70.0.3 a0:02:aa:aa:fa:aa dynamic +vlan 1 gi10 30.70.0.3 a0:02:aa:aa:fa:aa dynamic +vlan 1 gi10 30.70.3.33 00:a0:a2:a2:2f:a2 dynamic +vlan 1 gi10 30.70.33.3 aa:a2:a2:aa:fa:2a dynamic diff --git a/test/unit/mocked_data/test_get_config/SG250-10P/expected_result.json b/test/unit/mocked_data/test_get_config/SG250-10P/expected_result.json new file mode 100644 index 0000000..1239df6 --- /dev/null +++ b/test/unit/mocked_data/test_get_config/SG250-10P/expected_result.json @@ -0,0 +1 @@ +{"startup": "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end ABCD1234abcdABCD1234abcdABCD12c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink none\nunit-type-control-end\n!\ncdp device-id format hostname\nspanning-tree mode mst\nspanning-tree loopback-guard\nport jumbo-frame\nvlan database\nvlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001\nexit\nvoice vlan id 7\nvoice vlan state disabled\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______________\nno eee enable\nlink-flap prevention disable\nbonjour interface range vlan 1\nhostname switch-no-2548-1\nlogging host 30.70.3.33\nlogging host 30.73.3.30 port 50001\nlogging buffered notifications\nlogging origin-id hostname\nlogging console errors\nno passwords complexity enable\npasswords aging 0\nusername admin password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15\nusername cisco password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\ncrypto key pubkey-chain ssh\nuser-key admin rsa\nkey-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L\nkey-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB\nkey-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav\nkey-string row ABCD1234abcdABCD1234abcdABCD12dS\nkey-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9\nkey-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7\nkey-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF\nkey-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv\nkey-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV\nkey-string row SWtO0EiL2pTczbwxGw==\nexit\nexit\nsnmp-server server\nsnmp-server location \"Something;Somewhere;Somestreet;othersatnice;0;vratnice\"\nsnmp-server community Abcdef rw view DefaultSuper\nclock timezone CET +1\nclock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00\nsntp server 30.30.3.33 poll\nsntp server 30.70.3.33 poll\nsntp server ntp.examples.com poll\nsntp server ntp.ph.examp.com poll\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip name-server 30.70.3.33\nip host tftp 30.70.3.33\n!\ninterface vlan 1\n name default\n ip address 30.70.0.37 333.333.337.0\n no ip address dhcp\n!\ninterface vlan 7\n name VoIP-Phones\n!\ninterface vlan 8\n name INET_DMZ\n!\ninterface vlan 10\n name AD-Clients\n!\ninterface vlan 11\n name VOIP_VoiceTrunk\n!\ninterface vlan 30\n name Alantis_DMZ\n!\ninterface vlan 31\n name Abcdef_DMZ\n!\ninterface vlan 100\n name RAW_Inet_Abcdef\n!\ninterface vlan 200\n name ABC-ADS\n!\ninterface vlan 480\n name ABC-ITMGMT\n!\ninterface vlan 490\n name HOSTNET\n!\ninterface vlan 491\n name TECHNET\n!\ninterface vlan 1000\n name ABC-IT\n!\ninterface vlan 1001\n name CES-MAR\n!\ninterface GigabitEthernet8\n no eee enable\n no eee lldp enable\n power inline priority critical\n!\ninterface GigabitEthernet9\n switchport trunk native vlan none\n!\ninterface GigabitEthernet10\n description \"Trunk to switchkuch-1\"\n!\nexit\nip default-gateway 30.70.0.3\nencrypted ip ssh-client key rsa key-pair\n---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----\nComment: RSA Private Key\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u/LrfNpsC+\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12nGmfnMiTzL\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123BLQIyiTXh\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD128sfN3HfTcT\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD122JkvT8qdYc\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD127RLGCjKRGg\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12DUHsuYRcp4\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12ecNyEd+yKG\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD129xA6s+kaKr\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123iQURrQLpf\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qaNplfEtQQ\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Fzg1zCmKmm\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12XbJtiivB9P\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qybAVD6G7N\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u+epBMcIsl\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12==\n---- END SSH2 PRIVATE KEY ----\n---- BEGIN SSH2 PUBLIC KEY ----\nComment: RSA Public Key\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LOFaFaMAP/\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12X/gDrfYHCu\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Uw==\n---- END SSH2 PUBLIC KEY ----\n.\nencrypted ip ssh-client key dsa key-pair\n---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----\nComment: DSA Private Key\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12EQTG4SHh6Z\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FNfTUMF6C6\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12i4B02/IZGI\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12yX7nY+AOPD\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12pL8r4cXujS\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12a6Ut3tCQVy\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FsYD/d5xWs\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lzxObeJ7Z1\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12mOCGodNRAf\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LpzOPWsz6N\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD1248vEoC1X0n\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12SV\n---- END SSH2 PRIVATE KEY ----\n---- BEGIN SSH2 PUBLIC KEY ----\nComment: DSA Public Key\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12cHQnMuaXDn\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qvE1vMH5xv\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lc4rWWCO6b\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12TVuouFfgdF\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12wj/WAxB4Op\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lSIoIAfpkY\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12RqD0MS/9X5\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12m52u4/cBjY\nqCqdkBI+B+YqB1jT8w==\n---- END SSH2 PUBLIC KEY ----\n.", "running": "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end ABCD1234abcdABCD1234abcdABCD12c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink none\nunit-type-control-end\n!\ncdp device-id format hostname\nspanning-tree mode mst\nspanning-tree loopback-guard\nport jumbo-frame\nvlan database\nvlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001\nexit\nvoice vlan id 7\nvoice vlan state disabled\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______________\nno eee enable\nlink-flap prevention disable\nbonjour interface range vlan 1\nhostname switch-no-2548-1\nlogging host 30.70.3.33\nlogging host 30.73.3.30 port 50001\nlogging buffered notifications\nlogging origin-id hostname\nlogging console errors\nno passwords complexity enable\npasswords aging 0\nusername admin password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15\nusername cisco password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\ncrypto key pubkey-chain ssh\nuser-key admin rsa\nkey-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L\nkey-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB\nkey-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav\nkey-string row ABCD1234abcdABCD1234abcdABCD12dS\nkey-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9\nkey-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7\nkey-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF\nkey-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv\nkey-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV\nkey-string row SWtO0EiL2pTczbwxGw==\nexit\nexit\nsnmp-server server\nsnmp-server location \"Something;Somewhere;Somestreet;othersatnice;0;vratnice\"\nsnmp-server community Abcdef rw view DefaultSuper\nclock timezone CET +1\nclock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00\nsntp server 30.30.3.33 poll\nsntp server 30.70.3.33 poll\nsntp server ntp.examples.com poll\nsntp server ntp.ph.examp.com poll\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip name-server 30.70.3.33\nip host tftp 30.70.3.33\n!\ninterface vlan 1\n name default\n ip address 30.70.0.37 333.333.337.0\n no ip address dhcp\n!\ninterface vlan 7\n name VoIP-Phones\n!\ninterface vlan 8\n name INET_DMZ\n!\ninterface vlan 10\n name AD-Clients\n!\ninterface vlan 11\n name VOIP_VoiceTrunk\n!\ninterface vlan 30\n name Alantis_DMZ\n!\ninterface vlan 31\n name Abcdef_DMZ\n!\ninterface vlan 100\n name RAW_Inet_Abcdef\n!\ninterface vlan 200\n name ABC-ADS\n!\ninterface vlan 480\n name ABC-ITMGMT\n!\ninterface vlan 490\n name HOSTNET\n!\ninterface vlan 491\n name TECHNET\n!\ninterface vlan 1000\n name ABC-IT\n!\ninterface vlan 1001\n name CES-MAR\n!\ninterface GigabitEthernet8\n no eee enable\n no eee lldp enable\n power inline priority critical\n!\ninterface GigabitEthernet9\n switchport trunk native vlan none\n!\ninterface GigabitEthernet10\n description \"Trunk to switchkuch-1\"\n!\nexit\nip default-gateway 30.70.0.3", "candidate": ""} diff --git a/test/unit/mocked_data/test_get_config/SG250-10P/show_running_config.txt b/test/unit/mocked_data/test_get_config/SG250-10P/show_running_config.txt new file mode 100644 index 0000000..ed0fcf6 --- /dev/null +++ b/test/unit/mocked_data/test_get_config/SG250-10P/show_running_config.txt @@ -0,0 +1,136 @@ +config-file-header +switch-no-2548-1 +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 ABCD1234abcdABCD1234abcdABCD12c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink none +unit-type-control-end +! +cdp device-id format hostname +spanning-tree mode mst +spanning-tree loopback-guard +port jumbo-frame +vlan database +vlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001 +exit +voice vlan id 7 +voice vlan state disabled +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______________ +no eee enable +link-flap prevention disable +bonjour interface range vlan 1 +hostname switch-no-2548-1 +logging host 30.70.3.33 +logging host 30.73.3.30 port 50001 +logging buffered notifications +logging origin-id hostname +logging console errors +no passwords complexity enable +passwords aging 0 +username admin password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +username cisco password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +crypto key pubkey-chain ssh +user-key admin rsa +key-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L +key-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB +key-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav +key-string row ABCD1234abcdABCD1234abcdABCD12dS +key-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9 +key-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7 +key-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF +key-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv +key-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV +key-string row SWtO0EiL2pTczbwxGw== +exit +exit +snmp-server server +snmp-server location "Something;Somewhere;Somestreet;othersatnice;0;vratnice" +snmp-server community Abcdef rw view DefaultSuper +clock timezone CET +1 +clock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00 +sntp server 30.30.3.33 poll +sntp server 30.70.3.33 poll +sntp server ntp.examples.com poll +sntp server ntp.ph.examp.com poll +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 name-server 30.70.3.33 +ip host tftp 30.70.3.33 +! +interface vlan 1 + name default + ip address 30.70.0.37 333.333.337.0 + no ip address dhcp +! +interface vlan 7 + name VoIP-Phones +! +interface vlan 8 + name INET_DMZ +! +interface vlan 10 + name AD-Clients +! +interface vlan 11 + name VOIP_VoiceTrunk +! +interface vlan 30 + name Alantis_DMZ +! +interface vlan 31 + name Abcdef_DMZ +! +interface vlan 100 + name RAW_Inet_Abcdef +! +interface vlan 200 + name ABC-ADS +! +interface vlan 480 + name ABC-ITMGMT +! +interface vlan 490 + name HOSTNET +! +interface vlan 491 + name TECHNET +! +interface vlan 1000 + name ABC-IT +! +interface vlan 1001 + name CES-MAR +! +interface GigabitEthernet8 + no eee enable + no eee lldp enable + power inline priority critical +! +interface GigabitEthernet9 + switchport trunk native vlan none +! +interface GigabitEthernet10 + description "Trunk to switchkuch-1" +! +exit +ip default-gateway 30.70.0.3 diff --git a/test/unit/mocked_data/test_get_config/SG250-10P/show_startup_config.txt b/test/unit/mocked_data/test_get_config/SG250-10P/show_startup_config.txt new file mode 100644 index 0000000..30d0400 --- /dev/null +++ b/test/unit/mocked_data/test_get_config/SG250-10P/show_startup_config.txt @@ -0,0 +1,192 @@ +config-file-header +switch-no-2548-1 +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 ABCD1234abcdABCD1234abcdABCD12c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink none +unit-type-control-end +! +cdp device-id format hostname +spanning-tree mode mst +spanning-tree loopback-guard +port jumbo-frame +vlan database +vlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001 +exit +voice vlan id 7 +voice vlan state disabled +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______________ +no eee enable +link-flap prevention disable +bonjour interface range vlan 1 +hostname switch-no-2548-1 +logging host 30.70.3.33 +logging host 30.73.3.30 port 50001 +logging buffered notifications +logging origin-id hostname +logging console errors +no passwords complexity enable +passwords aging 0 +username admin password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +username cisco password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +crypto key pubkey-chain ssh +user-key admin rsa +key-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L +key-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB +key-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav +key-string row ABCD1234abcdABCD1234abcdABCD12dS +key-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9 +key-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7 +key-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF +key-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv +key-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV +key-string row SWtO0EiL2pTczbwxGw== +exit +exit +snmp-server server +snmp-server location "Something;Somewhere;Somestreet;othersatnice;0;vratnice" +snmp-server community Abcdef rw view DefaultSuper +clock timezone CET +1 +clock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00 +sntp server 30.30.3.33 poll +sntp server 30.70.3.33 poll +sntp server ntp.examples.com poll +sntp server ntp.ph.examp.com poll +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 name-server 30.70.3.33 +ip host tftp 30.70.3.33 +! +interface vlan 1 + name default + ip address 30.70.0.37 333.333.337.0 + no ip address dhcp +! +interface vlan 7 + name VoIP-Phones +! +interface vlan 8 + name INET_DMZ +! +interface vlan 10 + name AD-Clients +! +interface vlan 11 + name VOIP_VoiceTrunk +! +interface vlan 30 + name Alantis_DMZ +! +interface vlan 31 + name Abcdef_DMZ +! +interface vlan 100 + name RAW_Inet_Abcdef +! +interface vlan 200 + name ABC-ADS +! +interface vlan 480 + name ABC-ITMGMT +! +interface vlan 490 + name HOSTNET +! +interface vlan 491 + name TECHNET +! +interface vlan 1000 + name ABC-IT +! +interface vlan 1001 + name CES-MAR +! +interface GigabitEthernet8 + no eee enable + no eee lldp enable + power inline priority critical +! +interface GigabitEthernet9 + switchport trunk native vlan none +! +interface GigabitEthernet10 + description "Trunk to switchkuch-1" +! +exit +ip default-gateway 30.70.0.3 +encrypted ip ssh-client key rsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: RSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u/LrfNpsC+ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12nGmfnMiTzL +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123BLQIyiTXh +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD128sfN3HfTcT +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD122JkvT8qdYc +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD127RLGCjKRGg +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12DUHsuYRcp4 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12ecNyEd+yKG +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD129xA6s+kaKr +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123iQURrQLpf +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qaNplfEtQQ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Fzg1zCmKmm +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12XbJtiivB9P +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qybAVD6G7N +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u+epBMcIsl +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12== +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LOFaFaMAP/ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12X/gDrfYHCu +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Uw== +---- END SSH2 PUBLIC KEY ---- +. +encrypted ip ssh-client key dsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12EQTG4SHh6Z +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FNfTUMF6C6 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12i4B02/IZGI +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12yX7nY+AOPD +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12pL8r4cXujS +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12a6Ut3tCQVy +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FsYD/d5xWs +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lzxObeJ7Z1 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12mOCGodNRAf +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LpzOPWsz6N +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD1248vEoC1X0n +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12SV +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: DSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12cHQnMuaXDn +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qvE1vMH5xv +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lc4rWWCO6b +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12TVuouFfgdF +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12wj/WAxB4Op +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lSIoIAfpkY +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12RqD0MS/9X5 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12m52u4/cBjY +qCqdkBI+B+YqB1jT8w== +---- END SSH2 PUBLIC KEY ---- +. diff --git a/test/unit/mocked_data/test_get_config_filtered/SG250-10P/expected_result.json b/test/unit/mocked_data/test_get_config_filtered/SG250-10P/expected_result.json new file mode 100644 index 0000000..b8bf81a --- /dev/null +++ b/test/unit/mocked_data/test_get_config_filtered/SG250-10P/expected_result.json @@ -0,0 +1 @@ +{"startup": "", "running": "", "candidate": ""} diff --git a/test/unit/mocked_data/test_get_config_filtered/SG250-10P/show_running_config.txt b/test/unit/mocked_data/test_get_config_filtered/SG250-10P/show_running_config.txt new file mode 100644 index 0000000..ed0fcf6 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_filtered/SG250-10P/show_running_config.txt @@ -0,0 +1,136 @@ +config-file-header +switch-no-2548-1 +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 ABCD1234abcdABCD1234abcdABCD12c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink none +unit-type-control-end +! +cdp device-id format hostname +spanning-tree mode mst +spanning-tree loopback-guard +port jumbo-frame +vlan database +vlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001 +exit +voice vlan id 7 +voice vlan state disabled +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______________ +no eee enable +link-flap prevention disable +bonjour interface range vlan 1 +hostname switch-no-2548-1 +logging host 30.70.3.33 +logging host 30.73.3.30 port 50001 +logging buffered notifications +logging origin-id hostname +logging console errors +no passwords complexity enable +passwords aging 0 +username admin password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +username cisco password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +crypto key pubkey-chain ssh +user-key admin rsa +key-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L +key-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB +key-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav +key-string row ABCD1234abcdABCD1234abcdABCD12dS +key-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9 +key-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7 +key-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF +key-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv +key-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV +key-string row SWtO0EiL2pTczbwxGw== +exit +exit +snmp-server server +snmp-server location "Something;Somewhere;Somestreet;othersatnice;0;vratnice" +snmp-server community Abcdef rw view DefaultSuper +clock timezone CET +1 +clock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00 +sntp server 30.30.3.33 poll +sntp server 30.70.3.33 poll +sntp server ntp.examples.com poll +sntp server ntp.ph.examp.com poll +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 name-server 30.70.3.33 +ip host tftp 30.70.3.33 +! +interface vlan 1 + name default + ip address 30.70.0.37 333.333.337.0 + no ip address dhcp +! +interface vlan 7 + name VoIP-Phones +! +interface vlan 8 + name INET_DMZ +! +interface vlan 10 + name AD-Clients +! +interface vlan 11 + name VOIP_VoiceTrunk +! +interface vlan 30 + name Alantis_DMZ +! +interface vlan 31 + name Abcdef_DMZ +! +interface vlan 100 + name RAW_Inet_Abcdef +! +interface vlan 200 + name ABC-ADS +! +interface vlan 480 + name ABC-ITMGMT +! +interface vlan 490 + name HOSTNET +! +interface vlan 491 + name TECHNET +! +interface vlan 1000 + name ABC-IT +! +interface vlan 1001 + name CES-MAR +! +interface GigabitEthernet8 + no eee enable + no eee lldp enable + power inline priority critical +! +interface GigabitEthernet9 + switchport trunk native vlan none +! +interface GigabitEthernet10 + description "Trunk to switchkuch-1" +! +exit +ip default-gateway 30.70.0.3 diff --git a/test/unit/mocked_data/test_get_config_filtered/SG250-10P/show_startup_config.txt b/test/unit/mocked_data/test_get_config_filtered/SG250-10P/show_startup_config.txt new file mode 100644 index 0000000..30d0400 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_filtered/SG250-10P/show_startup_config.txt @@ -0,0 +1,192 @@ +config-file-header +switch-no-2548-1 +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 ABCD1234abcdABCD1234abcdABCD12c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink none +unit-type-control-end +! +cdp device-id format hostname +spanning-tree mode mst +spanning-tree loopback-guard +port jumbo-frame +vlan database +vlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001 +exit +voice vlan id 7 +voice vlan state disabled +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______________ +no eee enable +link-flap prevention disable +bonjour interface range vlan 1 +hostname switch-no-2548-1 +logging host 30.70.3.33 +logging host 30.73.3.30 port 50001 +logging buffered notifications +logging origin-id hostname +logging console errors +no passwords complexity enable +passwords aging 0 +username admin password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +username cisco password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +crypto key pubkey-chain ssh +user-key admin rsa +key-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L +key-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB +key-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav +key-string row ABCD1234abcdABCD1234abcdABCD12dS +key-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9 +key-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7 +key-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF +key-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv +key-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV +key-string row SWtO0EiL2pTczbwxGw== +exit +exit +snmp-server server +snmp-server location "Something;Somewhere;Somestreet;othersatnice;0;vratnice" +snmp-server community Abcdef rw view DefaultSuper +clock timezone CET +1 +clock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00 +sntp server 30.30.3.33 poll +sntp server 30.70.3.33 poll +sntp server ntp.examples.com poll +sntp server ntp.ph.examp.com poll +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 name-server 30.70.3.33 +ip host tftp 30.70.3.33 +! +interface vlan 1 + name default + ip address 30.70.0.37 333.333.337.0 + no ip address dhcp +! +interface vlan 7 + name VoIP-Phones +! +interface vlan 8 + name INET_DMZ +! +interface vlan 10 + name AD-Clients +! +interface vlan 11 + name VOIP_VoiceTrunk +! +interface vlan 30 + name Alantis_DMZ +! +interface vlan 31 + name Abcdef_DMZ +! +interface vlan 100 + name RAW_Inet_Abcdef +! +interface vlan 200 + name ABC-ADS +! +interface vlan 480 + name ABC-ITMGMT +! +interface vlan 490 + name HOSTNET +! +interface vlan 491 + name TECHNET +! +interface vlan 1000 + name ABC-IT +! +interface vlan 1001 + name CES-MAR +! +interface GigabitEthernet8 + no eee enable + no eee lldp enable + power inline priority critical +! +interface GigabitEthernet9 + switchport trunk native vlan none +! +interface GigabitEthernet10 + description "Trunk to switchkuch-1" +! +exit +ip default-gateway 30.70.0.3 +encrypted ip ssh-client key rsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: RSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u/LrfNpsC+ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12nGmfnMiTzL +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123BLQIyiTXh +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD128sfN3HfTcT +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD122JkvT8qdYc +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD127RLGCjKRGg +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12DUHsuYRcp4 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12ecNyEd+yKG +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD129xA6s+kaKr +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123iQURrQLpf +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qaNplfEtQQ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Fzg1zCmKmm +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12XbJtiivB9P +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qybAVD6G7N +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u+epBMcIsl +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12== +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LOFaFaMAP/ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12X/gDrfYHCu +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Uw== +---- END SSH2 PUBLIC KEY ---- +. +encrypted ip ssh-client key dsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12EQTG4SHh6Z +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FNfTUMF6C6 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12i4B02/IZGI +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12yX7nY+AOPD +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12pL8r4cXujS +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12a6Ut3tCQVy +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FsYD/d5xWs +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lzxObeJ7Z1 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12mOCGodNRAf +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LpzOPWsz6N +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD1248vEoC1X0n +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12SV +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: DSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12cHQnMuaXDn +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qvE1vMH5xv +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lc4rWWCO6b +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12TVuouFfgdF +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12wj/WAxB4Op +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lSIoIAfpkY +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12RqD0MS/9X5 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12m52u4/cBjY +qCqdkBI+B+YqB1jT8w== +---- END SSH2 PUBLIC KEY ---- +. diff --git a/test/unit/mocked_data/test_get_config_sanitized/SG250-10P/expected_result.json b/test/unit/mocked_data/test_get_config_sanitized/SG250-10P/expected_result.json new file mode 100644 index 0000000..07bb771 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_sanitized/SG250-10P/expected_result.json @@ -0,0 +1 @@ +{"startup": "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end ABCD1234abcdABCD1234abcdABCD12c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink none\nunit-type-control-end\n!\ncdp device-id format hostname\nspanning-tree mode mst\nspanning-tree loopback-guard\nport jumbo-frame\nvlan database\nvlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001\nexit\nvoice vlan id 7\nvoice vlan state disabled\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______________\nno eee enable\nlink-flap prevention disable\nbonjour interface range vlan 1\nhostname switch-no-2548-1\nlogging host 30.70.3.33\nlogging host 30.73.3.30 port 50001\nlogging buffered notifications\nlogging origin-id hostname\nlogging console errors\nno passwords complexity enable\npasswords aging 0\nusername admin password encrypted privilege 15\nusername cisco password encrypted privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\ncrypto key pubkey-chain ssh\nuser-key admin rsa\nkey-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L\nkey-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB\nkey-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav\nkey-string row ABCD1234abcdABCD1234abcdABCD12dS\nkey-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9\nkey-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7\nkey-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF\nkey-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv\nkey-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV\nkey-string row SWtO0EiL2pTczbwxGw==\nexit\nexit\nsnmp-server server\nsnmp-server location \nsnmp-server community \nclock timezone CET +1\nclock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00\nsntp server 30.30.3.33 poll\nsntp server 30.70.3.33 poll\nsntp server ntp.examples.com poll\nsntp server ntp.ph.examp.com poll\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip name-server 30.70.3.33\nip host tftp 30.70.3.33\n!\ninterface vlan 1\n name default\n ip address 30.70.0.37 333.333.337.0\n no ip address dhcp\n!\ninterface vlan 7\n name VoIP-Phones\n!\ninterface vlan 8\n name INET_DMZ\n!\ninterface vlan 10\n name AD-Clients\n!\ninterface vlan 11\n name VOIP_VoiceTrunk\n!\ninterface vlan 30\n name Alantis_DMZ\n!\ninterface vlan 31\n name Abcdef_DMZ\n!\ninterface vlan 100\n name RAW_Inet_Abcdef\n!\ninterface vlan 200\n name ABC-ADS\n!\ninterface vlan 480\n name ABC-ITMGMT\n!\ninterface vlan 490\n name HOSTNET\n!\ninterface vlan 491\n name TECHNET\n!\ninterface vlan 1000\n name ABC-IT\n!\ninterface vlan 1001\n name CES-MAR\n!\ninterface GigabitEthernet8\n no eee enable\n no eee lldp enable\n power inline priority critical\n!\ninterface GigabitEthernet9\n switchport trunk native vlan none\n!\ninterface GigabitEthernet10\n description \"Trunk to switchkuch-1\"\n!\nexit\nip default-gateway 30.70.0.3\nencrypted ip ssh-client key rsa key-pair\n---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----\nComment: RSA Private Key\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u/LrfNpsC+\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12nGmfnMiTzL\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123BLQIyiTXh\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD128sfN3HfTcT\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD122JkvT8qdYc\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD127RLGCjKRGg\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12DUHsuYRcp4\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12ecNyEd+yKG\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD129xA6s+kaKr\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123iQURrQLpf\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qaNplfEtQQ\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Fzg1zCmKmm\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12XbJtiivB9P\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qybAVD6G7N\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u+epBMcIsl\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12==\n---- END SSH2 PRIVATE KEY ----\n---- BEGIN SSH2 PUBLIC KEY ----\nComment: RSA Public Key\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LOFaFaMAP/\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12X/gDrfYHCu\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Uw==\n---- END SSH2 PUBLIC KEY ----\n.\nencrypted ip ssh-client key dsa key-pair\n---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----\nComment: DSA Private Key\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12EQTG4SHh6Z\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FNfTUMF6C6\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12i4B02/IZGI\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12yX7nY+AOPD\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12pL8r4cXujS\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12a6Ut3tCQVy\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FsYD/d5xWs\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lzxObeJ7Z1\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12mOCGodNRAf\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LpzOPWsz6N\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD1248vEoC1X0n\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12SV\n---- END SSH2 PRIVATE KEY ----\n---- BEGIN SSH2 PUBLIC KEY ----\nComment: DSA Public Key\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12cHQnMuaXDn\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qvE1vMH5xv\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lc4rWWCO6b\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12TVuouFfgdF\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12wj/WAxB4Op\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lSIoIAfpkY\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12RqD0MS/9X5\nABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12m52u4/cBjY\nqCqdkBI+B+YqB1jT8w==\n---- END SSH2 PUBLIC KEY ----\n.", "running": "\nssd-control-start\nssd config\nssd file passphrase control unrestricted\nno ssd file integrity control\nssd-control-end ABCD1234abcdABCD1234abcdABCD12c0\n!\n!\nunit-type-control-start\nunit-type unit 1 network gi uplink none\nunit-type-control-end\n!\ncdp device-id format hostname\nspanning-tree mode mst\nspanning-tree loopback-guard\nport jumbo-frame\nvlan database\nvlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001\nexit\nvoice vlan id 7\nvoice vlan state disabled\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______________\nno eee enable\nlink-flap prevention disable\nbonjour interface range vlan 1\nhostname switch-no-2548-1\nlogging host 30.70.3.33\nlogging host 30.73.3.30 port 50001\nlogging buffered notifications\nlogging origin-id hostname\nlogging console errors\nno passwords complexity enable\npasswords aging 0\nusername admin password encrypted privilege 15\nusername cisco password encrypted privilege 15\nip ssh server\nip ssh password-auth\nip ssh pubkey-auth auto-login\ncrypto key pubkey-chain ssh\nuser-key admin rsa\nkey-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L\nkey-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB\nkey-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav\nkey-string row ABCD1234abcdABCD1234abcdABCD12dS\nkey-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9\nkey-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7\nkey-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF\nkey-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv\nkey-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV\nkey-string row SWtO0EiL2pTczbwxGw==\nexit\nexit\nsnmp-server server\nsnmp-server location \nsnmp-server community \nclock timezone CET +1\nclock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00\nsntp server 30.30.3.33 poll\nsntp server 30.70.3.33 poll\nsntp server ntp.examples.com poll\nsntp server ntp.ph.examp.com poll\nno sntp server time-a.timefreq.bldrdoc.gov\nno sntp server time-b.timefreq.bldrdoc.gov\nno sntp server time-c.timefreq.bldrdoc.gov\nip name-server 30.70.3.33\nip host tftp 30.70.3.33\n!\ninterface vlan 1\n name default\n ip address 30.70.0.37 333.333.337.0\n no ip address dhcp\n!\ninterface vlan 7\n name VoIP-Phones\n!\ninterface vlan 8\n name INET_DMZ\n!\ninterface vlan 10\n name AD-Clients\n!\ninterface vlan 11\n name VOIP_VoiceTrunk\n!\ninterface vlan 30\n name Alantis_DMZ\n!\ninterface vlan 31\n name Abcdef_DMZ\n!\ninterface vlan 100\n name RAW_Inet_Abcdef\n!\ninterface vlan 200\n name ABC-ADS\n!\ninterface vlan 480\n name ABC-ITMGMT\n!\ninterface vlan 490\n name HOSTNET\n!\ninterface vlan 491\n name TECHNET\n!\ninterface vlan 1000\n name ABC-IT\n!\ninterface vlan 1001\n name CES-MAR\n!\ninterface GigabitEthernet8\n no eee enable\n no eee lldp enable\n power inline priority critical\n!\ninterface GigabitEthernet9\n switchport trunk native vlan none\n!\ninterface GigabitEthernet10\n description \"Trunk to switchkuch-1\"\n!\nexit\nip default-gateway 30.70.0.3", "candidate": ""} diff --git a/test/unit/mocked_data/test_get_config_sanitized/SG250-10P/show_running_config.txt b/test/unit/mocked_data/test_get_config_sanitized/SG250-10P/show_running_config.txt new file mode 100644 index 0000000..ed0fcf6 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_sanitized/SG250-10P/show_running_config.txt @@ -0,0 +1,136 @@ +config-file-header +switch-no-2548-1 +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 ABCD1234abcdABCD1234abcdABCD12c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink none +unit-type-control-end +! +cdp device-id format hostname +spanning-tree mode mst +spanning-tree loopback-guard +port jumbo-frame +vlan database +vlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001 +exit +voice vlan id 7 +voice vlan state disabled +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______________ +no eee enable +link-flap prevention disable +bonjour interface range vlan 1 +hostname switch-no-2548-1 +logging host 30.70.3.33 +logging host 30.73.3.30 port 50001 +logging buffered notifications +logging origin-id hostname +logging console errors +no passwords complexity enable +passwords aging 0 +username admin password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +username cisco password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +crypto key pubkey-chain ssh +user-key admin rsa +key-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L +key-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB +key-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav +key-string row ABCD1234abcdABCD1234abcdABCD12dS +key-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9 +key-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7 +key-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF +key-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv +key-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV +key-string row SWtO0EiL2pTczbwxGw== +exit +exit +snmp-server server +snmp-server location "Something;Somewhere;Somestreet;othersatnice;0;vratnice" +snmp-server community Abcdef rw view DefaultSuper +clock timezone CET +1 +clock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00 +sntp server 30.30.3.33 poll +sntp server 30.70.3.33 poll +sntp server ntp.examples.com poll +sntp server ntp.ph.examp.com poll +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 name-server 30.70.3.33 +ip host tftp 30.70.3.33 +! +interface vlan 1 + name default + ip address 30.70.0.37 333.333.337.0 + no ip address dhcp +! +interface vlan 7 + name VoIP-Phones +! +interface vlan 8 + name INET_DMZ +! +interface vlan 10 + name AD-Clients +! +interface vlan 11 + name VOIP_VoiceTrunk +! +interface vlan 30 + name Alantis_DMZ +! +interface vlan 31 + name Abcdef_DMZ +! +interface vlan 100 + name RAW_Inet_Abcdef +! +interface vlan 200 + name ABC-ADS +! +interface vlan 480 + name ABC-ITMGMT +! +interface vlan 490 + name HOSTNET +! +interface vlan 491 + name TECHNET +! +interface vlan 1000 + name ABC-IT +! +interface vlan 1001 + name CES-MAR +! +interface GigabitEthernet8 + no eee enable + no eee lldp enable + power inline priority critical +! +interface GigabitEthernet9 + switchport trunk native vlan none +! +interface GigabitEthernet10 + description "Trunk to switchkuch-1" +! +exit +ip default-gateway 30.70.0.3 diff --git a/test/unit/mocked_data/test_get_config_sanitized/SG250-10P/show_startup_config.txt b/test/unit/mocked_data/test_get_config_sanitized/SG250-10P/show_startup_config.txt new file mode 100644 index 0000000..30d0400 --- /dev/null +++ b/test/unit/mocked_data/test_get_config_sanitized/SG250-10P/show_startup_config.txt @@ -0,0 +1,192 @@ +config-file-header +switch-no-2548-1 +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 ABCD1234abcdABCD1234abcdABCD12c0 +! +! +unit-type-control-start +unit-type unit 1 network gi uplink none +unit-type-control-end +! +cdp device-id format hostname +spanning-tree mode mst +spanning-tree loopback-guard +port jumbo-frame +vlan database +vlan 7-8,10-11,30-31,100,200,480,490-491,1000-1001 +exit +voice vlan id 7 +voice vlan state disabled +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______________ +no eee enable +link-flap prevention disable +bonjour interface range vlan 1 +hostname switch-no-2548-1 +logging host 30.70.3.33 +logging host 30.73.3.30 port 50001 +logging buffered notifications +logging origin-id hostname +logging console errors +no passwords complexity enable +passwords aging 0 +username admin password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +username cisco password encrypted ABCD1234abcdABCD1234abcdABCD122f0222aa2a privilege 15 +ip ssh server +ip ssh password-auth +ip ssh pubkey-auth auto-login +crypto key pubkey-chain ssh +user-key admin rsa +key-string row ABCD1234abcdABCD1234abcdABCD12Mdfpc6NU0L +key-string row ABCD1234abcdABCD1234abcdABCD12IK2g3BQGlB +key-string row ABCD1234abcdABCD1234abcdABCD12RQDtU8sgav +key-string row ABCD1234abcdABCD1234abcdABCD12dS +key-string row ABCD1234abcdABCD1234abcdABCD12clVSXW+VS9 +key-string row ABCD1234abcdABCD1234abcdABCD121yWQ/dirg7 +key-string row ABCD1234abcdABCD1234abcdABCD126+oTfMZRDF +key-string row ABCD1234abcdABCD1234abcdABCD121OnMyls0Cv +key-string row ABCD1234abcdABCD1234abcdABCD12xIINJVB3mV +key-string row SWtO0EiL2pTczbwxGw== +exit +exit +snmp-server server +snmp-server location "Something;Somewhere;Somestreet;othersatnice;0;vratnice" +snmp-server community Abcdef rw view DefaultSuper +clock timezone CET +1 +clock summer-time CEST recurring last sun mar 02:00 last sun oct 03:00 +sntp server 30.30.3.33 poll +sntp server 30.70.3.33 poll +sntp server ntp.examples.com poll +sntp server ntp.ph.examp.com poll +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 name-server 30.70.3.33 +ip host tftp 30.70.3.33 +! +interface vlan 1 + name default + ip address 30.70.0.37 333.333.337.0 + no ip address dhcp +! +interface vlan 7 + name VoIP-Phones +! +interface vlan 8 + name INET_DMZ +! +interface vlan 10 + name AD-Clients +! +interface vlan 11 + name VOIP_VoiceTrunk +! +interface vlan 30 + name Alantis_DMZ +! +interface vlan 31 + name Abcdef_DMZ +! +interface vlan 100 + name RAW_Inet_Abcdef +! +interface vlan 200 + name ABC-ADS +! +interface vlan 480 + name ABC-ITMGMT +! +interface vlan 490 + name HOSTNET +! +interface vlan 491 + name TECHNET +! +interface vlan 1000 + name ABC-IT +! +interface vlan 1001 + name CES-MAR +! +interface GigabitEthernet8 + no eee enable + no eee lldp enable + power inline priority critical +! +interface GigabitEthernet9 + switchport trunk native vlan none +! +interface GigabitEthernet10 + description "Trunk to switchkuch-1" +! +exit +ip default-gateway 30.70.0.3 +encrypted ip ssh-client key rsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: RSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u/LrfNpsC+ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12nGmfnMiTzL +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123BLQIyiTXh +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD128sfN3HfTcT +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD122JkvT8qdYc +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD127RLGCjKRGg +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12DUHsuYRcp4 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12ecNyEd+yKG +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD129xA6s+kaKr +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD123iQURrQLpf +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qaNplfEtQQ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Fzg1zCmKmm +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12XbJtiivB9P +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qybAVD6G7N +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12u+epBMcIsl +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12== +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: RSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LOFaFaMAP/ +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12X/gDrfYHCu +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12Uw== +---- END SSH2 PUBLIC KEY ---- +. +encrypted ip ssh-client key dsa key-pair +---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- +Comment: DSA Private Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12EQTG4SHh6Z +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FNfTUMF6C6 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12i4B02/IZGI +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12yX7nY+AOPD +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12pL8r4cXujS +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12a6Ut3tCQVy +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12FsYD/d5xWs +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lzxObeJ7Z1 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12mOCGodNRAf +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12LpzOPWsz6N +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD1248vEoC1X0n +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12SV +---- END SSH2 PRIVATE KEY ---- +---- BEGIN SSH2 PUBLIC KEY ---- +Comment: DSA Public Key +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12cHQnMuaXDn +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12qvE1vMH5xv +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lc4rWWCO6b +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12TVuouFfgdF +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12wj/WAxB4Op +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12lSIoIAfpkY +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12RqD0MS/9X5 +ABCD1234abcdABCD1234abcdABCD12ABCD1234abcdABCD1234abcdABCD12m52u4/cBjY +qCqdkBI+B+YqB1jT8w== +---- END SSH2 PUBLIC KEY ---- +. diff --git a/test/unit/mocked_data/test_get_facts/SG250-10P/expected_result.json b/test/unit/mocked_data/test_get_facts/SG250-10P/expected_result.json new file mode 100644 index 0000000..46aa65a --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG250-10P/expected_result.json @@ -0,0 +1 @@ +{"fqdn": "Unknown", "hostname": "switch-no-2548-1", "interface_list": ["GigabitEthernet1", "GigabitEthernet2", "GigabitEthernet3", "GigabitEthernet4", "GigabitEthernet5", "GigabitEthernet6", "GigabitEthernet7", "GigabitEthernet8", "GigabitEthernet9", "GigabitEthernet10", "Port-channel1", "Port-channel2", "Port-channel3", "Port-channel4"], "model": "SG250-10P-K9", "os_version": "2.4.5.71", "serial_number": "ABC12234XYZ", "uptime": 10687167.0, "vendor": "Cisco"} diff --git a/test/unit/mocked_data/test_get_facts/SG250-10P/show_hosts.txt b/test/unit/mocked_data/test_get_facts/SG250-10P/show_hosts.txt new file mode 100644 index 0000000..e13ba7f --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG250-10P/show_hosts.txt @@ -0,0 +1,38 @@ +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 +-------------------------------------------- ------- --------- ---------- +30.70.3.33 static 1 + + +Cache Table +Flags: (STA/DYN, OK/NE/??) +STA - Static, DYN - Dynamic +OK - Okay, NE - Negative Cache, ?? - No Response + + Remaining + Host Addresses Type State TTL +------------------------- ------------------------ ---- ------ ---------- +tftp 30.70.3.33 IPv4 STA,OK +ntp.examples.com 30.70.3.33 IPv4 DYN,OK 0003:38:43 +ntp.examples.com no resolution IPv6 DYN,?? +ntp.ph.examp.com 30.30.3.33 IPv4 DYN,OK 0003:38:43 +ntp.ph.examp.com no resolution IPv6 DYN,?? +pnpserver.qqq.aa no resolution IPv6 DYN,NE 0020:55:13 +pnpserver.qqq.aa no resolution IPv4 DYN,NE 0020:55:13 +pingu.examples.com 30.70.3.33 IPv4 DYN,OK 0003:38:43 +ns-cb-1.examples.com 30.70.3.300 IPv4 DYN,OK 0003:38:43 +ns-cb-2.examples.com 30.70.3.300 IPv4 DYN,OK 0003:38:43 diff --git a/test/unit/mocked_data/test_get_facts/SG250-10P/show_interfaces_status.txt b/test/unit/mocked_data/test_get_facts/SG250-10P/show_interfaces_status.txt new file mode 100644 index 0000000..d61d603 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG250-10P/show_interfaces_status.txt @@ -0,0 +1,21 @@ +Flow Link Back Mdix +Port Type Duplex Speed Neg ctrl State Pressure Mode +-------- ------------ ------ ----- -------- ---- ----------- -------- ------- +gi1 1G-Copper Half 10 Enabled Off Up Disabled On +gi2 1G-Copper Half 10 Enabled Off Up Disabled On +gi3 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi4 1G-Copper Full 100 Enabled Off Up Disabled On +gi5 1G-Copper Full 100 Enabled Off Up Disabled On +gi6 1G-Copper Full 100 Enabled Off Up Disabled On +gi7 1G-Copper Half 10 Enabled Off Up Disabled On +gi8 1G-Copper Full 100 Enabled Off Up Disabled Off +gi9 1G-Combo-C -- -- -- -- Down -- -- +gi10 1G-Combo-C Full 100 Enabled 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 diff --git a/test/unit/mocked_data/test_get_facts/SG250-10P/show_inventory.txt b/test/unit/mocked_data/test_get_facts/SG250-10P/show_inventory.txt new file mode 100644 index 0000000..0869d85 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG250-10P/show_inventory.txt @@ -0,0 +1,2 @@ +NAME: "1" DESCR: "SG250-10P 10-Port Gigabit PoE Smart Switch" +PID: SG250-10P-K9 VID: V04 SN: ABC12234XYZ diff --git a/test/unit/mocked_data/test_get_facts/SG250-10P/show_system.txt b/test/unit/mocked_data/test_get_facts/SG250-10P/show_system.txt new file mode 100644 index 0000000..64f78df --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG250-10P/show_system.txt @@ -0,0 +1,21 @@ +System Description: SG250-10P 10-Port Gigabit PoE Smart Switch +System Up Time (days,hour:min:sec): 123,16:39:27 +System Contact: +System Name: switch-no-2548-1 +System Location: Something;Somewhere;Somestreet;others + atnice;0;vratnice +System MAC Address: aa:aa:a0:22:2a:a2 +System Object ID: 2.2.8.4.4.1.9.6.1.97.10.5 + +Unit Type +---- ---------------------- + 1 SG250-10P + + +Unit Fans Status +---- ------------------------------------- + 1 Fans status is N/A + +Unit Temperature (Celsius) Status +---- --------------------- ---------- + 1 65 OK diff --git a/test/unit/mocked_data/test_get_facts/SG250-10P/show_version.txt b/test/unit/mocked_data/test_get_facts/SG250-10P/show_version.txt new file mode 100644 index 0000000..94480c5 --- /dev/null +++ b/test/unit/mocked_data/test_get_facts/SG250-10P/show_version.txt @@ -0,0 +1,10 @@ +Active-image: flash://system/images/sg250_image_tesla_250_2.4.5.71.bin + Version: 2.4.5.71 + MD5 Digest: ABCD1234abcdABCD1234abcdABCD121c + Date: 04-Nov-2018 + Time: 19:46:16 +Inactive-image: flash://system/images/image1.bin + Version: 2.2.8.4 + MD5 Digest: ABCD1234abcdABCD1234abcdABCD12f1 + Date: 21-Dec-2016 + Time: 22:03:09 diff --git a/test/unit/mocked_data/test_get_interfaces/SG250-10P/expected_result.json b/test/unit/mocked_data/test_get_interfaces/SG250-10P/expected_result.json new file mode 100644 index 0000000..7fbd9cc --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG250-10P/expected_result.json @@ -0,0 +1 @@ +{"GigabitEthernet1": {"is_up": true, "is_enabled": true, "speed": 10.0, "mtu": 9000, "last_flapped": -1.0, "description": "", "mac_address": "AA:AA:A0:22:2A:A2"}, "GigabitEthernet2": {"is_up": true, "is_enabled": true, "speed": 10.0, "mtu": 9000, "last_flapped": -1.0, "description": "", "mac_address": "AA:AA:A0:22:2A:A2"}, "GigabitEthernet3": {"is_up": true, "is_enabled": true, "speed": 1000.0, "mtu": 9000, "last_flapped": -1.0, "description": "", "mac_address": "AA:AA:A0:22:2A:A2"}, "GigabitEthernet4": {"is_up": true, "is_enabled": true, "speed": 100.0, "mtu": 9000, "last_flapped": -1.0, "description": "", "mac_address": "AA:AA:A0:22:2A:A2"}, "GigabitEthernet5": {"is_up": true, "is_enabled": true, "speed": 100.0, "mtu": 9000, "last_flapped": -1.0, "description": "", "mac_address": "AA:AA:A0:22:2A:A2"}, "GigabitEthernet6": {"is_up": true, "is_enabled": true, "speed": 100.0, "mtu": 9000, "last_flapped": -1.0, "description": "", "mac_address": "AA:AA:A0:22:2A:A2"}, "GigabitEthernet7": {"is_up": true, "is_enabled": true, "speed": 10.0, "mtu": 9000, "last_flapped": -1.0, "description": "", "mac_address": "AA:AA:A0:22:2A:A2"}, "GigabitEthernet8": {"is_up": true, "is_enabled": true, "speed": 100.0, "mtu": 9000, "last_flapped": -1.0, "description": "", "mac_address": "AA:AA:A0:22:2A:A2"}, "GigabitEthernet9": {"is_up": false, "is_enabled": false, "speed": 0.0, "mtu": 9000, "last_flapped": -1.0, "description": "", "mac_address": "AA:AA:A0:22:2A:A2"}, "GigabitEthernet10": {"is_up": true, "is_enabled": true, "speed": 100.0, "mtu": 9000, "last_flapped": -1.0, "description": "Trunk to switchkuch-1", "mac_address": "AA:AA:A0:22:2A:A2"}} diff --git a/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_interfaces_description.txt b/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_interfaces_description.txt new file mode 100644 index 0000000..e46ead9 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_interfaces_description.txt @@ -0,0 +1,19 @@ +Port Description +------- ----------- +gi1 +gi2 +gi3 +gi4 +gi5 +gi6 +gi7 +gi8 +gi9 +gi10 Trunk to switchkuch-1 + +Ch Description +------- ----------- +Po1 +Po2 +Po3 +Po4 diff --git a/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_interfaces_status.txt b/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_interfaces_status.txt new file mode 100644 index 0000000..d61d603 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_interfaces_status.txt @@ -0,0 +1,21 @@ +Flow Link Back Mdix +Port Type Duplex Speed Neg ctrl State Pressure Mode +-------- ------------ ------ ----- -------- ---- ----------- -------- ------- +gi1 1G-Copper Half 10 Enabled Off Up Disabled On +gi2 1G-Copper Half 10 Enabled Off Up Disabled On +gi3 1G-Copper Full 1000 Enabled Off Up Disabled Off +gi4 1G-Copper Full 100 Enabled Off Up Disabled On +gi5 1G-Copper Full 100 Enabled Off Up Disabled On +gi6 1G-Copper Full 100 Enabled Off Up Disabled On +gi7 1G-Copper Half 10 Enabled Off Up Disabled On +gi8 1G-Copper Full 100 Enabled Off Up Disabled Off +gi9 1G-Combo-C -- -- -- -- Down -- -- +gi10 1G-Combo-C Full 100 Enabled 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 diff --git a/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_lldp_local_gi1.txt b/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_lldp_local_gi1.txt new file mode 100644 index 0000000..e4a558c --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_lldp_local_gi1.txt @@ -0,0 +1,28 @@ +Device ID: aa:aa:a0:22:2a:a2 +Port ID: gi10 +Capabilities: Bridge, Router +System Name: switch-no-2548-1 +Management address: 30.70.0.37 +Management address: fe80::c644:a0ff:fe3b:17d2%vlan1 + +802.3 Power Via Mdi: + MDI Power support Port Class: PSE + PSE MDI Power Support: Not supported + PSE MDI Power State: Not enabled + PSE power pair control ability: Not supported + PSE Power Pair: Signal + PSE Power class: 1 + Power Type: Type 2 PD + Power Source: Unknown Power Source + Power Priority: unknown + PSE Allocated Power Value: 0.0 + +4-Pair POE supported: No +Spare Pair Detection/Classification required: No +PD Spare Pair Desired State: Disabled + + +802.1 PVID: 1 +802.1 PPVID: +802.1 VLAN: +802.1 Protocol: diff --git a/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_ports_jumbo_frame.txt b/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_ports_jumbo_frame.txt new file mode 100644 index 0000000..7aa3793 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces/SG250-10P/show_ports_jumbo_frame.txt @@ -0,0 +1,2 @@ +Jumbo frames are enabled + Jumbo frames will be enabled after reset diff --git a/test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/expected_result.json b/test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/expected_result.json new file mode 100644 index 0000000..5993cb4 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/expected_result.json @@ -0,0 +1 @@ +{"VLAN1": {"ipv4": {"30.70.0.37": {"prefix_length": 17}}}} diff --git a/test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/show_ip_interface.txt b/test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/show_ip_interface.txt new file mode 100644 index 0000000..cfb8e0a --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/show_ip_interface.txt @@ -0,0 +1,4 @@ +IP Address I/F I/F Status Type Directed Prec Redirect Status + admin/oper Broadcast +------------------ --------- ---------- ------- --------- ---- -------- ------ +30.70.0.37/17 vlan 1 UP/UP Static disable No enable Valid diff --git a/test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/show_version.txt b/test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/show_version.txt new file mode 100644 index 0000000..94480c5 --- /dev/null +++ b/test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/show_version.txt @@ -0,0 +1,10 @@ +Active-image: flash://system/images/sg250_image_tesla_250_2.4.5.71.bin + Version: 2.4.5.71 + MD5 Digest: ABCD1234abcdABCD1234abcdABCD121c + Date: 04-Nov-2018 + Time: 19:46:16 +Inactive-image: flash://system/images/image1.bin + Version: 2.2.8.4 + MD5 Digest: ABCD1234abcdABCD1234abcdABCD12f1 + Date: 21-Dec-2016 + Time: 22:03:09 diff --git a/test/unit/mocked_data/test_get_lldp_neighbors/SG250-10P/expected_result.json b/test/unit/mocked_data/test_get_lldp_neighbors/SG250-10P/expected_result.json new file mode 100644 index 0000000..cd83a27 --- /dev/null +++ b/test/unit/mocked_data/test_get_lldp_neighbors/SG250-10P/expected_result.json @@ -0,0 +1 @@ +{"GigabitEthernet3": [{"hostname": "", "port": "aa:aa:22:a2:22:2a"}], "GigabitEthernet10": [{"hostname": "switchkuch-1", "port": "Fa0/22"}]} diff --git a/test/unit/mocked_data/test_get_lldp_neighbors/SG250-10P/show_lldp_neighbors.txt b/test/unit/mocked_data/test_get_lldp_neighbors/SG250-10P/show_lldp_neighbors.txt new file mode 100644 index 0000000..6cd576d --- /dev/null +++ b/test/unit/mocked_data/test_get_lldp_neighbors/SG250-10P/show_lldp_neighbors.txt @@ -0,0 +1,9 @@ +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 +--------- ----------------- ----------------- ----------------- ------------ ----- +gi3 aa:aa:22:a2:22:2a aa:aa:22:a2:22:2a O 2938 +gi10 00:2a:aa:a2:2a:20 Fa0/22 switchkuch-1 B 102 diff --git a/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/expected_result.json b/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/expected_result.json new file mode 100644 index 0000000..7b6c5c7 --- /dev/null +++ b/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/expected_result.json @@ -0,0 +1 @@ +{"GigabitEthernet3": [{"parent_interface": "N/A", "remote_port": "FastEthernet0/22", "remote_port_description": "FastEthernet0/22", "remote_chassis_id": "00:2a:aa:a2:2a:20", "remote_system_name": "switchkuch-1", "remote_system_description": "Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(2)SE11, RELEASE SOFTWARE (fc3)", "remote_system_capab": ["B"], "remote_system_enable_capab": ["B"]}], "GigabitEthernet10": [{"parent_interface": "N/A", "remote_port": "FastEthernet0/22", "remote_port_description": "FastEthernet0/22", "remote_chassis_id": "00:2a:aa:a2:2a:20", "remote_system_name": "switchkuch-1", "remote_system_description": "Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(2)SE11, RELEASE SOFTWARE (fc3)", "remote_system_capab": ["B"], "remote_system_enable_capab": ["B"]}]} diff --git a/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_local_gi10.txt b/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_local_gi10.txt new file mode 100644 index 0000000..e4a558c --- /dev/null +++ b/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_local_gi10.txt @@ -0,0 +1,28 @@ +Device ID: aa:aa:a0:22:2a:a2 +Port ID: gi10 +Capabilities: Bridge, Router +System Name: switch-no-2548-1 +Management address: 30.70.0.37 +Management address: fe80::c644:a0ff:fe3b:17d2%vlan1 + +802.3 Power Via Mdi: + MDI Power support Port Class: PSE + PSE MDI Power Support: Not supported + PSE MDI Power State: Not enabled + PSE power pair control ability: Not supported + PSE Power Pair: Signal + PSE Power class: 1 + Power Type: Type 2 PD + Power Source: Unknown Power Source + Power Priority: unknown + PSE Allocated Power Value: 0.0 + +4-Pair POE supported: No +Spare Pair Detection/Classification required: No +PD Spare Pair Desired State: Disabled + + +802.1 PVID: 1 +802.1 PPVID: +802.1 VLAN: +802.1 Protocol: diff --git a/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors.txt b/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors.txt new file mode 100644 index 0000000..6cd576d --- /dev/null +++ b/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors.txt @@ -0,0 +1,9 @@ +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 +--------- ----------------- ----------------- ----------------- ------------ ----- +gi3 aa:aa:22:a2:22:2a aa:aa:22:a2:22:2a O 2938 +gi10 00:2a:aa:a2:2a:20 Fa0/22 switchkuch-1 B 102 diff --git a/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors_GigabitEthernet10.txt b/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors_GigabitEthernet10.txt new file mode 100644 index 0000000..3196c7d --- /dev/null +++ b/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors_GigabitEthernet10.txt @@ -0,0 +1,22 @@ +Device ID: 00:2a:aa:a2:2a:20 +Port ID: Fa0/22 +Capabilities: Bridge +System Name: switchkuch-1 +System description: Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(2)SE11, RELEASE SOFTWARE (fc3) +Technical Support: http://www.cisco.com/techsupport +Copyrigh +Port description: FastEthernet0/22 +Management Address: 30.70.0.33 +Time To Live: 91 + + +802.3 MAC/PHY Configuration/Status +Auto-negotiation support: Supported +Auto-negotiation status: Enabled +Auto-negotiation Advertised Capabilities: 100BASE-TX full duplex mode, 100BASE-TX half duplex mode, 10BASE-T full duplex mode, 10BASE-T half duplex mode +Operational MAU type: 100BaseTXFD + +802.1 PVID: 1 +802.1 PPVID: +802.1 VLAN: +802.1 Protocol: diff --git a/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors_GigabitEthernet3.txt b/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors_GigabitEthernet3.txt new file mode 100644 index 0000000..3196c7d --- /dev/null +++ b/test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors_GigabitEthernet3.txt @@ -0,0 +1,22 @@ +Device ID: 00:2a:aa:a2:2a:20 +Port ID: Fa0/22 +Capabilities: Bridge +System Name: switchkuch-1 +System description: Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0(2)SE11, RELEASE SOFTWARE (fc3) +Technical Support: http://www.cisco.com/techsupport +Copyrigh +Port description: FastEthernet0/22 +Management Address: 30.70.0.33 +Time To Live: 91 + + +802.3 MAC/PHY Configuration/Status +Auto-negotiation support: Supported +Auto-negotiation status: Enabled +Auto-negotiation Advertised Capabilities: 100BASE-TX full duplex mode, 100BASE-TX half duplex mode, 10BASE-T full duplex mode, 10BASE-T half duplex mode +Operational MAU type: 100BaseTXFD + +802.1 PVID: 1 +802.1 PPVID: +802.1 VLAN: +802.1 Protocol: diff --git a/test/unit/mocked_data/test_get_ntp_servers/SG250-10P/expected_result.json b/test/unit/mocked_data/test_get_ntp_servers/SG250-10P/expected_result.json new file mode 100644 index 0000000..469fe7e --- /dev/null +++ b/test/unit/mocked_data/test_get_ntp_servers/SG250-10P/expected_result.json @@ -0,0 +1 @@ +{"30.30.3.33": {}, "30.70.3.33": {}, "ntp.examples.com": {}, "ntp.ph.examp.com": {}} diff --git a/test/unit/mocked_data/test_get_ntp_servers/SG250-10P/show_sntp_status.txt b/test/unit/mocked_data/test_get_ntp_servers/SG250-10P/show_sntp_status.txt new file mode 100644 index 0000000..64f9a47 --- /dev/null +++ b/test/unit/mocked_data/test_get_ntp_servers/SG250-10P/show_sntp_status.txt @@ -0,0 +1,43 @@ +Clock is synchronized, stratum 2, reference is 30.70.3.33, unicast + +Unicast servers: + +Server : 30.30.3.33 + Source : Static + Stratum : 2 + Status : up + Last Response : 14:45:42.0 CEST Apr 4 2024 + Offset : 1094.3411020 mSec + Delay : 0 mSec + +Server : 30.70.3.33 + Source : Static + Stratum : 2 + Status : up + Last Response : 14:18:57.0 CEST Apr 24 2024 + Offset : 1088.6150517 mSec + Delay : 0 mSec + +Server : ntp.examples.com + Source : Static + Stratum : 255 + Status : down + Last Response : 00:00:00.0 Jan 1 1900 + Offset : 0.0000000 mSec + Delay : 0 mSec + +Server : ntp.ph.examp.com + Source : Static + Stratum : 255 + Status : down + Last Response : 00:00:00.0 Jan 1 1900 + Offset : 0.0000000 mSec + Delay : 0 mSec + + + +Anycast server: + + + +Broadcast: diff --git a/test/unit/mocked_data/test_is_alive/SG250-10P/expected_result.json b/test/unit/mocked_data/test_is_alive/SG250-10P/expected_result.json new file mode 100644 index 0000000..43b92ac --- /dev/null +++ b/test/unit/mocked_data/test_is_alive/SG250-10P/expected_result.json @@ -0,0 +1 @@ +{"is_alive": true}