From 0c54958dbf682f1266e87e522ec64c1da2e3378f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Kl=C3=ADma?= Date: Wed, 24 Apr 2024 17:27:22 +0200 Subject: [PATCH] Release 0.5.1 (#101) * use netmiko_args * Add changes for 4.1.0 (#89) * Update requirements.txt * Typpo in requirements * _send_command has only two parameters * Adapt to stricter Unit tests --------- Co-authored-by: Anton Gridnev * Remove s350_base_interfaces custom map - it is allready in napalm base * Adapt Unit tests to canonical_interface_name() * Add format parameter to get_config() * Add badges * Tests for push are enought * update CD actions * add tests for device SG500-52 * Merge CI to develop (#95) * Simplify CI * CI update * CI update * Update CI from develop (#94) * Add format parameter to get_config() * Add badges * Tests for push are enought * update CD actions * add tests for device SG500-52 * fetch_command_output helper (#97) * fetch_command_output.sh tool * Update fetch_command_update from develop (#93) * adding read_timeout_override netmiko option --------- Signed-off-by: dependabot[bot] Co-authored-by: Petr Klima Co-authored-by: Dave Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Anton Gridnev * Set default command timeout (#98) * adding read_timeout_override netmiko option --------- Signed-off-by: dependabot[bot] Co-authored-by: Petr Klima * Fetch command output - obfuscations (#99) * add IP and MAC obfuscation * Add obfuscate strings * Merge master changes back to develop (#100) * Lift version to 0.4.1 * Adapt to napalm 4.1 tests (#90) * use netmiko_args * Add changes for 4.1.0 (#89) * Update requirements.txt * Typpo in requirements * _send_command has only two parameters * Adapt to stricter Unit tests --------- Co-authored-by: Anton Gridnev * Remove s350_base_interfaces custom map - it is allready in napalm base * Adapt Unit tests to canonical_interface_name() --------- Co-authored-by: Dave Co-authored-by: Anton Gridnev * move version to 0.4.1.1 * Make it napalm 5 compliant (#92) * use netmiko_args * Add changes for 4.1.0 (#89) * Update requirements.txt * Typpo in requirements * _send_command has only two parameters * Adapt to stricter Unit tests --------- Co-authored-by: Anton Gridnev * Remove s350_base_interfaces custom map - it is allready in napalm base * Adapt Unit tests to canonical_interface_name() * Add format parameter to get_config() * Add badges --------- Co-authored-by: Dave Co-authored-by: Anton Gridnev * move version to 5.0.0 * move to version 0.5.0 --------- Co-authored-by: Dave Co-authored-by: Anton Gridnev * better obfuscation for fetch command output * better obfuscation for fetch command output * get rid of textFSM templates * get rid of textFSM templates * Add support and tests for SG250 * bump to version 0.5.1 --------- Signed-off-by: dependabot[bot] Co-authored-by: Dave Co-authored-by: Anton Gridnev Co-authored-by: Petr Klima Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/FastTest.yml | 4 - .github/workflows/PublishToPIP.yml | 4 +- .github/workflows/ThoroughTest.yml | 4 - .gitignore | 5 + README.md | 118 +++--- napalm_s350/s350.py | 23 +- napalm_s350/utils/__init__.py | 1 - napalm_s350/utils/textfsm_templates/hosts.tpl | 8 - setup.py | 2 +- .../command_output/SG250-10P/show_arp.txt | 10 + .../command_output/SG250-10P/show_hosts.txt | 38 ++ .../show_interface_switchport_gi1.txt | 23 ++ .../SG250-10P/show_interfaces_description.txt | 19 + .../SG250-10P/show_interfaces_status.txt | 21 ++ .../SG250-10P/show_inventory.txt | 2 + .../SG250-10P/show_ip_interface.txt | 4 + .../SG250-10P/show_ipv6_interface_brief.txt | 4 + .../SG250-10P/show_lldp_local_gi10.txt | 28 ++ .../SG250-10P/show_lldp_neighbors.txt | 9 + .../SG250-10P/show_lldp_neighbors_gi10.txt | 22 ++ .../SG250-10P/show_ports_jumbo_frame.txt | 2 + .../SG250-10P/show_running_config.txt | 136 +++++++ .../show_running_config_detailed.txt | 344 ++++++++++++++++++ .../SG250-10P/show_sntp_status.txt | 43 +++ .../SG250-10P/show_startup_config.txt | 192 ++++++++++ .../command_output/SG250-10P/show_system.txt | 21 ++ .../command_output/SG250-10P/show_version.txt | 10 + .../command_output/SG500-52-K9/show_dir.txt | 0 ...nterface_switchport_GigabitEthernet1_4.txt | 0 .../show_interfaces_description.txt | 0 .../SG500-52-K9/show_interfaces_status.txt | 0 .../SG500-52-K9/show_inventory.txt | 0 .../SG500-52-K9/show_running_config.txt | 0 .../show_running_config_detailed.txt | 0 .../SG500-52-K9/show_startup_config.txt | 0 .../SG500-52-K9/show_system.txt | 0 .../SG500-52-K9/show_version.txt | 0 test/unit/fetch_command_output.cfg | 70 ++++ test/unit/fetch_command_output.cfg.template | 68 ++++ test/unit/fetch_command_output.sh | 235 ++++++++++++ .../SG250-10P/expected_result.json | 1 + .../test_get_arp_table/SG250-10P/show_arp.txt | 10 + .../SG250-10P/expected_result.json | 1 + .../SG250-10P/show_arp.txt | 10 + .../SG250-10P/expected_result.json | 1 + .../SG250-10P/show_running_config.txt | 136 +++++++ .../SG250-10P/show_startup_config.txt | 192 ++++++++++ .../SG250-10P/expected_result.json | 1 + .../SG250-10P/show_running_config.txt | 136 +++++++ .../SG250-10P/show_startup_config.txt | 192 ++++++++++ .../SG250-10P/expected_result.json | 1 + .../SG250-10P/show_running_config.txt | 136 +++++++ .../SG250-10P/show_startup_config.txt | 192 ++++++++++ .../SG250-10P/expected_result.json | 1 + .../test_get_facts/SG250-10P/show_hosts.txt | 38 ++ .../SG250-10P/show_interfaces_status.txt | 21 ++ .../SG250-10P/show_inventory.txt | 2 + .../test_get_facts/SG250-10P/show_system.txt | 21 ++ .../test_get_facts/SG250-10P/show_version.txt | 10 + .../SG250-10P/expected_result.json | 1 + .../SG250-10P/show_interfaces_description.txt | 19 + .../SG250-10P/show_interfaces_status.txt | 21 ++ .../SG250-10P/show_lldp_local_gi1.txt | 28 ++ .../SG250-10P/show_ports_jumbo_frame.txt | 2 + .../SG250-10P/expected_result.json | 1 + .../SG250-10P/show_ip_interface.txt | 4 + .../SG250-10P/show_version.txt | 10 + .../SG250-10P/expected_result.json | 1 + .../SG250-10P/show_lldp_neighbors.txt | 9 + .../SG250-10P/expected_result.json | 1 + .../SG250-10P/show_lldp_local_gi10.txt | 28 ++ .../SG250-10P/show_lldp_neighbors.txt | 9 + .../show_lldp_neighbors_GigabitEthernet10.txt | 22 ++ .../show_lldp_neighbors_GigabitEthernet3.txt | 22 ++ .../SG250-10P/expected_result.json | 1 + .../SG250-10P/show_sntp_status.txt | 43 +++ .../SG250-10P/expected_result.json | 1 + 77 files changed, 2720 insertions(+), 75 deletions(-) delete mode 100644 napalm_s350/utils/__init__.py delete mode 100644 napalm_s350/utils/textfsm_templates/hosts.tpl create mode 100644 test/unit/command_output/SG250-10P/show_arp.txt create mode 100644 test/unit/command_output/SG250-10P/show_hosts.txt create mode 100644 test/unit/command_output/SG250-10P/show_interface_switchport_gi1.txt create mode 100644 test/unit/command_output/SG250-10P/show_interfaces_description.txt create mode 100644 test/unit/command_output/SG250-10P/show_interfaces_status.txt create mode 100644 test/unit/command_output/SG250-10P/show_inventory.txt create mode 100644 test/unit/command_output/SG250-10P/show_ip_interface.txt create mode 100644 test/unit/command_output/SG250-10P/show_ipv6_interface_brief.txt create mode 100644 test/unit/command_output/SG250-10P/show_lldp_local_gi10.txt create mode 100644 test/unit/command_output/SG250-10P/show_lldp_neighbors.txt create mode 100644 test/unit/command_output/SG250-10P/show_lldp_neighbors_gi10.txt create mode 100644 test/unit/command_output/SG250-10P/show_ports_jumbo_frame.txt create mode 100644 test/unit/command_output/SG250-10P/show_running_config.txt create mode 100644 test/unit/command_output/SG250-10P/show_running_config_detailed.txt create mode 100644 test/unit/command_output/SG250-10P/show_sntp_status.txt create mode 100644 test/unit/command_output/SG250-10P/show_startup_config.txt create mode 100644 test/unit/command_output/SG250-10P/show_system.txt create mode 100644 test/unit/command_output/SG250-10P/show_version.txt rename napalm_s350/templates/.placeholder => test/unit/command_output/SG500-52-K9/show_dir.txt (100%) rename napalm_s350/utils/textfsm_templates/.placeholder => test/unit/command_output/SG500-52-K9/show_interface_switchport_GigabitEthernet1_4.txt (100%) create mode 100644 test/unit/command_output/SG500-52-K9/show_interfaces_description.txt create mode 100644 test/unit/command_output/SG500-52-K9/show_interfaces_status.txt create mode 100644 test/unit/command_output/SG500-52-K9/show_inventory.txt create mode 100644 test/unit/command_output/SG500-52-K9/show_running_config.txt create mode 100644 test/unit/command_output/SG500-52-K9/show_running_config_detailed.txt create mode 100644 test/unit/command_output/SG500-52-K9/show_startup_config.txt create mode 100644 test/unit/command_output/SG500-52-K9/show_system.txt create mode 100644 test/unit/command_output/SG500-52-K9/show_version.txt create mode 100644 test/unit/fetch_command_output.cfg create mode 100644 test/unit/fetch_command_output.cfg.template create mode 100755 test/unit/fetch_command_output.sh create mode 100644 test/unit/mocked_data/test_get_arp_table/SG250-10P/expected_result.json create mode 100644 test/unit/mocked_data/test_get_arp_table/SG250-10P/show_arp.txt create mode 100644 test/unit/mocked_data/test_get_arp_table_with_vrf/SG250-10P/expected_result.json create mode 100644 test/unit/mocked_data/test_get_arp_table_with_vrf/SG250-10P/show_arp.txt create mode 100644 test/unit/mocked_data/test_get_config/SG250-10P/expected_result.json create mode 100644 test/unit/mocked_data/test_get_config/SG250-10P/show_running_config.txt create mode 100644 test/unit/mocked_data/test_get_config/SG250-10P/show_startup_config.txt create mode 100644 test/unit/mocked_data/test_get_config_filtered/SG250-10P/expected_result.json create mode 100644 test/unit/mocked_data/test_get_config_filtered/SG250-10P/show_running_config.txt create mode 100644 test/unit/mocked_data/test_get_config_filtered/SG250-10P/show_startup_config.txt create mode 100644 test/unit/mocked_data/test_get_config_sanitized/SG250-10P/expected_result.json create mode 100644 test/unit/mocked_data/test_get_config_sanitized/SG250-10P/show_running_config.txt create mode 100644 test/unit/mocked_data/test_get_config_sanitized/SG250-10P/show_startup_config.txt create mode 100644 test/unit/mocked_data/test_get_facts/SG250-10P/expected_result.json create mode 100644 test/unit/mocked_data/test_get_facts/SG250-10P/show_hosts.txt create mode 100644 test/unit/mocked_data/test_get_facts/SG250-10P/show_interfaces_status.txt create mode 100644 test/unit/mocked_data/test_get_facts/SG250-10P/show_inventory.txt create mode 100644 test/unit/mocked_data/test_get_facts/SG250-10P/show_system.txt create mode 100644 test/unit/mocked_data/test_get_facts/SG250-10P/show_version.txt create mode 100644 test/unit/mocked_data/test_get_interfaces/SG250-10P/expected_result.json create mode 100644 test/unit/mocked_data/test_get_interfaces/SG250-10P/show_interfaces_description.txt create mode 100644 test/unit/mocked_data/test_get_interfaces/SG250-10P/show_interfaces_status.txt create mode 100644 test/unit/mocked_data/test_get_interfaces/SG250-10P/show_lldp_local_gi1.txt create mode 100644 test/unit/mocked_data/test_get_interfaces/SG250-10P/show_ports_jumbo_frame.txt create mode 100644 test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/expected_result.json create mode 100644 test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/show_ip_interface.txt create mode 100644 test/unit/mocked_data/test_get_interfaces_ip/SG250-10P/show_version.txt create mode 100644 test/unit/mocked_data/test_get_lldp_neighbors/SG250-10P/expected_result.json create mode 100644 test/unit/mocked_data/test_get_lldp_neighbors/SG250-10P/show_lldp_neighbors.txt create mode 100644 test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/expected_result.json create mode 100644 test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_local_gi10.txt create mode 100644 test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors.txt create mode 100644 test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors_GigabitEthernet10.txt create mode 100644 test/unit/mocked_data/test_get_lldp_neighbors_detail/SG250-10P/show_lldp_neighbors_GigabitEthernet3.txt create mode 100644 test/unit/mocked_data/test_get_ntp_servers/SG250-10P/expected_result.json create mode 100644 test/unit/mocked_data/test_get_ntp_servers/SG250-10P/show_sntp_status.txt create mode 100644 test/unit/mocked_data/test_is_alive/SG250-10P/expected_result.json diff --git a/.github/workflows/FastTest.yml b/.github/workflows/FastTest.yml index 024c538..a6b58bf 100644 --- a/.github/workflows/FastTest.yml +++ b/.github/workflows/FastTest.yml @@ -8,10 +8,6 @@ on: branches-ignore: - develop - master - pull_request: - branches-ignore: - - develop - - master jobs: diff --git a/.github/workflows/PublishToPIP.yml b/.github/workflows/PublishToPIP.yml index 492b919..4323411 100644 --- a/.github/workflows/PublishToPIP.yml +++ b/.github/workflows/PublishToPIP.yml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies diff --git a/.github/workflows/ThoroughTest.yml b/.github/workflows/ThoroughTest.yml index dc8ff30..a0d023f 100644 --- a/.github/workflows/ThoroughTest.yml +++ b/.github/workflows/ThoroughTest.yml @@ -8,10 +8,6 @@ on: branches: - develop - master - pull_request: - branches: - - develop - - master # check every 14 days schedule: - cron: '0 6 5,20 * *' diff --git a/.gitignore b/.gitignore index 5c76993..7ffa4a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ + +# cfg for getting cmd outputs +test/unit/fetch_command_output.cfg + + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/README.md b/README.md index 446614b..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 @@ -106,6 +106,22 @@ NS - not supported - devices do not have support for that feature To be sure we can support new device we use test files. +### Fetch command output tool +There is tool for getting necessary infromatin form running switch +``` +cd test/unit + +# DEVICE_TYPE as PID: in "show inventory" output +# INTERFACE an inteface +# LLDP_INTERFACE inteface for getting LLDP inforation +./fetch_command_output.sh -u USER -p PASSWORD -t DEVICE_TYPE -v s350 \ + -d SWITCH_IP_or_FQDN -i INTERFACE -l LLDP_INTERFACE +``` + +Output files from that tool are in "test/unit/command_output/$DEVICE_TYPE" + +### By hand + We need text output of those commands, to add new device: ``` show arp diff --git a/napalm_s350/s350.py b/napalm_s350/s350.py index 59d9f3b..7c1e8e7 100644 --- a/napalm_s350/s350.py +++ b/napalm_s350/s350.py @@ -100,11 +100,11 @@ class S350Driver(NetworkDriver): try: if isinstance(command, list): for cmd in command: - output = self.device.send_command(cmd) + output = self.device.send_command(cmd, read_timeout=self.timeout) if "% Invalid" not in output: break else: - output = self.device.send_command(command) + output = self.device.send_command(command, read_timeout=self.timeout) return output.strip() except (socket.error, EOFError) as e: raise ConnectionClosedException(str(e)) @@ -245,13 +245,28 @@ class S350Driver(NetworkDriver): uptime = self._parse_uptime(uptime_str) # serial_number and model + # take first device inventory = self._get_facts_parse_inventory(show_inv)["1"] serial_number = inventory["sn"] model = inventory["pid"] # fqdn - domainname = napalm.base.helpers.textfsm_extractor(self, "hosts", show_hosts)[0] - domainname = domainname["domain_name"] + # take first domain name + domainname = "Unknown" + atDTh = False + atDT = False + for line in show_hosts.splitlines(): + if line.startswith("Default Domain Table"): + atDTh = True + continue + if atDTh and line.startswith("--------"): + atDT = True + continue + if atDT: + fields = line.split(" ") + domainname = fields[0] + break + if domainname == "Domain": domainname = "Unknown" if domainname != "Unknown" and hostname != "Unknown": diff --git a/napalm_s350/utils/__init__.py b/napalm_s350/utils/__init__.py deleted file mode 100644 index 678164a..0000000 --- a/napalm_s350/utils/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""napalm.utils package.""" diff --git a/napalm_s350/utils/textfsm_templates/hosts.tpl b/napalm_s350/utils/textfsm_templates/hosts.tpl deleted file mode 100644 index 9a45db9..0000000 --- a/napalm_s350/utils/textfsm_templates/hosts.tpl +++ /dev/null @@ -1,8 +0,0 @@ -Value DOMAIN_NAME ([\w+.]+) - -Start - ^\s+Domain\s+Source\s+Interface\s+Preference -> Domains - ^\s+Source\s+Interface\s+Preference\s+Domain -> Domains - -Domains - ^${DOMAIN_NAME} -> Record End diff --git a/setup.py b/setup.py index 36f676c..7ef489d 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ with open("README.md", "r") as fs: setup( name="napalm-s350", - version="0.5.0", + version="0.5.1", packages=find_packages(exclude=("test*",)), author="Jasper Lievisse Adriaanse, Petr KlĂ­ma, Daniel Bacher", author_email="j@jasper.la, qaxi@seznam.cz, mail@phill93.de", 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/napalm_s350/templates/.placeholder b/test/unit/command_output/SG500-52-K9/show_dir.txt similarity index 100% rename from napalm_s350/templates/.placeholder rename to test/unit/command_output/SG500-52-K9/show_dir.txt diff --git a/napalm_s350/utils/textfsm_templates/.placeholder b/test/unit/command_output/SG500-52-K9/show_interface_switchport_GigabitEthernet1_4.txt similarity index 100% rename from napalm_s350/utils/textfsm_templates/.placeholder rename to test/unit/command_output/SG500-52-K9/show_interface_switchport_GigabitEthernet1_4.txt diff --git a/test/unit/command_output/SG500-52-K9/show_interfaces_description.txt b/test/unit/command_output/SG500-52-K9/show_interfaces_description.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/unit/command_output/SG500-52-K9/show_interfaces_status.txt b/test/unit/command_output/SG500-52-K9/show_interfaces_status.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/unit/command_output/SG500-52-K9/show_inventory.txt b/test/unit/command_output/SG500-52-K9/show_inventory.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/unit/command_output/SG500-52-K9/show_running_config.txt b/test/unit/command_output/SG500-52-K9/show_running_config.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/unit/command_output/SG500-52-K9/show_running_config_detailed.txt b/test/unit/command_output/SG500-52-K9/show_running_config_detailed.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/unit/command_output/SG500-52-K9/show_startup_config.txt b/test/unit/command_output/SG500-52-K9/show_startup_config.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/unit/command_output/SG500-52-K9/show_system.txt b/test/unit/command_output/SG500-52-K9/show_system.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/unit/command_output/SG500-52-K9/show_version.txt b/test/unit/command_output/SG500-52-K9/show_version.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/unit/fetch_command_output.cfg b/test/unit/fetch_command_output.cfg new file mode 100644 index 0000000..c09df6c --- /dev/null +++ b/test/unit/fetch_command_output.cfg @@ -0,0 +1,70 @@ +# Config file for utility 'fetch_command_output.sh' +# +# This will help you to make bunch of command output files for napalm drivers unit tests +# +# There is not any IP, MAC or names obfuscation or anonymizations! +# Before using outputs as a unit test files it is recommendet to protect +# your privacy information yourself by editing output files. + +# Required variables +# $INTERFACE - for detailed interface information +# $LLDPINTERFACE - for detailed LLDP information + +# Define empty array of commands +COMMANDS=() + +# This is example set of commands for napalm driver 's350' (Cisco SMB) + +# system info +COMMANDS+=("show version") +COMMANDS+=("show system") +COMMANDS+=("show version") +COMMANDS+=("show inventory") + +# config commands +COMMANDS+=("show startup-config") +COMMANDS+=("show running-config") +COMMANDS+=("show running-config detailed") + +# interface commands +COMMANDS+=("show interfaces status") +COMMANDS+=("show interfaces description") +COMMANDS+=("show interface switchport $INTERFACE") +COMMANDS+=("show ports jumbo-frame") + +# ip commands +COMMANDS+=("show hosts") +COMMANDS+=("show ip interface") +COMMANDS+=("show ipv6 interface brief") +COMMANDS+=("show arp") + +# lldp commands +COMMANDS+=("show lldp neighbors") +COMMANDS+=("show lldp local $LLDPINTERFACE") +COMMANDS+=("show lldp neighbors $LLDPINTERFACE") + +# ntp commands +COMMANDS+=("show sntp status") + +# !!! keeep replacement the same lenght +OBFUSCATE=() +# keys and secrets +OBFUSCATE+=("[a-f0-9]{40}&&&0123456789abcdef0123456789abcdef01234567") +OBFUSCATE+=("[a-zA-Z0-9+/]{30}&&&ABCD1234abcdABCD1234abcdABCD12") +# domains +OBFUSCATE+=("sw-cb-vratnice-&&&switch-no-2548-") +OBFUSCATE+=("sw-cb-&&&switch") +OBFUSCATE+=("cb.madeta.cz&&&examples.com") +OBFUSCATE+=("madeta.cz&&&examp.com") +# names and acronims +OBFUSCATE+=("CZ;Ceske Budejovice;Rudolfovska 83;vr&&&Something;Somewhere;Somestreet;others") +OBFUSCATE+=("MDT&&&ABC") +OBFUSCATE+=("Madeta&&&Abcdef") +OBFUSCATE+=("NECOSS&&&Abcdef") +OBFUSCATE+=("Atlantis&&&Abcdefgh") +OBFUSCATE+=("PSZ21221ECM&&&ABC12234XYZ") +# specific repairs for example: +# - versions confused with IPs +OBFUSCATE+=("3.3.3.73&&&2.4.5.71") +OBFUSCATE+=("3.3.7.3&&&2.2.8.4") + diff --git a/test/unit/fetch_command_output.cfg.template b/test/unit/fetch_command_output.cfg.template new file mode 100644 index 0000000..44b04e3 --- /dev/null +++ b/test/unit/fetch_command_output.cfg.template @@ -0,0 +1,68 @@ +# Config file for utility 'fetch_command_output.sh' +# +# This will help you to make bunch of command output files for napalm drivers unit tests +# +# There is not any IP, MAC or names obfuscation or anonymizations! +# Before using outputs as a unit test files it is recommendet to protect +# your privacy information yourself by editing output files. + +# Required variables +# $INTERFACE - for detailed interface information +# $LLDPINTERFACE - for detailed LLDP information + +# Define empty array of commands +COMMANDS=() + +# This is example set of commands for napalm driver 's350' (Cisco SMB) + +# system info +COMMANDS+=("show version") +COMMANDS+=("show system") +COMMANDS+=("show version") +COMMANDS+=("show inventory") + +# config commands +COMMANDS+=("show startup-config") +COMMANDS+=("show running-config") +COMMANDS+=("show running-config detailed") + +# interface commands +COMMANDS+=("show interfaces status") +COMMANDS+=("show interfaces description") +COMMANDS+=("show interface switchport $INTERFACE") +COMMANDS+=("show ports jumbo-frame") + +# ip commands +COMMANDS+=("show hosts") +COMMANDS+=("show ip interface") +COMMANDS+=("show ipv6 interface brief") +COMMANDS+=("show arp") + +# lldp commands +COMMANDS+=("show lldp neighbors") +COMMANDS+=("show lldp local $LLDPINTERFACE") +COMMANDS+=("show lldp neighbors $LLDPINTERFACE") + +# ntp commands +COMMANDS+=("show sntp status") + +# Additional obfuscations +# format is "SOURCE&&&REPLACEMENT" +# !!! keep source and replacement the same lenght +OBFUSCATE=() +# keys and secrets +OBFUSCATE+=("[a-f0-9]{40}&&&0123456789abcdef0123456789abcdef01234567") +OBFUSCATE+=("[a-zA-Z0-9+/]{30}&&&ABCD1234abcdABCD1234abcdABCD12") +# domains +OBFUSCATE+=("somedoma.org&&&examples.com") +OBFUSCATE+=("domai.org&&&examp.com") +# names and acronims +OBFUSCATE+=("SECRET&&&someth") +OBFUSCATE+=("IBM&&&ABC") +OBFUSCATE+=("Microsoft&&&Abcdefgh") +OBFUSCATE+=("PS222221ECM&&&ABC12234XYZ") +# specific repairs for example: +# - versions confused with IPs +OBFUSCATE+=("3.3.3.73&&&2.4.5.71") +OBFUSCATE+=("3.3.7.3&&&2.2.8.4") + diff --git a/test/unit/fetch_command_output.sh b/test/unit/fetch_command_output.sh new file mode 100755 index 0000000..ee48a62 --- /dev/null +++ b/test/unit/fetch_command_output.sh @@ -0,0 +1,235 @@ +#!/bin/bash + +# Defaults +DEF_FORCE="n" +#DEF_METHOD="cli" - nice with --method-kwargs "commands=['show ip interface']" +# but output is JSON +DEF_METHOD="_send_command" + +# mocked data dir +MDDIR="mocked_data" +# command output dir +CODIR="command_output" +# config +CMDIN="./$(basename $0 .sh ).cfg" + +GETOPTS=":hu:p:ft:m:i:l:v:d:" +function usage() { + MSG="usage: $(basename $0) [-h] -u USERNAME -p PASSWORD [-f]\n" + MSG+=" [-m METHOD] -i INTERFACE -l LLDP_INTERFACE\n" + MSG+=" -t TYPE -v VENDOR -d DEVICE [SINGLE_COMMAND]\n" + MSG+="\n" + MSG+=" This utility helps to get output of commands from device.\n" + MSG+=" Set of commands can be configured in '$CMDIN'\n" + MSG+=" Command output is saved to '$CODIR/DEVICE_TYPE/command_out.txt'\n" + MSG+=" and by default is not to be overwriten.\n" + MSG+="\n" + MSG+=" There is not any IP, MAC or names obfuscation or anonymizations!\n" + MSG+=" Before using as a unit test files it is recommendet to protect\n" + MSG+=" your privacy information yourself by editing output files\n" + MSG+=" in '$CODIR/DEVICE_TYPE/command_out.txt'!\n" + MSG+="\n" + MSG+=" -h - this help\n" + MSG+=" -u USERNAME - login username (or env DEVUSERNAME)\n" + MSG+=" -p PASSWORD - login password (or env DEVPASSWORD)\n" + MSG+=" -f - overwrite already downloaded output files\n" + MSG+=" -t TYPE - device type\n" + MSG+=" -m METHOD - what method sends command to device (def '$DEF_METHOD')\n" + MSG+=" -i INTERFACE - interface for deailed info (see '$CMDIN')\n" + MSG+=" -l INTERFACE - interface for deailed lldp info (see '$CMDIN')\n" + MSG+=" -v VENDOR - vendor napalm driver\n" + MSG+=" -d DEVICE - device to connect\n" + + [[ -n $@ ]] && echo -e "\n### $@ ###\n" >&2 + + echo -e "$MSG" >&2 + exit 127 +} + + +# Parse options +# No run without options +if ( ! getopts $GETOPTS opt); then # CLI bez options + usage "Options needed !!!" +fi +OPTIND=1 # reset index + +# Preset defaults +FORCE="$DEF_FORCE" +METHOD="$DEF_METHOD" + +while getopts $GETOPTS opt; do + #echo $opt; + + case "$opt" in + 'u') + DEVUSERNAME=$OPTARG ;; + + 'p') + DEVPASSWORD=$OPTARG ;; + + 't') + TYPE=$OPTARG ;; + + 'i') + INTERFACE=$OPTARG ;; + + 'l') + LLDPINTERFACE=$OPTARG ;; + + 'v') + VENDOR=$OPTARG ;; + + 'm') + METHOD=$OPTARG ;; + + 'd') + DEVICE=$OPTARG ;; + + 'f') + FORCE='y' ;; + + 'h') + usage ;; + + ':') + usage "Parameter '-$OPTARG' needs value." + ;; + + '?'|*) + usage "Unknown parameter '-$OPTARG' ." + ;; + esac +done + + +# read commands from file +[ -f "$CMDIN" ] || usage "File '$CMDIN' does not exists." +[ -r "$CMDIN" ] || usage "Can not read file '$CMDIN'." + +[ -z "$INTERFACE" ] && usage "Parameter -i needed" +[ -z "$LLDPINTERFACE" ] && usage "Parameter -l needed" + +. "${CMDIN}" + +# Get possible last arg and set it as only command +shift $(($OPTIND - 1)) +[ -z "$1" ] || COMMANDS=("$1") + +[ -z "$DEVUSERNAME" ] && usage "Parameter -u needed" +[ -z "$DEVPASSWORD" ] && usage "Parameter -p needed" +[ -z "$TYPE" ] && usage "Parameter -t needed" +[ -z "$VENDOR" ] && usage "Parameter -v needed" +[ -z "$DEVICE" ] && usage "Parameter -d needed" + +# ensure directory structure exists +[ -d "$CODIR" ] || usage "Output directory '$CODIR' does not exist." +[ -w "$CODIR" ] || usage "Output directory '$CODIR' is not writeable." + +mkdir -p "$CODIR/$TYPE" || usage "Can not make directory '$CODIR/$TYPE'" +[ -w "$CODIR/$TYPE" ] || usage "Output directory '$CODIR/$TYPE' is not writeable." + +echo "########## Generate output for type $TYPE ##########" +# lets get commands outputs +OLDIFS="$IFS" +IFS=$'\t\n' +for CMD in ${COMMANDS[@]} +do + IFS="$OLDIFS" + + CMDSTR=${CMD// /_} + CMDSTR=${CMDSTR//-/_} + CMDSTR=${CMDSTR/\\/_} + CMDSTR=${CMDSTR/./_} + CMDSTR=${CMDSTR////_} + CMDFILE="$CODIR/$TYPE/${CMDSTR}.txt" + + # skip already fetched command outputs + if [ -f "$CMDFILE" -a "$FORCE" = "n" ]; then + echo "###### Skiping '$CMD'. File '$CMDFILE' exists (force run by -f)" + continue + fi + + echo "## Fetching '$CMD' to '$CMDSTR.txt'" + # --debug + echo -e "$(napalm --user "$DEVUSERNAME" --password "$DEVPASSWORD" --vendor "$VENDOR" "$DEVICE" call --method-kwargs "command='$CMD'" "$METHOD" | sed 's/^"//;s/"$//;s/\\"/"/g')" > "$CMDFILE" +done + +echo "#### Preparing obfuscate script" +echo "## IP addresses" +IPs=$(cat "$CODIR/$TYPE/"*.txt \ + | sed -rn 's/.*[^0-9\.](([0-9]{1,3}\.){3}[0-9]{1,3})[^0-9\.]*.*/\1/gp' \ + | sort \ + | uniq +) +echo $IPs + +for a in $IPs +do + oa=${a} + oa=${oa//1/3} + oa=${oa//2/3} + oa=${oa//4/3} + oa=${oa//5/3} + oa=${oa//6/7} + oa=${oa//8/7} + oa=${oa//9/7} + + oa=" -e s/$a/$oa/g " + + oIPs="$oIPs$oa " +done + +echo "## MAC addresses" +MACs=$(cat "$CODIR/$TYPE/"*.txt \ + | sed -rn -e 's/.*[^0-9\.:a-f-](([[:xdigit:]]{2}[:.-]?){5}[[:xdigit:]]{2})[^0-9\.:a-f-]*.*/\1/gp' \ + | sort \ + | uniq +) +echo $MACs + +for m in $MACs +do + om=${m} + om=${om//1/2} + om=${om//3/2} + om=${om//6/2} + om=${om//8/2} + om=${om//b/2} + om=${om//e/2} + om=${om//4/a} + om=${om//5/a} + om=${om//7/a} + om=${om//9/a} + om=${om//c/a} + om=${om//d/a} + + om=" -e s/$m/$om/g " + + oMACs="$oMACs$om " +done + +echo "## Obfuscate IPs and MACs" +echo oIPS=$oIPs +echo oMACs=$oMACs +set -x +sed -r -i $oMACs $oIPs "$CODIR/$TYPE/"*.txt +set +x + +echo "## Obfuscate strings from OBFUSCATE config variable" + +for s in "${OBFUSCATE[@]}" +do + f="${s%%&&&*}" + t="${s##*&&&}" + oSTR="${oSTR}s/$f/$t/g;" +done + +echo $oSTR +sed -r -i -e "$oSTR" "$CODIR/$TYPE/"*.txt + +echo "###################################################" +echo "## Do not forget obfuscate other output: ##" +echo "## passwords, secrets, keys, certificates ##" +echo "## descriptions, names and other ... ##" +echo "###################################################" 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}