From 565c259cf478b69181a55c521e67516a90cc5107 Mon Sep 17 00:00:00 2001 From: Brandon Ewing Date: Sat, 8 Jul 2023 14:52:24 -0500 Subject: [PATCH] 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 57ecd72eb..a070a0f36 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,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)