diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..4d69b064f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM debian:stretch + +## Install min deps +RUN apt-get update + +COPY ./ /var/cache/napalm/ + +## Install NAPALM & underlying libraries dependencies +RUN apt-get install -y python-cffi python-dev libxslt1-dev libssl-dev libffi-dev \ + && apt-get install -y python-pip \ + && pip install -U cffi \ + && pip install -U cryptography \ + && pip install /var/cache/napalm/ + +RUN rm -rf /var/lib/apt/lists/* diff --git a/docs/index.rst b/docs/index.rst index 8693abe97..280445662 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -22,9 +22,7 @@ Supported Network Operating Systems: extras ______ -In addition to the core drivers napalm also supports community driven drivers. You can find more information about them here: - -TBD Link to extras/core drivers' documentation +In addition to the core drivers napalm also supports community driven drivers. You can find more information about them here: :ref:`contributing-drivers` Selecting the right driver -------------------------- diff --git a/docs/support/index.rst b/docs/support/index.rst index 131a6bcf6..d8abbb6df 100644 --- a/docs/support/index.rst +++ b/docs/support/index.rst @@ -109,24 +109,24 @@ NAPALM supports passing certain optional arguments to some drivers. To do that y List of supported optional arguments ____________________________________ -* :code:`allow_agent` (ios, iosxr) - Paramiko argument, enable connecting to the SSH agent (default: ``False``). -* :code:`alt_host_keys` (ios, iosxr) - If ``True``, host keys will be loaded from the file specified in ``alt_key_file``. -* :code:`alt_key_file` (ios, iosxr) - SSH host key file to use (if ``alt_host_keys`` is ``True``). +* :code:`allow_agent` (ios, iosxr, nxos_ssh) - Paramiko argument, enable connecting to the SSH agent (default: ``False``). +* :code:`alt_host_keys` (ios, iosxr, nxos_ssh) - If ``True``, host keys will be loaded from the file specified in ``alt_key_file``. +* :code:`alt_key_file` (ios, iosxr, nxos_ssh) - SSH host key file to use (if ``alt_host_keys`` is ``True``). * :code:`auto_rollback_on_error` (ios) - Disable automatic rollback (certain versions of IOS support configure replace, but not rollback on error) (default: ``True``). * :code:`config_lock` (iosxr, junos) - Lock the config during open() (default: ``False``). * :code:`canonical_int` (ios) - Convert operational interface's returned name to canonical name (fully expanded name) (default: ``False``). * :code:`dest_file_system` (ios) - Destination file system for SCP transfers (default: ``flash:``). * :code:`enable_password` (eos) - Password required to enter privileged exec (enable) (default: ``''``). -* :code:`global_delay_factor` (ios) - Allow for additional delay in command execution (default: ``1``). +* :code:`global_delay_factor` (ios, nxos_ssh) - Allow for additional delay in command execution (default: ``1``). * :code:`ignore_warning` (junos) - Allows to set `ignore_warning` when loading configuration to avoid exceptions via junos-pyez. (default: ``False``). -* :code:`keepalive` (junos, iosxr) - SSH keepalive interval, in seconds (default: ``30`` seconds). -* :code:`key_file` (junos, ios, iosxr) - Path to a private key file. (default: ``False``). -* :code:`port` (eos, iosxr, junos, ios, nxos) - Allows you to specify a port other than the default. -* :code:`secret` (ios) - Password required to enter privileged exec (enable) (default: ``''``). -* :code:`ssh_config_file` (junos, ios, iosxr) - File name of OpenSSH configuration file. -* :code:`ssh_strict` (iosxr, ios) - Automatically reject unknown SSH host keys (default: ``False``, which means unknown SSH host keys will be accepted). +* :code:`keepalive` (iosxr, junos) - SSH keepalive interval, in seconds (default: ``30`` seconds). +* :code:`key_file` (ios, iosxr, junos, nxos_ssh) - Path to a private key file. (default: ``False``). +* :code:`port` (eos, ios, iosxr, junos, nxos, nxos_ssh) - Allows you to specify a port other than the default. +* :code:`secret` (ios, nxos_ssh) - Password required to enter privileged exec (enable) (default: ``''``). +* :code:`ssh_config_file` (ios, iosxr, junos, nxos_ssh) - File name of OpenSSH configuration file. +* :code:`ssh_strict` (ios, iosxr, nxos_ssh) - Automatically reject unknown SSH host keys (default: ``False``, which means unknown SSH host keys will be accepted). * :code:`transport` (eos, ios, nxos) - Protocol to connect with (see `The transport argument`_ for more information). -* :code:`use_keys` (iosxr, ios, panos) - Paramiko argument, enable searching for discoverable private key files in ``~/.ssh/`` (default: ``False``). +* :code:`use_keys` (ios, iosxr, nxos_ssh) - Paramiko argument, enable searching for discoverable private key files in ``~/.ssh/`` (default: ``False``). * :code:`eos_autoComplete` (eos) - Allows to set `autoComplete` when running commands. (default: ``None`` equivalent to ``False``) The transport argument diff --git a/docs/tutorials/index.rst b/docs/tutorials/index.rst index 9a5e87ea6..22fe1f2e5 100644 --- a/docs/tutorials/index.rst +++ b/docs/tutorials/index.rst @@ -13,3 +13,4 @@ Tutorials extend_driver wrapup ansible-napalm + mock_driver diff --git a/docs/tutorials/mock_driver.rst b/docs/tutorials/mock_driver.rst new file mode 100644 index 000000000..8e22f300d --- /dev/null +++ b/docs/tutorials/mock_driver.rst @@ -0,0 +1,178 @@ +Unit tests: Mock driver +======================= + +A mock driver is a software that imitates the response pattern of another +system. It is meant to do nothing but returns the same predictable result, +usually of the cases in a testing environment. + +A driver `mock` can mock all actions done by a common napalm driver. It can be +used for unit tests, either to test napalm itself or inside external projects +making use of napalm. + + +Overview +-------- + +For any action, the ``mock`` driver will use a file matching a specific pattern +to return its content as a result. + +Each of these files will be located inside a directory specified at the driver +initialization. Their names depend on the entire call name made to the +driver, and about their order in the call stack. + + +Replacing a standard driver by a ``mock`` +----------------------------------------- + +Get the driver in napalm:: + + >>> import napalm + >>> driver = napalm.get_network_driver('mock') + +And instantiate it with any host and credentials:: + + device = driver( + hostname='foo', username='user', password='pass', + optional_args={'path': path_to_results} + ) + +Like other drivers, ``mock`` takes optional arguments: + +- ``path`` - Required. Directory where results files are located + +Open the driver:: + + >>> device.open() + +A user should now be able to call any function of a standard driver:: + + >>> device.get_network_instances() + +But should get an error because no mocked data is yet written:: + + NotImplementedError: You can provide mocked data in get_network_instances.1 + + +Mocked data +----------- + +We will use ``/tmp/mock`` as an example of a directory that will contain +our mocked data. Define a device using this path:: + + >>> with driver('foo', 'user', 'pass', optional_args={'path': '/tmp/mock'}) as device: + +Mock a single call +~~~~~~~~~~~~~~~~~~ + +In order to be able to call, for example, ``device.get_interfaces()``, a mocked +data is needed. + +To build the file name that the driver will look for, take the function name +(``get_interfaces``) and suffix it with the place of this call in the device +call stack. + +.. note:: + ``device.open()`` counts as a command. Each following order of call will + start at 1. + +Here, ``get_interfaces`` is the first call made to ``device`` after ``open()``, +so the mocked data need to be put in ``/tmp/mock/get_interfaces.1``:: + + + { + "Ethernet1/1": { + "is_up": true, "is_enabled": true, "description": "", + "last_flapped": 1478175306.5162635, "speed": 10000, + "mac_address": "FF:FF:FF:FF:FF:FF" + }, + "Ethernet1/2": { + "is_up": true, "is_enabled": true, "description": "", + "last_flapped": 1492172106.5163276, "speed": 10000, + "mac_address": "FF:FF:FF:FF:FF:FF" + } + } + +The content is the wanted result of ``get_interfaces`` in JSON, exactly as +another driver would return it. + +Mock multiple iterative calls +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If ``/tmp/mock/get_interfaces.1`` was defined and used, for any other call on +the same device, the number of calls needs to be incremented. + +For example, to call ``device.get_interfaces_ip()`` after +``device.get_interfaces()``, the file ``/tmp/mock/get_interfaces_ip.2`` needs +to be defined:: + + { + "Ethernet1/1": { + "ipv6": {"2001:DB8::": {"prefix_length": 64}} + } + } + +Mock a CLI call +~~~~~~~~~~~~~~~ + +``device.cli(commands)`` calls are a bit different to mock, as a suffix +corresponding to the command applied to the device needs to be added. As +before, the data mocked file will start by ``cli`` and the number of calls done +before (here, ``cli.1``). Then, the same process needs to be applied to each +command. + +Each command needs to be sanitized: any special character (`` -,./\``, etc.) +needs to be replaced by ``_``. Add the index of this command as it is sent to +``device.cli()``. Each file then will contain the raw wanted output of its +associated command. + +Example +^^^^^^^ + +Example with 2 commands, ``show interface Ethernet 1/1`` and ``show interface +Ethernet 1/2``. + +To define the mocked data, create a file ``/tmp/mock/cli.1.show_interface_Ethernet_1_1.0``:: + + Ethernet1/1 is up + admin state is up, Dedicated Interface + +And a file ``/tmp/mock/cli.1.show_interface_Ethernet_1_2.1``:: + + Ethernet1/2 is up + admin state is up, Dedicated Interface + +And now they can be called:: + + >>> device.cli(["show interface Ethernet 1/1", "show interface Ethernet 1/2"]) + + +Mock an error +~~~~~~~~~~~~~ + +The `mock` driver can raise an exception during a call, to simulate an error. +An error definition is actually a json composed of 3 keys: + + * `exception`: the exception type that will be raised + * `args` and `kwargs`: parameters sent to the exception constructor + +For example, to raise the exception `ConnectionClosedException` when calling +``device.get_interfaces()``, the file ``/tmp/mock/get_interfaces.1`` needs to +be defined:: + + { + "exception": "napalm.base.exceptions.ConnectionClosedException", + "args": [ + "Connection closed." + ], + "kwargs": {} + } + +Now calling `get_interfaces()` for the 1st time will raise an exception:: + + >>> device.get_interfaces() + ConnectionClosedException: Connection closed + +As before, mock will depend on the number of calls. If a second file +``/tmp/mock/get_interfaces.2`` was defined and filled with some expected data +(not an exception), retrying `get_interfaces()` will run correctly if the first +exception was caught. diff --git a/napalm/base/helpers.py b/napalm/base/helpers.py index be2b28a00..b007ebfee 100644 --- a/napalm/base/helpers.py +++ b/napalm/base/helpers.py @@ -102,44 +102,46 @@ def textfsm_extractor(cls, template_name, raw_text): :return: table-like list of entries """ textfsm_data = list() - cls.__class__.__name__.replace('Driver', '') - current_dir = os.path.dirname(os.path.abspath(sys.modules[cls.__module__].__file__)) - template_dir_path = '{current_dir}/utils/textfsm_templates'.format( - current_dir=current_dir - ) - template_path = '{template_dir_path}/{template_name}.tpl'.format( - template_dir_path=template_dir_path, - template_name=template_name - ) - - try: - fsm_handler = textfsm.TextFSM(open(template_path)) - except IOError: - raise napalm.base.exceptions.TemplateNotImplemented( - "TextFSM template {template_name}.tpl is not defined under {path}".format( - template_name=template_name, - path=template_dir_path - ) + fsm_handler = None + for c in cls.__class__.mro(): + if c is object: + continue + current_dir = os.path.dirname(os.path.abspath(sys.modules[c.__module__].__file__)) + template_dir_path = '{current_dir}/utils/textfsm_templates'.format( + current_dir=current_dir ) - except textfsm.TextFSMTemplateError as tfte: - raise napalm.base.exceptions.TemplateRenderException( - "Wrong format of TextFSM template {template_name}: {error}".format( - template_name=template_name, - error=py23_compat.text_type(tfte) - ) + template_path = '{template_dir_path}/{template_name}.tpl'.format( + template_dir_path=template_dir_path, + template_name=template_name ) - objects = fsm_handler.ParseText(raw_text) - - for obj in objects: - index = 0 - entry = {} - for entry_value in obj: - entry[fsm_handler.header[index].lower()] = entry_value - index += 1 - textfsm_data.append(entry) + try: + with open(template_path) as f: + fsm_handler = textfsm.TextFSM(f) + + for obj in fsm_handler.ParseText(raw_text): + entry = {} + for index, entry_value in enumerate(obj): + entry[fsm_handler.header[index].lower()] = entry_value + textfsm_data.append(entry) + + return textfsm_data + except IOError: # Template not present in this class + continue # Continue up the MRO + except textfsm.TextFSMTemplateError as tfte: + raise napalm.base.exceptions.TemplateRenderException( + "Wrong format of TextFSM template {template_name}: {error}".format( + template_name=template_name, + error=py23_compat.text_type(tfte) + ) + ) - return textfsm_data + raise napalm.base.exceptions.TemplateNotImplemented( + "TextFSM template {template_name}.tpl is not defined under {path}".format( + template_name=template_name, + path=template_dir_path + ) + ) def find_txt(xml_tree, path, default=''): diff --git a/napalm/base/mock.py b/napalm/base/mock.py index fe5aa92e0..946680dda 100644 --- a/napalm/base/mock.py +++ b/napalm/base/mock.py @@ -17,9 +17,9 @@ from __future__ import unicode_literals from napalm.base.base import NetworkDriver +from napalm.base.utils import py23_compat import napalm.base.exceptions -import inspect import json import os import re @@ -28,10 +28,6 @@ from pydoc import locate -# inspect.getargspec deprecated in Python 3.5, use getfullargspec if available -inspect_getargspec = getattr(inspect, "getfullargspec", inspect.getargspec) - - def raise_exception(result): exc = locate(result["exception"]) if exc: @@ -49,7 +45,7 @@ def is_mocked_method(method): def mocked_method(path, name, count): parent_method = getattr(NetworkDriver, name) - parent_method_args = inspect_getargspec(parent_method) + parent_method_args = py23_compat.argspec(parent_method) modifier = 0 if 'self' not in parent_method_args.args else 1 def _mocked_method(*args, **kwargs): diff --git a/napalm/base/netmiko_helpers.py b/napalm/base/netmiko_helpers.py index a75922b5a..f85745a0b 100644 --- a/napalm/base/netmiko_helpers.py +++ b/napalm/base/netmiko_helpers.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations under # the License. from __future__ import unicode_literals -import inspect +from napalm.base.utils import py23_compat from netmiko import BaseConnection @@ -20,13 +20,15 @@ def netmiko_args(optional_args): Return a dictionary of these optional args that will be passed into the Netmiko ConnectHandler call. """ - netmiko_args, _, _, netmiko_defaults = inspect.getargspec(BaseConnection.__init__) + fields = py23_compat.argspec(BaseConnection.__init__) + args = fields[0] + defaults = fields[3] - check_self = netmiko_args.pop(0) + check_self = args.pop(0) if check_self != 'self': raise ValueError("Error processing Netmiko arguments") - netmiko_argument_map = dict(zip(netmiko_args, netmiko_defaults)) + netmiko_argument_map = dict(zip(args, defaults)) # Netmiko arguments that are integrated into NAPALM already netmiko_filter = ['ip', 'host', 'username', 'password', 'device_type', 'timeout'] diff --git a/napalm/base/test/getters.py b/napalm/base/test/getters.py index fa5e08806..a3331ceff 100644 --- a/napalm/base/test/getters.py +++ b/napalm/base/test/getters.py @@ -19,15 +19,11 @@ from napalm.base import NetworkDriver # text_type is 'unicode' for py2 and 'str' for py3 -from napalm.base.utils.py23_compat import text_type +from napalm.base.utils.py23_compat import text_type, argspec from napalm.base.test import conftest -# inspect.getargspec deprecated in Python 3.5, use getfullargspec if available -inspect_getargspec = getattr(inspect, "getfullargspec", inspect.getargspec) - - def list_dicts_diff(prv, nxt): """Compare two lists of dicts.""" result = [] @@ -137,17 +133,17 @@ def test_method_signatures(self): continue try: orig = getattr(NetworkDriver, attr) - orig_spec = inspect_getargspec(orig) + orig_spec = argspec(orig) except AttributeError: orig_spec = 'Method does not exist in napalm.base' - func_spec = inspect_getargspec(func) + func_spec = argspec(func) if orig_spec != func_spec: errors[attr] = (orig_spec, func_spec) EXTRA_METHODS = ['__init__', ] for method in EXTRA_METHODS: - orig_spec = inspect_getargspec(getattr(NetworkDriver, method)) - func_spec = inspect_getargspec(getattr(cls, method)) + orig_spec = argspec(getattr(NetworkDriver, method)) + func_spec = argspec(getattr(cls, method)) if orig_spec != func_spec: errors[attr] = (orig_spec, func_spec) diff --git a/napalm/base/utils/py23_compat.py b/napalm/base/utils/py23_compat.py index fb753e176..7f84eb6b2 100644 --- a/napalm/base/utils/py23_compat.py +++ b/napalm/base/utils/py23_compat.py @@ -3,13 +3,26 @@ from __future__ import unicode_literals import sys +import inspect PY2 = sys.version_info.major == 2 PY3 = sys.version_info.major == 3 -if sys.version_info.major == 3: + +def argspec(*args, **kwargs): + if PY2: + # (args, varargs, keywords, defaults) + return inspect.getargspec(*args, **kwargs) + elif PY3: + # (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations) + return inspect.getfullargspec(*args, **kwargs) + + +if PY3: string_types = (str,) text_type = str -else: +elif PY2: string_types = (basestring,) # noqa text_type = unicode # noqa +else: + raise ValueError("Invalid version of Python dectected") diff --git a/napalm/base/validate.py b/napalm/base/validate.py index 13cdc430d..c3224c15b 100644 --- a/napalm/base/validate.py +++ b/napalm/base/validate.py @@ -22,7 +22,7 @@ def _get_validation_file(validation_file): try: with open(validation_file, 'r') as stream: try: - validation_source = yaml.load(stream) + validation_source = yaml.safe_load(stream) except yaml.YAMLError as exc: raise ValidationException(exc) except IOError: diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index ec50439a6..79f3b6cd6 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -63,7 +63,7 @@ class EOSDriver(NetworkDriver): _RE_BGP_INFO = re.compile(r'BGP neighbor is (?P.*?), remote AS (?P.*?), .*') # noqa _RE_BGP_RID_INFO = re.compile(r'.*BGP version 4, remote router ID (?P.*?), VRF (?P.*?)$') # noqa - _RE_BGP_DESC = re.compile(r'\s+Description: (?P.*?)') + _RE_BGP_DESC = re.compile(r'\s+Description: (?P.*?)$') _RE_BGP_LOCAL = re.compile(r'Local AS is (?P.*?),.*') _RE_BGP_PREFIX = re.compile(r'(\s*?)(?PIPv[46]) Unicast:\s*(?P\d+)\s*(?P\d+)') # noqa _RE_SNMP_COMM = re.compile(r"""^snmp-server\s+community\s+(?P\S+) @@ -542,9 +542,9 @@ def extract_temperature_data(data): if not is_veos: for psu, data in power_output['powerSupplies'].items(): environment_counters['power'][psu] = { - 'status': data['state'] == 'ok', - 'capacity': data['capacity'], - 'output': data['outputPower'] + 'status': data.get('state', 'ok') == 'ok', + 'capacity': data.get('capacity', -1.0), + 'output': data.get('outputPower', -1.0), } cpu_lines = cpu_output.splitlines() # Matches either of @@ -1067,12 +1067,9 @@ def get_route_to(self, destination='', protocol=''): if protocol.lower() == 'direct': protocol = 'connected' - try: - ipv = '' - if IPNetwork(destination).version == 6: - ipv = 'v6' - except AddrFormatError: - return 'Please specify a valid destination!' + ipv = '' + if IPNetwork(destination).version == 6: + ipv = 'v6' commands = [] for _vrf in vrfs: diff --git a/napalm/eos/utils/textfsm_templates/vrf.tpl b/napalm/eos/utils/textfsm_templates/vrf.tpl index fb53d2030..17f9eac46 100644 --- a/napalm/eos/utils/textfsm_templates/vrf.tpl +++ b/napalm/eos/utils/textfsm_templates/vrf.tpl @@ -4,7 +4,7 @@ Value List Interfaces (.+?) Start - ^(\s)?\S+\s+(\d|<) -> Continue.Record + ^(\s+)?\S+\s+(\d|<) -> Continue.Record ^(\s+)?${Name}\s+${Route_Distinguisher}\s+(ipv4(,ipv6)?\s+)?v4:(incomplete|(no )?routing(; multicast)?),\s+${Interfaces}(?:,|\s|$$) -> Continue ^(\s+)?\S+\s+(?:\d+:\d+|)\s+(ipv4(,ipv6)?\s+)?v4:(incomplete|(no )?routing(; multicast)?),\s+(.+?),\s${Interfaces}(\s|,|$$) -> Continue ^(\s+)?\S+\s+(?:\d+:\d+|)\s+(ipv4(,ipv6)?\s+)?v4:(incomplete|(no )?routing(; multicast)?),\s+(.+?),\s(.+?),\s${Interfaces}(\s|,|$$) -> Continue diff --git a/napalm/ios/ios.py b/napalm/ios/ios.py index 0baa27c08..1fd6a6ffc 100644 --- a/napalm/ios/ios.py +++ b/napalm/ios/ios.py @@ -2163,24 +2163,21 @@ def ping(self, destination, source=C.PING_SOURCE, ttl=C.PING_TTL, timeout=C.PING } for line in output.splitlines(): - fields = line.split() - if 'Success rate is 0' in line: - sent_and_received = re.search(r'\((\d*)/(\d*)\)', fields[5]) - probes_sent = int(sent_and_received.groups()[0]) - probes_received = int(sent_and_received.groups()[1]) - ping_dict['success']['probes_sent'] = probes_sent - ping_dict['success']['packet_loss'] = probes_sent - probes_received - elif 'Success rate is' in line: - sent_and_received = re.search(r'\((\d*)/(\d*)\)', fields[5]) - probes_sent = int(sent_and_received.groups()[0]) - probes_received = int(sent_and_received.groups()[1]) - min_avg_max = re.search(r'(\d*)/(\d*)/(\d*)', fields[9]) + if 'Success rate is' in line: + sent_and_received = re.search(r'\((\d*)/(\d*)\)', line) + probes_sent = int(sent_and_received.group(2)) + probes_received = int(sent_and_received.group(1)) ping_dict['success']['probes_sent'] = probes_sent ping_dict['success']['packet_loss'] = probes_sent - probes_received + # If there were zero valid response packets, we are done + if 'Success rate is 0 ' in line: + break + + min_avg_max = re.search(r'(\d*)/(\d*)/(\d*)', line) ping_dict['success'].update({ - 'rtt_min': float(min_avg_max.groups()[0]), - 'rtt_avg': float(min_avg_max.groups()[1]), - 'rtt_max': float(min_avg_max.groups()[2]), + 'rtt_min': float(min_avg_max.group(1)), + 'rtt_avg': float(min_avg_max.group(2)), + 'rtt_max': float(min_avg_max.group(3)), }) results_array = [] for i in range(probes_received): diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index 24965e306..836080ad4 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -300,7 +300,12 @@ def _convert_to_dict(interfaces): for iface in interfaces.keys(): result[iface] = { 'is_up': interfaces[iface]['is_up'], - 'is_enabled': interfaces[iface]['is_enabled'], + # For physical interfaces will always be there, so just + # return the value interfaces[iface]['is_enabled'] + # For logical interfaces if is present interface is disabled, + # otherwise interface is enabled + 'is_enabled': (True if interfaces[iface]['is_enabled'] is None + else interfaces[iface]['is_enabled']), 'description': (interfaces[iface]['description'] or u''), 'last_flapped': float((interfaces[iface]['last_flapped'] or -1)), 'mac_address': napalm.base.helpers.convert( @@ -755,12 +760,16 @@ def get_lldp_neighbors_detail(self, interface=''): 'EX3400': rpc_call_without_information, 'EX4300-48P': rpc_call_without_information, 'EX4600-40F': rpc_call_without_information, + 'QFX5100-48S-6Q': rpc_call_without_information, 'QFX5110-48S-4C': rpc_call_without_information, 'QFX10002-36Q': rpc_call_without_information, - 'QFX10008': rpc_call_without_information + 'QFX10008': rpc_call_without_information, + 'EX2300-24P': rpc_call_without_information, + 'EX2300-C-12P': rpc_call_without_information }, 'SRX_BRANCH': { - 'default': rpc_call_with_information + 'default': rpc_call_with_information, + 'SRX300': rpc_call_without_information }, 'SRX_HIGHEND': { 'default': rpc_call_without_information @@ -1611,7 +1620,7 @@ def get_route_to(self, destination='', protocol=''): d = {} # next_hop = route[0] d = {elem[0]: elem[1] for elem in route[1]} - destination = napalm.base.helpers.ip(d.pop('destination', '')) + destination = d.pop('destination', '') prefix_length = d.pop('prefix_length', 32) destination = '{d}/{p}'.format( d=destination, diff --git a/napalm/junos/utils/junos_views.py b/napalm/junos/utils/junos_views.py index 6b4ac7fe0..b14292e36 100755 --- a/napalm/junos/utils/junos_views.py +++ b/napalm/junos/utils/junos_views.py @@ -17,7 +17,7 @@ def _preprocess_yml(path): def _loadyaml_bypass(yaml_str): """Bypass Juniper's loadyaml and directly call FactoryLoader""" - return FactoryLoader().load(yaml.load(yaml_str)) + return FactoryLoader().load(yaml.safe_load(yaml_str)) _YAML_ = splitext(__file__)[0] + '.yml' diff --git a/napalm/junos/utils/junos_views.yml b/napalm/junos/utils/junos_views.yml index 714844434..a6443aca4 100644 --- a/napalm/junos/utils/junos_views.yml +++ b/napalm/junos/utils/junos_views.yml @@ -30,7 +30,8 @@ junos_logical_iface_table: junos_logical_iface_view: fields: is_up: { ../oper-status: True=up } - is_enabled: { if-config-flags/iff-up: flag } + # Return False if iff-down flag is present. If not is_enabled == True + is_enabled: { if-config-flags/iff-down: False=regex(iff-down) } description: { description: unicode } last_flapped: { ../interface-flapped/@seconds: int } speed: ../speed diff --git a/napalm/nxos_ssh/nxos_ssh.py b/napalm/nxos_ssh/nxos_ssh.py index e2ba33889..b52d516e1 100644 --- a/napalm/nxos_ssh/nxos_ssh.py +++ b/napalm/nxos_ssh/nxos_ssh.py @@ -89,8 +89,8 @@ def parse_intf_section(interface): re_is_enabled_1 = r"^admin state is (?P\S+)$" re_is_enabled_2 = r"^admin state is (?P\S+), " re_is_enabled_3 = r"^.* is down.*Administratively down.*$" - re_mac = r"^\s+Hardware:\s+(?P.*), address:\s+(?P\S+) " - re_speed = r"\s+MTU .*, BW (?P\S+) (?P\S+), " + re_mac = r"^\s+Hardware:\s+(?P.*),\s+address:\s+(?P\S+) " + re_speed = r"\s+MTU .*,\s+BW\s+(?P\S+)\s+(?P\S+), " re_description_1 = r"^\s+Description:\s+(?P.*) (?:MTU|Internet)" re_description_2 = r"^\s+Description:\s+(?P.*)$" re_hardware = r"^.* Hardware: (?P\S+)$" diff --git a/setup.py b/setup.py index 20bb7d85c..82e0b751b 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name="napalm", - version='2.3.2', + version='2.3.3', packages=find_packages(exclude=("test*", )), test_suite='test_base', author="David Barroso, Kirk Byers, Mircea Ulinic", diff --git a/test/eos/mocked_data/test_get_environment/issue810_7010t/expected_result.json b/test/eos/mocked_data/test_get_environment/issue810_7010t/expected_result.json new file mode 100644 index 000000000..399cdaaa0 --- /dev/null +++ b/test/eos/mocked_data/test_get_environment/issue810_7010t/expected_result.json @@ -0,0 +1,73 @@ +{ + "fans": { + "1": { + "status": true + }, + "2": { + "status": true + } + }, + "temperature": { + "TempSensor1": { + "temperature": 37.751111950905496, + "is_alert": false, + "is_critical": false + }, + "TempSensor2": { + "temperature": 36.0, + "is_alert": false, + "is_critical": false + }, + "TempSensor3": { + "temperature": 35.875, + "is_alert": false, + "is_critical": false + }, + "TempSensor4": { + "temperature": 27.0, + "is_alert": false, + "is_critical": false + }, + "TempSensor5": { + "temperature": 22.75, + "is_alert": false, + "is_critical": false + }, + "TempSensor6": { + "temperature": 51.473600000000005, + "is_alert": false, + "is_critical": false + }, + "TempSensor7": { + "temperature": 52.016000000000005, + "is_alert": false, + "is_critical": false + }, + "TempSensor8": { + "temperature": 50.3888, + "is_alert": false, + "is_critical": false + } + }, + "power": { + "1": { + "status": true, + "capacity": 65.0, + "output": -1.0 + }, + "2": { + "status": false, + "capacity": 65.0, + "output": -1.0 + } + }, + "cpu": { + "0": { + "%usage": 10.3 + } + }, + "memory": { + "available_ram": 3886752, + "used_ram": 3780968 + } +} diff --git a/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_cooling.json b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_cooling.json new file mode 100644 index 000000000..f0e070f1c --- /dev/null +++ b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_cooling.json @@ -0,0 +1,45 @@ +{ + "overrideFanSpeed": 0, + "coolingMode": "automatic", + "powerSupplySlots": [], + "fanTraySlots": [ + { + "status": "ok", + "fans": [ + { + "status": "ok", + "uptime": 1531344413.6203134, + "maxSpeed": 12500, + "lastSpeedStableChangeTime": 1531344461.821326, + "configuredSpeed": 40, + "actualSpeed": 40, + "speedStable": true, + "label": "1/1" + } + ], + "speed": 40, + "label": "1" + }, + { + "status": "ok", + "fans": [ + { + "status": "ok", + "uptime": 1531344413.620448, + "maxSpeed": 12500, + "lastSpeedStableChangeTime": 1531344461.8213885, + "configuredSpeed": 40, + "actualSpeed": 40, + "speedStable": true, + "label": "2/1" + } + ], + "speed": 40, + "label": "2" + } + ], + "shutdownOnInsufficientFans": true, + "ambientTemperature": 22.75, + "systemStatus": "coolingOk", + "airflowDirection": "backToFrontAirflow" +} diff --git a/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_power.json b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_power.json new file mode 100644 index 000000000..2e58ee6b0 --- /dev/null +++ b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_power.json @@ -0,0 +1,21 @@ +{ + "powerSupplies": { + "1": { + "uptime": 1531344080.347931, + "modelName": "PWR-00194-01", + "capacity": 65.0, + "fans": {}, + "tempSensors": {}, + "managed": false, + "state": "ok" + }, + "2": { + "fans": {}, + "modelName": "PWR-00194-01", + "capacity": 65.0, + "tempSensors": {}, + "managed": false, + "state": "powerLoss" + } + } +} diff --git a/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_temperature.json b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_temperature.json new file mode 100644 index 000000000..3a07c12c5 --- /dev/null +++ b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_environment_temperature.json @@ -0,0 +1,128 @@ +{ + "cardSlots": [], + "powerSupplySlots": [], + "shutdownOnOverheat": true, + "tempSensors": [ + { + "maxTemperature": 42.202647053106695, + "maxTemperatureLastChange": 1531744107.3946292, + "hwStatus": "ok", + "currentTemperature": 37.751111950905496, + "description": "Cpu temp sensor", + "overheatThreshold": 105.0, + "criticalThreshold": 115.0, + "inAlertState": false, + "relPos": "1", + "alertCount": 0, + "pidDriverCount": 0, + "isPidDriver": false, + "name": "TempSensor1" + }, + { + "maxTemperature": 40.0, + "maxTemperatureLastChange": 1532562297.5917792, + "hwStatus": "ok", + "currentTemperature": 36.0, + "description": "Front internal sensor", + "overheatThreshold": 75.0, + "criticalThreshold": 85.0, + "inAlertState": false, + "relPos": "2", + "alertCount": 0, + "pidDriverCount": 0, + "isPidDriver": false, + "name": "TempSensor2" + }, + { + "maxTemperature": 39.25, + "maxTemperatureLastChange": 1532029012.2993102, + "hwStatus": "ok", + "currentTemperature": 35.875, + "description": "Front external sensor", + "overheatThreshold": 60.0, + "criticalThreshold": 75.0, + "inAlertState": false, + "relPos": "3", + "alertCount": 0, + "pidDriverCount": 0, + "isPidDriver": false, + "name": "TempSensor3" + }, + { + "maxTemperature": 31.0, + "maxTemperatureLastChange": 1532633354.0643, + "hwStatus": "ok", + "currentTemperature": 27.0, + "description": "Rear internal sensor", + "overheatThreshold": 75.0, + "criticalThreshold": 85.0, + "inAlertState": false, + "relPos": "4", + "alertCount": 0, + "pidDriverCount": 0, + "isPidDriver": false, + "name": "TempSensor4" + }, + { + "maxTemperature": 26.0, + "maxTemperatureLastChange": 1532453101.851557, + "hwStatus": "ok", + "currentTemperature": 22.75, + "description": "Rear external sensor", + "overheatThreshold": 60.0, + "criticalThreshold": 75.0, + "inAlertState": false, + "relPos": "5", + "alertCount": 0, + "pidDriverCount": 0, + "isPidDriver": false, + "name": "TempSensor5" + }, + { + "maxTemperature": 55.2704, + "maxTemperatureLastChange": 1532633848.5057478, + "hwStatus": "ok", + "currentTemperature": 51.473600000000005, + "description": "Switch ASIC Center", + "overheatThreshold": 100.0, + "criticalThreshold": 110.0, + "inAlertState": false, + "relPos": "6", + "alertCount": 0, + "pidDriverCount": 0, + "isPidDriver": false, + "name": "TempSensor6" + }, + { + "maxTemperature": 55.8128, + "maxTemperatureLastChange": 1532632510.879678, + "hwStatus": "ok", + "currentTemperature": 52.016000000000005, + "description": "Switch ASIC Lower Left Corner", + "overheatThreshold": 100.0, + "criticalThreshold": 110.0, + "inAlertState": false, + "relPos": "7", + "alertCount": 0, + "pidDriverCount": 0, + "isPidDriver": false, + "name": "TempSensor7" + }, + { + "maxTemperature": 54.18560000000001, + "maxTemperatureLastChange": 1532636022.9700015, + "hwStatus": "ok", + "currentTemperature": 50.3888, + "description": "Switch ASIC Upper Right Edge", + "overheatThreshold": 100.0, + "criticalThreshold": 110.0, + "inAlertState": false, + "relPos": "8", + "alertCount": 0, + "pidDriverCount": 0, + "isPidDriver": false, + "name": "TempSensor8" + } + ], + "systemStatus": "temperatureOk" +} diff --git a/test/eos/mocked_data/test_get_environment/issue810_7010t/show_processes_top_once.text b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_processes_top_once.text new file mode 100644 index 000000000..f5f07db8f --- /dev/null +++ b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_processes_top_once.text @@ -0,0 +1,305 @@ +top - 17:19:10 up 67 days, 19:57, 0 users, load average: 0.74, 0.66, 0.74 +Tasks: 298 total, 1 running, 297 sleeping, 0 stopped, 0 zombie +%Cpu(s): 8.5 us, 1.4 sy, 0.0 ni, 89.7 id, 0.0 wa, 0.3 hi, 0.1 si, 0.0 st +KiB Mem: 3886752 total, 3780968 used, 105784 free, 218720 buffers +KiB Swap: 0 total, 0 used, 0 free, 2016280 cached + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 3361 root 20 0 519m 126m 104m S 45.4 3.3 4551:22 StrataCounters +11060 network_ 20 0 14308 7656 6684 R 27.2 0.2 0:00.12 top + 1693 root 20 0 587m 291m 222m S 9.1 7.7 586:17.02 Sysdb + 2309 root 20 0 583m 98m 71m S 4.5 2.6 214:41.31 Aaa + 2512 root 20 0 506m 91m 73m S 4.5 2.4 389:57.29 Smbus + 3339 root 20 0 503m 81m 62m S 4.5 2.2 634:22.10 AgentMonitor + 1 root 20 0 8428 5840 4356 S 0.0 0.2 8:35.44 systemd + 2 root 20 0 0 0 0 S 0.0 0.0 0:00.46 kthreadd + 3 root 20 0 0 0 0 S 0.0 0.0 3:12.96 ksoftirqd/0 + 5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H + 7 root 20 0 0 0 0 S 0.0 0.0 51:24.65 rcu_preempt + 8 root 20 0 0 0 0 S 0.0 0.0 0:00.24 rcu_sched + 9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh + 10 root rt 0 0 0 0 S 0.0 0.0 0:17.40 migration/0 + 11 root rt 0 0 0 0 S 0.0 0.0 6:03.87 watchdog/0 + 12 root rt 0 0 0 0 S 0.0 0.0 5:55.78 watchdog/1 + 13 root rt 0 0 0 0 S 0.0 0.0 0:17.00 migration/1 + 14 root 20 0 0 0 0 S 0.0 0.0 3:34.56 ksoftirqd/1 + 16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0H + 17 root rt 0 0 0 0 S 0.0 0.0 5:49.03 watchdog/2 + 18 root rt 0 0 0 0 S 0.0 0.0 0:16.55 migration/2 + 19 root 20 0 0 0 0 S 0.0 0.0 3:08.29 ksoftirqd/2 + 21 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/2:0H + 22 root rt 0 0 0 0 S 0.0 0.0 5:49.26 watchdog/3 + 23 root rt 0 0 0 0 S 0.0 0.0 0:16.82 migration/3 + 24 root 20 0 0 0 0 S 0.0 0.0 3:10.40 ksoftirqd/3 + 26 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/3:0H + 27 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 khelper + 28 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs + 29 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns + 30 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 perf + 31 root 20 0 0 0 0 S 0.0 0.0 0:01.05 khungtaskd + 32 root 20 0 0 0 0 S 0.0 0.0 5:35.38 khungtaskd2 + 33 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback + 34 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 crypto + 35 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset + 36 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd + 37 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ata_sff + 38 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 edac-poller + 39 root 20 0 0 0 0 S 0.0 0.0 0:00.18 dst_gc_task + 40 root 20 0 0 0 0 S 0.0 0.0 0:00.00 arp_cache-prd + 42 root 20 0 0 0 0 S 0.0 0.0 3:21.02 icmp_unreachabl + 43 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 rpciod + 47 root 20 0 0 0 0 S 0.0 0.0 0:01.37 kswapd0 + 48 root 20 0 0 0 0 S 0.0 0.0 0:00.00 fsnotify_mark + 49 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 nfsiod + 54 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 pcielwd + 56 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0 + 57 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_0 + 58 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1 + 59 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_1 + 63 root -51 0 0 0 0 S 0.0 0.0 0:00.00 irq/16-mmc0 + 64 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ndisc_cache-prd + 65 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ipv6_addrconf + 66 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ecc_log_wq + 67 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 deferwq + 70 root 20 0 0 0 0 S 0.0 0.0 0:05.73 mmcqd/0 + 71 root 20 0 0 0 0 S 0.0 0.0 0:00.02 mmcqd/0boot0 + 72 root 20 0 0 0 0 S 0.0 0.0 0:00.02 mmcqd/0boot1 + 73 root 20 0 0 0 0 S 0.0 0.0 0:00.05 mmcqd/0rpmb + 312 root 0 -20 0 0 0 S 0.0 0.0 0:01.72 loop0 + 360 root 20 0 12124 4064 3496 S 0.0 0.1 0:00.61 systemd-udevd + 511 root 20 0 0 0 0 S 0.0 0.0 0:00.13 kworker/u8:1 + 540 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kvm-irqfd-clean + 940 root 20 0 5968 3544 2892 S 0.0 0.1 0:39.25 crond + 944 root 20 0 6032 3892 3428 S 0.0 0.1 0:38.79 systemd-logind + 945 dbus 20 0 13988 8524 7728 S 0.0 0.2 0:32.73 dbus-daemon + 967 root 20 0 4408 2652 2452 S 0.0 0.1 0:00.00 mcelog + 1247 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kworker/1:0 + 1380 root 20 0 90428 9676 5776 S 0.0 0.2 0:00.00 watchdog + 1382 root 15 -5 92476 9068 5168 S 0.0 0.2 17:22.89 wdog-cld + 1437 root 20 0 8580 5496 2832 S 0.0 0.1 0:00.00 python + 1438 root 20 0 8564 5568 2892 S 0.0 0.1 0:00.00 python + 1440 root 20 0 11360 7148 6648 S 0.0 0.2 0:00.94 ConnMgr + 1441 root 0 -20 4388 3196 2980 S 0.0 0.1 25:21.45 TimeAgent + 1503 root 20 0 501m 48m 31m S 0.0 1.3 0:00.01 netnsd-watcher + 1505 root 20 0 501m 48m 30m S 0.0 1.3 0:01.21 netnsd-server + 1514 root 20 0 522m 56m 34m S 0.0 1.5 0:00.01 ProcMgr-master + 1515 root 20 0 523m 58m 35m S 0.0 1.5 1408:26 ProcMgr-worker + 1527 root 20 0 8056 5024 2900 S 0.0 0.1 0:01.42 python + 1528 root 20 0 4344 1388 1228 S 0.0 0.0 0:00.18 inotifywait + 1539 root 20 0 8056 5112 2988 S 0.0 0.1 0:00.01 python + 1540 root 20 0 4344 1484 1328 S 0.0 0.0 0:00.00 inotifywait + 1552 root 20 0 8060 5060 2936 S 0.0 0.1 0:00.00 python + 1553 root 20 0 4416 2324 2108 S 0.0 0.1 0:00.00 inotifywait + 1636 root 20 0 4216 176 0 S 0.0 0.0 203:12.52 EosOomAdjust + 1647 root 20 0 0 0 0 S 0.0 0.0 5:45.06 rbfd_vrf_cleanu + 1692 root 20 0 4208 2308 2132 S 0.0 0.1 18:45.03 SlabMonitor + 1786 root 20 0 527m 95m 70m S 0.0 2.5 9:16.49 StageMgr + 1788 root 20 0 729m 404m 286m S 0.0 10.7 6005:31 ConfigAgent + 1799 root 20 0 544m 151m 122m S 0.0 4.0 26:07.82 Fru + 1807 root 20 0 532m 146m 116m S 0.0 3.9 20:02.73 Launcher + 2294 root 20 0 566m 141m 107m S 0.0 3.7 666:47.06 SuperServer + 2310 root 20 0 4408 1516 1340 S 0.0 0.0 0:00.02 netns + 2312 root 20 0 501m 46m 28m S 0.0 1.2 0:00.01 netnsd-session + 2314 root 20 0 514m 129m 108m S 0.0 3.4 14:22.37 Ira + 2321 root 20 0 4408 1460 1284 S 0.0 0.0 0:00.02 netns + 2323 root 20 0 501m 46m 28m S 0.0 1.2 0:00.01 netnsd-session + 2324 root 20 0 508m 116m 96m S 0.0 3.1 12:51.04 MaintenanceMode + 2331 root 20 0 4408 1460 1284 S 0.0 0.0 0:00.01 netns + 2332 root 20 0 501m 46m 28m S 0.0 1.2 0:00.01 netnsd-session + 2333 root 20 0 511m 124m 103m S 0.0 3.3 12:05.80 Bfd + 2424 root 20 0 527m 95m 70m S 0.0 2.5 223:45.18 PhyEthtool + 2464 root 20 0 4408 1476 1300 S 0.0 0.0 0:00.01 netns + 2469 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2471 root 20 0 504m 83m 65m S 0.0 2.2 11:22.03 PciBus + 2475 root 20 0 4408 1464 1284 S 0.0 0.0 0:00.01 netns + 2480 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2483 root 20 0 503m 79m 61m S 0.0 2.1 8:11.81 ReloadCauseAgen + 2487 root 20 0 4408 1504 1328 S 0.0 0.0 0:00.01 netns + 2492 root 20 0 501m 46m 28m S 0.0 1.2 0:00.01 netnsd-session + 2500 root 20 0 515m 94m 75m S 0.0 2.5 46:38.41 Scd + 2506 root 20 0 4408 1496 1316 S 0.0 0.0 0:00.02 netns + 2509 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2520 root 20 0 4408 1520 1340 S 0.0 0.0 0:00.01 netns + 2522 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2524 root 20 0 513m 123m 103m S 0.0 3.3 32:52.44 Ebra + 2563 root 20 0 11432 3112 2376 S 0.0 0.1 0:00.01 nginx + 2565 nobody 20 0 21152 12m 10m S 0.0 0.3 144:03.11 nginx + 2604 root 20 0 4408 1504 1328 S 0.0 0.0 0:00.01 netns + 2606 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2607 root 20 0 504m 85m 66m S 0.0 2.2 59:44.43 Max6658 + 2608 root 20 0 4408 1492 1316 S 0.0 0.0 0:00.01 netns + 2609 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2610 root 20 0 504m 80m 62m S 0.0 2.1 8:05.56 PowerManager + 2612 root 20 0 4408 1492 1316 S 0.0 0.0 0:00.01 netns + 2613 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2614 root 20 0 504m 85m 67m S 0.0 2.3 8:54.05 FanDetector + 2620 root 20 0 4408 1480 1300 S 0.0 0.0 0:00.02 netns + 2622 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2626 root 20 0 507m 118m 98m S 0.0 3.1 14:57.67 StrataCentral + 2631 root 20 0 4408 1484 1308 S 0.0 0.0 0:00.01 netns + 2633 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2635 root 20 0 503m 83m 64m S 0.0 2.2 8:25.16 GpioLed + 2646 root 20 0 4408 1532 1356 S 0.0 0.0 0:00.01 netns + 2647 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2648 root 20 0 506m 89m 71m S 0.0 2.4 39:14.18 Thermostat + 2650 root 20 0 4408 1492 1316 S 0.0 0.0 0:00.01 netns + 2651 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2652 root 20 0 504m 89m 70m S 0.0 2.4 194:52.85 StandbyCpld + 2784 root 20 0 4408 1452 1276 S 0.0 0.0 0:00.01 netns + 2785 root 20 0 501m 46m 28m S 0.0 1.2 0:00.01 netnsd-session + 2787 root 20 0 506m 109m 90m S 0.0 2.9 10:35.32 LacpTxAgent + 2790 root 20 0 4408 1504 1328 S 0.0 0.0 0:00.01 netns + 2792 root 20 0 501m 46m 28m S 0.0 1.2 0:00.01 netnsd-session + 2793 root 20 0 506m 107m 88m S 0.0 2.8 12:25.25 PortSec + 2801 root 20 0 5592 2572 2272 S 0.0 0.1 0:02.43 xinetd + 2805 root 20 0 4408 1492 1316 S 0.0 0.0 0:00.01 netns + 2808 root 20 0 501m 46m 28m S 0.0 1.2 0:00.01 netnsd-session + 2810 root 20 0 544m 155m 104m S 0.0 4.1 43:56.09 StrataVlanTopo + 2812 root 20 0 4408 1508 1328 S 0.0 0.0 0:00.01 netns + 2814 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2815 root 20 0 507m 111m 91m S 0.0 2.9 307:03.62 StpTxRx + 2819 root 20 0 4408 1524 1344 S 0.0 0.0 0:00.01 netns + 2820 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2821 root 20 0 509m 135m 113m S 0.0 3.6 30:43.60 Lag + 2827 root 20 0 531m 116m 91m S 0.0 3.1 53:33.14 XcvrAgent + 2832 root 20 0 4408 1460 1284 S 0.0 0.0 0:00.01 netns + 2834 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2835 root 20 0 505m 105m 86m S 0.0 2.8 10:34.53 StpTopology + 2837 root 20 0 4408 1492 1316 S 0.0 0.0 0:00.01 netns + 2842 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2843 root 20 0 510m 121m 101m S 0.0 3.2 80:25.82 Acl + 2855 root 20 0 4408 1532 1356 S 0.0 0.0 0:00.01 netns + 2858 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2859 root 20 0 507m 95m 77m S 0.0 2.5 98:47.81 Stp + 2861 root 20 0 4408 1504 1328 S 0.0 0.0 0:00.01 netns + 2862 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2863 root 20 0 517m 136m 114m S 0.0 3.6 13:52.88 StrataLag + 2866 root 20 0 4204 176 0 S 0.0 0.0 0:00.00 conlogd + 2867 root 20 0 5392 3372 3128 S 0.0 0.1 0:00.00 sh + 2868 root 20 0 4284 2696 2500 S 0.0 0.1 0:00.04 agetty + 2869 root 20 0 4216 2388 2212 S 0.0 0.1 0:00.04 mingetty + 2871 root 20 0 4264 1376 1228 S 0.0 0.0 2:33.21 tail + 2872 root 20 0 4828 2232 2040 S 0.0 0.1 0:00.00 sed + 2879 root 20 0 4408 1484 1308 S 0.0 0.0 0:00.01 netns + 2880 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2881 root 20 0 504m 85m 66m S 0.0 2.2 10:55.30 KernelNetworkIn + 2882 root 20 0 4408 1520 1344 S 0.0 0.0 0:00.01 netns + 2883 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2884 root 20 0 3823m 217m 162m S 0.0 5.7 39:24.24 StrataL3 + 2887 root 20 0 4408 1524 1344 S 0.0 0.0 0:00.01 netns + 2891 root 20 0 501m 46m 28m S 0.0 1.2 0:00.01 netnsd-session + 2893 root 20 0 531m 156m 136m S 0.0 4.1 35:01.16 StrataL2 + 2919 root 20 0 4408 1508 1328 S 0.0 0.0 0:00.01 netns + 2922 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2926 root 20 0 518m 136m 115m S 0.0 3.6 14:15.02 Arp + 2932 root 20 0 4408 1536 1356 S 0.0 0.0 0:00.01 netns + 2934 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2936 root 20 0 507m 102m 82m S 0.0 2.7 22:34.20 Qos + 2950 root 20 0 4408 1480 1304 S 0.0 0.0 0:00.01 netns + 2951 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2952 root 20 0 706m 255m 171m S 0.0 6.7 20249:50 Strata + 2961 root 20 0 4408 1496 1316 S 0.0 0.0 0:00.01 netns + 2962 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2963 root 20 0 508m 104m 85m S 0.0 2.7 9:33.30 TopoAgent + 2965 root 20 0 4408 1504 1328 S 0.0 0.0 0:00.01 netns + 2966 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 2967 root 20 0 511m 119m 96m S 0.0 3.2 10:46.92 KernelFib + 2968 root 20 0 276m 177m 151m S 0.0 4.7 436:38.94 Rib + 2976 root 20 0 34308 5000 3780 S 0.0 0.1 1:48.08 rsyslogd + 3250 ntp 20 0 16716 10m 9464 S 0.0 0.3 0:23.71 ntpd + 3297 root 20 0 4408 1504 1328 S 0.0 0.0 0:00.02 netns + 3299 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3300 root 20 0 507m 115m 95m S 0.0 3.0 52:11.14 Lldp + 3305 root 20 0 4408 1536 1356 S 0.0 0.0 0:00.02 netns + 3308 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3309 root 20 0 507m 119m 99m S 0.0 3.1 10:43.10 McastCommon + 3310 root 20 0 556m 199m 166m S 0.0 5.3 811:40.01 Snmp + 3315 root 20 0 4408 1480 1304 S 0.0 0.0 0:00.02 netns + 3316 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3317 root 20 0 503m 80m 62m S 0.0 2.1 39:11.40 Kabini + 3318 root 20 0 4408 1504 1324 S 0.0 0.0 0:00.01 netns + 3319 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3320 root 20 0 506m 102m 83m S 0.0 2.7 11:19.67 LedPolicy + 3325 root 20 0 4408 1508 1328 S 0.0 0.0 0:00.02 netns + 3326 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3328 root 20 0 510m 118m 96m S 0.0 3.1 74:57.90 EventMgr + 3331 root 20 0 4408 1500 1324 S 0.0 0.0 0:00.01 netns + 3332 root 20 0 501m 46m 28m S 0.0 1.2 0:00.01 netnsd-session + 3333 root 20 0 539m 103m 78m S 0.0 2.7 64:25.14 CapiApp + 3335 root 20 0 4408 1504 1328 S 0.0 0.0 0:00.02 netns + 3337 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3352 root 20 0 4408 1408 1228 S 0.0 0.0 0:00.02 netns + 3356 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3371 root 20 0 4408 1524 1344 S 0.0 0.0 0:00.01 netns + 3373 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3374 root 20 0 518m 127m 107m S 0.0 3.4 148:24.98 Sflow + 3378 root 20 0 4408 1496 1316 S 0.0 0.0 0:00.02 netns + 3380 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3381 root 20 0 502m 32m 13m S 0.0 0.8 8:17.21 Tunnel + 3382 root 20 0 4408 1536 1356 S 0.0 0.0 0:00.01 netns + 3383 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3384 root 20 0 507m 111m 91m S 0.0 2.9 10:35.33 McastCommon6 + 3391 root 20 0 4408 1516 1340 S 0.0 0.0 0:00.01 netns + 3392 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3393 root 20 0 506m 84m 65m S 0.0 2.2 11:07.18 PowerSupplyFixe + 3396 root 20 0 4408 1500 1324 S 0.0 0.0 0:00.01 netns + 3398 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3399 root 20 0 508m 113m 94m S 0.0 3.0 11:01.06 StrataMirror + 3406 root 20 0 4408 1480 1304 S 0.0 0.0 0:00.01 netns + 3408 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3409 root 20 0 504m 89m 71m S 0.0 2.4 10:54.07 L2Rib + 3410 root 20 0 4408 1464 1284 S 0.0 0.0 0:00.02 netns + 3411 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3412 root 20 0 506m 87m 68m S 0.0 2.3 10:05.39 Sol + 3413 root 20 0 4408 1508 1332 S 0.0 0.0 0:00.01 netns + 3414 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3415 root 20 0 512m 126m 106m S 0.0 3.3 10:59.52 DhcpRelay + 3419 root 20 0 4408 1520 1344 S 0.0 0.0 0:00.01 netns + 3421 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3423 root 20 0 503m 82m 64m S 0.0 2.2 10:06.63 FpgaAgent + 3425 root 20 0 4408 1504 1328 S 0.0 0.0 0:00.02 netns + 3427 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3428 root 20 0 504m 80m 61m S 0.0 2.1 8:04.55 PowerFuse + 3429 root 20 0 534m 131m 105m S 0.0 3.5 40:13.43 IgmpSnooping + 3441 root 20 0 4408 1504 1328 S 0.0 0.0 0:00.01 netns + 3442 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3443 root 20 0 512m 124m 104m S 0.0 3.3 11:53.67 PimBidirDf + 3446 root 20 0 4408 1492 1316 S 0.0 0.0 0:00.01 netns + 3447 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3448 root 20 0 506m 109m 90m S 0.0 2.9 9:42.58 KernelMfib + 3449 root 20 0 4408 1500 1324 S 0.0 0.0 0:00.01 netns + 3451 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3452 root 20 0 505m 97m 78m S 0.0 2.6 9:08.70 Msdp + 3453 root 20 0 4408 1500 1324 S 0.0 0.0 0:00.01 netns + 3455 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3456 root 20 0 508m 121m 102m S 0.0 3.2 11:56.70 Pim + 3458 root 20 0 4408 1504 1328 S 0.0 0.0 0:00.01 netns + 3459 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3460 root 20 0 507m 118m 99m S 0.0 3.1 10:41.93 Igmp + 3466 root 20 0 4408 1508 1328 S 0.0 0.0 0:00.01 netns + 3467 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3468 root 20 0 507m 113m 94m S 0.0 3.0 10:01.66 IgmpHostProxy + 3472 root 20 0 4408 1508 1328 S 0.0 0.0 0:00.01 netns + 3476 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3477 root 20 0 508m 127m 107m S 0.0 3.4 11:24.15 PimBsr + 3478 root 20 0 4408 1496 1316 S 0.0 0.0 0:00.01 netns + 3480 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3481 root 20 0 518m 151m 129m S 0.0 4.0 20:13.23 Pimsm + 3483 root 20 0 4408 1504 1328 S 0.0 0.0 0:00.01 netns + 3484 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3485 root 20 0 509m 130m 110m S 0.0 3.4 11:20.38 PimReg + 3489 root 20 0 4408 1508 1328 S 0.0 0.0 0:00.01 netns + 3492 root 20 0 501m 46m 28m S 0.0 1.2 0:00.02 netnsd-session + 3493 root 20 0 512m 126m 106m S 0.0 3.3 11:25.66 PimBidir + 4094 root 20 0 0 0 0 S 0.0 0.0 0:00.07 kworker/1:1 + 5066 root 20 0 0 0 0 S 0.0 0.0 0:00.05 kworker/3:3 + 9917 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/0:1 +10750 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/3:0 +13165 root 20 0 271m 169m 147m S 0.0 4.5 104:58.08 Rib-vrf-TEST +13186 root 20 0 4408 1892 1660 S 0.0 0.0 0:00.73 dnsmasq +13213 root 20 0 16392 6568 3268 S 0.0 0.2 63:12.22 snmpd +21821 root 20 0 0 0 0 S 0.0 0.0 0:00.18 kworker/3:2 +21822 root 20 0 0 0 0 S 0.0 0.0 0:00.16 kworker/2:2 +24536 root 20 0 0 0 0 S 0.0 0.0 0:00.21 kworker/0:0 +24989 root 20 0 0 0 0 S 0.0 0.0 0:03.57 kworker/u8:0 +26530 root 20 0 0 0 0 S 0.0 0.0 0:00.06 kworker/2:3 diff --git a/test/eos/mocked_data/test_get_environment/issue810_7010t/show_version.json b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_version.json new file mode 100644 index 000000000..c459d30a4 --- /dev/null +++ b/test/eos/mocked_data/test_get_environment/issue810_7010t/show_version.json @@ -0,0 +1,15 @@ +{ + "uptime": 5860361.78, + "modelName": "DCS-7010T-48-R", + "internalVersion": "4.20.7M-8944203.4207M", + "systemMacAddress": "28:99:3a:23:92:09", + "serialNumber": "SSJ12345678", + "memTotal": 3886752, + "bootupTimestamp": 1531344080.0, + "memFree": 2582420, + "version": "4.20.7M", + "architecture": "i386", + "isIntlVersion": false, + "internalBuildId": "c673df71-201a-43a3-8d66-9f28c0ac92fc", + "hardwareRevision": "12.00" +} 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 new file mode 100644 index 000000000..11370a1ce --- /dev/null +++ b/test/eos/mocked_data/test_get_network_instances/issue-796/expected_result.json @@ -0,0 +1 @@ +{"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 new file mode 100644 index 000000000..780f4279a --- /dev/null +++ b/test/eos/mocked_data/test_get_network_instances/issue-796/show_ip_interface.json @@ -0,0 +1,66 @@ +{ + "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 new file mode 100644 index 000000000..582256041 --- /dev/null +++ b/test/eos/mocked_data/test_get_network_instances/issue-796/show_ipv6_interface.json @@ -0,0 +1,6 @@ +{ + "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 new file mode 100644 index 000000000..a4e955e40 --- /dev/null +++ b/test/eos/mocked_data/test_get_network_instances/issue-796/show_vrf.text @@ -0,0 +1,9 @@ +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/utils/textfsm_templates b/test/eos/utils/textfsm_templates deleted file mode 120000 index 1abb77c74..000000000 --- a/test/eos/utils/textfsm_templates +++ /dev/null @@ -1 +0,0 @@ -../../../napalm/eos/utils/textfsm_templates \ No newline at end of file diff --git a/test/ios/mocked_data/test_ping/ping_fail/expected_result.json b/test/ios/mocked_data/test_ping/ping_fail/expected_result.json new file mode 100644 index 000000000..40da3e9d8 --- /dev/null +++ b/test/ios/mocked_data/test_ping/ping_fail/expected_result.json @@ -0,0 +1,11 @@ +{ + "success": { + "results": [], + "rtt_avg": 0.0, + "packet_loss": 5, + "rtt_min": 0.0, + "rtt_max": 0.0, + "rtt_stddev": 0.0, + "probes_sent": 5 + } +} diff --git a/test/ios/mocked_data/test_ping/ping_fail/ping_8_8_8_8_timeout_2_size_100_repeat_5.txt b/test/ios/mocked_data/test_ping/ping_fail/ping_8_8_8_8_timeout_2_size_100_repeat_5.txt new file mode 100644 index 000000000..4791819ff --- /dev/null +++ b/test/ios/mocked_data/test_ping/ping_fail/ping_8_8_8_8_timeout_2_size_100_repeat_5.txt @@ -0,0 +1,4 @@ +Type escape sequence to abort. +Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds: +..... +Success rate is 0 percent (0/5) diff --git a/test/ios/utils/textfsm_templates/ip_bgp_all_sum.tpl b/test/ios/utils/textfsm_templates/ip_bgp_all_sum.tpl deleted file mode 100644 index 8e6e57f86..000000000 --- a/test/ios/utils/textfsm_templates/ip_bgp_all_sum.tpl +++ /dev/null @@ -1,24 +0,0 @@ -Value Filldown ADDR_FAMILY (.*) -Value Filldown ROUTER_ID (\S+) -Value Filldown LOCAL_AS (\d+) -Value NEIGHBOR (\S+) -Value BGP_VER (\d) -Value REMOTE_AS (\d+) -Value MSG_RECV (\d+) -Value MSG_SENT (\d+) -Value TBL_VER (\d+) -Value IN_Q (\d+) -Value OUT_Q (\d+) -Value UP (\w+) -Value PREFIX_RECV (.*) - -Start - ^For address family\: ${ADDR_FAMILY} - ^BGP router identifier ${ROUTER_ID}, local AS number ${LOCAL_AS} - ^Neighbor\s+V -> Table - -Table - ^${NEIGHBOR}\s+${BGP_VER}\s+${REMOTE_AS}\s+${MSG_RECV}\s+${MSG_SENT}\s+${TBL_VER}\s+${IN_Q}\s+${OUT_Q}\s+${UP}\s+${PREFIX_RECV} -> Record Table - ^\s* -> Clearall Start - -EOF diff --git a/test/ios/utils/textfsm_templates/ip_bgp_neigh.tpl b/test/ios/utils/textfsm_templates/ip_bgp_neigh.tpl deleted file mode 100644 index b811c00a8..000000000 --- a/test/ios/utils/textfsm_templates/ip_bgp_neigh.tpl +++ /dev/null @@ -1,56 +0,0 @@ -Value NEIGHBOR (\S+) -Value REMOTE_AS (\d+) -Value BGP_TYPE (\w+) -Value VRF (\w+) -Value DESCRIPTION (.*) -Value ROUTER_ID (\S+) -Value BGP_STATE (\w+) -Value UP (\w+) -Value UPTIME (\w+) -Value LAST_READ (.*) -Value LAST_WRITE (.*) -Value HOLDTIME (\d+) -Value KEEPALIVE (\d+) -Value FOUR_BYTE_AS (.*) -Value MSG_OPEN_OUT (\d+) -Value MSG_OPEN_IN (\d+) -Value MSG_NOTI_OUT (\d+) -Value MSG_NOTI_IN (\d+) -Value MSG_UPDATE_OUT (\d+) -Value MSG_UPDATE_IN (\d+) -Value MSG_KEEPALIVE_OUT (\d+) -Value MSG_KEEPALIVE_IN (\d+) -Value MSG_REFRESH_OUT (\d+) -Value MSG_REFRESH_IN (\d+) -Value MSG_TOTAL_OUT (\d+) -Value MSG_TOTAL_IN (\d+) -Value LOCAL_ADDRESS (.*) -Value LOCAL_PORT (\d+) -Value REMOTE_ADDRESS (.*) -Value REMOTE_PORT (\d+) -Value ROUTING_TABLE (\d+) -Value CONN_STATE (\w+) - -Start - ^BGP neighbor is ${NEIGHBOR},(?:\s+vrf ${VRF},)?\s+remote AS\s+${REMOTE_AS},\s+${BGP_TYPE} link - ^\s+Administratively shut ${UP} - ^\s+Description:\s+${DESCRIPTION} - ^\s+BGP version 4, remote router ID ${ROUTER_ID} - ^\s+BGP state = ${BGP_STATE}(?:, ${UP} for ${UPTIME})? - ^\s+Last read ${LAST_READ}, last write ${LAST_WRITE}, hold time is ${HOLDTIME}, keepalive interval is ${KEEPALIVE} seconds - ^\s+Four-octets ASN Capability:\s+${FOUR_BYTE_AS} - ^\s+Opens:\s+${MSG_OPEN_OUT}\s+${MSG_OPEN_IN} - ^\s+Notifications:\s+${MSG_NOTI_OUT}\s+${MSG_NOTI_IN} - ^\s+Updates:\s+${MSG_UPDATE_OUT}\s+${MSG_UPDATE_IN} - ^\s+Keepalives:\s+${MSG_KEEPALIVE_OUT}\s+${MSG_KEEPALIVE_IN} - ^\s+Route Refresh:\s+${MSG_REFRESH_OUT}\s+${MSG_REFRESH_IN} - ^\s+Total:\s+${MSG_TOTAL_OUT}\s+${MSG_TOTAL_IN} - ^\s*Connection state is ${CONN_STATE}, - ^\s*For address family -> Afi - ^Local host: ${LOCAL_ADDRESS}, Local port: ${LOCAL_PORT} - ^Foreign host: ${REMOTE_ADDRESS}, Foreign port: ${REMOTE_PORT} - ^Connection tableid \(VRF\): ${ROUTING_TABLE} - -Afi - ^\s -> Next - ^\w -> Start \ No newline at end of file diff --git a/test/ios/utils/textfsm_templates/ip_bgp_neigh_afi.tpl b/test/ios/utils/textfsm_templates/ip_bgp_neigh_afi.tpl deleted file mode 100644 index 7aac6c1b7..000000000 --- a/test/ios/utils/textfsm_templates/ip_bgp_neigh_afi.tpl +++ /dev/null @@ -1,41 +0,0 @@ -Value AFI (.*) -Value SESSION (\S+) -Value POLICY_IN (\S+) -Value POLICY_OUT (\S+) -Value PREFIX_CURR_OUT (\d+) -Value PREFIX_CURR_IN (\d+) -Value PREFIX_TOTAL_OUT (\d+) -Value PREFIX_TOTAL_IN (\d+) -Value WITHDRAW_IMPLICIT_OUT (\d+) -Value WITHDRAW_IMPLICIT_IN (\d+) -Value WITHDRAW_EXPLICIT_OUT (\d+) -Value WITHDRAW_EXPLICIT_IN (\d+) -Value BESTPATHS (\d+) -Value MULTIPATHS (\d+) -Value SECONDARIES (\d+) -Value REJECTED_PREFIX_IN (\d+) -Value REJECTED_PREFIX_OUT (\d+) -Value FLAP_COUNT (\d+) -Value LAST_EVENT (.*) -Value LOCAL_ADDR_CONF (peering address in same link) - -Start - ^\s*For address family: -> Continue.Record - ^\s*For address family: ${AFI} - ^\s+Session: ${SESSION} - ^\s+Route map for incoming advertisements is ${POLICY_IN} - ^\s+Route map for outgoing advertisements is ${POLICY_OUT} - ^\s+Prefixes Current:\s+${PREFIX_CURR_OUT}\s+${PREFIX_CURR_IN} - ^\s+Prefixes Total:\s+${PREFIX_TOTAL_OUT}\s+${PREFIX_TOTAL_IN} - ^\s+Implicit Withdraw:\s+${WITHDRAW_IMPLICIT_OUT}\s+${WITHDRAW_IMPLICIT_IN} - ^\s+Explicit Withdraw:\s+${WITHDRAW_EXPLICIT_OUT}\s+${WITHDRAW_EXPLICIT_IN} - ^\s+Used as bestpath:\s+\S+\s+${BESTPATHS} - ^\s+Used as multipath:\s+\S+\s+${MULTIPATHS} - ^\s+Used as secondary:\s+\S+\s+${SECONDARIES} - ^\s+Total:\s+${REJECTED_PREFIX_OUT}\s+${REJECTED_PREFIX_IN} - ^\s+Connections established\s+\d+;\s+dropped\s+${FLAP_COUNT} - ^\s+Last reset ${LAST_EVENT} - ^\s+Interface associated: \S+ \(${LOCAL_ADDR_CONF}\) - ^Connection state is -> Record - - \ No newline at end of file diff --git a/test/ios/utils/textfsm_templates/show_lldp_neighbors.tpl b/test/ios/utils/textfsm_templates/show_lldp_neighbors.tpl deleted file mode 100644 index 1265e78ec..000000000 --- a/test/ios/utils/textfsm_templates/show_lldp_neighbors.tpl +++ /dev/null @@ -1,12 +0,0 @@ -Value LOCAL_INTERFACE ([^\s]{1,15}) - -Start - # Start capturing after the line that start the table - ^Device ID -> Record Neighbor - -Neighbor - ^Total entries displayed -> End - # Stop at the first empty line - ^$$ -> End - # Skip 20 characters for the Device ID - ^.{20}${LOCAL_INTERFACE} -> Record diff --git a/test/ios/utils/textfsm_templates/show_lldp_neighbors_detail.tpl b/test/ios/utils/textfsm_templates/show_lldp_neighbors_detail.tpl deleted file mode 100644 index 8bd69b8b1..000000000 --- a/test/ios/utils/textfsm_templates/show_lldp_neighbors_detail.tpl +++ /dev/null @@ -1,28 +0,0 @@ -Value LOCAL_INTERFACE (.*) -Value REMOTE_CHASSIS_ID (.*) -Value REMOTE_PORT (.*) -Value REMOTE_PORT_DESCRIPTION (.+) -Value REMOTE_SYSTEM_NAME (.*) -Value REMOTE_SYSTEM_DESCRIPTION (.+) -Value REMOTE_SYSTEM_CAPAB (.*) -Value REMOTE_SYSTEM_ENABLE_CAPAB (.*) - -Start - # A line of hyphens delimits neighbor records - ^------+ -> Record Neighbor - -Neighbor - ^Local Intf\s*?[:-]\s+${LOCAL_INTERFACE} - ^Chassis id\s*?[:-]\s+${REMOTE_CHASSIS_ID} - ^Port id\s*?[:-]\s+${REMOTE_PORT} - ^Port Description\s*?[:-]\s+${REMOTE_PORT_DESCRIPTION} - ^System Name\s*?[:-]\s+${REMOTE_SYSTEM_NAME} - # We need to change state to capture the entire next line - ^System Description: -> Description - ^System Description\s*-\s*${REMOTE_SYSTEM_DESCRIPTION} - ^System Capabilities\s*?[:-]\s+${REMOTE_SYSTEM_CAPAB} - ^Enabled Capabilities\s*?[:-]\s+${REMOTE_SYSTEM_ENABLE_CAPAB} -> Record - -Description - # Capture the entire line and go back to Neighbor state - ^${REMOTE_SYSTEM_DESCRIPTION} -> Neighbor diff --git a/test/junos/conftest.py b/test/junos/conftest.py index ca16b6741..ae86525fa 100644 --- a/test/junos/conftest.py +++ b/test/junos/conftest.py @@ -86,7 +86,7 @@ def facts(self): self._facts = self.default_facts return self._facts with open(alt_facts_filepath, 'r') as alt_facts: - self._facts.update(yaml.load(alt_facts)) + self._facts.update(yaml.safe_load(alt_facts)) return self._facts @property diff --git a/test/junos/mocked_data/test_get_interfaces/iffdown/expected_result.json b/test/junos/mocked_data/test_get_interfaces/iffdown/expected_result.json new file mode 100644 index 000000000..4ee348b04 --- /dev/null +++ b/test/junos/mocked_data/test_get_interfaces/iffdown/expected_result.json @@ -0,0 +1,642 @@ +{ + "cbp0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "20:D8:0B:71:28:11", + "speed": -1 + }, + "demux0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "dsc": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "em0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 245449.0, + "mac_address": "52:54:00:36:15:39", + "speed": 1000 + }, + "em0.32768": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 245449.0, + "mac_address": "52:54:00:36:15:39", + "speed": 1000 + }, + "esi": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "fxp0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 242925.0, + "mac_address": "E4:FC:82:4D:DA:3E", + "speed": 1000 + }, + "fxp0.0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 242925.0, + "mac_address": "E4:FC:82:4D:DA:3E", + "speed": 1000 + }, + "ge-5/0/0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 2185.0, + "mac_address": "20:D8:0B:71:2E:72", + "speed": 1000 + }, + "ge-5/0/0.0": { + "description": "", + "is_enabled": false, + "is_up": true, + "last_flapped": 2185.0, + "mac_address": "20:D8:0B:71:2E:72", + "speed": 1000 + }, + "ge-5/0/1": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 10.0, + "mac_address": "20:D8:0B:71:2E:73", + "speed": 1000 + }, + "ge-5/0/1.0": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 10.0, + "mac_address": "20:D8:0B:71:2E:73", + "speed": 1000 + }, + "ge-5/0/2": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:74", + "speed": 1000 + }, + "ge-5/0/3": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:75", + "speed": 1000 + }, + "ge-5/0/4": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:76", + "speed": 1000 + }, + "ge-5/0/5": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:77", + "speed": 1000 + }, + "ge-5/0/6": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:78", + "speed": 1000 + }, + "ge-5/0/7": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:79", + "speed": 1000 + }, + "ge-5/0/8": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:7A", + "speed": 1000 + }, + "ge-5/0/9": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:7B", + "speed": 1000 + }, + "ge-5/1/0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 2185.0, + "mac_address": "20:D8:0B:71:2E:C4", + "speed": 1000 + }, + "ge-5/1/0.0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 2185.0, + "mac_address": "20:D8:0B:71:2E:C4", + "speed": 1000 + }, + "ge-5/1/1": { + "description": "", + "is_enabled": false, + "is_up": false, + "last_flapped": 9.0, + "mac_address": "20:D8:0B:71:2E:C5", + "speed": 1000 + }, + "ge-5/1/1.0": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 9.0, + "mac_address": "20:D8:0B:71:2E:C5", + "speed": 1000 + }, + "ge-5/1/2": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:C6", + "speed": 1000 + }, + "ge-5/1/3": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:C7", + "speed": 1000 + }, + "ge-5/1/4": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:C8", + "speed": 1000 + }, + "ge-5/1/5": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:C9", + "speed": 1000 + }, + "ge-5/1/6": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:CA", + "speed": 1000 + }, + "ge-5/1/7": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:CB", + "speed": 1000 + }, + "ge-5/1/8": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:CC", + "speed": 1000 + }, + "ge-5/1/9": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245325.0, + "mac_address": "20:D8:0B:71:2E:CD", + "speed": 1000 + }, + "ge-5/2/0": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:16", + "speed": 1000 + }, + "ge-5/2/1": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:17", + "speed": 1000 + }, + "ge-5/2/2": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:18", + "speed": 1000 + }, + "ge-5/2/3": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:19", + "speed": 1000 + }, + "ge-5/2/4": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:1A", + "speed": 1000 + }, + "ge-5/2/5": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:1B", + "speed": 1000 + }, + "ge-5/2/6": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:1C", + "speed": 1000 + }, + "ge-5/2/7": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:1D", + "speed": 1000 + }, + "ge-5/2/8": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:1E", + "speed": 1000 + }, + "ge-5/2/9": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:1F", + "speed": 1000 + }, + "ge-5/3/0": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:68", + "speed": 1000 + }, + "ge-5/3/1": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:69", + "speed": 1000 + }, + "ge-5/3/2": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:6A", + "speed": 1000 + }, + "ge-5/3/3": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:6B", + "speed": 1000 + }, + "ge-5/3/4": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:6C", + "speed": 1000 + }, + "ge-5/3/5": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:6D", + "speed": 1000 + }, + "ge-5/3/6": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:6E", + "speed": 1000 + }, + "ge-5/3/7": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:6F", + "speed": 1000 + }, + "ge-5/3/8": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:70", + "speed": 1000 + }, + "ge-5/3/9": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 245316.0, + "mac_address": "20:D8:0B:71:2F:71", + "speed": 1000 + }, + "gre": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "igb0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 245452.0, + "mac_address": "02:00:01:00:00:04", + "speed": 1000 + }, + "igb0.0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 245452.0, + "mac_address": "02:00:01:00:00:04", + "speed": 1000 + }, + "ipip": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "irb": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "20:D8:0B:71:2F:F0", + "speed": -1 + }, + "ixlv0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 245452.0, + "mac_address": "02:00:00:00:00:04", + "speed": 1000 + }, + "ixlv0.0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 245452.0, + "mac_address": "02:00:00:00:00:04", + "speed": 1000 + }, + "jsrv": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "20:D8:0B:71:2F:C0", + "speed": -1 + }, + "jsrv.1": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "20:D8:0B:71:2F:C0", + "speed": -1 + }, + "lc-5/0/0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": 800 + }, + "lc-5/0/0.32769": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": 800 + }, + "lo0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "lo0.16384": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "lo0.16385": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "lsi": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "mtun": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "pfe-5/0/0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": 800 + }, + "pfe-5/0/0.16383": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": 800 + }, + "pfh-5/0/0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": 800 + }, + "pfh-5/0/0.16383": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": 800 + }, + "pfh-5/0/0.16384": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": 800 + }, + "pimd": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "pime": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "pip0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "20:D8:0B:71:2F:B0", + "speed": -1 + }, + "pp0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "rbeb": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "tap": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + }, + "vtep": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "None", + "speed": -1 + } +} diff --git a/test/junos/mocked_data/test_get_interfaces/iffdown/get-interface-information.xml b/test/junos/mocked_data/test_get_interfaces/iffdown/get-interface-information.xml new file mode 100644 index 000000000..b8f4213c8 --- /dev/null +++ b/test/junos/mocked_data/test_get_interfaces/iffdown/get-interface-information.xml @@ -0,0 +1,4213 @@ + + + ge-5/0/0 + up + up + 140 + 523 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + 0x1200 + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:72 + 20:d8:0b:71:2e:72 + 2018-08-13 09:30:17 UTC (00:36:25 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + ge-5/0/0.0 + 331 + 563 + + + + 0x4004000 + + ENET2 + + + + 53 + 94 + + + + + inet + 1500 + 100000 + 100000 + 0 + 0 + 0 + + + 0x0 + + + + multiservice + Unlimited + + + 0x0 + + + + + + lc-5/0/0 + up + up + 137 + 516 + 800mbps + + + + + + 0x200 + + + + + + + Never + + 0 + 0 + + + lc-5/0/0.32769 + 327 + 517 + + + + ENET2 + + + 0 + + 0 + 0 + + + + + vpls + Unlimited + + + 0x4000000 + + + + + + pfe-5/0/0 + up + up + 139 + 519 + 800mbps + + + + + + 0x200 + + + + + + + Never + + 0 + 0 + + + pfe-5/0/0.16383 + 328 + 520 + + + + + ENET2 + + + 0 + + 0 + 0 + + + + + inet + Unlimited + 0 + 0 + 0 + 0 + 0 + + + + + + inet6 + Unlimited + 0 + 0 + 0 + 0 + 0 + + + + + + + + pfh-5/0/0 + up + up + 138 + 518 + 800mbps + + + + + + 0x200 + + + + + + + Never + + 0 + 0 + + + pfh-5/0/0.16383 + 329 + 521 + + + + + ENET2 + + + 0 + + 0 + 0 + + + + + inet + Unlimited + 0 + 0 + 0 + 0 + 0 + + + + + + + pfh-5/0/0.16384 + 330 + 522 + + + + + ENET2 + + + 0 + + 0 + 0 + + + + + inet + Unlimited + 0 + 0 + 0 + 0 + 0 + + + + + + + + ge-5/0/1 + up + down + 141 + 524 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:73 + 20:d8:0b:71:2e:73 + 2018-08-13 10:06:32 UTC (00:00:10 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + ge-5/0/1.0 + 332 + 564 + + + + 0x4004000 + + ENET2 + + + + 76 + 76 + + + + + inet + 1500 + 100000 + 100000 + 0 + 0 + 0 + + + 0x0 + + + + multiservice + Unlimited + + 0x0 + + + + + + ge-5/0/2 + up + down + 142 + 525 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:74 + 20:d8:0b:71:2e:74 + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/0/3 + up + down + 143 + 526 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:75 + 20:d8:0b:71:2e:75 + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/0/4 + up + down + 144 + 527 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:76 + 20:d8:0b:71:2e:76 + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/0/5 + up + down + 145 + 528 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:77 + 20:d8:0b:71:2e:77 + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/0/6 + up + down + 146 + 529 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:78 + 20:d8:0b:71:2e:78 + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/0/7 + up + down + 147 + 530 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:79 + 20:d8:0b:71:2e:79 + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/0/8 + up + down + 148 + 531 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:7a + 20:d8:0b:71:2e:7a + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/0/9 + up + down + 149 + 532 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:7b + 20:d8:0b:71:2e:7b + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/1/0 + up + up + 150 + 533 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + 0x1200 + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:c4 + 20:d8:0b:71:2e:c4 + 2018-08-13 09:30:17 UTC (00:36:25 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + ge-5/1/0.0 + 333 + 565 + + + + 0x4004000 + + ENET2 + + + + 75 + 77 + + + + + inet + 1500 + 100000 + 100000 + 0 + 0 + 0 + + + 0x0 + + + + multiservice + Unlimited + + 0x0 + + + + + + ge-5/1/1 + down + down + 151 + 534 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:c5 + 20:d8:0b:71:2e:c5 + 2018-08-13 10:06:33 UTC (00:00:09 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + ge-5/1/1.0 + 334 + 566 + + + + 0x4004000 + + ENET2 + + + + 77 + 76 + + + + + inet + 1500 + 100000 + 100000 + 0 + 0 + 0 + + + 0x0 + + + + multiservice + Unlimited + + 0x0 + + + + + + ge-5/1/2 + up + down + 152 + 535 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:c6 + 20:d8:0b:71:2e:c6 + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/1/3 + up + down + 153 + 536 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:c7 + 20:d8:0b:71:2e:c7 + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/1/4 + up + down + 154 + 537 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:c8 + 20:d8:0b:71:2e:c8 + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/1/5 + up + down + 155 + 538 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:c9 + 20:d8:0b:71:2e:c9 + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/1/6 + up + down + 156 + 539 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:ca + 20:d8:0b:71:2e:ca + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/1/7 + up + down + 157 + 540 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:cb + 20:d8:0b:71:2e:cb + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/1/8 + up + down + 158 + 541 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:cc + 20:d8:0b:71:2e:cc + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/1/9 + up + down + 159 + 542 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2e:cd + 20:d8:0b:71:2e:cd + 2018-08-10 13:57:57 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/2/0 + up + down + 160 + 543 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:16 + 20:d8:0b:71:2f:16 + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/2/1 + up + down + 161 + 544 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:17 + 20:d8:0b:71:2f:17 + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/2/2 + up + down + 162 + 545 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:18 + 20:d8:0b:71:2f:18 + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/2/3 + up + down + 163 + 546 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:19 + 20:d8:0b:71:2f:19 + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/2/4 + up + down + 164 + 547 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:1a + 20:d8:0b:71:2f:1a + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/2/5 + up + down + 165 + 548 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:1b + 20:d8:0b:71:2f:1b + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/2/6 + up + down + 166 + 549 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:1c + 20:d8:0b:71:2f:1c + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/2/7 + up + down + 167 + 550 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:1d + 20:d8:0b:71:2f:1d + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/2/8 + up + down + 168 + 551 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:1e + 20:d8:0b:71:2f:1e + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/2/9 + up + down + 169 + 552 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:1f + 20:d8:0b:71:2f:1f + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/3/0 + up + down + 170 + 553 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:68 + 20:d8:0b:71:2f:68 + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/3/1 + up + down + 171 + 554 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:69 + 20:d8:0b:71:2f:69 + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/3/2 + up + down + 172 + 555 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:6a + 20:d8:0b:71:2f:6a + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/3/3 + up + down + 173 + 556 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:6b + 20:d8:0b:71:2f:6b + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/3/4 + up + down + 174 + 557 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:6c + 20:d8:0b:71:2f:6c + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/3/5 + up + down + 175 + 558 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:6d + 20:d8:0b:71:2f:6d + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/3/6 + up + down + 176 + 559 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:6e + 20:d8:0b:71:2f:6e + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/3/7 + up + down + 177 + 560 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:6f + 20:d8:0b:71:2f:6f + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/3/8 + up + down + 178 + 561 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:70 + 20:d8:0b:71:2f:70 + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + ge-5/3/9 + up + down + 179 + 562 + Ethernet + 1514 + LAN-PHY + disabled + 1000mbps + none + none + none + none + disabled + enabled + enabled + online + Fiber + + + + + + + 0x1200 + + + + + 0x4000 + + + + + + 8 + 8 + + 20:d8:0b:71:2f:71 + 20:d8:0b:71:2f:71 + 2018-08-10 13:58:06 UTC (2d 20:08 ago) + + 0 + 0 + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + 0 + 0 + + Disabled + + + cbp0 + up + up + 129 + 501 + Ethernet + Ethernet + 9192 + + + + + + 0x200 + + + + + Full-Duplex + + + + 20:d8:0b:71:28:11 + 20:d8:0b:71:28:11 + Never + + 0 + 0 + + + + demux0 + up + up + 128 + 502 + Software-Pseudo + 9192 + 1 + + + + + + + 0x200 + + + + + + Full-Duplex + + + + Never + + 0 + 0 + + + + dsc + up + up + 5 + 5 + Software-Pseudo + Unlimited + + + + + + 0x200 + + + + + + + + + Never + + 0 + 0 + + + + em0 + up + up + 67 + 17 + Ethernet + Ethernet + 1514 + 1000mbps + + + + + + + 0x200 + + + + Full-Duplex + + + + 52:54:00:36:15:39 + 52:54:00:36:15:39 + 2018-08-10 13:55:53 UTC (2d 20:10 ago) + + 197815 + 176750 + + + em0.32768 + 5 + 503 + + + 0x4000000 + + ENET2 + + + 0 + + 197699 + 176751 + + + + + inet + 1500 + 100000 + 100000 + 1 + 0 + 0 + + + + + + + + + + + + 192.168.1/24 + 192.168.1.1 + 192.168.1.255 + + + + + + esi + up + up + 134 + 504 + Software-Pseudo + VxLAN-Tunnel-Endpoint + Unlimited + Unlimited + + + + + + + 0x200 + + + + + Full-Duplex + + + + Never + + 0 + 0 + + + + fxp0 + up + up + 66 + 1 + Ethernet + Ethernet + 1514 + 1000mbps + + + + + + 0x200 + + + + + Full-Duplex + + 0x4 + + e4:fc:82:4d:da:3e + e4:fc:82:4d:da:3e + 2018-08-10 14:37:57 UTC (2d 19:28 ago) + + 194060 + 42923 + + + fxp0.0 + 6 + 13 + + + + 0x4000000 + + ENET2 + + + + 193591 + 42893 + + + + + inet + 1500 + 100000 + 100000 + 1 + 0 + 0 + + + + + + + + + + + 128.141.254.32/28 + 128.141.254.37 + 128.141.254.47 + + + + + + gre + up + up + 10 + 8 + GRE + GRE + Unlimited + Unlimited + + + + + + 0x200 + + + + + + + 0 + 0 + + + + igb0 + up + up + 65 + 505 + Ethernet + Ethernet + 1514 + 1000mbps + + + + + + + 0x200 + + + + + Full-Duplex + + 0x4 + + 02:00:01:00:00:04 + 02:00:01:00:00:04 + 2018-08-10 13:55:50 UTC (2d 20:10 ago) + + 493680 + 1327890 + + + igb0.0 + 3 + 506 + + + + 0x4004000 + + ENET2 + + + + 493676 + 1327890 + + + + + inet + 1500 + 100000 + 100000 + 3 + 0 + 0 + + + + + + + + 10/8 + 10.0.0.4 + 10.255.255.255 + + + + + + + + 128/2 + 128.0.0.1 + 191.255.255.255 + + + + + + + + 128/2 + 128.0.0.4 + 191.255.255.255 + + + + inet6 + 1500 + 100000 + 100000 + 2 + 0 + 0 + + + + + + + 0x800 + + fe80::/64 + fe80::200:1ff:fe00:4 + + + + + + + + + + + + + fec0::/64 + fec0::a:0:0:4 + + + + + + + + + tnp + 1500 + + + + + 0x4 + + + + + + ipip + up + up + 11 + 9 + IPIP + IP-over-IP + Unlimited + Unlimited + + + + + + 0x200 + + + + + + 0 + 0 + + + + irb + up + up + 132 + 507 + Ethernet + Ethernet + 1514 + + + + + + + 0x200 + + + + + Full-Duplex + + + + 20:d8:0b:71:2f:f0 + 20:d8:0b:71:2f:f0 + Never + + 0 + 0 + + + + ixlv0 + up + up + 64 + 508 + Ethernet + Ethernet + 1514 + 1000mbps + + + + + + + 0x200 + + + + + Full-Duplex + + 0x4 + + 02:00:00:00:00:04 + 02:00:00:00:00:04 + 2018-08-10 13:55:50 UTC (2d 20:10 ago) + + 6994465 + 5496026 + + + ixlv0.0 + 4 + 509 + + + + 0x4004000 + + ENET2 + + + + 6994769 + 5496214 + + + + + inet + 1500 + 100000 + 100000 + 1 + 0 + 0 + + + + + + + + 10/8 + 10.0.0.4 + 10.255.255.255 + + + + + + + + 128/2 + 128.0.0.1 + 191.255.255.255 + + + + + + + 128/2 + 128.0.0.4 + 191.255.255.255 + + + + inet6 + 1500 + 100000 + 100000 + 1 + 0 + 0 + + + + + + + 0x800 + + fe80::/64 + fe80::200:ff:fe00:4 + + + + + + + + + + + + fec0::/64 + fec0::a:0:0:4 + + + + + + + + + tnp + 1500 + + + + + + 0x4 + + + + + + jsrv + up + up + 136 + 510 + Ethernet + Ethernet + 1514 + + + + + + 0x200 + + + + Full-Duplex + + + + 20:d8:0b:71:2f:c0 + 20:d8:0b:71:2f:c0 + Never + + 0 + 0 + + + jsrv.1 + 323 + 511 + + + 0x24004000 + + unknown + + + 1000mbps + + None + None + + + 0 + 0 + + + + + inet + 1514 + 100000 + 100000 + 0 + 0 + 0 + + + + + + + + + + + 128/2 + 128.0.0.127 + 191.255.255.255 + + + + + + lo0 + up + up + 6 + 6 + Loopback + Unlimited + + + + + + + 0x200 + + + + + + + + Never + + 866360 + 866360 + + + lo0.16384 + 321 + 21 + + + + Unspecified + + + + 0 + 0 + + + + + inet + Unlimited + 0 + 0 + 0 + 0 + 0 + + 0x0 + + + 127.0.0.1 + + + + + lo0.16385 + 320 + 22 + + + + Unspecified + + + + 866360 + 866360 + + + + + inet + Unlimited + 0 + 0 + 0 + 0 + 0 + + 0x0 + + + + + + lsi + up + up + 4 + 4 + Software-Pseudo + LSI + Unlimited + Unlimited + + + + + + 0x200 + + + + + + + Never + + 0 + 0 + + + + mtun + up + up + 68 + 12 + Multicast-GRE + GRE + Unlimited + Unlimited + + + + + + + 0x200 + + + + + + 0 + 0 + + + + pimd + up + up + 26 + 11 + PIMD + PIM-Decapsulator + Unlimited + Unlimited + + + + + + 0x200 + + + + + 0 + 0 + + + + pime + up + up + 25 + 10 + PIME + PIM-Encapsulator + Unlimited + Unlimited + + + + + + + 0x200 + + + + + 0 + 0 + + + + pip0 + up + up + 130 + 512 + Ethernet + Ethernet + 9192 + + + + + + 0x200 + + + + + Full-Duplex + + + + 20:d8:0b:71:2f:b0 + 20:d8:0b:71:2f:b0 + Never + + 0 + 0 + + + + pp0 + up + up + 131 + 513 + PPPoE + PPPoE + 1532 + + + + + + + 0x200 + + + + + + Full-Duplex + + + + + + rbeb + up + up + 135 + 514 + Software-Pseudo + Remote-BEB + Unlimited + Unlimited + + + + + + + 0x200 + + + + + Full-Duplex + + + + Never + + 0 + 0 + + + + tap + up + up + 12 + 7 + Software-Pseudo + Interface-Specific + Unlimited + Unlimited + + + + + + 0x200 + + + + + + + + Never + + 0 + 0 + + + + vtep + up + up + 133 + 515 + Software-Pseudo + VxLAN-Tunnel-Endpoint + Unlimited + Unlimited + + + + + + 0x200 + + + + + Full-Duplex + + + + Never + + 0 + 0 + + + diff --git a/test/junos/mocked_data/test_get_interfaces/normal/expected_result.json b/test/junos/mocked_data/test_get_interfaces/normal/expected_result.json index ea5a23c87..3f6971dce 100644 --- a/test/junos/mocked_data/test_get_interfaces/normal/expected_result.json +++ b/test/junos/mocked_data/test_get_interfaces/normal/expected_result.json @@ -1 +1,754 @@ -{".local.":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},".local..0":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},".local..1":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},".local..2":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},".local..3":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},".local..4":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},".local..5":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},".local..6":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},".local..7":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},"bme0":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"00:0B:CA:FE:00:00","speed":-1},"bme0.32768":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"00:0B:CA:FE:00:00","speed":-1},"dsc":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},"ge-0/0/0":{"description":"","is_enabled":true,"is_up":true,"last_flapped":17193266,"mac_address":"54:E0:32:80:68:83","speed":-1},"ge-0/0/0.0":{"description":"","is_enabled":false,"is_up":true,"last_flapped":17193266,"mac_address":"54:E0:32:80:68:83","speed":-1},"ge-0/0/1":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:84","speed":-1},"ge-0/0/10":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:8D","speed":-1},"ge-0/0/11":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:8E","speed":-1},"ge-0/0/12":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:8F","speed":-1},"ge-0/0/13":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:90","speed":-1},"ge-0/0/14":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:91","speed":-1},"ge-0/0/15":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:92","speed":-1},"ge-0/0/16":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:93","speed":-1},"ge-0/0/17":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:94","speed":-1},"ge-0/0/18":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:95","speed":-1},"ge-0/0/19":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:96","speed":-1},"ge-0/0/2":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:85","speed":-1},"ge-0/0/20":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:97","speed":-1},"ge-0/0/21":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:98","speed":-1},"ge-0/0/22":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:99","speed":-1},"ge-0/0/23":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:9A","speed":-1},"ge-0/0/24":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:9B","speed":-1},"ge-0/0/25":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:9C","speed":-1},"ge-0/0/26":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:9D","speed":-1},"ge-0/0/27":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:9E","speed":-1},"ge-0/0/28":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:9F","speed":-1},"ge-0/0/29":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:A0","speed":-1},"ge-0/0/3":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:86","speed":-1},"ge-0/0/30":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:A1","speed":-1},"ge-0/0/31":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:A2","speed":-1},"ge-0/0/32":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:A3","speed":-1},"ge-0/0/33":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:A4","speed":-1},"ge-0/0/34":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:A5","speed":-1},"ge-0/0/35":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:A6","speed":-1},"ge-0/0/36":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:A7","speed":-1},"ge-0/0/37":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:A8","speed":-1},"ge-0/0/38":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:A9","speed":-1},"ge-0/0/39":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:AA","speed":-1},"ge-0/0/4":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:87","speed":-1},"ge-0/0/40":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:AB","speed":-1},"ge-0/0/41":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:AC","speed":-1},"ge-0/0/42":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:AD","speed":-1},"ge-0/0/43":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:AE","speed":-1},"ge-0/0/44":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:AF","speed":-1},"ge-0/0/45":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:B0","speed":-1},"ge-0/0/46":{"description":"","is_enabled":true,"is_up":true,"last_flapped":12710488,"mac_address":"54:E0:32:80:68:B1","speed":-1},"ge-0/0/46.0":{"description":"","is_enabled":false,"is_up":true,"last_flapped":12710488,"mac_address":"54:E0:32:80:68:B1","speed":-1},"ge-0/0/47":{"description":"","is_enabled":true,"is_up":true,"last_flapped":12710487,"mac_address":"54:E0:32:80:68:B2","speed":-1},"ge-0/0/47.0":{"description":"","is_enabled":false,"is_up":true,"last_flapped":12710487,"mac_address":"54:E0:32:80:68:B2","speed":-1},"ge-0/0/5":{"description":"","is_enabled":true,"is_up":false,"last_flapped":16928759,"mac_address":"54:E0:32:80:68:88","speed":-1},"ge-0/0/6":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:89","speed":-1},"ge-0/0/7":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:8A","speed":-1},"ge-0/0/8":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:8B","speed":-1},"ge-0/0/9":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:8C","speed":-1},"gre":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},"ipip":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"None","speed":-1},"jsrv":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"54:E0:32:80:68:80","speed":1000},"jsrv.1":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"54:E0:32:80:68:80","speed":1000},"lo0":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},"lo0.16384":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},"lo0.2":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},"lo0.3":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},"lsi":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},"me0":{"description":"","is_enabled":true,"is_up":true,"last_flapped":48575831,"mac_address":"54:E0:32:80:68:FF","speed":1000},"me0.0":{"description":"","is_enabled":false,"is_up":true,"last_flapped":48575831,"mac_address":"54:E0:32:80:68:FF","speed":1000},"mtun":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},"pimd":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"None","speed":-1},"pime":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"None","speed":-1},"tap":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"Unspecified","speed":-1},"vcp-0":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"Unspecified","speed":32000},"vcp-0.32768":{"description":"","is_enabled":false,"is_up":false,"last_flapped":-1,"mac_address":"Unspecified","speed":32000},"vcp-1":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"Unspecified","speed":32000},"vcp-1.32768":{"description":"","is_enabled":false,"is_up":false,"last_flapped":-1,"mac_address":"Unspecified","speed":32000},"vlan":{"description":"","is_enabled":true,"is_up":true,"last_flapped":-1,"mac_address":"54:E0:32:80:68:81","speed":1000},"vlan.2":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"54:E0:32:80:68:81","speed":1000},"vlan.3":{"description":"","is_enabled":false,"is_up":true,"last_flapped":-1,"mac_address":"54:E0:32:80:68:81","speed":1000},"vme":{"description":"","is_enabled":true,"is_up":false,"last_flapped":-1,"mac_address":"54:E0:32:80:68:82","speed":1000},"xe-0/1/0":{"description":"","is_enabled":true,"is_up":true,"last_flapped":698360,"mac_address":"54:E0:32:80:68:B3","speed":10000},"xe-0/1/0.0":{"description":"","is_enabled":false,"is_up":true,"last_flapped":698360,"mac_address":"54:E0:32:80:68:B3","speed":10000},"xe-0/1/0.2":{"description":"","is_enabled":false,"is_up":true,"last_flapped":698360,"mac_address":"54:E0:32:80:68:B3","speed":10000},"xe-0/1/0.3":{"description":"","is_enabled":false,"is_up":true,"last_flapped":698360,"mac_address":"54:E0:32:80:68:B3","speed":10000},"xe-0/1/2":{"description":"","is_enabled":true,"is_up":true,"last_flapped":7876346,"mac_address":"54:E0:32:80:68:B5","speed":10000},"xe-0/1/2.0":{"description":"","is_enabled":false,"is_up":true,"last_flapped":7876346,"mac_address":"54:E0:32:80:68:B5","speed":10000},"xe-0/1/2.2":{"description":"","is_enabled":false,"is_up":true,"last_flapped":7876346,"mac_address":"54:E0:32:80:68:B5","speed":10000},"xe-0/1/2.3":{"description":"","is_enabled":false,"is_up":true,"last_flapped":7876346,"mac_address":"54:E0:32:80:68:B5","speed":10000}} +{ + ".local.": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + ".local..0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + ".local..1": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + ".local..2": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + ".local..3": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + ".local..4": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + ".local..5": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + ".local..6": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + ".local..7": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + "bme0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "00:0B:CA:FE:00:00", + "speed": -1 + }, + "bme0.32768": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "00:0B:CA:FE:00:00", + "speed": -1 + }, + "dsc": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + "ge-0/0/0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 17193266, + "mac_address": "54:E0:32:80:68:83", + "speed": -1 + }, + "ge-0/0/0.0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 17193266, + "mac_address": "54:E0:32:80:68:83", + "speed": -1 + }, + "ge-0/0/1": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:84", + "speed": -1 + }, + "ge-0/0/10": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:8D", + "speed": -1 + }, + "ge-0/0/11": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:8E", + "speed": -1 + }, + "ge-0/0/12": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:8F", + "speed": -1 + }, + "ge-0/0/13": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:90", + "speed": -1 + }, + "ge-0/0/14": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:91", + "speed": -1 + }, + "ge-0/0/15": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:92", + "speed": -1 + }, + "ge-0/0/16": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:93", + "speed": -1 + }, + "ge-0/0/17": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:94", + "speed": -1 + }, + "ge-0/0/18": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:95", + "speed": -1 + }, + "ge-0/0/19": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:96", + "speed": -1 + }, + "ge-0/0/2": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:85", + "speed": -1 + }, + "ge-0/0/20": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:97", + "speed": -1 + }, + "ge-0/0/21": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:98", + "speed": -1 + }, + "ge-0/0/22": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:99", + "speed": -1 + }, + "ge-0/0/23": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:9A", + "speed": -1 + }, + "ge-0/0/24": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:9B", + "speed": -1 + }, + "ge-0/0/25": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:9C", + "speed": -1 + }, + "ge-0/0/26": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:9D", + "speed": -1 + }, + "ge-0/0/27": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:9E", + "speed": -1 + }, + "ge-0/0/28": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:9F", + "speed": -1 + }, + "ge-0/0/29": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:A0", + "speed": -1 + }, + "ge-0/0/3": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:86", + "speed": -1 + }, + "ge-0/0/30": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:A1", + "speed": -1 + }, + "ge-0/0/31": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:A2", + "speed": -1 + }, + "ge-0/0/32": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:A3", + "speed": -1 + }, + "ge-0/0/33": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:A4", + "speed": -1 + }, + "ge-0/0/34": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:A5", + "speed": -1 + }, + "ge-0/0/35": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:A6", + "speed": -1 + }, + "ge-0/0/36": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:A7", + "speed": -1 + }, + "ge-0/0/37": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:A8", + "speed": -1 + }, + "ge-0/0/38": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:A9", + "speed": -1 + }, + "ge-0/0/39": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:AA", + "speed": -1 + }, + "ge-0/0/4": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:87", + "speed": -1 + }, + "ge-0/0/40": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:AB", + "speed": -1 + }, + "ge-0/0/41": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:AC", + "speed": -1 + }, + "ge-0/0/42": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:AD", + "speed": -1 + }, + "ge-0/0/43": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:AE", + "speed": -1 + }, + "ge-0/0/44": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:AF", + "speed": -1 + }, + "ge-0/0/45": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:B0", + "speed": -1 + }, + "ge-0/0/46": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 12710488, + "mac_address": "54:E0:32:80:68:B1", + "speed": -1 + }, + "ge-0/0/46.0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 12710488, + "mac_address": "54:E0:32:80:68:B1", + "speed": -1 + }, + "ge-0/0/47": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 12710487, + "mac_address": "54:E0:32:80:68:B2", + "speed": -1 + }, + "ge-0/0/47.0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 12710487, + "mac_address": "54:E0:32:80:68:B2", + "speed": -1 + }, + "ge-0/0/5": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": 16928759, + "mac_address": "54:E0:32:80:68:88", + "speed": -1 + }, + "ge-0/0/6": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:89", + "speed": -1 + }, + "ge-0/0/7": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:8A", + "speed": -1 + }, + "ge-0/0/8": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:8B", + "speed": -1 + }, + "ge-0/0/9": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:8C", + "speed": -1 + }, + "gre": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + "ipip": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "None", + "speed": -1 + }, + "jsrv": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:80", + "speed": 1000 + }, + "jsrv.1": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:80", + "speed": 1000 + }, + "lo0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + "lo0.16384": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + "lo0.2": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + "lo0.3": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + "lsi": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + "me0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 48575831, + "mac_address": "54:E0:32:80:68:FF", + "speed": 1000 + }, + "me0.0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 48575831, + "mac_address": "54:E0:32:80:68:FF", + "speed": 1000 + }, + "mtun": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + "pimd": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "None", + "speed": -1 + }, + "pime": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "None", + "speed": -1 + }, + "tap": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": -1 + }, + "vcp-0": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": 32000 + }, + "vcp-0.32768": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": 32000 + }, + "vcp-1": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": 32000 + }, + "vcp-1.32768": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "Unspecified", + "speed": 32000 + }, + "vlan": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:81", + "speed": 1000 + }, + "vlan.2": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:81", + "speed": 1000 + }, + "vlan.3": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:81", + "speed": 1000 + }, + "vme": { + "description": "", + "is_enabled": true, + "is_up": false, + "last_flapped": -1, + "mac_address": "54:E0:32:80:68:82", + "speed": 1000 + }, + "xe-0/1/0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 698360, + "mac_address": "54:E0:32:80:68:B3", + "speed": 10000 + }, + "xe-0/1/0.0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 698360, + "mac_address": "54:E0:32:80:68:B3", + "speed": 10000 + }, + "xe-0/1/0.2": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 698360, + "mac_address": "54:E0:32:80:68:B3", + "speed": 10000 + }, + "xe-0/1/0.3": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 698360, + "mac_address": "54:E0:32:80:68:B3", + "speed": 10000 + }, + "xe-0/1/2": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 7876346, + "mac_address": "54:E0:32:80:68:B5", + "speed": 10000 + }, + "xe-0/1/2.0": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 7876346, + "mac_address": "54:E0:32:80:68:B5", + "speed": 10000 + }, + "xe-0/1/2.2": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 7876346, + "mac_address": "54:E0:32:80:68:B5", + "speed": 10000 + }, + "xe-0/1/2.3": { + "description": "", + "is_enabled": true, + "is_up": true, + "last_flapped": 7876346, + "mac_address": "54:E0:32:80:68:B5", + "speed": 10000 + } +} diff --git a/test/nxos/utils/textfsm_templates b/test/nxos/utils/textfsm_templates deleted file mode 120000 index 7f97f02ea..000000000 --- a/test/nxos/utils/textfsm_templates +++ /dev/null @@ -1 +0,0 @@ -../../../napalm/nxos/utils/textfsm_templates \ No newline at end of file diff --git a/test/nxos_ssh/mocked_data/test_get_interfaces/6004_7_3_3_N1_1/expected_result.json b/test/nxos_ssh/mocked_data/test_get_interfaces/6004_7_3_3_N1_1/expected_result.json new file mode 100644 index 000000000..0754d01f1 --- /dev/null +++ b/test/nxos_ssh/mocked_data/test_get_interfaces/6004_7_3_3_N1_1/expected_result.json @@ -0,0 +1,10 @@ +{ + "Ethernet1/1": { + "description": "xxxxxxxxxxxxxxxx", + "is_enabled": true, + "is_up": true, + "last_flapped": -1.0, + "mac_address": "2C:C2:60:12:EC:74", + "speed": 40000 + } +} diff --git a/test/nxos_ssh/mocked_data/test_get_interfaces/6004_7_3_3_N1_1/show_interface.txt b/test/nxos_ssh/mocked_data/test_get_interfaces/6004_7_3_3_N1_1/show_interface.txt new file mode 100644 index 000000000..ddbd6c156 --- /dev/null +++ b/test/nxos_ssh/mocked_data/test_get_interfaces/6004_7_3_3_N1_1/show_interface.txt @@ -0,0 +1,40 @@ +hostname# sh interface +Ethernet1/1 is up + Dedicated Interface + + Belongs to Po81 + Hardware: 40000 Ethernet, address: 2cc2.6012.ec74 (bia 2cc2.6012.ec74) + Description: xxxxxxxxxxxxxxxx + MTU 1500 bytes, BW 40000000 Kbit, DLY 10 usec + reliability 255/255, txload 1/255, rxload 1/255 + Encapsulation ARPA, medium is broadcast + Port mode is trunk + full-duplex, 40 Gb/s, media type is 40G + Beacon is turned off + Input flow-control is off, output flow-control is off + Rate mode is dedicated + Switchport monitor is off + EtherType is 0x8100 + Last link flapped 2week(s) 3day(s) + Last clearing of "show interface" counters never + 1 interface resets + 30 seconds input rate 60611704 bits/sec, 12873 packets/sec + 30 seconds output rate 90316328 bits/sec, 16389 packets/sec + Load-Interval #2: 5 minute (300 seconds) + input rate 49.10 Mbps, 11.53 Kpps; output rate 77.21 Mbps, 14.64 Kpps + RX + 5032486173 unicast packets 429116 multicast packets 378816777 broadcast packets + 5411732066 input packets 3289497962170 bytes + 209492475 jumbo packets 0 storm suppression bytes + 0 runts 0 giants 0 CRC 0 no buffer + 0 input error 0 short frame 0 overrun 0 underrun 0 ignored + 0 watchdog 0 bad etype drop 0 bad proto drop 0 if down drop + 0 input with dribble 0 input discard + 0 Rx pause + TX + 5401707780 unicast packets 421754 multicast packets 438522856 broadcast packets + 5840652390 output packets 3811672709841 bytes + 155299606 jumbo packets + 0 output error 0 collision 0 deferred 0 late collision + 0 lost carrier 0 no carrier 0 babble 0 output discard + 0 Tx pause diff --git a/test/nxos_ssh/utils/textfsm_templates b/test/nxos_ssh/utils/textfsm_templates deleted file mode 120000 index 3efd0231f..000000000 --- a/test/nxos_ssh/utils/textfsm_templates +++ /dev/null @@ -1 +0,0 @@ -../../../napalm/nxos_ssh/utils/textfsm_templates \ No newline at end of file