From 392e5e8b9c5d893998f63e78ca757ac6b648b9c1 Mon Sep 17 00:00:00 2001 From: Brandon Ewing Date: Sat, 8 Jul 2023 14:52:24 -0500 Subject: [PATCH 01/11] eos: add explicit minimum version check Require 4.23.0F or later EOS image Require pyeapi >= 1.0.2 resolves #1958 Remove all references to FN0039 and any configuration alterations Remove text-based VRF parsing in favor of JSON version Update all tests to reflect --- napalm/base/exceptions.py | 4 + napalm/eos/eos.py | 57 +-- napalm/eos/pyeapi_syntax_wrapper.py | 42 -- napalm/eos/utils/cli_syntax.py | 359 ------------------ requirements.txt | 2 +- test/eos/conftest.py | 21 - test/eos/mocked_data/show_version.json | 32 +- .../issue-1922/expected_result.json | 30 -- .../issue-1922/show_vrf.text | 12 - .../issue-509/expected_result.json | 1 - .../issue-509/show_ip_interface.json | 279 -------------- .../issue-509/show_ipv6_interface.json | 6 - .../issue-509/show_vrf.text | 11 - .../issue-796/expected_result.json | 1 - .../issue-796/show_ip_interface.json | 66 ---- .../issue-796/show_ipv6_interface.json | 6 - .../issue-796/show_vrf.text | 9 - .../missing_v6/expected_result.json | 1 - .../missing_v6/show_ip_interface.json | 279 -------------- .../missing_v6/show_ipv6_interface.json | 6 - .../missing_v6/show_vrf.text | 14 - .../normal/expected_result.json | 32 +- .../normal/show_ip_interface.json | 279 -------------- .../normal/show_ipv6_interface.json | 6 - .../{vrf => normal}/show_vrf.json | 0 .../normal/show_vrf.text | 17 - .../vrf/cli_version.txt | 1 - .../vrf/expected_result.json | 31 -- .../iss_1069/expected_result.json | 27 +- .../test_get_route_to/iss_1069/show_vrf.json | 37 ++ .../test_get_route_to/iss_1069/show_vrf.text | 8 - .../iss_1347/expected_result.json | 269 ++++++++++++- .../test_get_route_to/iss_1347/show_vrf.json | 61 +++ .../test_get_route_to/iss_1347/show_vrf.text | 12 - .../iss_736/expected_result.json | 49 ++- .../test_get_route_to/iss_736/show_vrf.json | 24 ++ .../test_get_route_to/iss_736/show_vrf.text | 3 - .../normal/expected_result.json | 59 ++- ...te_vrf_default_1_0_4_0_24__bgp_detail.json | 2 +- .../test_get_route_to/normal/show_vrf.json | 44 +++ .../test_get_route_to/normal/show_vrf.text | 9 - .../normal/expected_result.json | 115 +++++- .../normal/show_vrf.json | 44 +++ .../normal/show_vrf.text | 6 - test/eos/test_cli_syntax.py | 51 --- test/eos/test_heredoc.py | 12 +- 46 files changed, 799 insertions(+), 1637 deletions(-) delete mode 100644 napalm/eos/pyeapi_syntax_wrapper.py delete mode 100644 napalm/eos/utils/cli_syntax.py delete mode 100644 test/eos/mocked_data/test_get_network_instances/issue-1922/expected_result.json delete mode 100644 test/eos/mocked_data/test_get_network_instances/issue-1922/show_vrf.text delete mode 100644 test/eos/mocked_data/test_get_network_instances/issue-509/expected_result.json delete mode 100644 test/eos/mocked_data/test_get_network_instances/issue-509/show_ip_interface.json delete mode 100644 test/eos/mocked_data/test_get_network_instances/issue-509/show_ipv6_interface.json delete mode 100644 test/eos/mocked_data/test_get_network_instances/issue-509/show_vrf.text delete mode 100644 test/eos/mocked_data/test_get_network_instances/issue-796/expected_result.json delete mode 100644 test/eos/mocked_data/test_get_network_instances/issue-796/show_ip_interface.json delete mode 100644 test/eos/mocked_data/test_get_network_instances/issue-796/show_ipv6_interface.json delete mode 100644 test/eos/mocked_data/test_get_network_instances/issue-796/show_vrf.text delete mode 100644 test/eos/mocked_data/test_get_network_instances/missing_v6/expected_result.json delete mode 100644 test/eos/mocked_data/test_get_network_instances/missing_v6/show_ip_interface.json delete mode 100644 test/eos/mocked_data/test_get_network_instances/missing_v6/show_ipv6_interface.json delete mode 100644 test/eos/mocked_data/test_get_network_instances/missing_v6/show_vrf.text delete mode 100644 test/eos/mocked_data/test_get_network_instances/normal/show_ip_interface.json delete mode 100644 test/eos/mocked_data/test_get_network_instances/normal/show_ipv6_interface.json rename test/eos/mocked_data/test_get_network_instances/{vrf => normal}/show_vrf.json (100%) delete mode 100644 test/eos/mocked_data/test_get_network_instances/normal/show_vrf.text delete mode 100644 test/eos/mocked_data/test_get_network_instances/vrf/cli_version.txt delete mode 100644 test/eos/mocked_data/test_get_network_instances/vrf/expected_result.json create mode 100644 test/eos/mocked_data/test_get_route_to/iss_1069/show_vrf.json delete mode 100644 test/eos/mocked_data/test_get_route_to/iss_1069/show_vrf.text create mode 100644 test/eos/mocked_data/test_get_route_to/iss_1347/show_vrf.json delete mode 100644 test/eos/mocked_data/test_get_route_to/iss_1347/show_vrf.text create mode 100644 test/eos/mocked_data/test_get_route_to/iss_736/show_vrf.json delete mode 100644 test/eos/mocked_data/test_get_route_to/iss_736/show_vrf.text create mode 100644 test/eos/mocked_data/test_get_route_to/normal/show_vrf.json delete mode 100644 test/eos/mocked_data/test_get_route_to/normal/show_vrf.text create mode 100644 test/eos/mocked_data/test_get_route_to_longer/normal/show_vrf.json delete mode 100644 test/eos/mocked_data/test_get_route_to_longer/normal/show_vrf.text delete mode 100644 test/eos/test_cli_syntax.py diff --git a/napalm/base/exceptions.py b/napalm/base/exceptions.py index c889ee006..4c39656f7 100644 --- a/napalm/base/exceptions.py +++ b/napalm/base/exceptions.py @@ -67,6 +67,10 @@ class ConnectionClosedException(ConnectionException): pass +class UnsupportedVersion(ConnectionException): + pass + + class ReplaceConfigException(NapalmException): pass diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index 52db5463b..37db5a8d1 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -47,11 +47,10 @@ ReplaceConfigException, SessionLockedException, CommandErrorException, + UnsupportedVersion, ) from napalm.eos.constants import LLDP_CAPAB_TRANFORM_TABLE -from napalm.eos.pyeapi_syntax_wrapper import Node from napalm.eos.utils.versions import EOSVersion -from napalm.eos.utils.cli_syntax import cli_convert import napalm.base.constants as c # local modules @@ -123,7 +122,6 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None) self.timeout = timeout self.config_session = None self.locked = False - self.cli_version = 1 self.platform = "eos" self.profile = [self.platform] @@ -131,7 +129,6 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None) self.enablepwd = self.optional_args.pop("enable_password", "") self.eos_autoComplete = self.optional_args.pop("eos_autoComplete", None) - self.fn0039_config = self.optional_args.pop("eos_fn0039_config", False) # Define locking method self.lock_disable = self.optional_args.pop("lock_disable", False) @@ -201,10 +198,6 @@ def open(self): device_type="arista_eos", netmiko_optional_args=self.netmiko_optional_args, ) - # let's try to determine if we need to use new EOS cli syntax - sh_ver = self._run_commands(["show version"]) - if EOSVersion(sh_ver[0]["version"]) >= EOSVersion("4.23.0"): - self.cli_version = 2 else: try: connection = self.transport_class( @@ -216,22 +209,24 @@ def open(self): ) if self.device is None: - self.device = Node(connection, enablepwd=self.enablepwd) + self.device = pyeapi.client.Node( + connection, enablepwd=self.enablepwd + ) # does not raise an Exception if unusable - # let's try to determine if we need to use new EOS cli syntax - sh_ver = self.device.run_commands(["show version"]) - self.cli_version = ( - 2 if EOSVersion(sh_ver[0]["version"]) >= EOSVersion("4.23.0") else 1 - ) - - self.device.update_cli_version(self.cli_version) except ConnectionError as ce: # and this is raised either if device not avaiable # either if HTTP(S) agent is not enabled # show management api http-commands raise ConnectionException(str(ce)) + # endif self.transport + + sh_ver = self._run_commands(["show version"]) + self._eos_version = EOSVersion(sh_ver[0]["version"]) + if self._eos_version < EOSVersion("4.23.0"): + raise UnsupportedVersion(self._eos_version) + def close(self): """Implementation of NAPALM method close.""" self.discard_config() @@ -263,11 +258,6 @@ def is_alive(self): def _run_commands(self, commands, **kwargs): if self.transport == "ssh": - if self.fn0039_config: - if isinstance(commands, str): - commands = [cli_convert(commands, self.cli_version)] - else: - commands = [cli_convert(cmd, self.cli_version) for cmd in commands] ret = [] for command in commands: if kwargs.get("encoding") == "text": @@ -463,10 +453,9 @@ def _load_config(self, filename=None, config=None, replace=True): self._run_commands( commands, autoComplete=self.eos_autoComplete, - fn0039_transform=self.fn0039_config, ) else: - self._run_commands(commands, fn0039_transform=self.fn0039_config) + self._run_commands(commands) except pyeapi.eapilib.CommandError as e: self.discard_config() msg = str(e) @@ -1527,23 +1516,14 @@ def get_route_to(self, destination="", protocol="", longer=False): nexthop_interface_map[nexthop_ip] = next_hop.get("interface") metric = route_details.get("metric") if _vrf not in vrf_cache.keys(): - if self.cli_version == 1: - command = "show ip{ipv} bgp {dest} {longer} detail vrf {_vrf}".format( + command = ( + "show ip{ipv} bgp {dest} {longer} detail vrf {_vrf}".format( ipv=ipv, dest=destination, longer="longer-prefixes" if longer else "", _vrf=_vrf, ) - else: - # Newer EOS can't mix longer-prefix and detail - command = ( - "show ip{ipv} bgp {dest} {longer} vrf {_vrf}".format( - ipv=ipv, - dest=destination, - longer="longer-prefixes" if longer else "", - _vrf=_vrf, - ) - ) + ) vrf_cache.update( { _vrf: self._run_commands([command])[0] @@ -2169,18 +2149,13 @@ def _show_vrf_text(self): return vrfs def _show_vrf(self): - if self.cli_version == 2: - return self._show_vrf_json() - else: - return self._show_vrf_text() + return self._show_vrf_json() def _get_vrfs(self): output = self._show_vrf() vrfs = [str(vrf["name"]) for vrf in output] - vrfs.append("default") - return vrfs def get_network_instances(self, name=""): diff --git a/napalm/eos/pyeapi_syntax_wrapper.py b/napalm/eos/pyeapi_syntax_wrapper.py deleted file mode 100644 index c240df3d4..000000000 --- a/napalm/eos/pyeapi_syntax_wrapper.py +++ /dev/null @@ -1,42 +0,0 @@ -"""pyeapi wrapper to fix cli syntax change""" -import pyeapi -from napalm.eos.utils.cli_syntax import cli_convert - - -class Node(pyeapi.client.Node): - """ - pyeapi node wrapper to fix cli syntax change - """ - - def __init__(self, *args, **kwargs): - if "cli_version" in kwargs: - self.cli_version = kwargs["cli_version"] - del kwargs["cli_version"] - else: - self.cli_version = 1 - - super(Node, self).__init__(*args, **kwargs) - - def update_cli_version(self, version): - """ - Update CLI version number for this device - :param version: int: version number - :return: None - """ - self.cli_version = version - - def run_commands(self, commands, *args, **kwargs): - """ - Run commands wrapper - :param commands: list of commands - :param kwargs: other args - :return: list of outputs - """ - fn0039_transform = kwargs.pop("fn0039_transform", True) - if fn0039_transform: - if isinstance(commands, str): - commands = [cli_convert(commands, self.cli_version)] - else: - commands = [cli_convert(cmd, self.cli_version) for cmd in commands] - - return super(Node, self).run_commands(commands, *args, **kwargs) diff --git a/napalm/eos/utils/cli_syntax.py b/napalm/eos/utils/cli_syntax.py deleted file mode 100644 index d4445fb01..000000000 --- a/napalm/eos/utils/cli_syntax.py +++ /dev/null @@ -1,359 +0,0 @@ -""" -EOS CLI syntax changes -""" -CLI_SYNTAX = { - # Default CLI syntax version - # We do trandlation from 4.23.0 syntax to pre-4.23.0 syntax - 1: { - "aaa authorization serial-console": "aaa authorization console", - "area not-so-stubby lsa type-7 convert type-5": "area nssa translate type7 always", - "arp aging timeout": "arp timeout", - "bfd default": "bfd all-interfaces", - "dynamic peer max": "bgp listen limit", - "class-map type copp": "class-map type control-plane", - "clear arp": "clear ip arp", - "clear ip nat flow translation": "clear ip nat translation", - "clear ospfv3 ipv6 force-spf": "clear ipv6 ospf force-spf", - "system control-plane": "control-plane", - "metric default": "default-metric", - "dot1x reauthorization request limit ": "dot1x max-reauth-req", - "enable password": "enable secret", - "delete startup-config": "erase startup-config", - "errdisable detect cause link-change": "errdisable detect cause link-flap", - "ip community-list regexp": "ip community-list expanded", - "ip dhcp relay all-subnets": "ip dhcp smart-relay", - "ip dhcp relay all-subnets default": "ip dhcp smart-relay global", - "dns domain": "ip domain-name", - "ip extcommunity-list regexp": "ip extcommunity-list expanded", - "ip extcommunity-list": "ip extcommunity-list standard", - "ip http client local-interface": "ip http client source-interface", - "query-max-response-time": "ip igmp query-max-response-time", - "ip igmp snooping vlan fast-leave": "ip igmp snooping vlan immediate-leave", - "ip igmp snooping vlan multicast-router": "ip igmp snooping vlan mrouter", - "ip igmp snooping vlan member": "ip igmp snooping vlan static", - # disabled next command because of ambiguity - # 'default-peer': 'ip msdp default-peer', - # disabled next command because of ambiguity - # 'description': 'ip msdp description', - "sa-limit": "ip msdp group-limit", - # disabled next command because of ambiguity - # 'keepalive': 'ip msdp keepalive', - "mesh-group": "ip msdp mesh-group", - "originator-id local-interface": "ip msdp originator-id", - # disabled next command because of ambiguity - # 'peer': 'ip msdp peer', - "sa filter in": "ip msdp sa-filter in", - "sa filter out": "ip msdp sa-filter out", - "sa limit": "ip msdp sa-limit", - # disabled next command because of ambiguity - # 'disabled': 'ip msdp shutdown', - "connection retry interval": "ip msdp timer", - "ip ospf neighbor bfd": "ip ospf bfd", - "router-id output-format hostnames": "ip ospf name-lookup", - "ip ospf disabled": "ip ospf shutdown", - "anycast-rp": "ip pim anycast-rp", - # disabled next command because of ambiguity - # 'bfd': 'ip pim bfd', - "pim bfd": "ip pim bfd-instance", - "pim bsr border": "ip pim bsr-border", - "log neighbors": "ip pim log-neighbor-changes", - "pim neighbor filter": "ip pim neighbor-filter", - "pim hello interval": "ip pim query-interval", - "register local-interface": "ip pim register-source", - "spt threshold match list": "ip pim spt-threshold group-list", - "ssm address range": "ip pim ssm range", - "rip v2 multicast disable": "ip rip v2-broadcast", - "ipv6 nd ra disabled": "ipv6 nd ra suppress", - "ospfv3 ipv6 retransmit-interval": "ipv6 ospf retransmit-interval", - "isis lsp tx interval": "isis lsp-interval", - # disabled next command because of ambiguity - # 'passive': 'passive-interface', - "lacp timer": "lacp rate", - "link tracking group ": "link state track", - "lldp hold-time": "lldp holdtime", - "lldp timer reinitialization": "lldp reinit", - "lldp tlv transmit": "lldp tlv-select", - "neighbor bfd": "neighbor fall-over bfd", - "neighbor peer group": "neighbor peer-group", - "neighbor rib-in pre-policy retain": "neighbor soft-reconfiguration", - "neighbor passive": "neighbor transport connection-mode", - "ntp local-interface": "ntp source", - "policy-map type copp": "policy-map type control-plane", - "policy-map type quality-of-service": "policy-map type qos", - "priority-flow-control": "priority-flow-control mode", - "pvlan mapping": "private-vlan mapping", - "ptp sync-message interval": "ptp sync interval", - "redundancy manual switchover": "redundancy force-switchover", - "cli vrf ": "routing-context vrf", - "logging format sequence-numbers": "service sequence-numbers", - "show aaa methods": "show aaa method-lists", - "show users detail": "show aaa sessions", - "show bfd peers": "show bfd neighbors", - "show dot1x all brief": "show dot1x all summary", - "show system environment all": "show environment all", - "show system environment cooling": "show environment cooling", - "show system environment temperature": "show environment temperature", - "show interfaces hardware": "show interfaces capabilities", - "show interfaces flow-control": "show interfaces flowcontrol", - "show pvlan mapping interfaces": "show interfaces private-vlan mapping", - "show interfaces switchport backup-link": "show interfaces switchport backup", - "show igmp snooping querier": "show ip igmp snooping querier", - "show multicast fib ipv4": "show ip mfib", - "show msdp mesh-group": "show ip msdp mesh-group", - "show msdp rpf-peer": "show ip msdp rpf-peer", - "show ip ospf request queue": "show ip ospf request-list", - "show ip ospf retransmission queue": "show ip ospf retransmission-list", - "show ip route match tag": "show ip route tag", - "show ipv6 bgp match community": "show ipv6 bgp community", - "show ipv6 bgp peers": "show ipv6 bgp neighbors", - "show ipv6 route match tag": "show ipv6 route tag", - "show isis network topology": "show isis topology", - "show lacp peer": "show lacp neighbor", - "show link tracking group": "show link state group", - "show lldp counters": "show lldp traffic", - "show bridge mac-address-table aging timeout": "show mac-address-table aging-time", - "show policy-map type copp": "show policy-map control-plane", - "show policy-map copp": "show policy-map interface control-plane", - "show port-channel dense": "show port-channel summary", - "show port-channel load-balance": "show port-channel traffic", - "show port-security mac-address": "show port-security address", - "show ptp local-clock": "show ptp clock", - "show ptp masters": "show ptp parent", - "show ptp local-clock time properties": "show ptp time-property", - "show redundancy status": "show redundancy states", - "show users roles": "show role", - "show snmp v2-mib chassis": "show snmp chassis", - "show snmp v2-mib contact": "show snmp contact", - "show snmp notification host": "show snmp host", - "show snmp v2-mib location": "show snmp location", - "show snmp local-interface": "show snmp source-interface", - "show snmp notification": "show snmp trap", - "show spanning-tree instance": "show spanning-tree bridge", - "show users accounts": "show user-account", - "show vlan brief count": "show vlan summary", - "snmp trap link-change": "snmp trap link-status", - "snmp-server local-interface": "snmp-server source-interface", - "spanning-tree transmit active": "spanning-tree bridge assurance", - "spanning-tree guard loop default": "spanning-tree loopguard default", - "spanning-tree edge-port bpdufilter default": "spanning-tree portfast bpdufilter default", - "spanning-tree edge-port bpduguard default": "spanning-tree portfast bpduguard default", - "spanning-tree bpdu tx hold-count": "spanning-tree transmit hold-count", - "spanning-tree vlan-id": "spanning-tree vlan", - "counters per-entry": "statistics per-entry", - "switchport backup-link": "switchport backup interface", - "switchport port-security mac-address maximum": "switchport port-security maximum", - "switchport vlan translation": "switchport vlan mapping", - # disabled next command because of ambiguity - # 'timers': 'timers basic', - "timers lsa rx min interval": "timers lsa arrival", - "timers lsa tx delay initial": "timers throttle lsa all", - "timers spf delay initial": "timers throttle spf", - "username ssh-key": "username sshkey", - "vlan internal order": "vlan internal allocation policy", - "vrf instance": "vrf definition", - # disabled next command because of ambiguity - # 'vrf': 'vrf forwarding', - "vrrp peer authentication": "vrrp authentication", - "vrrp timers delay reload": "vrrp delay reload", - "vrrp session description": "vrrp description", - "vrrp ipv4": "vrrp ip", - "vrrp ipv4 secondary": "vrrp ip secondary", - "vrrp priority-level": "vrrp priority", - "vrrp disabled": "vrrp shutdown", - "vrrp advertisement interval": "vrrp timers advertise", - "vrrp tracked-object": "vrrp track", - }, - # CLI syntax version after EOS 4.23.0 - 2: { - "aaa authorization console": "aaa authorization serial-console", - "area nssa translate type7 always": "area not-so-stubby lsa type-7 convert type-5", - "arp timeout": "arp aging timeout", - "bfd all-interfaces": "bfd default", - "bgp listen limit": "dynamic peer max", - "class-map type control-plane": "class-map type copp", - "clear ip arp": "clear arp", - "clear ip nat translation": "clear ip nat flow translation", - "clear ipv6 ospf force-spf": "clear ospfv3 ipv6 force-spf", - "control-plane": "system control-plane", - "default-metric": "metric default", - "dot1x max-reauth-req": "dot1x reauthorization request limit ", - "enable secret": "enable password", - "erase startup-config": "delete startup-config", - "errdisable detect cause link-flap": "errdisable detect cause link-change", - "ip community-list expanded": "ip community-list regexp", - "ip dhcp smart-relay": "ip dhcp relay all-subnets", - "ip dhcp smart-relay global": "ip dhcp relay all-subnets default", - "ip domain-name": "dns domain", - "ip extcommunity-list expanded": "ip extcommunity-list regexp", - "ip extcommunity-list standard": "ip extcommunity-list", - "ip http client source-interface": "ip http client local-interface", - "ip igmp query-max-response-time": "query-max-response-time", - "ip igmp snooping vlan immediate-leave": "ip igmp snooping vlan fast-leave", - "ip igmp snooping vlan mrouter": "ip igmp snooping vlan multicast-router", - "ip igmp snooping vlan static": "ip igmp snooping vlan member", - "ip msdp default-peer": "default-peer", - "ip msdp description": "description", - "ip msdp group-limit": "sa-limit", - "ip msdp keepalive": "keepalive", - "ip msdp mesh-group": "mesh-group", - "ip msdp originator-id": "originator-id local-interface", - "ip msdp peer": "peer", - "ip msdp sa-filter in": "sa filter in", - "ip msdp sa-filter out": "sa filter out", - "ip msdp sa-limit": "sa limit", - "ip msdp shutdown": "disabled", - "ip msdp timer": "connection retry interval", - "ip ospf bfd": "ip ospf neighbor bfd", - "ip ospf name-lookup": "router-id output-format hostnames", - "ip ospf shutdown": "ip ospf disabled", - "ip pim anycast-rp": "anycast-rp", - "ip pim bfd": "bfd", - "ip pim bfd-instance": "pim bfd", - "ip pim bsr-border": "pim bsr border", - "ip pim log-neighbor-changes": "log neighbors", - "ip pim neighbor-filter": "pim neighbor filter", - "ip pim query-interval": "pim hello interval", - "ip pim register-source": "register local-interface", - "ip pim spt-threshold group-list": "spt threshold match list", - "ip pim ssm range": "ssm address range", - "ip rip v2-broadcast": "rip v2 multicast disable", - "ipv6 nd ra suppress": "ipv6 nd ra disabled", - "ipv6 ospf retransmit-interval": "ospfv3 ipv6 retransmit-interval", - "isis lsp-interval": "isis lsp tx interval", - "passive-interface": "passive", - "lacp rate": "lacp timer", - "link state track": "link tracking group ", - "lldp holdtime": "lldp hold-time", - "lldp reinit": "lldp timer reinitialization", - "lldp tlv-select": "lldp tlv transmit", - "neighbor fall-over bfd": "neighbor bfd", - "neighbor peer-group": "neighbor peer group", - "neighbor soft-reconfiguration": "neighbor rib-in pre-policy retain", - "neighbor transport connection-mode": "neighbor passive", - "ntp source": "ntp local-interface", - "policy-map type control-plane": "policy-map type copp", - "policy-map type qos": "policy-map type quality-of-service", - "priority-flow-control mode": "priority-flow-control", - "private-vlan mapping": "pvlan mapping", - "ptp sync interval": "ptp sync-message interval", - "redundancy force-switchover": "redundancy manual switchover", - "routing-context vrf": "cli vrf ", - "service sequence-numbers": "logging format sequence-numbers", - "show aaa method-lists": "show aaa methods", - "show aaa sessions": "show users detail", - "show bfd neighbors": "show bfd peers", - "show dot1x all summary": "show dot1x all brief", - "show environment all": "show system environment all", - "show environment cooling": "show system environment cooling", - "show environment temperature": "show system environment temperature", - "show interfaces capabilities": "show interfaces hardware", - "show interfaces flowcontrol": "show interfaces flow-control", - "show interfaces private-vlan mapping": "show pvlan mapping interfaces", - "show interfaces switchport backup": "show interfaces switchport backup-link", - "show ip igmp snooping querier": "show igmp snooping querier", - "show ip mfib": "show multicast fib ipv4", - "show ip msdp mesh-group": "show msdp mesh-group", - "show ip msdp rpf-peer": "show msdp rpf-peer", - "show ip ospf request-list": "show ip ospf request queue", - "show ip ospf retransmission-list": "show ip ospf retransmission queue", - "show ip route tag": "show ip route match tag", - "show ipv6 bgp community": "show ipv6 bgp match community", - "show ipv6 bgp neighbors": "show ipv6 bgp peers", - "show ipv6 route tag": "show ipv6 route match tag", - "show isis topology": "show isis network topology", - "show lacp neighbor": "show lacp peer", - "show link state group": "show link tracking group", - "show lldp traffic": "show lldp counters", - "show mac-address-table aging-time": "show bridge mac-address-table aging timeout", - "show policy-map control-plane": "show policy-map type copp", - "show policy-map interface control-plane": "show policy-map copp", - "show port-channel summary": "show port-channel dense", - "show port-channel traffic": "show port-channel load-balance", - "show port-security address": "show port-security mac-address", - "show ptp clock": "show ptp local-clock", - "show ptp parent": "show ptp masters", - "show ptp time-property": "show ptp local-clock time properties", - "show redundancy states": "show redundancy status", - "show role": "show users roles", - "show snmp chassis": "show snmp v2-mib chassis", - "show snmp contact": "show snmp v2-mib contact", - "show snmp host": "show snmp notification host", - "show snmp location": "show snmp v2-mib location", - "show snmp source-interface": "show snmp local-interface", - "show snmp trap": "show snmp notification", - "show spanning-tree bridge": "show spanning-tree instance", - "show user-account": "show users accounts", - "show vlan summary": "show vlan brief count", - "snmp trap link-status": "snmp trap link-change", - "snmp-server source-interface": "snmp-server local-interface", - "spanning-tree bridge assurance": "spanning-tree transmit active", - "spanning-tree loopguard default": "spanning-tree guard loop default", - "spanning-tree portfast bpdufilter default": "spanning-tree edge-port bpdufilter default", - "spanning-tree portfast bpduguard default": "spanning-tree edge-port bpduguard default", - "spanning-tree transmit hold-count": "spanning-tree bpdu tx hold-count", - "spanning-tree vlan": "spanning-tree vlan-id", - "statistics per-entry": "counters per-entry", - "switchport backup interface": "switchport backup-link", - "switchport port-security maximum": "switchport port-security mac-address maximum", - "switchport vlan mapping": "switchport vlan translation", - "timers basic": "timers", - "timers lsa arrival": "timers lsa rx min interval", - "timers throttle lsa all": "timers lsa tx delay initial", - "timers throttle spf": "timers spf delay initial", - "username sshkey": "username ssh-key", - "vlan internal allocation policy": "vlan internal order", - "vrf definition": "vrf instance", - "vrf forwarding": "vrf", - "vrrp authentication": "vrrp peer authentication", - "vrrp delay reload": "vrrp timers delay reload", - "vrrp description": "vrrp session description", - "vrrp ip": "vrrp ipv4", - "vrrp ip secondary": "vrrp ipv4 secondary", - "vrrp priority": "vrrp priority-level", - "vrrp shutdown": "vrrp disabled", - "vrrp timers advertise": "vrrp advertisement interval", - "vrrp track": "vrrp tracked-object", - }, -} - - -class CliConverter: - """ - ClI converter class - """ - - def __init__(self, syntax): - """ - Object creation - :param syntax: syntax dict - """ - self.syntax = syntax - - def convert(self, command, version): - """ - Convert command from version 1 to specified version - :param command: str: command - :param version: int: version number - :return: str: command - """ - if version not in self.syntax: - return command - - for c in self.syntax[version]: - if command.startswith(c): - return self.syntax[version][c] + command[len(c) :] - - return command - - -CONVERTER = CliConverter(CLI_SYNTAX) - - -def cli_convert(command, version): - """ - Convert command from CLI version 1 to one from CLI of specified version - :param command: str: CLI command - :param version: int: EOS CLI version number - :return: str: command - """ - return CONVERTER.convert(command, version) diff --git a/requirements.txt b/requirements.txt index 3359b30a6..b7a20077a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ textfsm jinja2 netaddr pyYAML -pyeapi>=0.8.2 +pyeapi>=1.0.2 netmiko>=4.1.0 junos-eznc>=2.6.3 scp diff --git a/test/eos/conftest.py b/test/eos/conftest.py index aff8e78a1..d35204fe9 100644 --- a/test/eos/conftest.py +++ b/test/eos/conftest.py @@ -37,19 +37,6 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None) self.patched_attrs = ["device"] self.device = FakeEOSDevice() - self._cli_version = 1 - - @property - def cli_version(self): - try: - full_path = self.device.find_file("cli_version.txt") - except IOError: - return self._cli_version - return int(self.device.read_txt_file(full_path)) - - @cli_version.setter - def cli_version(self, value): - self._cli_version = value class FakeEOSDevice(BaseTestDouble): @@ -73,11 +60,3 @@ def run_commands(self, command_list, encoding="json"): result.append({"output": self.read_txt_file(full_path)}) return result - - def update_cli_version(self, version): - """ - Update CLI version number for this device - :param version: int: version number - :return: None - """ - self.cli_version = version diff --git a/test/eos/mocked_data/show_version.json b/test/eos/mocked_data/show_version.json index 092d29bce..4a1957a37 100644 --- a/test/eos/mocked_data/show_version.json +++ b/test/eos/mocked_data/show_version.json @@ -1,16 +1,22 @@ { - "memTotal": 3954980, - "uptime": 200478.31, - "modelName": "DCS-7150S-64-CL-R", - "internalVersion": "4.21.8M-2GB-13902577.4218M", "mfgName": "Arista", - "serialNumber": "JPE00000000", - "systemMacAddress": "00:1c:73:00:00:00", - "bootupTimestamp": 1588135848.0, - "memFree": 2558364, - "version": "4.21.8M-2GB", - "architecture": "i386", - "isIntlVersion": false, - "internalBuildId": "5af75062-ded5-4c99-8f44-daa88aa4414d", - "hardwareRevision": "01.03" + "modelName": "cEOSLab", + "hardwareRevision": "", + "serialNumber": "DE5B7D98C24A207BE70876CC0AD5546F", + "systemMacAddress": "00:1c:73:78:8e:81", + "hwMacAddress": "00:00:00:00:00:00", + "configMacAddress": "00:00:00:00:00:00", + "version": "4.30.0F-31408673.4300F (engineering build)", + "architecture": "x86_64", + "internalVersion": "4.30.0F-31408673.4300F", + "internalBuildId": "a35f0dc7-2d65-4f2a-a010-279cf445fd8c", + "imageFormatVersion": "1.0", + "imageOptimization": "None", + "cEosToolsVersion": "(unknown)", + "kernelVersion": "5.15.0-56-generic", + "bootupTimestamp": 1688840924.7556078, + "uptime": 374.72549414634705, + "memTotal": 231066228, + "memFree": 222939448, + "isIntlVersion": false } diff --git a/test/eos/mocked_data/test_get_network_instances/issue-1922/expected_result.json b/test/eos/mocked_data/test_get_network_instances/issue-1922/expected_result.json deleted file mode 100644 index 413d219c4..000000000 --- a/test/eos/mocked_data/test_get_network_instances/issue-1922/expected_result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "management": { - "name": "management", - "type": "L3VRF", - "state": { "route_distinguisher": "" }, - "interfaces": { "interface": { "Management1": {} } } - }, - "default": { - "interfaces": { - "interface": { - "Ethernet1": {}, - "Ethernet2": {}, - "Ethernet3": {}, - "Ethernet4": {}, - "Ethernet49/1": {}, - "Ethernet5": {}, - "Ethernet50/1": {}, - "Ethernet52/1": {}, - "Ethernet53/1": {}, - "Ethernet54/1": {}, - "Ethernet55/1": {}, - "Ethernet56/1": {}, - "Loopback0": {} - } - }, - "state": { "route_distinguisher": "" }, - "type": "DEFAULT_INSTANCE", - "name": "default" - } -} diff --git a/test/eos/mocked_data/test_get_network_instances/issue-1922/show_vrf.text b/test/eos/mocked_data/test_get_network_instances/issue-1922/show_vrf.text deleted file mode 100644 index cd1dbbba4..000000000 --- a/test/eos/mocked_data/test_get_network_instances/issue-1922/show_vrf.text +++ /dev/null @@ -1,12 +0,0 @@ -Maximum number of vrfs allowed: 1023 - VRF RD Protocols State Interfaces ----------------- --------------- --------------- ------------------- --------------------------- - default ipv4,ipv6 v4:routing, Ethernet1, Ethernet2, - v6:no routing Ethernet3, Ethernet4, - Ethernet49/1, Ethernet5, - Ethernet50/1, Ethernet52/1, - Ethernet53/1, Ethernet54/1, - Ethernet55/1, Ethernet56/1, - Loopback0 - management ipv4,ipv6 v4:routing, Management1 - v6:no routing diff --git a/test/eos/mocked_data/test_get_network_instances/issue-509/expected_result.json b/test/eos/mocked_data/test_get_network_instances/issue-509/expected_result.json deleted file mode 100644 index 14f3b574a..000000000 --- a/test/eos/mocked_data/test_get_network_instances/issue-509/expected_result.json +++ /dev/null @@ -1 +0,0 @@ -{"VRFA0": {"name": "VRFA0", "type": "L3VRF", "state": {"route_distinguisher": "201:201"}, "interfaces": {"interface": {"Vlan2": {}, "Vlan102": {}}}}, "VRFA1": {"name": "VRFA1", "type": "L3VRF", "state": {"route_distinguisher": "203:203"}, "interfaces": {"interface": {"Vlan3": {}, "Vlan103": {}}}}, "VRFA2": {"name": "VRFA2", "type": "L3VRF", "state": {"route_distinguisher": "205:205"}, "interfaces": {"interface": {"Ethernet1": {}, "Vlan100": {}}}}, "default": {"name": "default", "type": "DEFAULT_INSTANCE", "state": {"route_distinguisher": ""}, "interfaces": {"interface": {"Management1": {}, "Ethernet3": {}, "Vlan4": {}, "Vlan101": {}, "Vlan104": {}}}}} diff --git a/test/eos/mocked_data/test_get_network_instances/issue-509/show_ip_interface.json b/test/eos/mocked_data/test_get_network_instances/issue-509/show_ip_interface.json deleted file mode 100644 index a697ecf52..000000000 --- a/test/eos/mocked_data/test_get_network_instances/issue-509/show_ip_interface.json +++ /dev/null @@ -1,279 +0,0 @@ -{ - "interfaces": { - "Management1": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 23, - "address": "10.192.100.98" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Management1", - "urpf": "disable", - "interfaceStatus": "connected", - "enabled": true, - "mtu": 1500, - "vrf": "default", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "up", - "description": "" - }, - "Vlan3": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan3", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "MGMT", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Ethernet3": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Ethernet3", - "urpf": "disable", - "interfaceStatus": "connected", - "enabled": true, - "mtu": 1500, - "vrf": "default", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "up", - "description": "" - }, - "Ethernet1": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Ethernet1", - "urpf": "disable", - "interfaceStatus": "connected", - "enabled": true, - "mtu": 1500, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "up", - "description": "" - }, - "Vlan103": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan103", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan102": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan102", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan2": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan2", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "MGMT", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan100": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan100", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan4": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan4", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "MGMT", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan101": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan101", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan104": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan104", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - } - } -} diff --git a/test/eos/mocked_data/test_get_network_instances/issue-509/show_ipv6_interface.json b/test/eos/mocked_data/test_get_network_instances/issue-509/show_ipv6_interface.json deleted file mode 100644 index 582256041..000000000 --- a/test/eos/mocked_data/test_get_network_instances/issue-509/show_ipv6_interface.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "interfaces": {}, - "errors": [ - "No IPv6 configured interfaces" - ] -} diff --git a/test/eos/mocked_data/test_get_network_instances/issue-509/show_vrf.text b/test/eos/mocked_data/test_get_network_instances/issue-509/show_vrf.text deleted file mode 100644 index 65fdb6529..000000000 --- a/test/eos/mocked_data/test_get_network_instances/issue-509/show_vrf.text +++ /dev/null @@ -1,11 +0,0 @@ -Maximum number of vrfs allowed: 14 - Vrf RD Protocols State Interfaces -------- --------- ------------ ------------------------ ------------------- - VRFA0 201:201 ipv4 v4:routing; multicast, Vlan2, Vlan102 - v6:no routing - - VRFA1 203:203 ipv4 v4:routing; multicast, Vlan3, Vlan103 - v6:no routing - - VRFA2 205:205 ipv4 v4:routing; multicast, Ethernet1, Vlan100 - v6:no routing diff --git a/test/eos/mocked_data/test_get_network_instances/issue-796/expected_result.json b/test/eos/mocked_data/test_get_network_instances/issue-796/expected_result.json deleted file mode 100644 index 11370a1ce..000000000 --- a/test/eos/mocked_data/test_get_network_instances/issue-796/expected_result.json +++ /dev/null @@ -1 +0,0 @@ -{"ABC": {"name": "ABC", "type": "L3VRF", "state": {"route_distinguisher": "1:0"}, "interfaces": {"interface": {"Management1": {}}}}, "DEF": {"name": "DEF", "type": "L3VRF", "state": {"route_distinguisher": "2:0"}, "interfaces": {"interface": {"Ethernet1": {}}}}, "default": {"interfaces": {"interface": {}}, "state": {"route_distinguisher": ""}, "type": "DEFAULT_INSTANCE", "name": "default"}} diff --git a/test/eos/mocked_data/test_get_network_instances/issue-796/show_ip_interface.json b/test/eos/mocked_data/test_get_network_instances/issue-796/show_ip_interface.json deleted file mode 100644 index 780f4279a..000000000 --- a/test/eos/mocked_data/test_get_network_instances/issue-796/show_ip_interface.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "interfaces": { - "Management1": { - "directedBroadcastEnabled": false, - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "virtualSecondaryIps": {}, - "dhcp": true, - "secondaryIps": {}, - "primaryIp": { - "maskLen": 23, - "address": "10.192.104.32" - }, - "virtualSecondaryIpsOrderedList": [], - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Management1", - "urpf": "disable", - "interfaceStatus": "connected", - "enabled": true, - "mtu": 1500, - "addresslessForwarding": "isInvalid", - "vrf": "ABC", - "localProxyArp": false, - "injectHosts": false, - "proxyArp": false, - "lineProtocolStatus": "up", - "description": "" - }, - "Ethernet1": { - "directedBroadcastEnabled": false, - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "virtualSecondaryIps": {}, - "dhcp": false, - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualSecondaryIpsOrderedList": [], - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Ethernet1", - "urpf": "disable", - "interfaceStatus": "connected", - "enabled": true, - "mtu": 1500, - "addresslessForwarding": "isInvalid", - "vrf": "DEF", - "localProxyArp": false, - "injectHosts": false, - "proxyArp": false, - "lineProtocolStatus": "up", - "description": "" - } - } -} diff --git a/test/eos/mocked_data/test_get_network_instances/issue-796/show_ipv6_interface.json b/test/eos/mocked_data/test_get_network_instances/issue-796/show_ipv6_interface.json deleted file mode 100644 index 582256041..000000000 --- a/test/eos/mocked_data/test_get_network_instances/issue-796/show_ipv6_interface.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "interfaces": {}, - "errors": [ - "No IPv6 configured interfaces" - ] -} diff --git a/test/eos/mocked_data/test_get_network_instances/issue-796/show_vrf.text b/test/eos/mocked_data/test_get_network_instances/issue-796/show_vrf.text deleted file mode 100644 index a4e955e40..000000000 --- a/test/eos/mocked_data/test_get_network_instances/issue-796/show_vrf.text +++ /dev/null @@ -1,9 +0,0 @@ -Maximum number of vrfs allowed: 14 - Vrf RD Protocols State Interfaces ---------- --------- --------------- -------------------- ----------- - ABC 1:0 ipv4,ipv6 v4:no routing, Management1 - v6:no routing - - DEF 2:0 ipv4,ipv6 v4:no routing, Ethernet1 - v6:no routing - diff --git a/test/eos/mocked_data/test_get_network_instances/missing_v6/expected_result.json b/test/eos/mocked_data/test_get_network_instances/missing_v6/expected_result.json deleted file mode 100644 index 14e365769..000000000 --- a/test/eos/mocked_data/test_get_network_instances/missing_v6/expected_result.json +++ /dev/null @@ -1 +0,0 @@ -{"TEST": {"interfaces": {"interface": {"Ethernet1": {}, "Vlan103": {}, "Vlan102": {}, "Vlan101": {}, "Vlan100": {}, "Vlan104": {}}}, "state": {"route_distinguisher": "0:1"}, "type": "L3VRF", "name": "TEST"}, "default": {"interfaces": {"interface": {"Management1": {}, "Ethernet3": {}}}, "state": {"route_distinguisher": ""}, "type": "DEFAULT_INSTANCE", "name": "default"}, "NON": {"interfaces": {"interface": {}}, "state": {"route_distinguisher": ""}, "type": "L3VRF", "name": "NON"}, "TEST2": {"interfaces": {"interface": {}}, "state": {"route_distinguisher": "1234:4321"}, "type": "L3VRF", "name": "TEST2"}, "MGMT": {"interfaces": {"interface": {"Vlan2": {}, "Vlan3": {}, "Vlan4": {}}}, "state": {"route_distinguisher": "0:0"}, "type": "L3VRF", "name": "MGMT"}} diff --git a/test/eos/mocked_data/test_get_network_instances/missing_v6/show_ip_interface.json b/test/eos/mocked_data/test_get_network_instances/missing_v6/show_ip_interface.json deleted file mode 100644 index a697ecf52..000000000 --- a/test/eos/mocked_data/test_get_network_instances/missing_v6/show_ip_interface.json +++ /dev/null @@ -1,279 +0,0 @@ -{ - "interfaces": { - "Management1": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 23, - "address": "10.192.100.98" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Management1", - "urpf": "disable", - "interfaceStatus": "connected", - "enabled": true, - "mtu": 1500, - "vrf": "default", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "up", - "description": "" - }, - "Vlan3": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan3", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "MGMT", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Ethernet3": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Ethernet3", - "urpf": "disable", - "interfaceStatus": "connected", - "enabled": true, - "mtu": 1500, - "vrf": "default", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "up", - "description": "" - }, - "Ethernet1": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Ethernet1", - "urpf": "disable", - "interfaceStatus": "connected", - "enabled": true, - "mtu": 1500, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "up", - "description": "" - }, - "Vlan103": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan103", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan102": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan102", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan2": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan2", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "MGMT", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan100": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan100", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan4": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan4", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "MGMT", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan101": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan101", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan104": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan104", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - } - } -} diff --git a/test/eos/mocked_data/test_get_network_instances/missing_v6/show_ipv6_interface.json b/test/eos/mocked_data/test_get_network_instances/missing_v6/show_ipv6_interface.json deleted file mode 100644 index 582256041..000000000 --- a/test/eos/mocked_data/test_get_network_instances/missing_v6/show_ipv6_interface.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "interfaces": {}, - "errors": [ - "No IPv6 configured interfaces" - ] -} diff --git a/test/eos/mocked_data/test_get_network_instances/missing_v6/show_vrf.text b/test/eos/mocked_data/test_get_network_instances/missing_v6/show_vrf.text deleted file mode 100644 index ff52fbbb2..000000000 --- a/test/eos/mocked_data/test_get_network_instances/missing_v6/show_vrf.text +++ /dev/null @@ -1,14 +0,0 @@ -Maximum number of vrfs allowed: 14 - Vrf RD Protocols State Interfaces -------- ------------ ------------ ------------------------- ------------------- - MGMT 0:0 ipv4 v4:routing, Vlan2, Vlan3, Vlan4 - v6:no routing - - NON v4:incomplete, - v6:incomplete - - TEST 0:1 ipv4 v4:routing; multicast, Ethernet1, Vlan100, - v6:no routing Vlan101, Vlan102, - Vlan103, Vlan104 - TEST2 1234:4321 ipv4 v4:no routing, - v6:routing diff --git a/test/eos/mocked_data/test_get_network_instances/normal/expected_result.json b/test/eos/mocked_data/test_get_network_instances/normal/expected_result.json index 14e365769..dc3f3d294 100644 --- a/test/eos/mocked_data/test_get_network_instances/normal/expected_result.json +++ b/test/eos/mocked_data/test_get_network_instances/normal/expected_result.json @@ -1 +1,31 @@ -{"TEST": {"interfaces": {"interface": {"Ethernet1": {}, "Vlan103": {}, "Vlan102": {}, "Vlan101": {}, "Vlan100": {}, "Vlan104": {}}}, "state": {"route_distinguisher": "0:1"}, "type": "L3VRF", "name": "TEST"}, "default": {"interfaces": {"interface": {"Management1": {}, "Ethernet3": {}}}, "state": {"route_distinguisher": ""}, "type": "DEFAULT_INSTANCE", "name": "default"}, "NON": {"interfaces": {"interface": {}}, "state": {"route_distinguisher": ""}, "type": "L3VRF", "name": "NON"}, "TEST2": {"interfaces": {"interface": {}}, "state": {"route_distinguisher": "1234:4321"}, "type": "L3VRF", "name": "TEST2"}, "MGMT": {"interfaces": {"interface": {"Vlan2": {}, "Vlan3": {}, "Vlan4": {}}}, "state": {"route_distinguisher": "0:0"}, "type": "L3VRF", "name": "MGMT"}} +{ + "default": { + "name": "default", + "type": "DEFAULT_INSTANCE", + "state": { "route_distinguisher": "" }, + "interfaces": { + "interface": { + "Ethernet1": {}, + "Ethernet2": {}, + "Loopback0": {}, + "Management0": {} + } + } + }, + "foo": { + "name": "foo", + "type": "L3VRF", + "state": { "route_distinguisher": "0:1" }, + "interfaces": { + "interface": {} + } + }, + "bar": { + "name": "bar", + "type": "L3VRF", + "state": { "route_distinguisher": "" }, + "interfaces": { + "interface": {} + } + } +} diff --git a/test/eos/mocked_data/test_get_network_instances/normal/show_ip_interface.json b/test/eos/mocked_data/test_get_network_instances/normal/show_ip_interface.json deleted file mode 100644 index a697ecf52..000000000 --- a/test/eos/mocked_data/test_get_network_instances/normal/show_ip_interface.json +++ /dev/null @@ -1,279 +0,0 @@ -{ - "interfaces": { - "Management1": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 23, - "address": "10.192.100.98" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Management1", - "urpf": "disable", - "interfaceStatus": "connected", - "enabled": true, - "mtu": 1500, - "vrf": "default", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "up", - "description": "" - }, - "Vlan3": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan3", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "MGMT", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Ethernet3": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Ethernet3", - "urpf": "disable", - "interfaceStatus": "connected", - "enabled": true, - "mtu": 1500, - "vrf": "default", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "up", - "description": "" - }, - "Ethernet1": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Ethernet1", - "urpf": "disable", - "interfaceStatus": "connected", - "enabled": true, - "mtu": 1500, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "up", - "description": "" - }, - "Vlan103": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan103", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan102": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan102", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan2": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan2", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "MGMT", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan100": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan100", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan4": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan4", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "MGMT", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan101": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan101", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - }, - "Vlan104": { - "interfaceAddress": { - "secondaryIpsOrderedList": [], - "broadcastAddress": "255.255.255.255", - "secondaryIps": {}, - "primaryIp": { - "maskLen": 0, - "address": "0.0.0.0" - }, - "virtualIp": { - "maskLen": 0, - "address": "0.0.0.0" - } - }, - "name": "Vlan104", - "urpf": "disable", - "interfaceStatus": "notconnect", - "enabled": true, - "mtu": 1478, - "vrf": "TEST", - "localProxyArp": false, - "proxyArp": false, - "lineProtocolStatus": "lowerLayerDown", - "description": "" - } - } -} diff --git a/test/eos/mocked_data/test_get_network_instances/normal/show_ipv6_interface.json b/test/eos/mocked_data/test_get_network_instances/normal/show_ipv6_interface.json deleted file mode 100644 index 582256041..000000000 --- a/test/eos/mocked_data/test_get_network_instances/normal/show_ipv6_interface.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "interfaces": {}, - "errors": [ - "No IPv6 configured interfaces" - ] -} diff --git a/test/eos/mocked_data/test_get_network_instances/vrf/show_vrf.json b/test/eos/mocked_data/test_get_network_instances/normal/show_vrf.json similarity index 100% rename from test/eos/mocked_data/test_get_network_instances/vrf/show_vrf.json rename to test/eos/mocked_data/test_get_network_instances/normal/show_vrf.json diff --git a/test/eos/mocked_data/test_get_network_instances/normal/show_vrf.text b/test/eos/mocked_data/test_get_network_instances/normal/show_vrf.text deleted file mode 100644 index d1e1d7e11..000000000 --- a/test/eos/mocked_data/test_get_network_instances/normal/show_vrf.text +++ /dev/null @@ -1,17 +0,0 @@ -Maximum number of vrfs allowed: 14 - Vrf RD Protocols State Interfaces -------- ------------ ------------ ------------------------- ------------------- - MGMT 0:0 ipv4,ipv6 v4:routing, Vlan2, Vlan3, Vlan4 - v6:no routing - - NON v4:incomplete, - v6:incomplete - - TEST 0:1 ipv4,ipv6 v4:routing; multicast, Ethernet1, Vlan100, - v6:no routing Vlan101, Vlan102, - Vlan103, Vlan104 - TEST2 1234:4321 ipv4,ipv6 v4:no routing, - v6:routing - - - diff --git a/test/eos/mocked_data/test_get_network_instances/vrf/cli_version.txt b/test/eos/mocked_data/test_get_network_instances/vrf/cli_version.txt deleted file mode 100644 index 0cfbf0888..000000000 --- a/test/eos/mocked_data/test_get_network_instances/vrf/cli_version.txt +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/test/eos/mocked_data/test_get_network_instances/vrf/expected_result.json b/test/eos/mocked_data/test_get_network_instances/vrf/expected_result.json deleted file mode 100644 index dc3f3d294..000000000 --- a/test/eos/mocked_data/test_get_network_instances/vrf/expected_result.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "default": { - "name": "default", - "type": "DEFAULT_INSTANCE", - "state": { "route_distinguisher": "" }, - "interfaces": { - "interface": { - "Ethernet1": {}, - "Ethernet2": {}, - "Loopback0": {}, - "Management0": {} - } - } - }, - "foo": { - "name": "foo", - "type": "L3VRF", - "state": { "route_distinguisher": "0:1" }, - "interfaces": { - "interface": {} - } - }, - "bar": { - "name": "bar", - "type": "L3VRF", - "state": { "route_distinguisher": "" }, - "interfaces": { - "interface": {} - } - } -} diff --git a/test/eos/mocked_data/test_get_route_to/iss_1069/expected_result.json b/test/eos/mocked_data/test_get_route_to/iss_1069/expected_result.json index a13e763a5..1219f0660 100644 --- a/test/eos/mocked_data/test_get_route_to/iss_1069/expected_result.json +++ b/test/eos/mocked_data/test_get_route_to/iss_1069/expected_result.json @@ -1 +1,26 @@ -{"1.0.4.0/24": [{"current_active": true, "last_active": true, "age": 0, "next_hop": "169.254.123.2", "protocol": "eBGP", "outgoing_interface": "Vlan123", "preference": 200, "inactive_reason": "noReason", "routing_table": "default", "selected_next_hop": true, "protocol_attributes": {"metric": 0, "as_path": "65003", "local_preference": 100, "local_as": 65002, "remote_as": 65003, "remote_address": "169.254.123.2", "preference2": 0, "communities": []}}, {"current_active": true, "last_active": true, "age": 0, "next_hop": "169.254.123.2", "protocol": "eBGP", "outgoing_interface": "Vlan123", "preference": 200, "inactive_reason": "noReason", "routing_table": "default", "selected_next_hop": true, "protocol_attributes": {"metric": 0, "as_path": "65003", "local_preference": 100, "local_as": 65002, "remote_as": 65003, "remote_address": "169.254.123.2", "preference2": 0, "communities": []}}]} +{ + "1.0.4.0/24": [ + { + "current_active": true, + "last_active": true, + "age": 0, + "next_hop": "169.254.123.2", + "protocol": "eBGP", + "outgoing_interface": "Vlan123", + "preference": 200, + "inactive_reason": "noReason", + "routing_table": "default", + "selected_next_hop": true, + "protocol_attributes": { + "metric": 0, + "as_path": "65003", + "local_preference": 100, + "local_as": 65002, + "remote_as": 65003, + "remote_address": "169.254.123.2", + "preference2": 0, + "communities": [] + } + } + ] +} diff --git a/test/eos/mocked_data/test_get_route_to/iss_1069/show_vrf.json b/test/eos/mocked_data/test_get_route_to/iss_1069/show_vrf.json new file mode 100644 index 000000000..df8ebfb8f --- /dev/null +++ b/test/eos/mocked_data/test_get_route_to/iss_1069/show_vrf.json @@ -0,0 +1,37 @@ +{ + "vrfs": { + "default": { + "routeDistinguisher": "", + "protocols": { + "ipv4": { + "supported": true, + "protocolState": "up", + "routingState": "up" + }, + "ipv6": { + "supported": true, + "protocolState": "up", + "routingState": "down" + } + }, + "vrfState": "up", + "interfacesV4": [ + "Ethernet1", + "Ethernet2", + "Loopback1", + "Management1", + "Vlan123" + ], + "interfacesV6": [ + "Management1" + ], + "interfaces": [ + "Ethernet1", + "Ethernet2", + "Loopback1", + "Management1", + "Vlan123" + ] + } + } +} diff --git a/test/eos/mocked_data/test_get_route_to/iss_1069/show_vrf.text b/test/eos/mocked_data/test_get_route_to/iss_1069/show_vrf.text deleted file mode 100644 index cc3e254b8..000000000 --- a/test/eos/mocked_data/test_get_route_to/iss_1069/show_vrf.text +++ /dev/null @@ -1,8 +0,0 @@ -Maximum number of vrfs allowed: 14 - VRF RD Protocols State Interfaces ----------- ------------ ------------- ----------------- ----------------------- - default ipv4,ipv6 v4:routing, Ethernet1, Ethernet2, - v6:no routing Loopback1, Management1, - Vlan123 - - diff --git a/test/eos/mocked_data/test_get_route_to/iss_1347/expected_result.json b/test/eos/mocked_data/test_get_route_to/iss_1347/expected_result.json index 5d7d474e2..2a9acfd0f 100644 --- a/test/eos/mocked_data/test_get_route_to/iss_1347/expected_result.json +++ b/test/eos/mocked_data/test_get_route_to/iss_1347/expected_result.json @@ -1 +1,268 @@ -{"1.0.4.0/24": [{"current_active": true, "last_active": true, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "noReason", "routing_table": "TEST", "selected_next_hop": true, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.2", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.3", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.4", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.1", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.4", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.3", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.1", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.224.6", "protocol": "eBGP", "outgoing_interface": "vxlan1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "TEST", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419 65405", "local_preference": 100, "local_as": 65323, "remote_as": 65405, "remote_address": "169.254.216.2", "preference2": 0, "communities": []}}, {"current_active": true, "last_active": true, "age": 0, "next_hop": "169.254.232.160", "protocol": "eBGP", "outgoing_interface": "Ethernet4/1", "preference": 20, "inactive_reason": "noReason", "routing_table": "default", "selected_next_hop": true, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.160", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.156", "protocol": "eBGP", "outgoing_interface": "Ethernet3/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.156", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.148", "protocol": "eBGP", "outgoing_interface": "Ethernet1/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.148", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.152", "protocol": "eBGP", "outgoing_interface": "Ethernet2/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.152", "preference2": 0, "communities": []}}, {"current_active": true, "last_active": true, "age": 0, "next_hop": "169.254.232.160", "protocol": "eBGP", "outgoing_interface": "Ethernet4/1", "preference": 20, "inactive_reason": "noReason", "routing_table": "default", "selected_next_hop": true, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.160", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.156", "protocol": "eBGP", "outgoing_interface": "Ethernet3/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.156", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.148", "protocol": "eBGP", "outgoing_interface": "Ethernet1/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.148", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "169.254.232.152", "protocol": "eBGP", "outgoing_interface": "Ethernet2/1", "preference": 20, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 0, "as_path": "65418 65419", "local_preference": 100, "local_as": 65323, "remote_as": 65419, "remote_address": "169.254.232.152", "preference2": 0, "communities": []}}]} +{ + "1.0.4.0/24": [ + { + "current_active": true, + "last_active": true, + "age": 0, + "next_hop": "169.254.224.6", + "protocol": "eBGP", + "outgoing_interface": "vxlan1", + "preference": 200, + "inactive_reason": "noReason", + "routing_table": "TEST", + "selected_next_hop": true, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419 65405", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65405, + "remote_address": "169.254.216.2", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": false, + "last_active": false, + "age": 0, + "next_hop": "169.254.224.6", + "protocol": "eBGP", + "outgoing_interface": "vxlan1", + "preference": 200, + "inactive_reason": "ecmpFast", + "routing_table": "TEST", + "selected_next_hop": false, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419 65405", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65405, + "remote_address": "169.254.216.3", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": false, + "last_active": false, + "age": 0, + "next_hop": "169.254.224.6", + "protocol": "eBGP", + "outgoing_interface": "vxlan1", + "preference": 200, + "inactive_reason": "ecmpFast", + "routing_table": "TEST", + "selected_next_hop": false, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419 65405", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65405, + "remote_address": "169.254.216.4", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": false, + "last_active": false, + "age": 0, + "next_hop": "169.254.224.6", + "protocol": "eBGP", + "outgoing_interface": "vxlan1", + "preference": 200, + "inactive_reason": "ecmpFast", + "routing_table": "TEST", + "selected_next_hop": false, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419 65405", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65405, + "remote_address": "169.254.216.1", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": false, + "last_active": false, + "age": 0, + "next_hop": "169.254.224.6", + "protocol": "eBGP", + "outgoing_interface": "vxlan1", + "preference": 200, + "inactive_reason": "ecmpFast", + "routing_table": "TEST", + "selected_next_hop": false, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419 65405", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65405, + "remote_address": "169.254.216.4", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": false, + "last_active": false, + "age": 0, + "next_hop": "169.254.224.6", + "protocol": "eBGP", + "outgoing_interface": "vxlan1", + "preference": 200, + "inactive_reason": "ecmpFast", + "routing_table": "TEST", + "selected_next_hop": false, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419 65405", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65405, + "remote_address": "169.254.216.3", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": false, + "last_active": false, + "age": 0, + "next_hop": "169.254.224.6", + "protocol": "eBGP", + "outgoing_interface": "vxlan1", + "preference": 200, + "inactive_reason": "ecmpFast", + "routing_table": "TEST", + "selected_next_hop": false, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419 65405", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65405, + "remote_address": "169.254.216.1", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": false, + "last_active": false, + "age": 0, + "next_hop": "169.254.224.6", + "protocol": "eBGP", + "outgoing_interface": "vxlan1", + "preference": 200, + "inactive_reason": "ecmpFast", + "routing_table": "TEST", + "selected_next_hop": false, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419 65405", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65405, + "remote_address": "169.254.216.2", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": true, + "last_active": true, + "age": 0, + "next_hop": "169.254.232.160", + "protocol": "eBGP", + "outgoing_interface": "Ethernet4/1", + "preference": 20, + "inactive_reason": "noReason", + "routing_table": "default", + "selected_next_hop": true, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65419, + "remote_address": "169.254.232.160", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": false, + "last_active": false, + "age": 0, + "next_hop": "169.254.232.156", + "protocol": "eBGP", + "outgoing_interface": "Ethernet3/1", + "preference": 20, + "inactive_reason": "ecmpFast", + "routing_table": "default", + "selected_next_hop": false, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65419, + "remote_address": "169.254.232.156", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": false, + "last_active": false, + "age": 0, + "next_hop": "169.254.232.148", + "protocol": "eBGP", + "outgoing_interface": "Ethernet1/1", + "preference": 20, + "inactive_reason": "ecmpFast", + "routing_table": "default", + "selected_next_hop": false, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65419, + "remote_address": "169.254.232.148", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": false, + "last_active": false, + "age": 0, + "next_hop": "169.254.232.152", + "protocol": "eBGP", + "outgoing_interface": "Ethernet2/1", + "preference": 20, + "inactive_reason": "ecmpFast", + "routing_table": "default", + "selected_next_hop": false, + "protocol_attributes": { + "metric": 0, + "as_path": "65418 65419", + "local_preference": 100, + "local_as": 65323, + "remote_as": 65419, + "remote_address": "169.254.232.152", + "preference2": 0, + "communities": [] + } + } + ] +} diff --git a/test/eos/mocked_data/test_get_route_to/iss_1347/show_vrf.json b/test/eos/mocked_data/test_get_route_to/iss_1347/show_vrf.json new file mode 100644 index 000000000..9b5662cc0 --- /dev/null +++ b/test/eos/mocked_data/test_get_route_to/iss_1347/show_vrf.json @@ -0,0 +1,61 @@ +{ + "vrfs": { + "default": { + "routeDistinguisher": "", + "protocols": { + "ipv4": { + "supported": true, + "protocolState": "up", + "routingState": "up" + }, + "ipv6": { + "supported": true, + "protocolState": "up", + "routingState": "down" + } + }, + "vrfState": "up", + "interfaces": [ + "Ethernet1/1", + "Ethernet2/1", + "Ethernet3/1", + "Ethernet4/1", + "Loopback0", + "Loopback1", + "Vlan3001", + "Vlan3002", + "Vlan3003", + "Vlan3004", + "Vlan3005", + "Vlan3006" + ] + }, + "TEST": { + "routeDistinguisher": "65323:631", + "protocols": { + "ipv4": { + "supported": true, + "protocolState": "up", + "routingState": "up" + }, + "ipv6": { + "supported": true, + "protocolState": "up", + "routingState": "down" + } + }, + "vrfState": "up", + "interfaces": [ + "Vlan2001", + "Vlan2002", + "Vlan2003", + "Vlan2004", + "Vlan2005", + "Vlan2006", + "Vlan2007", + "Vlan2008", + "Vlan2009" + ] + } + } +} diff --git a/test/eos/mocked_data/test_get_route_to/iss_1347/show_vrf.text b/test/eos/mocked_data/test_get_route_to/iss_1347/show_vrf.text deleted file mode 100644 index da8989453..000000000 --- a/test/eos/mocked_data/test_get_route_to/iss_1347/show_vrf.text +++ /dev/null @@ -1,12 +0,0 @@ -Maximum number of vrfs allowed: 1023 - VRF RD Protocols State Interfaces ----------------- --------------- --------------- -------------------- ----------------------------- - TEST 65323:631 ipv4,ipv6 v4:routing, Vlan2001, Vlan2002, Vlan2003, - v6:no routing Vlan2004, Vlan2005, Vlan2006, - Vlan2007, Vlan2008, Vlan2009 - default ipv4,ipv6 v4:routing, Ethernet1/1, Ethernet2/1, - v6:no routing Ethernet3/1, Ethernet4/1, - Loopback0, Loopback1, - Vlan3001, Vlan3002, Vlan3003, - Vlan3004, Vlan3004, Vlan3006 - diff --git a/test/eos/mocked_data/test_get_route_to/iss_736/expected_result.json b/test/eos/mocked_data/test_get_route_to/iss_736/expected_result.json index b8942c698..ce90fbf34 100644 --- a/test/eos/mocked_data/test_get_route_to/iss_736/expected_result.json +++ b/test/eos/mocked_data/test_get_route_to/iss_736/expected_result.json @@ -1 +1,48 @@ -{"1.0.4.0/24": [{"current_active": true, "last_active": true, "age": 0, "next_hop": "1.0.4.221", "protocol": "eBGP", "outgoing_interface": "Ethernet51/1", "preference": 200, "inactive_reason": "noReason", "routing_table": "default", "selected_next_hop": true, "protocol_attributes": {"metric": 175, "as_path": "(20901 21149)", "local_preference": 100, "local_as": 20948, "remote_as": 21149, "remote_address": "1.0.4.221", "preference2": 0, "communities": []}}, {"current_active": false, "last_active": false, "age": 0, "next_hop": "1.0.4.223", "protocol": "eBGP", "outgoing_interface": "Ethernet52/1", "preference": 200, "inactive_reason": "ecmpFast", "routing_table": "default", "selected_next_hop": false, "protocol_attributes": {"metric": 175, "as_path": "(20902 21149)", "local_preference": 100, "local_as": 20948, "remote_as": 21149, "remote_address": "1.0.4.223", "preference2": 0, "communities": []}}]} +{ + "1.0.4.0/24": [ + { + "current_active": true, + "last_active": true, + "age": 0, + "next_hop": "1.0.4.221", + "protocol": "eBGP", + "outgoing_interface": "Ethernet51/1", + "preference": 200, + "inactive_reason": "noReason", + "routing_table": "default", + "selected_next_hop": true, + "protocol_attributes": { + "metric": 175, + "as_path": "(20901 21149)", + "local_preference": 100, + "local_as": 20948, + "remote_as": 21149, + "remote_address": "1.0.4.221", + "preference2": 0, + "communities": [] + } + }, + { + "current_active": false, + "last_active": false, + "age": 0, + "next_hop": "1.0.4.223", + "protocol": "eBGP", + "outgoing_interface": "Ethernet52/1", + "preference": 200, + "inactive_reason": "ecmpFast", + "routing_table": "default", + "selected_next_hop": false, + "protocol_attributes": { + "metric": 175, + "as_path": "(20902 21149)", + "local_preference": 100, + "local_as": 20948, + "remote_as": 21149, + "remote_address": "1.0.4.223", + "preference2": 0, + "communities": [] + } + } + ] +} diff --git a/test/eos/mocked_data/test_get_route_to/iss_736/show_vrf.json b/test/eos/mocked_data/test_get_route_to/iss_736/show_vrf.json new file mode 100644 index 000000000..b514669d3 --- /dev/null +++ b/test/eos/mocked_data/test_get_route_to/iss_736/show_vrf.json @@ -0,0 +1,24 @@ +{ + "vrfs": { + "default": { + "routeDistinguisher": "", + "protocols": { + "ipv4": { + "supported": true, + "protocolState": "up", + "routingState": "up" + }, + "ipv6": { + "supported": true, + "protocolState": "up", + "routingState": "down" + } + }, + "vrfState": "up", + "interfaces": [ + "Ethernet51/1", + "Ethernet52/1" + ] + } + } +} diff --git a/test/eos/mocked_data/test_get_route_to/iss_736/show_vrf.text b/test/eos/mocked_data/test_get_route_to/iss_736/show_vrf.text deleted file mode 100644 index f70ab6aa8..000000000 --- a/test/eos/mocked_data/test_get_route_to/iss_736/show_vrf.text +++ /dev/null @@ -1,3 +0,0 @@ -Maximum number of vrfs allowed: 14 - Vrf RD Protocols State Interfaces -------- ------------ ------------ ------------------------- ------------------- diff --git a/test/eos/mocked_data/test_get_route_to/normal/expected_result.json b/test/eos/mocked_data/test_get_route_to/normal/expected_result.json index 94b00e6f4..79be002db 100644 --- a/test/eos/mocked_data/test_get_route_to/normal/expected_result.json +++ b/test/eos/mocked_data/test_get_route_to/normal/expected_result.json @@ -1 +1,58 @@ -{"1.0.4.0/24": [{"next_hop": "192.168.0.1", "preference": 200, "protocol": "eBGP", "selected_next_hop": true, "current_active": true, "routing_table": "TEST", "protocol_attributes": {"remote_as": 43515, "as_path": "1299 15169 43515", "local_preference": 50, "remote_address": "192.168.0.1", "preference2": 0, "metric": 0, "communities": ["1299:1234", "1299:5678", "1299:91011", "1299:12134"], "local_as": 13335}, "outgoing_interface": "Port-Channel2", "last_active": true, "inactive_reason": "", "age": 0}, {"next_hop": "192.168.0.1", "preference": 200, "protocol": "eBGP", "selected_next_hop": true, "current_active": true, "routing_table": "default", "protocol_attributes": {"remote_as": 43515, "as_path": "1299 15169 43515", "local_preference": 50, "remote_address": "192.168.0.1", "preference2": 0, "metric": 0, "communities": ["1299:1234", "1299:5678", "1299:91011", "1299:12134"], "local_as": 13335}, "outgoing_interface": "Port-Channel2", "last_active": true, "inactive_reason": "", "age": 0}]} +{ + "1.0.4.0/24": [ + { + "next_hop": "192.168.0.1", + "preference": 200, + "protocol": "eBGP", + "selected_next_hop": true, + "current_active": true, + "routing_table": "TEST", + "protocol_attributes": { + "remote_as": 43515, + "as_path": "1299 15169 43515", + "local_preference": 50, + "remote_address": "192.168.0.1", + "preference2": 0, + "metric": 0, + "communities": [ + "1299:1234", + "1299:5678", + "1299:91011", + "1299:12134" + ], + "local_as": 13335 + }, + "outgoing_interface": "Port-Channel2", + "last_active": true, + "inactive_reason": "", + "age": 0 + }, + { + "next_hop": "192.168.0.1", + "preference": 200, + "protocol": "eBGP", + "selected_next_hop": true, + "current_active": true, + "routing_table": "default", + "protocol_attributes": { + "remote_as": 43515, + "as_path": "1299 15169 43515", + "local_preference": 50, + "remote_address": "192.168.0.1", + "preference2": 0, + "metric": 0, + "communities": [ + "1299:1234", + "1299:5678", + "1299:91011", + "1299:12134" + ], + "local_as": 13335 + }, + "outgoing_interface": "Port-Channel1", + "last_active": true, + "inactive_reason": "", + "age": 0 + } + ] +} diff --git a/test/eos/mocked_data/test_get_route_to/normal/show_ip_route_vrf_default_1_0_4_0_24__bgp_detail.json b/test/eos/mocked_data/test_get_route_to/normal/show_ip_route_vrf_default_1_0_4_0_24__bgp_detail.json index 6b4417b24..841200c99 100644 --- a/test/eos/mocked_data/test_get_route_to/normal/show_ip_route_vrf_default_1_0_4_0_24__bgp_detail.json +++ b/test/eos/mocked_data/test_get_route_to/normal/show_ip_route_vrf_default_1_0_4_0_24__bgp_detail.json @@ -9,7 +9,7 @@ "routeAction": "forward", "vias": [ { - "interface": "Port-Channel2", + "interface": "Port-Channel1", "nexthopAddr": "192.168.0.1" } ], diff --git a/test/eos/mocked_data/test_get_route_to/normal/show_vrf.json b/test/eos/mocked_data/test_get_route_to/normal/show_vrf.json new file mode 100644 index 000000000..a325e4024 --- /dev/null +++ b/test/eos/mocked_data/test_get_route_to/normal/show_vrf.json @@ -0,0 +1,44 @@ +{ + "vrfs": { + "default": { + "routeDistinguisher": "", + "protocols": { + "ipv4": { + "supported": true, + "protocolState": "up", + "routingState": "up" + }, + "ipv6": { + "supported": true, + "protocolState": "up", + "routingState": "down" + } + }, + "vrfState": "up", + "interfaces": [ + "Ethernet1", + "Port-Channel1" + ] + }, + "TEST": { + "routeDistinguisher": "0:1", + "protocols": { + "ipv4": { + "supported": true, + "protocolState": "up", + "routingState": "up" + }, + "ipv6": { + "supported": true, + "protocolState": "up", + "routingState": "down" + } + }, + "vrfState": "up", + "interfaces": [ + "Ethernet2", + "Port-Channel2" + ] + } + } +} diff --git a/test/eos/mocked_data/test_get_route_to/normal/show_vrf.text b/test/eos/mocked_data/test_get_route_to/normal/show_vrf.text deleted file mode 100644 index 0f46f3c0f..000000000 --- a/test/eos/mocked_data/test_get_route_to/normal/show_vrf.text +++ /dev/null @@ -1,9 +0,0 @@ -Maximum number of vrfs allowed: 14 - Vrf RD Protocols State Interfaces -------- ------------ ------------ ------------------------- ------------------- - TEST 0:1 ipv4,ipv6 v4:routing; multicast, Ethernet1, Vlan100, - v6:routing Vlan101, Vlan102, - Vlan103, Vlan104 - - - diff --git a/test/eos/mocked_data/test_get_route_to_longer/normal/expected_result.json b/test/eos/mocked_data/test_get_route_to_longer/normal/expected_result.json index 874210f21..efa565154 100644 --- a/test/eos/mocked_data/test_get_route_to_longer/normal/expected_result.json +++ b/test/eos/mocked_data/test_get_route_to_longer/normal/expected_result.json @@ -1 +1,114 @@ -{"1.0.4.0/25": [{"next_hop": "192.168.0.1", "preference": 200, "protocol": "eBGP", "selected_next_hop": true, "current_active": true, "routing_table": "TEST", "protocol_attributes": {"remote_as": 43515, "as_path": "1299 15169 43515", "local_preference": 50, "remote_address": "192.168.0.1", "preference2": 0, "metric": 0, "communities": ["1299:1234", "1299:5678", "1299:91011", "1299:12134"], "local_as": 13335}, "outgoing_interface": "Port-Channel2", "last_active": true, "inactive_reason": "", "age": 0}, {"next_hop": "192.168.0.1", "preference": 200, "protocol": "eBGP", "selected_next_hop": true, "current_active": true, "routing_table": "default", "protocol_attributes": {"remote_as": 43515, "as_path": "1299 15169 43515", "local_preference": 50, "remote_address": "192.168.0.1", "preference2": 0, "metric": 0, "communities": ["1299:1234", "1299:5678", "1299:91011", "1299:12134"], "local_as": 13335}, "outgoing_interface": "Port-Channel2", "last_active": true, "inactive_reason": "", "age": 0}], "1.0.4.128/25": [{"next_hop": "192.168.0.5", "preference": 200, "protocol": "eBGP", "selected_next_hop": true, "current_active": true, "routing_table": "TEST", "protocol_attributes": {"remote_as": 43515, "as_path": "1299 15169 43515", "local_preference": 50, "remote_address": "192.168.0.5", "preference2": 0, "metric": 0, "communities": ["1299:1234", "1299:5678", "1299:91011", "1299:12134"], "local_as": 13335}, "outgoing_interface": "Port-Channel1", "last_active": true, "inactive_reason": "", "age": 0}, {"next_hop": "192.168.0.5", "preference": 200, "protocol": "eBGP", "selected_next_hop": true, "current_active": true, "routing_table": "default", "protocol_attributes": {"remote_as": 43515, "as_path": "1299 15169 43515", "local_preference": 50, "remote_address": "192.168.0.5", "preference2": 0, "metric": 0, "communities": ["1299:1234", "1299:5678", "1299:91011", "1299:12134"], "local_as": 13335}, "outgoing_interface": "Port-Channel1", "last_active": true, "inactive_reason": "", "age": 0}]} +{ + "1.0.4.0/25": [ + { + "next_hop": "192.168.0.1", + "preference": 200, + "protocol": "eBGP", + "selected_next_hop": true, + "current_active": true, + "routing_table": "TEST", + "protocol_attributes": { + "remote_as": 43515, + "as_path": "1299 15169 43515", + "local_preference": 50, + "remote_address": "192.168.0.1", + "preference2": 0, + "metric": 0, + "communities": [ + "1299:1234", + "1299:5678", + "1299:91011", + "1299:12134" + ], + "local_as": 13335 + }, + "outgoing_interface": "Port-Channel2", + "last_active": true, + "inactive_reason": "", + "age": 0 + }, + { + "next_hop": "192.168.0.1", + "preference": 200, + "protocol": "eBGP", + "selected_next_hop": true, + "current_active": true, + "routing_table": "default", + "protocol_attributes": { + "remote_as": 43515, + "as_path": "1299 15169 43515", + "local_preference": 50, + "remote_address": "192.168.0.1", + "preference2": 0, + "metric": 0, + "communities": [ + "1299:1234", + "1299:5678", + "1299:91011", + "1299:12134" + ], + "local_as": 13335 + }, + "outgoing_interface": "Port-Channel2", + "last_active": true, + "inactive_reason": "", + "age": 0 + } + ], + "1.0.4.128/25": [ + { + "next_hop": "192.168.0.5", + "preference": 200, + "protocol": "eBGP", + "selected_next_hop": true, + "current_active": true, + "routing_table": "TEST", + "protocol_attributes": { + "remote_as": 43515, + "as_path": "1299 15169 43515", + "local_preference": 50, + "remote_address": "192.168.0.5", + "preference2": 0, + "metric": 0, + "communities": [ + "1299:1234", + "1299:5678", + "1299:91011", + "1299:12134" + ], + "local_as": 13335 + }, + "outgoing_interface": "Port-Channel1", + "last_active": true, + "inactive_reason": "", + "age": 0 + }, + { + "next_hop": "192.168.0.5", + "preference": 200, + "protocol": "eBGP", + "selected_next_hop": true, + "current_active": true, + "routing_table": "default", + "protocol_attributes": { + "remote_as": 43515, + "as_path": "1299 15169 43515", + "local_preference": 50, + "remote_address": "192.168.0.5", + "preference2": 0, + "metric": 0, + "communities": [ + "1299:1234", + "1299:5678", + "1299:91011", + "1299:12134" + ], + "local_as": 13335 + }, + "outgoing_interface": "Port-Channel1", + "last_active": true, + "inactive_reason": "", + "age": 0 + } + ] +} diff --git a/test/eos/mocked_data/test_get_route_to_longer/normal/show_vrf.json b/test/eos/mocked_data/test_get_route_to_longer/normal/show_vrf.json new file mode 100644 index 000000000..a325e4024 --- /dev/null +++ b/test/eos/mocked_data/test_get_route_to_longer/normal/show_vrf.json @@ -0,0 +1,44 @@ +{ + "vrfs": { + "default": { + "routeDistinguisher": "", + "protocols": { + "ipv4": { + "supported": true, + "protocolState": "up", + "routingState": "up" + }, + "ipv6": { + "supported": true, + "protocolState": "up", + "routingState": "down" + } + }, + "vrfState": "up", + "interfaces": [ + "Ethernet1", + "Port-Channel1" + ] + }, + "TEST": { + "routeDistinguisher": "0:1", + "protocols": { + "ipv4": { + "supported": true, + "protocolState": "up", + "routingState": "up" + }, + "ipv6": { + "supported": true, + "protocolState": "up", + "routingState": "down" + } + }, + "vrfState": "up", + "interfaces": [ + "Ethernet2", + "Port-Channel2" + ] + } + } +} diff --git a/test/eos/mocked_data/test_get_route_to_longer/normal/show_vrf.text b/test/eos/mocked_data/test_get_route_to_longer/normal/show_vrf.text deleted file mode 100644 index eaf448fbd..000000000 --- a/test/eos/mocked_data/test_get_route_to_longer/normal/show_vrf.text +++ /dev/null @@ -1,6 +0,0 @@ -Maximum number of vrfs allowed: 14 - Vrf RD Protocols State Interfaces -------- ------------ ------------ ------------------------- ------------------- - TEST 0:1 ipv4,ipv6 v4:routing; multicast, Ethernet1, Vlan100, - v6:routing Vlan101, Vlan102, - Vlan103, Vlan104 diff --git a/test/eos/test_cli_syntax.py b/test/eos/test_cli_syntax.py deleted file mode 100644 index 791dca095..000000000 --- a/test/eos/test_cli_syntax.py +++ /dev/null @@ -1,51 +0,0 @@ -""" -Tests for EOS cli_syntax -""" -from napalm.eos.utils.cli_syntax import cli_convert - - -def test_cli_no_change_v2(): - """ - Test no change for basic commands in version 2 - :return: - """ - commands = ["show version", "show interfaces"] - - for c in commands: - assert c == cli_convert(c, 2) - assert c == cli_convert(c, 1) - - -def test_cli_no_change_non_exist_version(): - """ - Test no change for basic commands and non-existing versions - :return: - """ - commands = ["show version", "show interfaces"] - - for c in commands: - assert c == cli_convert(c, 100000) - - -def test_cli_change_exact(): - """ - Test cli change for exact commands - """ - commands = ["show ipv6 bgp neighbors", "show lldp traffic"] - expect = ["show ipv6 bgp peers", "show lldp counters"] - - for c, e in zip(commands, expect): - assert e == cli_convert(c, 2) - assert c == cli_convert(e, 1) - - -def test_cli_change_long_commands(): - """ - Test cli change for long commands - """ - commands = ["show ipv6 bgp neighbors vrf all", "show lldp traffic | include test"] - expect = ["show ipv6 bgp peers vrf all", "show lldp counters | include test"] - - for c, e in zip(commands, expect): - assert e == cli_convert(c, 2) - assert c == cli_convert(e, 1) diff --git a/test/eos/test_heredoc.py b/test/eos/test_heredoc.py index 9190ff67e..cf5d891fa 100644 --- a/test/eos/test_heredoc.py +++ b/test/eos/test_heredoc.py @@ -57,9 +57,7 @@ def test_heredoc(self): "end", ] - self.device.device.run_commands.assert_called_with( - expected_result, fn0039_transform=False - ) + self.device.device.run_commands.assert_called_with(expected_result) def test_mode_comment(self): raw_config = dedent( @@ -111,9 +109,7 @@ def test_mode_comment(self): "end", ] - self.device.device.run_commands.assert_called_with( - expected_result, fn0039_transform=False - ) + self.device.device.run_commands.assert_called_with(expected_result) def test_heredoc_with_bangs(self): raw_config = dedent( @@ -150,6 +146,4 @@ def test_heredoc_with_bangs(self): "end", ] - self.device.device.run_commands.assert_called_with( - expected_result, fn0039_transform=False - ) + self.device.device.run_commands.assert_called_with(expected_result) From 5de951d896d57b854d8d3b278d4795e74434d268 Mon Sep 17 00:00:00 2001 From: Brandon Ewing Date: Mon, 10 Jul 2023 20:18:03 +0000 Subject: [PATCH 02/11] eos: update get_environment commands and tests Use new-format "show system ..." command for environment Update to also detect cEOS systems not having power supplies --- napalm/eos/eos.py | 9 +++++--- .../ceos430/expected_result.json | 14 ++++++++++++ .../ceos430/show_processes_top_once.text | 19 ++++++++++++++++ .../show_system_environment_cooling.json | 14 ++++++++++++ .../show_system_environment_temperature.json | 11 ++++++++++ .../ceos430/show_version.json | 22 +++++++++++++++++++ ...n => show_system_environment_cooling.json} | 0 ...son => show_system_environment_power.json} | 0 ... show_system_environment_temperature.json} | 0 ...n => show_system_environment_cooling.json} | 0 ...son => show_system_environment_power.json} | 0 ... show_system_environment_temperature.json} | 0 ...n => show_system_environment_cooling.json} | 0 ...son => show_system_environment_power.json} | 0 ... show_system_environment_temperature.json} | 0 ...n => show_system_environment_cooling.json} | 0 ... show_system_environment_temperature.json} | 0 ...n => show_system_environment_cooling.json} | 0 ...son => show_system_environment_power.json} | 0 ... show_system_environment_temperature.json} | 0 20 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 test/eos/mocked_data/test_get_environment/ceos430/expected_result.json create mode 100644 test/eos/mocked_data/test_get_environment/ceos430/show_processes_top_once.text create mode 100644 test/eos/mocked_data/test_get_environment/ceos430/show_system_environment_cooling.json create mode 100644 test/eos/mocked_data/test_get_environment/ceos430/show_system_environment_temperature.json create mode 100644 test/eos/mocked_data/test_get_environment/ceos430/show_version.json rename test/eos/mocked_data/test_get_environment/issue1671_top_mb/{show_environment_cooling.json => show_system_environment_cooling.json} (100%) rename test/eos/mocked_data/test_get_environment/issue1671_top_mb/{show_environment_power.json => show_system_environment_power.json} (100%) rename test/eos/mocked_data/test_get_environment/issue1671_top_mb/{show_environment_temperature.json => show_system_environment_temperature.json} (100%) rename test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/{show_environment_cooling.json => show_system_environment_cooling.json} (100%) rename test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/{show_environment_power.json => show_system_environment_power.json} (100%) rename test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/{show_environment_temperature.json => show_system_environment_temperature.json} (100%) rename test/eos/mocked_data/test_get_environment/issue810_7010t/{show_environment_cooling.json => show_system_environment_cooling.json} (100%) rename test/eos/mocked_data/test_get_environment/issue810_7010t/{show_environment_power.json => show_system_environment_power.json} (100%) rename test/eos/mocked_data/test_get_environment/issue810_7010t/{show_environment_temperature.json => show_system_environment_temperature.json} (100%) rename test/eos/mocked_data/test_get_environment/issue90_veos/{show_environment_cooling.json => show_system_environment_cooling.json} (100%) rename test/eos/mocked_data/test_get_environment/issue90_veos/{show_environment_temperature.json => show_system_environment_temperature.json} (100%) rename test/eos/mocked_data/test_get_environment/normal/{show_environment_cooling.json => show_system_environment_cooling.json} (100%) rename test/eos/mocked_data/test_get_environment/normal/{show_environment_power.json => show_system_environment_power.json} (100%) rename test/eos/mocked_data/test_get_environment/normal/{show_environment_temperature.json => show_system_environment_temperature.json} (100%) diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index 37db5a8d1..6c6d3f52f 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -820,10 +820,13 @@ def extract_temperature_data(data): yield name, values sh_version_out = self._run_commands(["show version"]) - is_veos = sh_version_out[0]["modelName"].lower() == "veos" - commands = ["show environment cooling", "show environment temperature"] + is_veos = sh_version_out[0]["modelName"].lower() in ["veos", "ceoslab"] + commands = [ + "show system environment cooling", + "show system environment temperature", + ] if not is_veos: - commands.append("show environment power") + commands.append("show system environment power") fans_output, temp_output, power_output = self._run_commands(commands) else: fans_output, temp_output = self._run_commands(commands) diff --git a/test/eos/mocked_data/test_get_environment/ceos430/expected_result.json b/test/eos/mocked_data/test_get_environment/ceos430/expected_result.json new file mode 100644 index 000000000..90508e7c9 --- /dev/null +++ b/test/eos/mocked_data/test_get_environment/ceos430/expected_result.json @@ -0,0 +1,14 @@ +{ + "temperature": {}, + "power": {}, + "fans": {}, + "memory": { + "available_ram": 16012300, + "used_ram": 4580692 + }, + "cpu": { + "0": { + "%usage": 4.3 + } + } +} diff --git a/test/eos/mocked_data/test_get_environment/ceos430/show_processes_top_once.text b/test/eos/mocked_data/test_get_environment/ceos430/show_processes_top_once.text new file mode 100644 index 000000000..912ae600d --- /dev/null +++ b/test/eos/mocked_data/test_get_environment/ceos430/show_processes_top_once.text @@ -0,0 +1,19 @@ +top - 14:03:41 up 131 days, 21:26, 1 user, load average: 0.39, 0.29, 0.32 +Tasks: 383 total, 1 running, 382 sleeping, 0 stopped, 0 zombie +Cpu(s): 3.5%us, 0.5%sy, 0.0%ni, 95.7%id, 0.0%wa, 0.2%hi, 0.1%si, 0.0%st +Mem: 16012300k total, 4580692k used, 11431608k free, 200332k buffers +Swap: 0k total, 0k used, 0k free, 2395436k cached + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 6416 root 20 0 662m 105m 37m S 9.0 0.7 3592:55 SandFabric + 6420 root 20 0 662m 105m 37m S 7.2 0.7 3589:14 SandFabric + 2606 root 20 0 562m 88m 23m S 3.6 0.6 3237:39 Smbus + 4332 root 20 0 761m 224m 94m S 3.6 1.4 10642:24 SandFap + 6419 root 20 0 662m 105m 37m S 3.6 0.7 3596:53 SandFabric + 2675 root 20 0 553m 78m 20m S 1.8 0.5 37:26.89 VrmIr + 3850 root 20 0 558m 85m 21m S 1.8 0.5 597:34.22 Adt7462Agent + 3954 root 20 0 565m 96m 31m S 1.8 0.6 1809:51 XcvrAgent + 6424 root 20 0 662m 105m 37m S 1.8 0.7 3614:34 SandFabric +20866 dbarroso 20 0 26552 12m 9668 R 1.8 0.1 0:00.06 top + 1 root 20 0 26340 12m 9832 S 0.0 0.1 0:02.62 init + 2 root 20 0 0 0 0 S 0.0 0.0 0:01.36 kthreadd diff --git a/test/eos/mocked_data/test_get_environment/ceos430/show_system_environment_cooling.json b/test/eos/mocked_data/test_get_environment/ceos430/show_system_environment_cooling.json new file mode 100644 index 000000000..820008f2d --- /dev/null +++ b/test/eos/mocked_data/test_get_environment/ceos430/show_system_environment_cooling.json @@ -0,0 +1,14 @@ +{ + "systemStatus": "unknownCoolingAlarmLevel", + "airflowDirection": "unknownAirflowDirection", + "currentZones": 1, + "configuredZones": 0, + "defaultZones": false, + "numCoolingZones": [], + "shutdownOnInsufficientFans": true, + "overrideFanSpeed": 0, + "minFanSpeed": 0, + "coolingMode": "automatic", + "fanTraySlots": [], + "powerSupplySlots": [] +} diff --git a/test/eos/mocked_data/test_get_environment/ceos430/show_system_environment_temperature.json b/test/eos/mocked_data/test_get_environment/ceos430/show_system_environment_temperature.json new file mode 100644 index 000000000..0a05a66dd --- /dev/null +++ b/test/eos/mocked_data/test_get_environment/ceos430/show_system_environment_temperature.json @@ -0,0 +1,11 @@ +{ + "systemStatus": "unknownTemperatureAlarmLevel", + "shutdownOnOverheat": false, + "powercycleOnOverheat": false, + "actionOnOverheat": "actionUnknown", + "recoveryModeOnOverheat": "recoveryModeNA", + "ambientThreshold": 45, + "tempSensors": [], + "cardSlots": [], + "powerSupplySlots": [] +} diff --git a/test/eos/mocked_data/test_get_environment/ceos430/show_version.json b/test/eos/mocked_data/test_get_environment/ceos430/show_version.json new file mode 100644 index 000000000..ecdaba003 --- /dev/null +++ b/test/eos/mocked_data/test_get_environment/ceos430/show_version.json @@ -0,0 +1,22 @@ +{ + "mfgName": "Arista", + "modelName": "cEOSLab", + "hardwareRevision": "", + "serialNumber": "DE5B7D98C24A207BE70876CC0AD5546F", + "systemMacAddress": "00:1c:73:78:8e:81", + "hwMacAddress": "00:00:00:00:00:00", + "configMacAddress": "00:00:00:00:00:00", + "version": "4.30.0F-31408673.4300F (engineering build)", + "architecture": "x86_64", + "internalVersion": "4.30.0F-31408673.4300F", + "internalBuildId": "a35f0dc7-2d65-4f2a-a010-279cf445fd8c", + "imageFormatVersion": "1.0", + "imageOptimization": "None", + "cEosToolsVersion": "(unknown)", + "kernelVersion": "5.15.0-56-generic", + "bootupTimestamp": 1688840924.7556078, + "uptime": 6527.436209201813, + "memTotal": 231066228, + "memFree": 221986768, + "isIntlVersion": false +} diff --git a/test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_environment_cooling.json b/test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_system_environment_cooling.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_environment_cooling.json rename to test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_system_environment_cooling.json diff --git a/test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_environment_power.json b/test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_system_environment_power.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_environment_power.json rename to test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_system_environment_power.json diff --git a/test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_environment_temperature.json b/test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_system_environment_temperature.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_environment_temperature.json rename to test/eos/mocked_data/test_get_environment/issue1671_top_mb/show_system_environment_temperature.json diff --git a/test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_environment_cooling.json b/test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_system_environment_cooling.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_environment_cooling.json rename to test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_system_environment_cooling.json diff --git a/test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_environment_power.json b/test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_system_environment_power.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_environment_power.json rename to test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_system_environment_power.json diff --git a/test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_environment_temperature.json b/test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_system_environment_temperature.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_environment_temperature.json rename to test/eos/mocked_data/test_get_environment/issue80_stacktrace_for_get_environment/show_system_environment_temperature.json diff --git a/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_cooling.json b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_system_environment_cooling.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_cooling.json rename to test/eos/mocked_data/test_get_environment/issue810_7010t/show_system_environment_cooling.json diff --git a/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_power.json b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_system_environment_power.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_power.json rename to test/eos/mocked_data/test_get_environment/issue810_7010t/show_system_environment_power.json diff --git a/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_temperature.json b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_system_environment_temperature.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_temperature.json rename to test/eos/mocked_data/test_get_environment/issue810_7010t/show_system_environment_temperature.json diff --git a/test/eos/mocked_data/test_get_environment/issue90_veos/show_environment_cooling.json b/test/eos/mocked_data/test_get_environment/issue90_veos/show_system_environment_cooling.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/issue90_veos/show_environment_cooling.json rename to test/eos/mocked_data/test_get_environment/issue90_veos/show_system_environment_cooling.json diff --git a/test/eos/mocked_data/test_get_environment/issue90_veos/show_environment_temperature.json b/test/eos/mocked_data/test_get_environment/issue90_veos/show_system_environment_temperature.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/issue90_veos/show_environment_temperature.json rename to test/eos/mocked_data/test_get_environment/issue90_veos/show_system_environment_temperature.json diff --git a/test/eos/mocked_data/test_get_environment/normal/show_environment_cooling.json b/test/eos/mocked_data/test_get_environment/normal/show_system_environment_cooling.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/normal/show_environment_cooling.json rename to test/eos/mocked_data/test_get_environment/normal/show_system_environment_cooling.json diff --git a/test/eos/mocked_data/test_get_environment/normal/show_environment_power.json b/test/eos/mocked_data/test_get_environment/normal/show_system_environment_power.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/normal/show_environment_power.json rename to test/eos/mocked_data/test_get_environment/normal/show_system_environment_power.json diff --git a/test/eos/mocked_data/test_get_environment/normal/show_environment_temperature.json b/test/eos/mocked_data/test_get_environment/normal/show_system_environment_temperature.json similarity index 100% rename from test/eos/mocked_data/test_get_environment/normal/show_environment_temperature.json rename to test/eos/mocked_data/test_get_environment/normal/show_system_environment_temperature.json From cc2c31019a2d7c7946572e6ed94752898df449de Mon Sep 17 00:00:00 2001 From: Brandon Ewing Date: Mon, 10 Jul 2023 21:19:50 +0000 Subject: [PATCH 03/11] eos: update bgp getters for new syntax show ip bgp neigh -> show ip bgp peers --- napalm/eos/eos.py | 23 ++++---- ..._Local_AS_Desc_BGP_state__remote_rou.text} | 0 ..._Local_AS_Desc_BGP_state__remote_rou.text} | 0 ..._Local_AS_Desc_BGP_state__remote_rou.text} | 0 ..._Local_AS_Desc_BGP_state__remote_rou.text} | 0 ..._Local_AS_Desc_BGP_state__remote_rou.text} | 0 ..._Local_AS_Desc_BGP_state__remote_rou.text} | 0 ....text => show_ipv6_bgp_peers_vrf_all.text} | 0 ....text => show_ipv6_bgp_peers_vrf_all.text} | 0 ....text => show_ipv6_bgp_peers_vrf_all.text} | 0 ....text => show_ipv6_bgp_peers_vrf_all.text} | 0 ... show_ip_bgp_1_0_4_0_24__vrf_default.json} | 0 ... => show_ip_bgp_1_0_4_0_24__vrf_TEST.json} | 0 ... show_ip_bgp_1_0_4_0_24__vrf_default.json} | 0 ... show_ip_bgp_1_0_4_0_24__vrf_default.json} | 0 ... => show_ip_bgp_1_0_4_0_24__vrf_TEST.json} | 0 ... show_ip_bgp_1_0_4_0_24__vrf_default.json} | 0 ..._1_0_4_0_24_longer_prefixes_vrf_TEST.json} | 0 ...0_4_0_24_longer_prefixes_vrf_default.json} | 0 ...n => show_ip_bgp_1_0_4_0_25_vrf_TEST.json} | 0 ...> show_ip_bgp_1_0_4_0_25_vrf_default.json} | 0 ...w_ip_bgp_1_0_4_128_25_detail_vrf_TEST.json | 57 ------------------- ...p_bgp_1_0_4_128_25_detail_vrf_default.json | 57 ------------------- 23 files changed, 12 insertions(+), 125 deletions(-) rename test/eos/mocked_data/test_get_bgp_neighbors/issue1168/{show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text => show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text} (100%) rename test/eos/mocked_data/test_get_bgp_neighbors/issue1356/{show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text => show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text} (100%) rename test/eos/mocked_data/test_get_bgp_neighbors/issue1759/{show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text => show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text} (100%) rename test/eos/mocked_data/test_get_bgp_neighbors/issue58_neighbor_down/{show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text => show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text} (100%) rename test/eos/mocked_data/test_get_bgp_neighbors/issue944/{show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text => show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text} (100%) rename test/eos/mocked_data/test_get_bgp_neighbors/normal/{show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text => show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text} (100%) rename test/eos/mocked_data/test_get_bgp_neighbors_detail/issue1416/{show_ipv6_bgp_neighbors_vrf_all.text => show_ipv6_bgp_peers_vrf_all.text} (100%) rename test/eos/mocked_data/test_get_bgp_neighbors_detail/issue53/{show_ipv6_bgp_neighbors_vrf_all.text => show_ipv6_bgp_peers_vrf_all.text} (100%) rename test/eos/mocked_data/test_get_bgp_neighbors_detail/issue68_neighbor_no_local_address/{show_ipv6_bgp_neighbors_vrf_all.text => show_ipv6_bgp_peers_vrf_all.text} (100%) rename test/eos/mocked_data/test_get_bgp_neighbors_detail/normal/{show_ipv6_bgp_neighbors_vrf_all.text => show_ipv6_bgp_peers_vrf_all.text} (100%) rename test/eos/mocked_data/test_get_route_to/iss_1069/{show_ip_bgp_1_0_4_0_24__detail_vrf_default.json => show_ip_bgp_1_0_4_0_24__vrf_default.json} (100%) rename test/eos/mocked_data/test_get_route_to/iss_1347/{show_ip_bgp_1_0_4_0_24__detail_vrf_TEST.json => show_ip_bgp_1_0_4_0_24__vrf_TEST.json} (100%) rename test/eos/mocked_data/test_get_route_to/iss_1347/{show_ip_bgp_1_0_4_0_24__detail_vrf_default.json => show_ip_bgp_1_0_4_0_24__vrf_default.json} (100%) rename test/eos/mocked_data/test_get_route_to/iss_736/{show_ip_bgp_1_0_4_0_24__detail_vrf_default.json => show_ip_bgp_1_0_4_0_24__vrf_default.json} (100%) rename test/eos/mocked_data/test_get_route_to/normal/{show_ip_bgp_1_0_4_0_24__detail_vrf_TEST.json => show_ip_bgp_1_0_4_0_24__vrf_TEST.json} (100%) rename test/eos/mocked_data/test_get_route_to/normal/{show_ip_bgp_1_0_4_0_24__detail_vrf_default.json => show_ip_bgp_1_0_4_0_24__vrf_default.json} (100%) rename test/eos/mocked_data/test_get_route_to_longer/normal/{show_ip_bgp_1_0_4_0_24_longer_prefixes_detail_vrf_TEST.json => show_ip_bgp_1_0_4_0_24_longer_prefixes_vrf_TEST.json} (100%) rename test/eos/mocked_data/test_get_route_to_longer/normal/{show_ip_bgp_1_0_4_0_24_longer_prefixes_detail_vrf_default.json => show_ip_bgp_1_0_4_0_24_longer_prefixes_vrf_default.json} (100%) rename test/eos/mocked_data/test_get_route_to_longer/normal/{show_ip_bgp_1_0_4_0_25_detail_vrf_TEST.json => show_ip_bgp_1_0_4_0_25_vrf_TEST.json} (100%) rename test/eos/mocked_data/test_get_route_to_longer/normal/{show_ip_bgp_1_0_4_0_25_detail_vrf_default.json => show_ip_bgp_1_0_4_0_25_vrf_default.json} (100%) delete mode 100644 test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_128_25_detail_vrf_TEST.json delete mode 100644 test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_128_25_detail_vrf_default.json diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index 6c6d3f52f..76b86290b 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -680,13 +680,16 @@ def get_re_group(res, key, default=None): except KeyError: return default - NEIGHBOR_FILTER = "bgp neighbors vrf all | include IPv[46] (Unicast|6PE):.*[0-9]+ | grep -v ' IPv[46] Unicast:/.' | remote AS |^Local AS|Desc|BGP state |remote router ID" # noqa + NEIGHBOR_FILTER = "vrf all | include IPv[46] (Unicast|6PE):.*[0-9]+ | grep -v ' IPv[46] Unicast:/.' | remote AS |^Local AS|Desc|BGP state |remote router ID" # noqa output_summary_cmds = self._run_commands( ["show ipv6 bgp summary vrf all", "show ip bgp summary vrf all"], encoding="json", ) output_neighbor_cmds = self._run_commands( - ["show ip " + NEIGHBOR_FILTER, "show ipv6 " + NEIGHBOR_FILTER], + [ + "show ip bgp neighbors " + NEIGHBOR_FILTER, + "show ipv6 bgp peers " + NEIGHBOR_FILTER, + ], encoding="text", ) @@ -1519,13 +1522,11 @@ def get_route_to(self, destination="", protocol="", longer=False): nexthop_interface_map[nexthop_ip] = next_hop.get("interface") metric = route_details.get("metric") if _vrf not in vrf_cache.keys(): - command = ( - "show ip{ipv} bgp {dest} {longer} detail vrf {_vrf}".format( - ipv=ipv, - dest=destination, - longer="longer-prefixes" if longer else "", - _vrf=_vrf, - ) + command = "show ip{ipv} bgp {dest} {longer} vrf {_vrf}".format( + ipv=ipv, + dest=destination, + longer="longer-prefixes" if longer else "", + _vrf=_vrf, ) vrf_cache.update( { @@ -1933,7 +1934,7 @@ def _append(bgp_dict, peer_info): summary_commands = [] if not neighbor_address: commands.append("show ip bgp neighbors vrf all") - commands.append("show ipv6 bgp neighbors vrf all") + commands.append("show ipv6 bgp peers vrf all") summary_commands.append("show ip bgp summary vrf all") summary_commands.append("show ipv6 bgp summary vrf all") else: @@ -1946,7 +1947,7 @@ def _append(bgp_dict, peer_info): commands.append("show ip bgp neighbors %s vrf all" % neighbor_address) summary_commands.append("show ip bgp summary vrf all") elif peer_ver == 6: - commands.append("show ipv6 bgp neighbors %s vrf all" % neighbor_address) + commands.append("show ipv6 bgp peers %s vrf all" % neighbor_address) summary_commands.append("show ipv6 bgp summary vrf all") raw_output = self._run_commands(commands, encoding="text") diff --git a/test/eos/mocked_data/test_get_bgp_neighbors/issue1168/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text b/test/eos/mocked_data/test_get_bgp_neighbors/issue1168/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text similarity index 100% rename from test/eos/mocked_data/test_get_bgp_neighbors/issue1168/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text rename to test/eos/mocked_data/test_get_bgp_neighbors/issue1168/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text diff --git a/test/eos/mocked_data/test_get_bgp_neighbors/issue1356/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text b/test/eos/mocked_data/test_get_bgp_neighbors/issue1356/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text similarity index 100% rename from test/eos/mocked_data/test_get_bgp_neighbors/issue1356/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text rename to test/eos/mocked_data/test_get_bgp_neighbors/issue1356/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text diff --git a/test/eos/mocked_data/test_get_bgp_neighbors/issue1759/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text b/test/eos/mocked_data/test_get_bgp_neighbors/issue1759/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text similarity index 100% rename from test/eos/mocked_data/test_get_bgp_neighbors/issue1759/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text rename to test/eos/mocked_data/test_get_bgp_neighbors/issue1759/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text diff --git a/test/eos/mocked_data/test_get_bgp_neighbors/issue58_neighbor_down/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text b/test/eos/mocked_data/test_get_bgp_neighbors/issue58_neighbor_down/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text similarity index 100% rename from test/eos/mocked_data/test_get_bgp_neighbors/issue58_neighbor_down/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text rename to test/eos/mocked_data/test_get_bgp_neighbors/issue58_neighbor_down/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text diff --git a/test/eos/mocked_data/test_get_bgp_neighbors/issue944/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text b/test/eos/mocked_data/test_get_bgp_neighbors/issue944/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text similarity index 100% rename from test/eos/mocked_data/test_get_bgp_neighbors/issue944/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text rename to test/eos/mocked_data/test_get_bgp_neighbors/issue944/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text diff --git a/test/eos/mocked_data/test_get_bgp_neighbors/normal/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text b/test/eos/mocked_data/test_get_bgp_neighbors/normal/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text similarity index 100% rename from test/eos/mocked_data/test_get_bgp_neighbors/normal/show_ipv6_bgp_neighbors_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote.text rename to test/eos/mocked_data/test_get_bgp_neighbors/normal/show_ipv6_bgp_peers_vrf_all___include_IPv_46___Unicast_6PE_____0_9_____grep__v___IPv_46__Unicast_______remote_AS___Local_AS_Desc_BGP_state__remote_rou.text diff --git a/test/eos/mocked_data/test_get_bgp_neighbors_detail/issue1416/show_ipv6_bgp_neighbors_vrf_all.text b/test/eos/mocked_data/test_get_bgp_neighbors_detail/issue1416/show_ipv6_bgp_peers_vrf_all.text similarity index 100% rename from test/eos/mocked_data/test_get_bgp_neighbors_detail/issue1416/show_ipv6_bgp_neighbors_vrf_all.text rename to test/eos/mocked_data/test_get_bgp_neighbors_detail/issue1416/show_ipv6_bgp_peers_vrf_all.text diff --git a/test/eos/mocked_data/test_get_bgp_neighbors_detail/issue53/show_ipv6_bgp_neighbors_vrf_all.text b/test/eos/mocked_data/test_get_bgp_neighbors_detail/issue53/show_ipv6_bgp_peers_vrf_all.text similarity index 100% rename from test/eos/mocked_data/test_get_bgp_neighbors_detail/issue53/show_ipv6_bgp_neighbors_vrf_all.text rename to test/eos/mocked_data/test_get_bgp_neighbors_detail/issue53/show_ipv6_bgp_peers_vrf_all.text diff --git a/test/eos/mocked_data/test_get_bgp_neighbors_detail/issue68_neighbor_no_local_address/show_ipv6_bgp_neighbors_vrf_all.text b/test/eos/mocked_data/test_get_bgp_neighbors_detail/issue68_neighbor_no_local_address/show_ipv6_bgp_peers_vrf_all.text similarity index 100% rename from test/eos/mocked_data/test_get_bgp_neighbors_detail/issue68_neighbor_no_local_address/show_ipv6_bgp_neighbors_vrf_all.text rename to test/eos/mocked_data/test_get_bgp_neighbors_detail/issue68_neighbor_no_local_address/show_ipv6_bgp_peers_vrf_all.text diff --git a/test/eos/mocked_data/test_get_bgp_neighbors_detail/normal/show_ipv6_bgp_neighbors_vrf_all.text b/test/eos/mocked_data/test_get_bgp_neighbors_detail/normal/show_ipv6_bgp_peers_vrf_all.text similarity index 100% rename from test/eos/mocked_data/test_get_bgp_neighbors_detail/normal/show_ipv6_bgp_neighbors_vrf_all.text rename to test/eos/mocked_data/test_get_bgp_neighbors_detail/normal/show_ipv6_bgp_peers_vrf_all.text diff --git a/test/eos/mocked_data/test_get_route_to/iss_1069/show_ip_bgp_1_0_4_0_24__detail_vrf_default.json b/test/eos/mocked_data/test_get_route_to/iss_1069/show_ip_bgp_1_0_4_0_24__vrf_default.json similarity index 100% rename from test/eos/mocked_data/test_get_route_to/iss_1069/show_ip_bgp_1_0_4_0_24__detail_vrf_default.json rename to test/eos/mocked_data/test_get_route_to/iss_1069/show_ip_bgp_1_0_4_0_24__vrf_default.json diff --git a/test/eos/mocked_data/test_get_route_to/iss_1347/show_ip_bgp_1_0_4_0_24__detail_vrf_TEST.json b/test/eos/mocked_data/test_get_route_to/iss_1347/show_ip_bgp_1_0_4_0_24__vrf_TEST.json similarity index 100% rename from test/eos/mocked_data/test_get_route_to/iss_1347/show_ip_bgp_1_0_4_0_24__detail_vrf_TEST.json rename to test/eos/mocked_data/test_get_route_to/iss_1347/show_ip_bgp_1_0_4_0_24__vrf_TEST.json diff --git a/test/eos/mocked_data/test_get_route_to/iss_1347/show_ip_bgp_1_0_4_0_24__detail_vrf_default.json b/test/eos/mocked_data/test_get_route_to/iss_1347/show_ip_bgp_1_0_4_0_24__vrf_default.json similarity index 100% rename from test/eos/mocked_data/test_get_route_to/iss_1347/show_ip_bgp_1_0_4_0_24__detail_vrf_default.json rename to test/eos/mocked_data/test_get_route_to/iss_1347/show_ip_bgp_1_0_4_0_24__vrf_default.json diff --git a/test/eos/mocked_data/test_get_route_to/iss_736/show_ip_bgp_1_0_4_0_24__detail_vrf_default.json b/test/eos/mocked_data/test_get_route_to/iss_736/show_ip_bgp_1_0_4_0_24__vrf_default.json similarity index 100% rename from test/eos/mocked_data/test_get_route_to/iss_736/show_ip_bgp_1_0_4_0_24__detail_vrf_default.json rename to test/eos/mocked_data/test_get_route_to/iss_736/show_ip_bgp_1_0_4_0_24__vrf_default.json diff --git a/test/eos/mocked_data/test_get_route_to/normal/show_ip_bgp_1_0_4_0_24__detail_vrf_TEST.json b/test/eos/mocked_data/test_get_route_to/normal/show_ip_bgp_1_0_4_0_24__vrf_TEST.json similarity index 100% rename from test/eos/mocked_data/test_get_route_to/normal/show_ip_bgp_1_0_4_0_24__detail_vrf_TEST.json rename to test/eos/mocked_data/test_get_route_to/normal/show_ip_bgp_1_0_4_0_24__vrf_TEST.json diff --git a/test/eos/mocked_data/test_get_route_to/normal/show_ip_bgp_1_0_4_0_24__detail_vrf_default.json b/test/eos/mocked_data/test_get_route_to/normal/show_ip_bgp_1_0_4_0_24__vrf_default.json similarity index 100% rename from test/eos/mocked_data/test_get_route_to/normal/show_ip_bgp_1_0_4_0_24__detail_vrf_default.json rename to test/eos/mocked_data/test_get_route_to/normal/show_ip_bgp_1_0_4_0_24__vrf_default.json diff --git a/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_24_longer_prefixes_detail_vrf_TEST.json b/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_24_longer_prefixes_vrf_TEST.json similarity index 100% rename from test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_24_longer_prefixes_detail_vrf_TEST.json rename to test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_24_longer_prefixes_vrf_TEST.json diff --git a/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_24_longer_prefixes_detail_vrf_default.json b/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_24_longer_prefixes_vrf_default.json similarity index 100% rename from test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_24_longer_prefixes_detail_vrf_default.json rename to test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_24_longer_prefixes_vrf_default.json diff --git a/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_25_detail_vrf_TEST.json b/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_25_vrf_TEST.json similarity index 100% rename from test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_25_detail_vrf_TEST.json rename to test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_25_vrf_TEST.json diff --git a/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_25_detail_vrf_default.json b/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_25_vrf_default.json similarity index 100% rename from test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_25_detail_vrf_default.json rename to test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_0_25_vrf_default.json diff --git a/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_128_25_detail_vrf_TEST.json b/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_128_25_detail_vrf_TEST.json deleted file mode 100644 index 1789d4dd3..000000000 --- a/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_128_25_detail_vrf_TEST.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "vrfs": { - "TEST": { - "routerId": "192.168.256.1", - "vrf": "default", - "bgpRouteEntries": { - "1.0.4.128/25": { - "totalPaths": 1, - "bgpAdvertisedPeerGroups": {}, - "totalAdvertisedPeers": 0, - "maskLength": 20, - "bgpRoutePaths": [ - { - "asPathEntry": { - "asPathType": "External", - "asPath": "1299 15169 43515" - }, - "med": 0, - "localPreference": 50, - "weight": 0, - "nextHop": "192.168.0.5", - "routeType": { - "atomicAggregator": false, - "valid": true, - "ecmpContributor": false, - "active": true, - "backup": false, - "stale": false, - "suppressed": false, - "ecmpHead": false, - "queued": false, - "ecmp": false - }, - "routeDetail": { - "origin": "Igp", - "peerEntry": { - "peerRouterId": "192.168.256.1", - "peerAddr": "192.168.0.5" - }, - "extCommunityList": [], - "communityList": [ - "1299:1234", - "1299:5678", - "1299:91011", - "1299:12134" - ], - "recvdFromRRClient": false - } - } - ], - "address": "1.0.4.128" - } - }, - "asn": 13335 - } - } -} diff --git a/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_128_25_detail_vrf_default.json b/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_128_25_detail_vrf_default.json deleted file mode 100644 index 6ac90ca10..000000000 --- a/test/eos/mocked_data/test_get_route_to_longer/normal/show_ip_bgp_1_0_4_128_25_detail_vrf_default.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "vrfs": { - "default": { - "routerId": "192.168.256.1", - "vrf": "default", - "bgpRouteEntries": { - "1.0.4.128/25": { - "totalPaths": 1, - "bgpAdvertisedPeerGroups": {}, - "totalAdvertisedPeers": 0, - "maskLength": 20, - "bgpRoutePaths": [ - { - "asPathEntry": { - "asPathType": "External", - "asPath": "1299 15169 43515" - }, - "med": 0, - "localPreference": 50, - "weight": 0, - "nextHop": "192.168.0.5", - "routeType": { - "atomicAggregator": false, - "valid": true, - "ecmpContributor": false, - "active": true, - "backup": false, - "stale": false, - "suppressed": false, - "ecmpHead": false, - "queued": false, - "ecmp": false - }, - "routeDetail": { - "origin": "Igp", - "peerEntry": { - "peerRouterId": "192.168.256.1", - "peerAddr": "192.168.0.5" - }, - "extCommunityList": [], - "communityList": [ - "1299:1234", - "1299:5678", - "1299:91011", - "1299:12134" - ], - "recvdFromRRClient": false - } - } - ], - "address": "1.0.4.128" - } - }, - "asn": 13335 - } - } -} From 75461b6065ffbf386e5164b107e7bd66b549b866 Mon Sep 17 00:00:00 2001 From: Brandon Ewing Date: Mon, 10 Jul 2023 21:49:32 +0000 Subject: [PATCH 04/11] eos: update get_snmp_information command syntax show snmp -> show snmp v2-mib --- napalm/eos/eos.py | 6 +++++- ...show_snmp_chassis.json => show_snmp_v2_mib_chassis.json} | 0 ...show_snmp_contact.json => show_snmp_v2_mib_contact.json} | 0 ...ow_snmp_location.json => show_snmp_v2_mib_location.json} | 0 4 files changed, 5 insertions(+), 1 deletion(-) rename test/eos/mocked_data/test_get_snmp_information/normal/{show_snmp_chassis.json => show_snmp_v2_mib_chassis.json} (100%) rename test/eos/mocked_data/test_get_snmp_information/normal/{show_snmp_contact.json => show_snmp_v2_mib_contact.json} (100%) rename test/eos/mocked_data/test_get_snmp_information/normal/{show_snmp_location.json => show_snmp_v2_mib_location.json} (100%) diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index 76b86290b..71f5c5743 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -1640,7 +1640,11 @@ def get_snmp_information(self): # Default values snmp_dict = {"chassis_id": "", "location": "", "contact": "", "community": {}} - commands = ["show snmp chassis", "show snmp location", "show snmp contact"] + commands = [ + "show snmp v2-mib chassis", + "show snmp v2-mib location", + "show snmp v2-mib contact", + ] snmp_config = self._run_commands(commands, encoding="json") for line in snmp_config: for k, v in line.items(): diff --git a/test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_chassis.json b/test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_v2_mib_chassis.json similarity index 100% rename from test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_chassis.json rename to test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_v2_mib_chassis.json diff --git a/test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_contact.json b/test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_v2_mib_contact.json similarity index 100% rename from test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_contact.json rename to test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_v2_mib_contact.json diff --git a/test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_location.json b/test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_v2_mib_location.json similarity index 100% rename from test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_location.json rename to test/eos/mocked_data/test_get_snmp_information/normal/show_snmp_v2_mib_location.json From 805f98f7f458da31807d58ca1a863f9551b93283 Mon Sep 17 00:00:00 2001 From: Brandon Ewing Date: Wed, 11 Oct 2023 16:20:01 -0500 Subject: [PATCH 05/11] eos: update get_users commands show user-accounts -> show users accounts --- napalm/eos/eos.py | 2 +- .../{show_user_account.json => show_users_accounts.json} | 0 .../normal/{show_user_account.json => show_users_accounts.json} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename test/eos/mocked_data/test_get_users/no_sshkey/{show_user_account.json => show_users_accounts.json} (100%) rename test/eos/mocked_data/test_get_users/normal/{show_user_account.json => show_users_accounts.json} (100%) diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index 71f5c5743..2a4c209df 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -1679,7 +1679,7 @@ def _sshkey_type(sshkey): users = {} - commands = ["show user-account"] + commands = ["show users accounts"] user_items = self._run_commands(commands)[0].get("users", {}) for user, user_details in user_items.items(): diff --git a/test/eos/mocked_data/test_get_users/no_sshkey/show_user_account.json b/test/eos/mocked_data/test_get_users/no_sshkey/show_users_accounts.json similarity index 100% rename from test/eos/mocked_data/test_get_users/no_sshkey/show_user_account.json rename to test/eos/mocked_data/test_get_users/no_sshkey/show_users_accounts.json diff --git a/test/eos/mocked_data/test_get_users/normal/show_user_account.json b/test/eos/mocked_data/test_get_users/normal/show_users_accounts.json similarity index 100% rename from test/eos/mocked_data/test_get_users/normal/show_user_account.json rename to test/eos/mocked_data/test_get_users/normal/show_users_accounts.json From 9c09afe0c171ea2e61b18237082a788b0f3a0fd6 Mon Sep 17 00:00:00 2001 From: Brandon Ewing Date: Fri, 13 Oct 2023 15:46:58 -0500 Subject: [PATCH 06/11] eos: add optional real-device integration test --- test/eos/test_integration.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test/eos/test_integration.py diff --git a/test/eos/test_integration.py b/test/eos/test_integration.py new file mode 100644 index 000000000..fc14e05c0 --- /dev/null +++ b/test/eos/test_integration.py @@ -0,0 +1,31 @@ +import os +import pytest + +from napalm.eos import eos +from napalm.base.base import NetworkDriver + + +@pytest.fixture +def integration_device(): + with eos.EOSDriver( + os.environ["NAPALM_INTEGRATION_HOST"], + os.environ["NAPALM_USERNAME"], + os.environ["NAPALM_PASSWORD"], + ) as d: + yield d + + +@pytest.mark.skipif( + os.getenv("NAPALM_INTEGRATION_HOST") is None, reason="No integration host specified" +) +def test_eos_foo(integration_device): + getters = [s for s in dir(NetworkDriver) if s.startswith("get_")] + + getter_options = {"get_route_to": {"destination": "0.0.0.0/0", "longer": True}} + + for getter in getters: + try: + ret = getattr(integration_device, getter)(**getter_options.get(getter, {})) + assert ret + except NotImplementedError: + pass From 1858e725d582be1b11c056a62a7768c3293d6fa3 Mon Sep 17 00:00:00 2001 From: Urs Baumann Date: Mon, 23 Oct 2023 18:41:23 +0200 Subject: [PATCH 07/11] NXOS_SSH/IOS XE IPv6 Regex update (#2016) --- napalm/ios/ios.py | 2 +- napalm/nxos_ssh/nxos_ssh.py | 17 ++++-- .../ipv6/expected_result.json | 59 +++++++++++++++++++ .../ipv6/show_bgp_all_summary_vrf_all.txt | 29 +++++++++ 4 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 test/nxos_ssh/mocked_data/test_get_bgp_neighbors/ipv6/expected_result.json create mode 100644 test/nxos_ssh/mocked_data/test_get_bgp_neighbors/ipv6/show_bgp_all_summary_vrf_all.txt diff --git a/napalm/ios/ios.py b/napalm/ios/ios.py index df7a78400..322962c70 100644 --- a/napalm/ios/ios.py +++ b/napalm/ios/ios.py @@ -59,7 +59,7 @@ IP_ADDR_REGEX = r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" IPV4_ADDR_REGEX = IP_ADDR_REGEX IPV6_ADDR_REGEX_1 = r"::" -IPV6_ADDR_REGEX_2 = r"[0-9a-fA-F:]{1,39}::[0-9a-fA-F:]{1,39}" +IPV6_ADDR_REGEX_2 = r"[0-9a-fA-F:]{0,39}::[0-9a-fA-F:]{0,39}" IPV6_ADDR_REGEX_3 = ( r"[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:" "[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}" diff --git a/napalm/nxos_ssh/nxos_ssh.py b/napalm/nxos_ssh/nxos_ssh.py index bdb01f5a9..6fa051937 100644 --- a/napalm/nxos_ssh/nxos_ssh.py +++ b/napalm/nxos_ssh/nxos_ssh.py @@ -38,7 +38,7 @@ IP_ADDR_REGEX = r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" IPV4_ADDR_REGEX = IP_ADDR_REGEX IPV6_ADDR_REGEX_1 = r"::" -IPV6_ADDR_REGEX_2 = r"[0-9a-fA-F:]{1,39}::[0-9a-fA-F:]{1,39}" +IPV6_ADDR_REGEX_2 = r"[0-9a-fA-F:]{0,39}::[0-9a-fA-F:]{0,39}" IPV6_ADDR_REGEX_3 = ( r"[0-9a-fA-F]{1,3}:[0-9a-fA-F]{1,3}:[0-9a-fA-F]{1,3}:[0-9a-fA-F]{1,3}:" r"[0-9a-fA-F]{1,3}:[0-9a-fA-F]{1,3}:[0-9a-fA-F]{1,3}:[0-9a-fA-F]{1,3}" @@ -264,13 +264,22 @@ def bgp_normalize_table_data(bgp_table): 4 65535 163664 163693 145 0 0 3w2d 3 2001:db8:e0:dd::1 4 10 327491 327278 145 0 0 3w1d 4 + 2001:db8:e0:df:: + 4 12345678 + 327465 327268 145 0 0 3w1d 4 Normalize this so the line wrap doesn't exit. """ bgp_table = bgp_table.strip() - bgp_multiline_pattern = r"({})\s*\n".format(IPV4_OR_IPV6_REGEX) - # Strip out the newline - return re.sub(bgp_multiline_pattern, r"\1", bgp_table) + # Remove newline after ipv6 address + bgp_ipv6_multiline_pattern = r"({})\s*\n".format(IPV4_OR_IPV6_REGEX) + bgp_table = re.sub(bgp_ipv6_multiline_pattern, r"\1", bgp_table) + # Remove newline after a long AS number + bgp_long_as_multiline_pattern = r"((?:{})\s*\d*\s*\d*)\s*\n".format( + IPV4_OR_IPV6_REGEX + ) + bgp_table = re.sub(bgp_long_as_multiline_pattern, r"\1", bgp_table) + return bgp_table def bgp_table_parser(bgp_table): diff --git a/test/nxos_ssh/mocked_data/test_get_bgp_neighbors/ipv6/expected_result.json b/test/nxos_ssh/mocked_data/test_get_bgp_neighbors/ipv6/expected_result.json new file mode 100644 index 000000000..7623433ae --- /dev/null +++ b/test/nxos_ssh/mocked_data/test_get_bgp_neighbors/ipv6/expected_result.json @@ -0,0 +1,59 @@ +{ + "RED3": { + "router_id": "10.1.0.18", + "peers": { + "2001:db8:4:701::2": { + "is_enabled": true, + "uptime": 1987200, + "remote_as": 65535, + "address_family": { + "ipv6": { + "sent_prefixes": -1, + "accepted_prefixes": -1, + "received_prefixes": 3 + } + }, + "is_up": true, + "remote_id": "0.0.0.0", + "local_as": 65535, + "description": "" + }, + "2001:db8:e0:df::": { + "is_enabled": true, + "uptime": 1900800, + "remote_as": 12345678, + "address_family": { + "ipv6": { + "sent_prefixes": -1, + "accepted_prefixes": -1, + "received_prefixes": 4 + } + }, + "is_up": true, + "remote_id": "0.0.0.0", + "local_as": 65535, + "description": "" + }, + "2001:db8:e0:dd::1": { + "is_enabled": true, + "uptime": 1900800, + "remote_as": 10, + "address_family": { + "ipv6": { + "sent_prefixes": -1, + "accepted_prefixes": -1, + "received_prefixes": 4 + } + }, + "is_up": true, + "remote_id": "0.0.0.0", + "local_as": 65535, + "description": "" + } + } + }, + "global": { + "router_id": "10.1.0.16", + "peers": {} + } +} \ No newline at end of file diff --git a/test/nxos_ssh/mocked_data/test_get_bgp_neighbors/ipv6/show_bgp_all_summary_vrf_all.txt b/test/nxos_ssh/mocked_data/test_get_bgp_neighbors/ipv6/show_bgp_all_summary_vrf_all.txt new file mode 100644 index 000000000..7287514bc --- /dev/null +++ b/test/nxos_ssh/mocked_data/test_get_bgp_neighbors/ipv6/show_bgp_all_summary_vrf_all.txt @@ -0,0 +1,29 @@ +BGP summary information for VRF default, address family IPv4 Unicast +BGP router identifier 10.1.0.16, local AS number 65535 +BGP table version is 361, IPv4 Unicast config peers 2, capable peers 2 +13 network entries and 17 paths using 2224 bytes of memory +BGP attribute entries [4/576], BGP AS path entries [1/14] +BGP community entries [295/10792], BGP clusterlist entries [0/0] +13 received paths for inbound soft reconfiguration +4 identical, 9 modified, 0 filtered received paths using 72 bytes + +Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd + + +BGP summary information for VRF RED3, address family IPv6 Unicast +BGP router identifier 10.1.0.18, local AS number 65535 +BGP table version is 145, IPv6 Unicast config peers 3, capable peers 3 +12 network entries and 15 paths using 2136 bytes of memory +BGP attribute entries [16/2304], BGP AS path entries [6/72] +BGP community entries [295/10792], BGP clusterlist entries [0/0] +11 received paths for inbound soft reconfiguration +3 identical, 8 modified, 0 filtered received paths using 64 bytes + +Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd +2001:db8:4:701::2 + 4 65535 163664 163693 145 0 0 3w2d 3 +2001:db8:e0:dd::1 + 4 10 327491 327278 145 0 0 3w1d 4 +2001:db8:e0:df:: + 4 12345678 + 327465 327268 145 0 0 3w1d 4 From d9c41a55a1ee1742c9509913443d2cca2c7a21ec Mon Sep 17 00:00:00 2001 From: Kirk Byers Date: Wed, 15 Nov 2023 09:37:37 -0800 Subject: [PATCH 08/11] Drop PY3.7 support in napalm 5.0.0; add PY3.12 tests --- .github/workflows/commit.yaml | 2 +- README.md | 3 +++ setup.py | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 0329a5554..8494d6c4b 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -10,7 +10,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.7, 3.8, 3.9, 3.10.9, 3.11] + python-version: [3.8, 3.9, 3.10.9, 3.11, 3.12.0] steps: - name: Checkout repository diff --git a/README.md b/README.md index 5a642d103..764f39bff 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,9 @@ Install pip install napalm ``` +*Note*: Beginning with release 5.0.0 and later, NAPALM offers support for +Python 3.8+ only. + *Note*: Beginning with release 4.0.0 and later, NAPALM offers support for Python 3.7+ only. diff --git a/setup.py b/setup.py index 0a3bbe374..25bf112df 100644 --- a/setup.py +++ b/setup.py @@ -26,10 +26,11 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: POSIX :: Linux", "Operating System :: MacOS", ], From cc84e926cc1c848fbefe55831c6d61e713d90d3a Mon Sep 17 00:00:00 2001 From: Kirk Byers Date: Wed, 15 Nov 2023 09:38:40 -0800 Subject: [PATCH 09/11] Require ncclient >= 0.6.15 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b7a20077a..66ba95708 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ netmiko>=4.1.0 junos-eznc>=2.6.3 scp lxml>=4.3.0 -ncclient +ncclient>=0.6.15 ttp ttp_templates netutils>=1.0.0 From b762c194ec42a35d5f26f65ae66acfc1605c59ed Mon Sep 17 00:00:00 2001 From: Kirk Byers Date: Wed, 15 Nov 2023 09:43:26 -0800 Subject: [PATCH 10/11] PIP dependency resolver wouldn't allow this --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 66ba95708..b7a20077a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ netmiko>=4.1.0 junos-eznc>=2.6.3 scp lxml>=4.3.0 -ncclient>=0.6.15 +ncclient ttp ttp_templates netutils>=1.0.0 From d3dd5d26153871eb78fb0cd84b2eca865330a235 Mon Sep 17 00:00:00 2001 From: Brandon Ewing Date: Wed, 31 Jan 2024 10:12:32 -0600 Subject: [PATCH 11/11] require junos-eznc >= 2.7.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b7a20077a..ccd3ef5b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ netaddr pyYAML pyeapi>=1.0.2 netmiko>=4.1.0 -junos-eznc>=2.6.3 +junos-eznc>=2.7.0 scp lxml>=4.3.0 ncclient