From 7b4470e841942143ab49aed64a3ac74eb7faeb37 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 20 Mar 2022 06:12:55 -0700 Subject: [PATCH 01/49] remove unnecessary type ignore for paramiko transport --- scrapli/transport/plugins/paramiko/transport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrapli/transport/plugins/paramiko/transport.py b/scrapli/transport/plugins/paramiko/transport.py index 8694e7aa..7c547eb1 100644 --- a/scrapli/transport/plugins/paramiko/transport.py +++ b/scrapli/transport/plugins/paramiko/transport.py @@ -77,7 +77,7 @@ def open(self) -> None: self.socket.open() try: - self.session = _ParamikoTransport(self.socket.sock) # type: ignore + self.session = _ParamikoTransport(self.socket.sock) self.session.start_client() except Exception as exc: self.logger.critical("failed to complete handshake with host") From df87576054dcc44387214bf963b0f0091e0d49c1 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Fri, 1 Apr 2022 08:43:24 -0700 Subject: [PATCH 02/49] house keeping --- .github/workflows/commit.yaml | 10 +++++----- .github/workflows/debug.yaml | 2 +- .github/workflows/publish.yaml | 4 ++-- .github/workflows/weekly.yaml | 4 ++-- requirements-dev.txt | 14 +++++++------- scrapli/driver/network/base_driver.py | 2 +- scrapli/transport/plugins/paramiko/transport.py | 2 +- setup.py | 3 ++- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 51269e82..ec546e8d 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -11,7 +11,7 @@ jobs: os: [ubuntu-latest] version: ["3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} uses: actions/setup-python@v3 with: @@ -32,7 +32,7 @@ jobs: os: [ubuntu-latest] version: ["3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} uses: actions/setup-python@v3 with: @@ -57,7 +57,7 @@ jobs: os: [ubuntu-latest, macos-latest] version: ["3.7", "3.8", "3.9", "3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} uses: actions/setup-python@v3 with: @@ -86,10 +86,10 @@ jobs: docs-test: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: docker run -v $(pwd):/docs --entrypoint "" squidfunk/mkdocs-material:latest ash -c 'pip install mdx_gh_links && mkdocs build --clean --strict' - name: Cache htmltest external links - uses: actions/cache@v2 + uses: actions/cache@v3.0.1 with: path: tmp/.htmltest # key will contain hash of all md files to check if files have changed diff --git a/.github/workflows/debug.yaml b/.github/workflows/debug.yaml index 7d9ab783..60ba984b 100644 --- a/.github/workflows/debug.yaml +++ b/.github/workflows/debug.yaml @@ -14,6 +14,6 @@ jobs: runs-on: ubuntu-latest if: github.actor == github.event.repository.owner.login steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup tmate session uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 6f015b45..56a1d736 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -8,7 +8,7 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: set up python 3.10 uses: actions/setup-python@v2 with: @@ -27,7 +27,7 @@ jobs: python setup.py sdist bdist_wheel python -m twine upload dist/* - name: create release branch - uses: peterjgrainger/action-create-branch@v2.1.0 + uses: peterjgrainger/action-create-branch@v2.2.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/weekly.yaml b/.github/workflows/weekly.yaml index ab9a693a..aa303540 100644 --- a/.github/workflows/weekly.yaml +++ b/.github/workflows/weekly.yaml @@ -15,7 +15,7 @@ jobs: os: [ubuntu-latest] version: ["3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} uses: actions/setup-python@v3 with: @@ -36,7 +36,7 @@ jobs: os: [ubuntu-latest, macos-latest] version: ["3.7", "3.8", "3.9", "3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} uses: actions/setup-python@v3 with: diff --git a/requirements-dev.txt b/requirements-dev.txt index f2d0d27a..29746637 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,13 +1,13 @@ -black==22.1.0 -darglint==1.8.1,<2.0.0 +black==22.3.0 +darglint>=1.8.1,<2.0.0 isort>=5.10.1,<6.0.0 -mypy==0.931 +mypy==0.942 nox==2022.01.07 -pycodestyle==2.8.0,<3.0.0 -pydocstyle==6.1.1,<7.0.0 +pycodestyle>=2.8.0,<3.0.0 +pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 -pylama==8.3.7,<9.0.0 -pylint==2.12.2 +pylama>=8.3.7,<9.0.0 +pylint==2.13.4 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 diff --git a/scrapli/driver/network/base_driver.py b/scrapli/driver/network/base_driver.py index b72ce3a0..7ebfac8e 100644 --- a/scrapli/driver/network/base_driver.py +++ b/scrapli/driver/network/base_driver.py @@ -112,7 +112,7 @@ def _generate_comms_prompt_pattern(self) -> None: rf"({priv_level_data.pattern})" for priv_level_data in self.privilege_levels.values() ) - @lru_cache() + @lru_cache(maxsize=64) def _determine_current_priv(self, current_prompt: str) -> List[str]: """ Determine current privilege level from prompt string diff --git a/scrapli/transport/plugins/paramiko/transport.py b/scrapli/transport/plugins/paramiko/transport.py index 7c547eb1..8694e7aa 100644 --- a/scrapli/transport/plugins/paramiko/transport.py +++ b/scrapli/transport/plugins/paramiko/transport.py @@ -77,7 +77,7 @@ def open(self) -> None: self.socket.open() try: - self.session = _ParamikoTransport(self.socket.sock) + self.session = _ParamikoTransport(self.socket.sock) # type: ignore self.session.start_client() except Exception as exc: self.logger.critical("failed to complete handshake with host") diff --git a/setup.py b/setup.py index 0f0f2810..b81183f0 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ #!/usr/bin/env python """scrapli""" +from copy import copy from pathlib import Path import setuptools @@ -23,7 +24,7 @@ "community": [], } -for extra in EXTRAS_REQUIRE: +for extra in copy(EXTRAS_REQUIRE): with open(f"requirements-{extra}.txt", "r", encoding="utf-8") as f: # drops the version cap on pins but lets us keep it in the extras requirements files # such that CI can be more deterministic and dependabot notifications are more useful From b9d6a954e0892cfb3a313d7475d88e2c2f4273a9 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 3 Apr 2022 09:09:19 -0700 Subject: [PATCH 03/49] change weekly build to develop branch --- .github/workflows/weekly.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/weekly.yaml b/.github/workflows/weekly.yaml index aa303540..b84b4b20 100644 --- a/.github/workflows/weekly.yaml +++ b/.github/workflows/weekly.yaml @@ -16,6 +16,8 @@ jobs: version: ["3.10"] steps: - uses: actions/checkout@v3 + with: + ref: develop - name: set up python ${{ matrix.version }} uses: actions/setup-python@v3 with: @@ -37,6 +39,8 @@ jobs: version: ["3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3 + with: + ref: develop - name: set up python ${{ matrix.version }} uses: actions/setup-python@v3 with: From 34b1b8776ddd9df1c5d4515cc19d841c4094ee21 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 9 Apr 2022 13:31:07 -0700 Subject: [PATCH 04/49] move control chars to base transport package --- scrapli/transport/base/telnet_common.py | 9 +++++++++ scrapli/transport/plugins/asynctelnet/transport.py | 13 ++----------- 2 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 scrapli/transport/base/telnet_common.py diff --git a/scrapli/transport/base/telnet_common.py b/scrapli/transport/base/telnet_common.py new file mode 100644 index 00000000..5aa5acf6 --- /dev/null +++ b/scrapli/transport/base/telnet_common.py @@ -0,0 +1,9 @@ +"""scrapli.transport.base.telnet_common""" + +IAC = bytes([255]) +DONT = bytes([254]) +DO = bytes([253]) +WONT = bytes([252]) +WILL = bytes([251]) +TERM_TYPE = bytes([24]) +SUPPRESS_GO_AHEAD = bytes([3]) diff --git a/scrapli/transport/plugins/asynctelnet/transport.py b/scrapli/transport/plugins/asynctelnet/transport.py index d47e5457..81b01f3e 100644 --- a/scrapli/transport/plugins/asynctelnet/transport.py +++ b/scrapli/transport/plugins/asynctelnet/transport.py @@ -11,15 +11,7 @@ ScrapliConnectionNotOpened, ) from scrapli.transport.base import AsyncTransport, BasePluginTransportArgs, BaseTransportArgs - -# telnet control characters we care about -IAC = bytes([255]) -DONT = bytes([254]) -DO = bytes([253]) -WONT = bytes([252]) -WILL = bytes([251]) -TERM_TYPE = bytes([24]) -SUPPRESS_GO_AHEAD = bytes([3]) +from scrapli.transport.base.telnet_common import DO, DONT, IAC, SUPPRESS_GO_AHEAD, WILL, WONT @dataclass() @@ -38,7 +30,6 @@ def __init__( self.stdin: Optional[asyncio.StreamWriter] = None self._initial_buf = b"" - self._stdout_binary_transmission = False def _handle_control_chars_response(self, control_buf: bytes, c: bytes) -> bytes: """ " @@ -98,7 +89,7 @@ def _handle_control_chars_response(self, control_buf: bytes, c: bytes) -> bytes: return control_buf async def _handle_control_chars(self) -> None: - """ " + """ Handle control characters -- nearly identical to CPython telnetlib Basically we want to read and "decline" any and all control options that the server proposes From 721d9ea9a2d0dbec08d35925d901cb7a6c271277 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 9 Apr 2022 14:46:32 -0700 Subject: [PATCH 05/49] asynctelnet tidying --- scrapli/transport/plugins/asynctelnet/transport.py | 2 +- .../plugins/asynctelnet/test_asynctelnet_transport.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scrapli/transport/plugins/asynctelnet/transport.py b/scrapli/transport/plugins/asynctelnet/transport.py index 81b01f3e..30c02195 100644 --- a/scrapli/transport/plugins/asynctelnet/transport.py +++ b/scrapli/transport/plugins/asynctelnet/transport.py @@ -32,7 +32,7 @@ def __init__( self._initial_buf = b"" def _handle_control_chars_response(self, control_buf: bytes, c: bytes) -> bytes: - """ " + """ Handle the actual response to control characters Broken up to be easier to test as well as to appease mr. mccabe diff --git a/tests/unit/transport/plugins/asynctelnet/test_asynctelnet_transport.py b/tests/unit/transport/plugins/asynctelnet/test_asynctelnet_transport.py index f5971e93..86b27c20 100644 --- a/tests/unit/transport/plugins/asynctelnet/test_asynctelnet_transport.py +++ b/tests/unit/transport/plugins/asynctelnet/test_asynctelnet_transport.py @@ -85,6 +85,8 @@ async def _read(cls, _): await asynctelnet_transport._handle_control_chars() + assert _read_called == 1 + async def test_handle_control_characters_exception(asynctelnet_transport): with pytest.raises(ScrapliConnectionNotOpened): @@ -121,6 +123,8 @@ async def _read(cls, _): with pytest.raises(ScrapliConnectionNotOpened): await asynctelnet_transport._handle_control_chars() + assert _read_called == 1 + def test_close(asynctelnet_transport): # lie like connection is open From 5b95ff659214b13a4abd1504b384ed542f4d4839 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 9 Apr 2022 15:30:30 -0700 Subject: [PATCH 06/49] add kex to iosxe functional test params --- tests/devices.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/devices.py b/tests/devices.py index 405660cc..cb21f0e7 100644 --- a/tests/devices.py +++ b/tests/devices.py @@ -35,6 +35,7 @@ "host": "localhost" if not CLAB_BRIDGE else "172.18.0.11", "port": 21022 if not CLAB_BRIDGE else 22, "base_config": f"{TEST_DATA_PATH}/base_configs/cisco_iosxe", + "transport_options": {"open_cmd": ["-o", "KexAlgorithms=+diffie-hellman-group14-sha1"]}, }, "cisco_nxos": { "driver": NXOSDriver, From c8c342b721463ec300dfd7739049b535a3b5aa3b Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 9 Apr 2022 15:30:43 -0700 Subject: [PATCH 07/49] add kex to iosxe prepare dev env --- tests/prepare_devices.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/prepare_devices.py b/tests/prepare_devices.py index bfb79886..a270f68a 100644 --- a/tests/prepare_devices.py +++ b/tests/prepare_devices.py @@ -24,6 +24,7 @@ def prepare_device(test_devices): "auth_password": DEVICES[device]["auth_password"], "auth_secondary": DEVICES[device]["auth_secondary"], "auth_strict_key": DEVICES[device]["auth_strict_key"], + "transport_options": {"open_cmd": ["-o", "KexAlgorithms=+diffie-hellman-group14-sha1"]}, "platform": device, # nxos on macos w/out acceleration is... slooooooooooow "timeout_ops": 120, From 36a944676c412721a49e1817c384d6c686c81e16 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 9 Apr 2022 15:38:15 -0700 Subject: [PATCH 08/49] custom telnet transport --- scrapli/transport/plugins/telnet/transport.py | 196 ++++++++++--- .../plugins/telnet/test_telnet_transport.py | 277 +++++++++++++++--- 2 files changed, 391 insertions(+), 82 deletions(-) diff --git a/scrapli/transport/plugins/telnet/transport.py b/scrapli/transport/plugins/telnet/transport.py index d4fd0333..63c6a76b 100644 --- a/scrapli/transport/plugins/telnet/transport.py +++ b/scrapli/transport/plugins/telnet/transport.py @@ -1,11 +1,12 @@ """scrapli.transport.plugins.telnet.transport""" from dataclasses import dataclass -from telnetlib import Telnet from typing import Optional from scrapli.decorators import TransportTimeout from scrapli.exceptions import ScrapliConnectionError, ScrapliConnectionNotOpened from scrapli.transport.base import BasePluginTransportArgs, BaseTransportArgs, Transport +from scrapli.transport.base.base_socket import Socket +from scrapli.transport.base.telnet_common import DO, DONT, IAC, SUPPRESS_GO_AHEAD, WILL, WONT @dataclass() @@ -13,81 +14,196 @@ class PluginTransportArgs(BasePluginTransportArgs): pass -class ScrapliTelnet(Telnet): - def __init__(self, host: str, port: int, timeout: float) -> None: +class TelnetTransport(Transport): + def __init__( + self, base_transport_args: BaseTransportArgs, plugin_transport_args: PluginTransportArgs + ) -> None: + super().__init__(base_transport_args=base_transport_args) + self.plugin_transport_args = plugin_transport_args + + self.socket: Optional[Socket] = None + self._initial_buf = b"" + + def _set_socket_timeout(self, timeout: float) -> None: """ - ScrapliTelnet class for typing purposes + Set underlying socket timeout + + Mostly this exists just to assert that socket and socket.sock are not None to appease mypy! Args: - host: string of host - port: integer port to connect to - timeout: timeout value in seconds + timeout: float value to set as the timeout Returns: - None + N/A Raises: + ScrapliConnectionNotOpened: if either socket or socket.sock are None + """ + if self.socket is None: + raise ScrapliConnectionNotOpened + if self.socket.sock is None: + raise ScrapliConnectionNotOpened + self.socket.sock.settimeout(timeout) + + def _handle_control_chars_response(self, control_buf: bytes, c: bytes) -> bytes: + """ + Handle the actual response to control characters + + Broken up to be easier to test as well as to appease mr. mccabe + + NOTE: see the asynctelnet transport for additional comments inline about what is going on + here. + + Args: + control_buf: current control_buf to work with + c: currently read control char to process + + Returns: + bytes: updated control_buf + + Raises: + ScrapliConnectionNotOpened: if connection is not opened for some reason + + """ + if not self.socket: + raise ScrapliConnectionNotOpened + + if not control_buf: + if c != IAC: + self._initial_buf += c + else: + control_buf += c + + elif len(control_buf) == 1 and c in (DO, DONT, WILL, WONT): + control_buf += c + + elif len(control_buf) == 2: + cmd = control_buf[1:2] + control_buf = b"" + + if (cmd == DO) and (c == SUPPRESS_GO_AHEAD): + self.write(IAC + WILL + c) + elif cmd in (DO, DONT): + self.write(IAC + WONT + c) + elif cmd == WILL: + self.write(IAC + DO + c) + elif cmd == WONT: + self.write(IAC + DONT + c) + + return control_buf + + def _handle_control_chars(self) -> None: + """ + Handle control characters -- nearly identical to CPython (removed in 3.11) telnetlib + + Basically we want to read and "decline" any and all control options that the server proposes + to us -- so if they say "DO" XYZ directive, we say "DONT", if they say "WILL" we say "WONT". + + NOTE: see the asynctelnet transport for additional comments inline about what is going on + here. + + Args: N/A + Returns: + None + + Raises: + ScrapliConnectionNotOpened: if connection is not opened for some reason + ScrapliConnectionNotOpened: if we read an empty byte string from the reader -- this + indicates the server sent an EOF -- see #142 + """ - self.eof: bool - self.timeout: float + if not self.socket: + raise ScrapliConnectionNotOpened - super().__init__(host, port, int(timeout)) + control_buf = b"" + original_socket_timeout = self._base_transport_args.timeout_socket + self._set_socket_timeout(self._base_transport_args.timeout_socket / 4) -class TelnetTransport(Transport): - def __init__( - self, base_transport_args: BaseTransportArgs, plugin_transport_args: PluginTransportArgs - ) -> None: - super().__init__(base_transport_args=base_transport_args) - self.plugin_transport_args = plugin_transport_args + while True: + try: + c = self._read(1) + if not c: + raise ScrapliConnectionNotOpened("server returned EOF, connection not opened") + except TimeoutError: + # shouldn't really matter/need to be reset back to "normal", but don't really want + # to leave it modified as that would be confusing! + self._base_transport_args.timeout_socket = original_socket_timeout + return - self.session: Optional[ScrapliTelnet] = None + self._set_socket_timeout(self._base_transport_args.timeout_socket / 10) + control_buf = self._handle_control_chars_response(control_buf=control_buf, c=c) def open(self) -> None: self._pre_open_closing_log(closing=False) - # establish session with "socket" timeout, then reset timeout to "transport" timeout - try: - self.session = ScrapliTelnet( + if not self.socket: + self.socket = Socket( host=self._base_transport_args.host, port=self._base_transport_args.port, timeout=self._base_transport_args.timeout_socket, ) - self.session.timeout = self._base_transport_args.timeout_transport - except ConnectionError as exc: - msg = f"Failed to open telnet session to host {self._base_transport_args.host}" - if "connection refused" in str(exc).lower(): - msg = ( - f"Failed to open telnet session to host {self._base_transport_args.host}, " - "connection refused" - ) - raise ScrapliConnectionError(msg) from exc + + if not self.socket.isalive(): + self.socket.open() + + self._handle_control_chars() self._post_open_closing_log(closing=False) def close(self) -> None: self._pre_open_closing_log(closing=True) - if self.session: - self.session.close() + if self.socket: + self.socket.close() - self.session = None + self.socket = None self._post_open_closing_log(closing=True) def isalive(self) -> bool: - if not self.session: + if not self.socket: return False - return not self.session.eof + if not self.socket.isalive(): + return False + return True + + def _read(self, n: int = 65535) -> bytes: + """ + Read n bytes from the socket + + Mostly this exists just to assert that socket and socket.sock are not None to appease mypy! + + Args: + n: optional amount of bytes to try to recv from the underlying socket + + Returns: + N/A + + Raises: + ScrapliConnectionNotOpened: if either socket or socket.sock are None + """ + if self.socket is None: + raise ScrapliConnectionNotOpened + if self.socket.sock is None: + raise ScrapliConnectionNotOpened + return self.socket.sock.recv(n) @TransportTimeout("timed out reading from transport") def read(self) -> bytes: - if not self.session: + if not self.socket: raise ScrapliConnectionNotOpened + + if self._initial_buf: + buf = self._initial_buf + self._initial_buf = b"" + return buf + try: - buf = self.session.read_eager() + buf = self._read() + buf = buf.replace(b"\x00", b"") except Exception as exc: raise ScrapliConnectionError( "encountered EOF reading from transport; typically means the device closed the " @@ -96,6 +212,8 @@ def read(self) -> bytes: return buf def write(self, channel_input: bytes) -> None: - if not self.session: + if self.socket is None: + raise ScrapliConnectionNotOpened + if self.socket.sock is None: raise ScrapliConnectionNotOpened - self.session.write(channel_input) + self.socket.sock.send(channel_input) diff --git a/tests/unit/transport/plugins/telnet/test_telnet_transport.py b/tests/unit/transport/plugins/telnet/test_telnet_transport.py index 8472ae11..94daca87 100644 --- a/tests/unit/transport/plugins/telnet/test_telnet_transport.py +++ b/tests/unit/transport/plugins/telnet/test_telnet_transport.py @@ -1,86 +1,277 @@ +import time from io import BytesIO -from telnetlib import Telnet import pytest -from scrapli.exceptions import ScrapliConnectionError, ScrapliConnectionNotOpened -from scrapli.transport.plugins.telnet.transport import ScrapliTelnet +from scrapli.exceptions import ScrapliConnectionNotOpened, ScrapliTimeout -def test_scrapli_telnet_type(): - # connection error will get raised because 23 shouldnt be open for most devices running the test - with pytest.raises(ConnectionError): - conn = ScrapliTelnet("localhost", 23, 100) - assert conn.host == "localhost" - assert conn.port == 23 - assert conn.timeout == 100 +def test_handle_control_characters_response_empty_control_buf_iac(telnet_transport): + # lie to transport so socket is not None + telnet_transport.socket = 1 + actual_control_buf = telnet_transport._handle_control_chars_response( + control_buf=b"", c=bytes([255]) + ) + assert actual_control_buf == bytes([255]) -def test_close(monkeypatch, telnet_transport): - def _close(cls): - pass - monkeypatch.setattr( - "telnetlib.Telnet.close", - _close, +def test_handle_control_characters_response_not_iac(telnet_transport): + # lie to transport so socket is not None + telnet_transport.socket = 1 + + actual_control_buf = telnet_transport._handle_control_chars_response(control_buf=b"", c=b"X") + assert telnet_transport._initial_buf == b"X" + assert actual_control_buf == b"" + + +def test_handle_control_characters_response_second_char(telnet_transport): + # lie to transport so socket is not None + telnet_transport.socket = 1 + + actual_control_buf = telnet_transport._handle_control_chars_response( + control_buf=bytes([255]), c=bytes([253]) ) + assert telnet_transport._initial_buf == b"" + assert actual_control_buf == bytes([255, 253]) - telnet_transport.session = Telnet() - telnet_transport.close() - assert telnet_transport.session is None +@pytest.mark.parametrize( + "test_data", + ((253, 252), (251, 253), (252, 254)), + ids=("do-return-wont", "will-return-do", "wont-return-dont"), +) +def test_handle_control_characters_response_third_char(telnet_transport, test_data): + control_buf_input, expected_output = test_data + # lie to transport so socket is not None and give sock a thing to write to + class Dummy: + ... -def test_isalive_no_session(telnet_transport): - assert telnet_transport.isalive() is False + class DummySock: + def __init__(self): + self.buf = BytesIO() + def send(self, channel_input): + self.buf.write(channel_input) -def test_isalive(telnet_transport): - telnet_transport.session = Telnet() - assert telnet_transport.isalive() is True + telnet_transport.socket = Dummy() + telnet_transport.socket.sock = DummySock() + + actual_control_buf = telnet_transport._handle_control_chars_response( + control_buf=bytes([255, control_buf_input]), c=bytes([1]) + ) + assert telnet_transport._initial_buf == b"" + assert actual_control_buf == b"" + + telnet_transport.socket.sock.buf.seek(0) + # assert we get IAC, DONT, then whatever the command was + assert telnet_transport.socket.sock.buf.read() == bytes([255, expected_output, 1]) + + +def test_handle_control_characters_response_exception(telnet_transport): + with pytest.raises(ScrapliConnectionNotOpened): + telnet_transport._handle_control_chars_response(control_buf=b"", c=b"") + + +def test_handle_control_characters(monkeypatch, telnet_transport): + _read_called = 0 + + def _read(cls, _): + nonlocal _read_called + if _read_called == 0: + _read_called += 1 + return bytes([255]) -def test_read(monkeypatch, telnet_transport): - def _read(cls): - return b"somebytes" + # we expect to timeout reading control chars (in this case after just reading one to test + # the overall flow of things) + raise TimeoutError monkeypatch.setattr( - "telnetlib.Telnet.read_eager", + "scrapli.transport.plugins.telnet.transport.TelnetTransport._read", _read, ) - # lie and pretend the session is already assigned - telnet_transport.session = Telnet() + monkeypatch.setattr( + "scrapli.transport.plugins.telnet.transport.TelnetTransport._handle_control_chars_response", + lambda cls, **kwargs: None, + ) - assert telnet_transport.read() == b"somebytes" + # lie like connection is open + class Dummy: + ... + + class DummySock: + def __init__(self): + self.buf = BytesIO() + + def send(self, channel_input): + self.buf.write(channel_input) + def settimeout(self, t): + ... -def test_read_exception_not_open(telnet_transport): + telnet_transport.socket = Dummy() + telnet_transport.socket.sock = DummySock() + + telnet_transport._handle_control_chars() + + assert _read_called == 1 + + +def test_handle_control_characters_exception(telnet_transport): with pytest.raises(ScrapliConnectionNotOpened): - telnet_transport.read() + telnet_transport._handle_control_chars() -def test_read_exception_eof(monkeypatch, telnet_transport): - def _read(cls): - raise EOFError +def test_handle_control_characters_exception_eof(monkeypatch, telnet_transport): + # if the server closes the connection/EOF we will read an empty byte string, see #141 + _read_called = 0 + + def _read(cls, _): + nonlocal _read_called + + if _read_called == 0: + _read_called += 1 + return b"" monkeypatch.setattr( - "telnetlib.Telnet.read_eager", + "scrapli.transport.plugins.telnet.transport.TelnetTransport._read", _read, ) - # lie and pretend the session is already assigned - telnet_transport.session = Telnet() + monkeypatch.setattr( + "scrapli.transport.plugins.telnet.transport.TelnetTransport._handle_control_chars_response", + lambda cls, **kwargs: None, + ) + + # lie like connection is open + class Dummy: + ... + + class DummySock: + def __init__(self): + self.buf = BytesIO() + + def send(self, channel_input): + self.buf.write(channel_input) + + def settimeout(self, t): + ... + + telnet_transport.socket = Dummy() + telnet_transport.socket.sock = DummySock() + telnet_transport._base_transport_args.timeout_socket = 0.4 - with pytest.raises(ScrapliConnectionError): + with pytest.raises(ScrapliConnectionNotOpened): + telnet_transport._handle_control_chars() + + assert _read_called == 1 + + +def test_close(telnet_transport): + # lie like connection is open + class Dummy: + def close(self): + ... + + telnet_transport.socket = Dummy() + + telnet_transport.close() + + assert telnet_transport.socket is None + + +def test_isalive_no_session(telnet_transport): + assert telnet_transport.isalive() is False + + +def test_isalive(telnet_transport): + # lie like connection is open + class Dummy: + def isalive(self): + return True + + telnet_transport.socket = Dummy() + + assert telnet_transport.isalive() is True + + +async def test_read(telnet_transport): + # lie like connection is open + class Dummy: + ... + + class DummySock: + def __init__(self): + self.buf = BytesIO() + + def send(self, channel_input): + self.buf.write(channel_input) + + def settimeout(self, t): + ... + + def recv(self, n): + self.buf.seek(0) + return self.buf.read() + + telnet_transport.socket = Dummy() + telnet_transport.socket.sock = DummySock() + telnet_transport.socket.sock.buf.write(b"somebytes\x00") + + assert telnet_transport.read() == b"somebytes" + + +def test_read_timeout(telnet_transport): + # lie like connection is open + class Dummy: + def close(self): + ... + + class DummySock: + def __init__(self): + self.buf = BytesIO() + + def send(self, channel_input): + self.buf.write(channel_input) + + def recv(self, n): + time.sleep(1) + return self.buf.read() + + telnet_transport.socket = Dummy() + telnet_transport.socket.sock = DummySock() + telnet_transport._base_transport_args.timeout_transport = 0.1 + + with pytest.raises(ScrapliTimeout): telnet_transport.read() def test_write(telnet_transport): - telnet_transport.session = BytesIO() + # lie like connection is open + class Dummy: + def close(self): + ... + + class DummySock: + def __init__(self): + self.buf = BytesIO() + + def send(self, channel_input): + self.buf.write(channel_input) + + def recv(self, n): + time.sleep(1) + return self.buf.read() + + telnet_transport.socket = Dummy() + telnet_transport.socket.sock = DummySock() telnet_transport.write(b"blah") - telnet_transport.session.seek(0) - assert telnet_transport.session.read() == b"blah" + telnet_transport.socket.sock.buf.seek(0) + + assert telnet_transport.read() == b"blah" def test_write_exception(telnet_transport): From c350bad634cb4435568e3adb43c0409cb5cd7e6f Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 9 Apr 2022 15:57:40 -0700 Subject: [PATCH 09/49] bump pylint --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 29746637..310a06ed 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 pylama>=8.3.7,<9.0.0 -pylint==2.13.4 +pylint==2.13.5 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 From 62b988ad611c27813a52fd09f6663794d460fe58 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Thu, 21 Apr 2022 07:26:54 -0700 Subject: [PATCH 10/49] add thank you to jetbrains, because they are awesome! --- README.md | 4 ++-- docs/about/thank_you.md | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ce59a665..da4e2bee 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

+

[![Supported Versions](https://img.shields.io/pypi/pyversions/scrapli.svg)](https://pypi.org/project/scrapli) [![PyPI version](https://badge.fury.io/py/scrapli.svg)](https://badge.fury.io/py/scrapli) @@ -68,7 +68,7 @@ See the [docs](https://carlmontanari.github.io/scrapli/user_guide/installation) -## A simple Example +## A Simple Example ```python from scrapli import Scrapli diff --git a/docs/about/thank_you.md b/docs/about/thank_you.md index f53bfb91..38f6270e 100644 --- a/docs/about/thank_you.md +++ b/docs/about/thank_you.md @@ -22,7 +22,7 @@ Thank you to the following people who have made contributions other than (and ma - [Roman Dodin](https://github.com/hellt) for inspiration to make the docs much better and for adding the doc testing to keep them looking good! - + The following people have helped identify and report bugs in scrapli, thank you all! - [Kirill Pletnev](https://github.com/horseinthesky) @@ -37,3 +37,13 @@ The following people have helped identify and report bugs in scrapli, thank you - [Additional enable password prompt format IOSXE](https://github.com/carlmontanari/scrapli/issues/45) - [Natasha Samoylenko](https://github.com/natenka) - Missing open timeout on `asynctelnet` transport + +This list has not been kept up as well as it should, apologies for that! Thank you to everyone else who has +contributed in any way to scrapli! + +Last, but very much not least, a huge shoutout to JetBrains for building awesome tools and providing licenses for their +pro tools to open source developers (like me)! If you would like to use JetBrains awesome products, check out their +open source support page [here](https://jb.gg/OpenSourceSupport) for me info. + +

JetBrains Logo (Main) logo.

From 036ea924d2b20026f3a4acc3baa67a5e01749cc5 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 1 May 2022 05:29:28 -0700 Subject: [PATCH 11/49] bump pins --- .github/workflows/commit.yaml | 4 ++-- requirements-dev.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index ec546e8d..06b4b240 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -47,7 +47,7 @@ jobs: TERM: xterm run: python -m nox -s unit_tests - name: Upload coverage - uses: codecov/codecov-action@v2.1.0 + uses: codecov/codecov-action@v3.1.0 build_posix: runs-on: ${{ matrix.os }} @@ -89,7 +89,7 @@ jobs: - uses: actions/checkout@v3 - run: docker run -v $(pwd):/docs --entrypoint "" squidfunk/mkdocs-material:latest ash -c 'pip install mdx_gh_links && mkdocs build --clean --strict' - name: Cache htmltest external links - uses: actions/cache@v3.0.1 + uses: actions/cache@v3.0.2 with: path: tmp/.htmltest # key will contain hash of all md files to check if files have changed diff --git a/requirements-dev.txt b/requirements-dev.txt index 310a06ed..18a506be 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,13 +1,13 @@ black==22.3.0 darglint>=1.8.1,<2.0.0 isort>=5.10.1,<6.0.0 -mypy==0.942 +mypy==0.950 nox==2022.01.07 pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 pylama>=8.3.7,<9.0.0 -pylint==2.13.5 +pylint==2.13.7 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 From 8ab6cbde14036c7fe73b92b3a9ccc6fa332570e2 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Fri, 6 May 2022 08:47:30 -0700 Subject: [PATCH 12/49] handle seeing current priv again after trying to escalate auth --- docs/changelog.md | 4 ++ scrapli/driver/network/async_driver.py | 5 +- scrapli/driver/network/sync_driver.py | 5 +- .../network/test_network_async_driver.py | 62 +++++++++++++++++++ .../network/test_network_sync_driver.py | 62 ++++++++++++++++++- 5 files changed, 135 insertions(+), 3 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index a6f120af..3397282c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -6,6 +6,10 @@ Changelog - Remove newline anchor in in-channel auth password pattern. Felt like a good/smart idea but Cisco in their infinite wisdom have some awful banner on IOL (CML/VIRL) things that doesn't end with a newline and too many people will hit that. +- Modified `escalate_priv` methods to check for password prompt and desired prompt patterns *and* the current prompt + pattern. There was an issue in scrapligo/containerlab where a cEOS device would not let you auth past enable until + it is done "booting" up, and scrapli would just simply timeout as it didn't expect to see the exec prompt again. + Thanks to @hellt for helping track this one down! ## 2022.01.30 diff --git a/scrapli/driver/network/async_driver.py b/scrapli/driver/network/async_driver.py index 13acab8e..d1a16563 100644 --- a/scrapli/driver/network/async_driver.py +++ b/scrapli/driver/network/async_driver.py @@ -106,7 +106,10 @@ async def _escalate(self, escalate_priv: PrivilegeLevel) -> None: (escalate_priv.escalate, escalate_priv.escalate_prompt, False), (self.auth_secondary, escalate_priv.pattern, True), ], - interaction_complete_patterns=[escalate_priv.pattern], + interaction_complete_patterns=[ + self.privilege_levels[escalate_priv.previous_priv].pattern, + escalate_priv.pattern, + ], ) except ScrapliTimeout as exc: raise ScrapliAuthenticationFailed( diff --git a/scrapli/driver/network/sync_driver.py b/scrapli/driver/network/sync_driver.py index a12934dc..11027337 100644 --- a/scrapli/driver/network/sync_driver.py +++ b/scrapli/driver/network/sync_driver.py @@ -106,7 +106,10 @@ def _escalate(self, escalate_priv: PrivilegeLevel) -> None: (escalate_priv.escalate, escalate_priv.escalate_prompt, False), (self.auth_secondary, escalate_priv.pattern, True), ], - interaction_complete_patterns=[escalate_priv.pattern], + interaction_complete_patterns=[ + self.privilege_levels[escalate_priv.previous_priv].pattern, + escalate_priv.pattern, + ], ) except ScrapliTimeout as exc: raise ScrapliAuthenticationFailed( diff --git a/tests/unit/driver/network/test_network_async_driver.py b/tests/unit/driver/network/test_network_async_driver.py index 9251c884..4c3cafb2 100644 --- a/tests/unit/driver/network/test_network_async_driver.py +++ b/tests/unit/driver/network/test_network_async_driver.py @@ -112,6 +112,68 @@ async def _send_input(cls, channel_input, **kwargs): await async_network_driver.acquire_priv(desired_priv="privilege_exec") +async def test_acquire_priv_escalate_not_ready_same_priv(monkeypatch, async_network_driver): + """ + This tests to make sure that if the device does something like ceos does like this: + + ``` + info::ceos::"sending channelInput: enable; stripPrompt: false; eager: false + write::ceos::write: enable + debug::ceos::read: enable + write::ceos::write: + debug::ceos::read: + debug::ceos::read: % Authorization denied for command 'enable': Default authorization provider rejects all commands + debug::ceos::read: ceos> + ``` + + we gracefully handle returning to the current priv level -- rather than only being okay with + seeing a password prompt and/or the *next* pirv level. Thank you @ntdvps/@hellt (Roman) for + helping find this issue! + + """ + _prompt_counter = 0 + + async def _get_prompt(cls): + nonlocal _prompt_counter + if _prompt_counter == 0: + prompt = "scrapli>" + elif _prompt_counter == 1: + prompt = "scrapli>" + else: + prompt = "scrapli#" + _prompt_counter += 1 + return prompt + + async def __read_until_input(cls, channel_input): + return channel_input + + async def __read_until_explicit_prompt(cls, prompts): + # we dont really care what we return here, just needs to be bytes. but we *do* care that + # in this case we are receiving *three* prompt patterns -- the password pattern, the + # escalate priv pattern, and the *current* priv pattern. + assert len(prompts) == 3 + + return b"scrapli>" + + def _write(cls, channel_input, **kwargs): + return + + monkeypatch.setattr("scrapli.channel.async_channel.AsyncChannel.get_prompt", _get_prompt) + monkeypatch.setattr( + "scrapli.channel.async_channel.AsyncChannel._read_until_input", __read_until_input + ) + monkeypatch.setattr( + "scrapli.channel.async_channel.AsyncChannel._read_until_explicit_prompt", + __read_until_explicit_prompt, + ) + monkeypatch.setattr( + "scrapli.transport.plugins.asynctelnet.transport.AsynctelnetTransport.write", _write + ) + + async_network_driver._current_priv_level = async_network_driver.privilege_levels["exec"] + await async_network_driver.acquire_priv(desired_priv="privilege_exec") + + async def test_acquire_priv_failure(monkeypatch, async_network_driver): async def _get_prompt(cls): return "scrapli(config)#" diff --git a/tests/unit/driver/network/test_network_sync_driver.py b/tests/unit/driver/network/test_network_sync_driver.py index a3c78a2f..d1163622 100644 --- a/tests/unit/driver/network/test_network_sync_driver.py +++ b/tests/unit/driver/network/test_network_sync_driver.py @@ -1,6 +1,6 @@ import pytest -from scrapli.exceptions import ScrapliPrivilegeError +from scrapli.exceptions import ScrapliPrivilegeError, ScrapliTimeout def test_escalate(monkeypatch, sync_network_driver): @@ -101,6 +101,66 @@ def _send_input(cls, channel_input, **kwargs): sync_network_driver.acquire_priv(desired_priv="privilege_exec") +def test_acquire_priv_escalate_not_ready_same_priv(monkeypatch, sync_network_driver): + """ + This tests to make sure that if the device does something like ceos does like this: + + ``` + info::ceos::"sending channelInput: enable; stripPrompt: false; eager: false + write::ceos::write: enable + debug::ceos::read: enable + write::ceos::write: + debug::ceos::read: + debug::ceos::read: % Authorization denied for command 'enable': Default authorization provider rejects all commands + debug::ceos::read: ceos> + ``` + + we gracefully handle returning to the current priv level -- rather than only being okay with + seeing a password prompt and/or the *next* pirv level. Thank you @ntdvps/@hellt (Roman) for + helping find this issue! + + """ + _prompt_counter = 0 + + def _get_prompt(cls): + nonlocal _prompt_counter + if _prompt_counter == 0: + prompt = "scrapli>" + elif _prompt_counter == 1: + prompt = "scrapli>" + else: + prompt = "scrapli#" + _prompt_counter += 1 + return prompt + + def __read_until_input(cls, channel_input): + return channel_input + + def __read_until_explicit_prompt(cls, prompts): + # we dont really care what we return here, just needs to be bytes. but we *do* care that + # in this case we are receiving *three* prompt patterns -- the password pattern, the + # escalate priv pattern, and the *current* priv pattern. + assert len(prompts) == 3 + + return b"scrapli>" + + def _write(cls, channel_input, **kwargs): + return + + monkeypatch.setattr("scrapli.channel.sync_channel.Channel.get_prompt", _get_prompt) + monkeypatch.setattr( + "scrapli.channel.sync_channel.Channel._read_until_input", __read_until_input + ) + monkeypatch.setattr( + "scrapli.channel.sync_channel.Channel._read_until_explicit_prompt", + __read_until_explicit_prompt, + ) + monkeypatch.setattr("scrapli.transport.plugins.system.transport.SystemTransport.write", _write) + + sync_network_driver._current_priv_level = sync_network_driver.privilege_levels["exec"] + sync_network_driver.acquire_priv(desired_priv="privilege_exec") + + def test_acquire_priv_failure(monkeypatch, sync_network_driver): def _get_prompt(cls): return "scrapli(config)#" From e32f5f9bd1f2e9d84dc6c99f7ee5e35e34a1f0b1 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:10:26 -0700 Subject: [PATCH 13/49] add 3.11 to ci, bump pylint --- .github/workflows/commit.yaml | 4 ++-- .github/workflows/weekly.yaml | 4 ++-- requirements-dev.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 06b4b240..3175bf9d 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -52,10 +52,10 @@ jobs: build_posix: runs-on: ${{ matrix.os }} strategy: - max-parallel: 8 + max-parallel: 10 matrix: os: [ubuntu-latest, macos-latest] - version: ["3.7", "3.8", "3.9", "3.10"] + version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} diff --git a/.github/workflows/weekly.yaml b/.github/workflows/weekly.yaml index b84b4b20..126d74ea 100644 --- a/.github/workflows/weekly.yaml +++ b/.github/workflows/weekly.yaml @@ -33,10 +33,10 @@ jobs: build_posix: runs-on: ${{ matrix.os }} strategy: - max-parallel: 8 + max-parallel: 10 matrix: os: [ubuntu-latest, macos-latest] - version: ["3.7", "3.8", "3.9", "3.10"] + version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 with: diff --git a/requirements-dev.txt b/requirements-dev.txt index 18a506be..36bbb099 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 pylama>=8.3.7,<9.0.0 -pylint==2.13.7 +pylint==2.13.8 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 From 34bbaf61d3d8a790aec32ddd74f2ff6ee6fbd238 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:16:53 -0700 Subject: [PATCH 14/49] add 'dev' to 3.11 for actions setup python --- .github/workflows/commit.yaml | 2 +- .github/workflows/weekly.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 3175bf9d..25eed013 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -55,7 +55,7 @@ jobs: max-parallel: 10 matrix: os: [ubuntu-latest, macos-latest] - version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"] steps: - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} diff --git a/.github/workflows/weekly.yaml b/.github/workflows/weekly.yaml index 126d74ea..cd8a5060 100644 --- a/.github/workflows/weekly.yaml +++ b/.github/workflows/weekly.yaml @@ -36,7 +36,7 @@ jobs: max-parallel: 10 matrix: os: [ubuntu-latest, macos-latest] - version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"] steps: - uses: actions/checkout@v3 with: From 5b4d563006883b5fa304955510400606e1ec0572 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:18:47 -0700 Subject: [PATCH 15/49] add unit tests 3.11 in nox --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 2c4f8cb3..cca2f3f8 100644 --- a/noxfile.py +++ b/noxfile.py @@ -63,7 +63,7 @@ def parse_requirements(dev: bool = True) -> Dict[str, str]: SKIP_LIST: List[str] = [] -@nox.session(python=["3.7", "3.8", "3.9", "3.10"]) +@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"]) def unit_tests(session): """ Nox run unit tests From 201e2d2b4de670058b57ce9d21461cb406aceade Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:28:08 -0700 Subject: [PATCH 16/49] skip ssh2-python tests on 3.11 --- requirements-ssh2.txt | 2 +- tests/unit/transport/plugins/ssh2/test_ssh2_transport.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/requirements-ssh2.txt b/requirements-ssh2.txt index 117a7884..1ad9fcbc 100644 --- a/requirements-ssh2.txt +++ b/requirements-ssh2.txt @@ -1 +1 @@ -ssh2-python>=0.23.0,<1.0.0 \ No newline at end of file +ssh2-python>=0.23.0,<1.0.0 ; sys_platform != "darwin" or sys_platform == "darwin" and python_version < "3.11" \ No newline at end of file diff --git a/tests/unit/transport/plugins/ssh2/test_ssh2_transport.py b/tests/unit/transport/plugins/ssh2/test_ssh2_transport.py index 8bed37a1..e372bccd 100644 --- a/tests/unit/transport/plugins/ssh2/test_ssh2_transport.py +++ b/tests/unit/transport/plugins/ssh2/test_ssh2_transport.py @@ -5,15 +5,18 @@ from scrapli.exceptions import ScrapliConnectionNotOpened +@pytest.mark.skipif(sys.version_info >= (3, 11), reason="skipping ssh2 on 3.11") def test_open_channel_no_session(ssh2_transport): with pytest.raises(ScrapliConnectionNotOpened): assert ssh2_transport._open_channel() +@pytest.mark.skipif(sys.version_info >= (3, 11), reason="skipping ssh2 on 3.11") def test_isalive_no_session(ssh2_transport): assert ssh2_transport.isalive() is False +@pytest.mark.skipif(sys.version_info >= (3, 11), reason="skipping ssh2 on 3.11") def test_write_exception(ssh2_transport): with pytest.raises(ScrapliConnectionNotOpened): ssh2_transport.write("blah") From 0665876299eca44e73d254f8691f6a2c672f9316 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:46:55 -0700 Subject: [PATCH 17/49] jk no ssh2 on any 3.11 things! --- requirements-ssh2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-ssh2.txt b/requirements-ssh2.txt index 1ad9fcbc..89f4eed0 100644 --- a/requirements-ssh2.txt +++ b/requirements-ssh2.txt @@ -1 +1 @@ -ssh2-python>=0.23.0,<1.0.0 ; sys_platform != "darwin" or sys_platform == "darwin" and python_version < "3.11" \ No newline at end of file +ssh2-python>=0.23.0,<1.0.0 ; python_version < "3.11" \ No newline at end of file From dcb249c8d0445e761c21105dcc74e8c4de0829d6 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:53:06 -0700 Subject: [PATCH 18/49] change test to paramiko for transport timeout testing --- tests/unit/driver/base/test_base_common_driver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/driver/base/test_base_common_driver.py b/tests/unit/driver/base/test_base_common_driver.py index 30e9753a..d912b4a6 100644 --- a/tests/unit/driver/base/test_base_common_driver.py +++ b/tests/unit/driver/base/test_base_common_driver.py @@ -85,11 +85,11 @@ def test_timeout_properties_transport_plugin_set_timeout(monkeypatch): Specifically for plugins with set_timeout method -- i.e. ssh2/paramiko """ monkeypatch.setattr( - "scrapli.transport.plugins.ssh2.transport.Ssh2Transport._set_timeout", + "scrapli.transport.plugins.paramiko.transport.ParamikoTransport._set_timeout", lambda cls, value: None, ) - driver = BaseDriver(host="localhost", transport="ssh2") + driver = BaseDriver(host="localhost", transport="paramiko") assert driver.timeout_transport == 30.0 driver.timeout_transport = 999.99 assert driver.timeout_transport == 999.99 From 9c0fbf66b41e019d953ffd70067443e0a2171733 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 14 May 2022 11:35:40 -0700 Subject: [PATCH 19/49] decorator overhaul --- scrapli/channel/async_channel.py | 14 +- scrapli/channel/sync_channel.py | 14 +- scrapli/decorators.py | 466 +++++++----------- scrapli/driver/network/base_driver.py | 2 +- .../transport/plugins/asyncssh/transport.py | 4 +- .../plugins/asynctelnet/transport.py | 4 +- .../transport/plugins/system/ptyprocess.py | 10 +- scrapli/transport/plugins/system/transport.py | 4 +- scrapli/transport/plugins/telnet/transport.py | 4 +- tests/unit/test_decorators.py | 26 +- 10 files changed, 213 insertions(+), 335 deletions(-) diff --git a/scrapli/channel/async_channel.py b/scrapli/channel/async_channel.py index 388ca4b2..a03589f0 100644 --- a/scrapli/channel/async_channel.py +++ b/scrapli/channel/async_channel.py @@ -14,7 +14,7 @@ from typing import AsyncIterator, List, Optional, Tuple from scrapli.channel.base_channel import BaseChannel, BaseChannelArgs -from scrapli.decorators import ChannelTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ScrapliAuthenticationFailed, ScrapliTimeout from scrapli.transport.base import AsyncTransport @@ -260,7 +260,7 @@ async def _read_until_prompt_or_time( return read_buf.getvalue() - @ChannelTimeout(message="timed out during in channel ssh authentication") + @timeout_wrapper async def channel_authenticate_ssh( self, auth_password: str, auth_private_key_passphrase: str ) -> None: @@ -333,7 +333,7 @@ async def channel_authenticate_ssh( ): return - @ChannelTimeout(message="timed out during in channel telnet authentication") + @timeout_wrapper async def channel_authenticate_telnet( # noqa: C901 self, auth_username: str = "", auth_password: str = "" ) -> None: @@ -420,7 +420,7 @@ async def channel_authenticate_telnet( # noqa: C901 ): return - @ChannelTimeout(message="timed out getting prompt") + @timeout_wrapper async def get_prompt(self) -> str: """ Get current channel prompt @@ -456,7 +456,7 @@ async def get_prompt(self) -> str: current_prompt = channel_match.group(0) return current_prompt.decode().strip() - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper async def send_input( self, channel_input: str, @@ -504,7 +504,7 @@ async def send_input( ) return buf, processed_buf - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper async def send_input_and_read( self, channel_input: str, @@ -559,7 +559,7 @@ async def send_input_and_read( return buf, processed_buf - @ChannelTimeout(message="timed out sending interactive input to device") + @timeout_wrapper async def send_inputs_interact( self, interact_events: List[Tuple[str, str, Optional[bool]]], diff --git a/scrapli/channel/sync_channel.py b/scrapli/channel/sync_channel.py index 7e067954..7ae3908f 100644 --- a/scrapli/channel/sync_channel.py +++ b/scrapli/channel/sync_channel.py @@ -8,7 +8,7 @@ from typing import Iterator, List, Optional, Tuple from scrapli.channel.base_channel import BaseChannel, BaseChannelArgs -from scrapli.decorators import ChannelTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ScrapliAuthenticationFailed, ScrapliTimeout from scrapli.transport.base import Transport @@ -251,7 +251,7 @@ def _read_until_prompt_or_time( return read_buf.getvalue() - @ChannelTimeout(message="timed out during in channel ssh authentication") + @timeout_wrapper def channel_authenticate_ssh( self, auth_password: str, auth_private_key_passphrase: str ) -> None: @@ -323,7 +323,7 @@ def channel_authenticate_ssh( ): return - @ChannelTimeout(message="timed out during in channel telnet authentication") + @timeout_wrapper def channel_authenticate_telnet(self, auth_username: str = "", auth_password: str = "") -> None: """ Handle Telnet Authentication @@ -404,7 +404,7 @@ def channel_authenticate_telnet(self, auth_username: str = "", auth_password: st ): return - @ChannelTimeout(message="timed out getting prompt") + @timeout_wrapper def get_prompt(self) -> str: """ Get current channel prompt @@ -440,7 +440,7 @@ def get_prompt(self) -> str: current_prompt = channel_match.group(0) return current_prompt.decode().strip() - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper def send_input( self, channel_input: str, @@ -488,7 +488,7 @@ def send_input( ) return buf, processed_buf - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper def send_input_and_read( self, channel_input: str, @@ -543,7 +543,7 @@ def send_input_and_read( return buf, processed_buf - @ChannelTimeout(message="timed out sending interactive input to device") + @timeout_wrapper def send_inputs_interact( self, interact_events: List[Tuple[str, str, Optional[bool]]], diff --git a/scrapli/decorators.py b/scrapli/decorators.py index 9020605c..4831a26c 100644 --- a/scrapli/decorators.py +++ b/scrapli/decorators.py @@ -4,359 +4,239 @@ import sys import threading from concurrent.futures import ThreadPoolExecutor, wait -from functools import update_wrapper +from functools import partial, update_wrapper from logging import Logger, LoggerAdapter -from typing import TYPE_CHECKING, Any, Callable +from typing import TYPE_CHECKING, Any, Callable, Tuple from scrapli.exceptions import ScrapliTimeout if TYPE_CHECKING: - from scrapli.channel import Channel # pragma: no cover from scrapli.driver import AsyncGenericDriver, GenericDriver # pragma: no cover from scrapli.transport.base.base_transport import BaseTransport # pragma: no cover if TYPE_CHECKING: - LoggerAdapterT = LoggerAdapter[Logger] # pylint:disable=E1136 + LoggerAdapterT = LoggerAdapter[Logger] # pragma: no cover # pylint:disable=E1136 else: LoggerAdapterT = LoggerAdapter _IS_WINDOWS = sys.platform.startswith("win") -class TransportTimeout: - def __init__(self, message: str = "") -> None: - """ - Transport timeout decorator +FUNC_TIMEOUT_MESSAGE_MAP = { + "channel_authenticate_ssh": "timed out during in channel ssh authentication", + "channel_authenticate_telnet": "timed out during in channel telnet authentication", + "get_prompt": "timed out getting prompt", + "send_input": "timed out sending input to device", + "send_input_and_read": "timed out sending input to device", + "send_inputs_interact": "timed out sending interactive input to device", + "read": "timed out reading from transport", +} - Args: - message: accepts message from decorated function to add context to any timeout - (if a timeout happens!) - Returns: - None +def _get_timeout_message(func_name: str) -> str: + """ + Return appropriate timeout message for the given function name - Raises: - N/A + Args: + func_name: name of function to fetch timeout message for - """ - self.message = message - self.transport_instance: "BaseTransport" - self.transport_timeout_transport = 0.0 + Returns: + str: timeout message - def __call__(self, wrapped_func: Callable[..., Any]) -> Callable[..., Any]: - """ - Decorate an "operation" to modify the timeout_transport value for duration of that operation + Raises: + N/A - This decorator wraps a transport read operation and is used to allow users to control the - transport timeout via the `timeout_transport` attribute. This decorator should be applied to - any transport "read" operations. + """ + return FUNC_TIMEOUT_MESSAGE_MAP.get(func_name, "unspecified timeout occurred") - Args: - wrapped_func: function being decorated - Returns: - decorate: decorated func +def _signal_raise_exception( + signum: Any, frame: Any, transport: "BaseTransport", logger: LoggerAdapterT, message: str +) -> None: + """ + Signal method exception handler - Raises: - N/A + Args: + signum: singum from the singal handler, unused here + frame: frame from the signal handler, unused here - """ + Returns: + None - if asyncio.iscoroutinefunction(wrapped_func): + Raises: + N/A - async def decorate(*args: Any, **kwargs: Any) -> Any: - self.transport_instance = args[0] - self.transport_timeout_transport = self._get_timeout_transport() + """ + _, _ = signum, frame - if not self.transport_timeout_transport: - return await wrapped_func(*args, **kwargs) + return _handle_timeout(transport=transport, logger=logger, message=message) - try: - return await asyncio.wait_for( - wrapped_func(*args, **kwargs), timeout=self.transport_timeout_transport - ) - except asyncio.TimeoutError: - self._handle_timeout() - else: - # ignoring type error: - # "All conditional function variants must have identical signatures" - # one is sync one is async so never going to be identical here! - def decorate(*args: Any, **kwargs: Any) -> Any: # type: ignore - self.transport_instance = args[0] - self.transport_timeout_transport = self._get_timeout_transport() - - if not self.transport_timeout_transport: - return wrapped_func(*args, **kwargs) - - transport_instance_class_name = self.transport_instance.__class__.__name__ - - if ( - transport_instance_class_name in ("SystemTransport", "TelnetTransport") - or _IS_WINDOWS - or threading.current_thread() is not threading.main_thread() - ): - return self._multiprocessing_timeout( - wrapped_func=wrapped_func, - args=args, - kwargs=kwargs, - ) +def _multiprocessing_timeout( + transport: "BaseTransport", + logger: LoggerAdapterT, + timeout: float, + wrapped_func: Callable[..., Any], + args: Any, + kwargs: Any, +) -> Any: + """ + Return appropriate timeout message for the given function name - old = signal.signal(signal.SIGALRM, self._signal_raise_exception) - signal.setitimer(signal.ITIMER_REAL, self.transport_timeout_transport) - try: - return wrapped_func(*args, **kwargs) - finally: - if self.transport_timeout_transport: - signal.setitimer(signal.ITIMER_REAL, 0) - signal.signal(signal.SIGALRM, old) + Args: + transport: + logger: + timeout: + wrapped_func: + args: + kwargs: - # ensures that the wrapped function is updated w/ the original functions docs/etc. -- - # necessary for introspection for the auto gen docs to work! - update_wrapper(wrapper=decorate, wrapped=wrapped_func) - return decorate - - def _get_timeout_transport(self) -> float: - """ - Fetch and return timeout transport from the transport object - - Args: - N/A + Returns: + Any: result of the wrapped function - Returns: - float: transport timeout value + Raises: + N/A - Raises: - N/A - - """ - transport_args = self.transport_instance._base_transport_args # pylint: disable=W0212 - return transport_args.timeout_transport - - def _handle_timeout(self) -> None: - """ - Timeout handler method to close connections and raise ScrapliTimeout - - Args: - N/A - - Returns: - None - - Raises: - ScrapliTimeout: always, if we hit this method we have already timed out! - - """ - self.transport_instance.logger.critical("transport operation timed out, closing transport") - self.transport_instance.close() - raise ScrapliTimeout(self.message) - - def _multiprocessing_timeout( - self, wrapped_func: Callable[..., Any], args: Any, kwargs: Any - ) -> Any: - """ - Multiprocessing method for timeouts; works in threads and on windows - - Args: - wrapped_func: function being decorated - args: function being decorated args - kwargs: function being decorated kwargs - - Returns: - Any: result of decorated function - - Raises: - N/A - - """ - with ThreadPoolExecutor(max_workers=1) as pool: - future = pool.submit(wrapped_func, *args, **kwargs) - wait([future], timeout=self.transport_timeout_transport) - if not future.done(): - self._handle_timeout() + """ + with ThreadPoolExecutor(max_workers=1) as pool: + future = pool.submit(wrapped_func, *args, **kwargs) + wait([future], timeout=timeout) + if not future.done(): + return _handle_timeout( + transport=transport, + logger=logger, + message=_get_timeout_message(func_name=wrapped_func.__name__), + ) return future.result() - def _signal_raise_exception(self, signum: Any, frame: Any) -> None: - """ - Signal method exception handler - Args: - signum: singum from the singal handler, unused here - frame: frame from the signal handler, unused here +def _handle_timeout(transport: "BaseTransport", logger: LoggerAdapterT, message: str) -> None: + """ + Timeout handler method to close connections and raise ScrapliTimeout - Returns: - None + Args: + transport: + message: - Raises: - N/A + Returns: + None - """ - _, _ = signum, frame - self._handle_timeout() + Raises: + ScrapliTimeout: always, if we hit this method we have already timed out! + """ + logger.critical("operation timed out, closing transport") + transport.close() + raise ScrapliTimeout(message) -class ChannelTimeout: - def __init__(self, message: str = "") -> None: - """ - Channel timeout decorator - Args: - message: accepts message from decorated function to add context to any timeout - (if a timeout happens!) +def _get_transport_logger_timeout( + cls: Any, +) -> Tuple["BaseTransport", LoggerAdapterT, float]: + """ + Fetch the transport, logger and timeout from the channel or transport object - Returns: - None + Args: + cls: - Raises: - N/A + Returns: + Tuple: - """ - self.message = message - self.channel_timeout_ops = 0.0 - self.channel_logger: LoggerAdapterT - self.transport_instance: "BaseTransport" + Raises: + ScrapliTimeout: always, if we hit this method we have already timed out! - def __call__(self, wrapped_func: Callable[..., Any]) -> Callable[..., Any]: - """ - Decorate an "operation" to modify the timeout_ops value for duration of that operation + """ + if hasattr(cls, "transport"): + return ( + cls.transport, + cls.logger, + cls._base_channel_args.timeout_ops, # pylint: disable=W0212 + ) - This decorator wraps send command/config ops and is used to allow users to set a - `timeout_ops` value for the duration of a single method call -- this makes it so users don't - need to manually set/reset the value + return ( + cls, + cls.logger, + cls._base_transport_args.timeout_transport, # pylint: disable=W0212 + ) - Args: - wrapped_func: function being decorated - Returns: - decorate: decorated func +def timeout_wrapper(wrapped_func: Callable[..., Any]) -> Callable[..., Any]: + """ + Timeout wrapper for transports - Raises: - N/A + Args: + wrapped_func: - """ - if asyncio.iscoroutinefunction(wrapped_func): + Returns: + Any: result of wrapped function - async def decorate(*args: Any, **kwargs: Any) -> Any: - channel_instance: "Channel" = args[0] - self.channel_logger = channel_instance.logger - self.channel_timeout_ops = ( - channel_instance._base_channel_args.timeout_ops # pylint: disable=W0212 - ) + Raises: + ScrapliTimeout: if the function does not complete in time - if not self.channel_timeout_ops: - return await wrapped_func(*args, **kwargs) + """ + if asyncio.iscoroutinefunction(wrapped_func): - self.transport_instance = channel_instance.transport + async def decorate(*args: Any, **kwargs: Any) -> Any: + transport, logger, timeout = _get_transport_logger_timeout(cls=args[0]) - try: - return await asyncio.wait_for( - wrapped_func(*args, **kwargs), timeout=self.channel_timeout_ops - ) - except asyncio.TimeoutError: - self._handle_timeout() + if not timeout: + return await wrapped_func(*args, **kwargs) - else: - # ignoring type error: - # "All conditional function variants must have identical signatures" - # one is sync one is async so never going to be identical here! - def decorate(*args: Any, **kwargs: Any) -> Any: # type: ignore - channel_instance: "Channel" = args[0] - self.channel_logger = channel_instance.logger - self.channel_timeout_ops = ( - channel_instance._base_channel_args.timeout_ops # pylint: disable=W0212 + try: + return await asyncio.wait_for(wrapped_func(*args, **kwargs), timeout=timeout) + except asyncio.TimeoutError: + _handle_timeout( + transport=transport, + logger=logger, + message=_get_timeout_message(func_name=wrapped_func.__name__), ) - if not self.channel_timeout_ops: - return wrapped_func(*args, **kwargs) - - self.transport_instance = channel_instance.transport - transport_instance_class_name = self.transport_instance.__class__.__name__ - - if ( - transport_instance_class_name in ("SystemTransport", "TelnetTransport") - or _IS_WINDOWS - or threading.current_thread() is not threading.main_thread() - ): - return self._multiprocessing_timeout( - wrapped_func=wrapped_func, - args=args, - kwargs=kwargs, - ) - - old = signal.signal(signal.SIGALRM, self._signal_raise_exception) - signal.setitimer(signal.ITIMER_REAL, self.channel_timeout_ops) - try: - return wrapped_func(*args, **kwargs) - finally: - if self.channel_timeout_ops: - signal.setitimer(signal.ITIMER_REAL, 0) - signal.signal(signal.SIGALRM, old) - - # ensures that the wrapped function is updated w/ the original functions docs/etc. -- - # necessary for introspection for the auto gen docs to work! - update_wrapper(wrapper=decorate, wrapped=wrapped_func) - return decorate - - def _handle_timeout(self) -> None: - """ - Timeout handler method to close connections and raise ScrapliTimeout - - Args: - N/A - - Returns: - None - - Raises: - ScrapliTimeout: always, if we hit this method we have already timed out! - - """ - self.channel_logger.critical("channel operation timed out, closing transport") - self.transport_instance.close() - raise ScrapliTimeout(self.message) - - def _multiprocessing_timeout( - self, wrapped_func: Callable[..., Any], args: Any, kwargs: Any - ) -> Any: - """ - Multiprocessing method for timeouts; works in threads and on windows - - Args: - wrapped_func: function being decorated - args: function being decorated args - kwargs: function being decorated kwargs - - Returns: - Any: result of decorated function - - Raises: - N/A - - """ - with ThreadPoolExecutor(max_workers=1) as pool: - future = pool.submit(wrapped_func, *args, **kwargs) - wait([future], timeout=self.channel_timeout_ops) - if not future.done(): - self._handle_timeout() - return future.result() - - def _signal_raise_exception(self, signum: Any, frame: Any) -> None: - """ - Signal method exception handler - - Args: - signum: singum from the singal handler, unused here - frame: frame from the signal handler, unused here - - Returns: - None - - Raises: - N/A + else: + # ignoring type error: + # "All conditional function variants must have identical signatures" + # one is sync one is async so never going to be identical here! + def decorate(*args: Any, **kwargs: Any) -> Any: # type: ignore + transport, logger, timeout = _get_transport_logger_timeout(cls=args[0]) + + if not timeout: + return wrapped_func(*args, **kwargs) + + cls_name = transport.__class__.__name__ + + if ( + cls_name in ("SystemTransport", "TelnetTransport") + or _IS_WINDOWS + or threading.current_thread() is not threading.main_thread() + ): + return _multiprocessing_timeout( + transport=transport, + logger=logger, + timeout=timeout, + wrapped_func=wrapped_func, + args=args, + kwargs=kwargs, + ) - """ - _, _ = signum, frame - self._handle_timeout() + callback = partial( + _signal_raise_exception, + transport=transport, + logger=logger, + message=_get_timeout_message(wrapped_func.__name__), + ) + + old = signal.signal(signal.SIGALRM, callback) + signal.setitimer(signal.ITIMER_REAL, timeout) + try: + return wrapped_func(*args, **kwargs) + finally: + if timeout: + signal.setitimer(signal.ITIMER_REAL, 0) + signal.signal(signal.SIGALRM, old) + + # ensures that the wrapped function is updated w/ the original functions docs/etc. -- + # necessary for introspection for the auto gen docs to work! + update_wrapper(wrapper=decorate, wrapped=wrapped_func) + return decorate class TimeoutOpsModifier: diff --git a/scrapli/driver/network/base_driver.py b/scrapli/driver/network/base_driver.py index 7ebfac8e..b257f53a 100644 --- a/scrapli/driver/network/base_driver.py +++ b/scrapli/driver/network/base_driver.py @@ -12,7 +12,7 @@ from scrapli.response import MultiResponse, Response if TYPE_CHECKING: - LoggerAdapterT = LoggerAdapter[Logger] # pylint:disable=E1136 + LoggerAdapterT = LoggerAdapter[Logger] # pragma: no cover # pylint:disable=E1136 else: LoggerAdapterT = LoggerAdapter diff --git a/scrapli/transport/plugins/asyncssh/transport.py b/scrapli/transport/plugins/asyncssh/transport.py index de973374..f8a00005 100644 --- a/scrapli/transport/plugins/asyncssh/transport.py +++ b/scrapli/transport/plugins/asyncssh/transport.py @@ -7,7 +7,7 @@ from asyncssh.misc import ConnectionLost, PermissionDenied from asyncssh.stream import SSHReader, SSHWriter -from scrapli.decorators import TransportTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ( ScrapliAuthenticationFailed, ScrapliConnectionError, @@ -245,7 +245,7 @@ def isalive(self) -> bool: pass return False - @TransportTimeout("timed out reading from transport") + @timeout_wrapper async def read(self) -> bytes: if not self.stdout: raise ScrapliConnectionNotOpened diff --git a/scrapli/transport/plugins/asynctelnet/transport.py b/scrapli/transport/plugins/asynctelnet/transport.py index d47e5457..7fb10511 100644 --- a/scrapli/transport/plugins/asynctelnet/transport.py +++ b/scrapli/transport/plugins/asynctelnet/transport.py @@ -4,7 +4,7 @@ from dataclasses import dataclass from typing import Optional -from scrapli.decorators import TransportTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ( ScrapliAuthenticationFailed, ScrapliConnectionError, @@ -197,7 +197,7 @@ def isalive(self) -> bool: return False return not self.stdout.at_eof() - @TransportTimeout("timed out reading from transport") + @timeout_wrapper async def read(self) -> bytes: if not self.stdout: raise ScrapliConnectionNotOpened diff --git a/scrapli/transport/plugins/system/ptyprocess.py b/scrapli/transport/plugins/system/ptyprocess.py index 2e64efd2..ce6dc740 100644 --- a/scrapli/transport/plugins/system/ptyprocess.py +++ b/scrapli/transport/plugins/system/ptyprocess.py @@ -401,7 +401,7 @@ def __del__(self) -> None: except Exception: pass - def close(self, force: bool = True) -> None: + def close(self) -> None: """ Close the instance @@ -412,7 +412,7 @@ def close(self, force: bool = True) -> None: and SIGINT). Args: - force: bool + N/A Returns: None @@ -422,8 +422,6 @@ def close(self, force: bool = True) -> None: """ if not self.closed: - self.flush() - # in the original ptyprocess vendor'd code the file object is "gracefully" closed, # however in some situations it seemed to hang forever on the close call... given that # as soon as this connection is closed it will need to be re-opened, and that will of @@ -437,11 +435,11 @@ def close(self, force: bool = True) -> None: # Give kernel time to update process status. time.sleep(self.delayafterclose) if self.isalive(): - if not self.terminate(force): + if not self.terminate(force=True): raise PtyProcessError("Could not terminate the child.") self.fd = -1 self.closed = True - # self.pid = None + self.pid = None def flush(self) -> None: """ diff --git a/scrapli/transport/plugins/system/transport.py b/scrapli/transport/plugins/system/transport.py index b49317b8..84e78dd0 100644 --- a/scrapli/transport/plugins/system/transport.py +++ b/scrapli/transport/plugins/system/transport.py @@ -3,7 +3,7 @@ from dataclasses import dataclass from typing import List, Optional -from scrapli.decorators import TransportTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ( ScrapliConnectionError, ScrapliConnectionNotOpened, @@ -150,7 +150,7 @@ def isalive(self) -> bool: return True return False - @TransportTimeout("timed out reading from transport") + @timeout_wrapper def read(self) -> bytes: if not self.session: raise ScrapliConnectionNotOpened diff --git a/scrapli/transport/plugins/telnet/transport.py b/scrapli/transport/plugins/telnet/transport.py index d4fd0333..e8d6d8a7 100644 --- a/scrapli/transport/plugins/telnet/transport.py +++ b/scrapli/transport/plugins/telnet/transport.py @@ -3,7 +3,7 @@ from telnetlib import Telnet from typing import Optional -from scrapli.decorators import TransportTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ScrapliConnectionError, ScrapliConnectionNotOpened from scrapli.transport.base import BasePluginTransportArgs, BaseTransportArgs, Transport @@ -82,7 +82,7 @@ def isalive(self) -> bool: return False return not self.session.eof - @TransportTimeout("timed out reading from transport") + @timeout_wrapper def read(self) -> bytes: if not self.session: raise ScrapliConnectionNotOpened diff --git a/tests/unit/test_decorators.py b/tests/unit/test_decorators.py index dbf19924..84b447a6 100644 --- a/tests/unit/test_decorators.py +++ b/tests/unit/test_decorators.py @@ -3,7 +3,7 @@ import pytest -from scrapli.decorators import ChannelTimeout, TimeoutOpsModifier, TransportTimeout +from scrapli.decorators import TimeoutOpsModifier, timeout_wrapper from scrapli.exceptions import ScrapliTimeout @@ -19,7 +19,7 @@ def test_transport_timeout_sync_signals(monkeypatch, sync_transport_no_abc, test timeout_transport = test_data sync_transport_no_abc._base_transport_args.timeout_transport = timeout_transport - @TransportTimeout() + @timeout_wrapper def _open(cls): return cls._base_transport_args.timeout_transport @@ -42,7 +42,7 @@ def test_transport_timeout_sync_multiprocessing(monkeypatch, sync_transport_no_a timeout_transport = test_data sync_transport_no_abc._base_transport_args.timeout_transport = timeout_transport - @TransportTimeout() + @timeout_wrapper def _open(cls): return cls._base_transport_args.timeout_transport @@ -58,7 +58,7 @@ def _open(cls): def test_transport_timeout_sync_timed_out_signals(monkeypatch, sync_transport_no_abc): sync_transport_no_abc._base_transport_args.timeout_transport = 0.1 - @TransportTimeout() + @timeout_wrapper def _open(cls): time.sleep(0.5) @@ -72,7 +72,7 @@ def _open(cls): def test_transport_timeout_sync_timed_out_multiprocessing(monkeypatch, sync_transport_no_abc): sync_transport_no_abc._base_transport_args.timeout_transport = 0.1 - @TransportTimeout() + @timeout_wrapper def _open(cls): time.sleep(0.5) @@ -88,7 +88,7 @@ def _open(cls): async def test_transport_timeout_async_timed_out(monkeypatch, async_transport_no_abc): async_transport_no_abc._base_transport_args.timeout_transport = 0.1 - @TransportTimeout() + @timeout_wrapper async def _open(cls): await asyncio.sleep(0.5) @@ -111,7 +111,7 @@ async def test_transport_timeout_async(monkeypatch, async_transport_no_abc, test timeout_transport = test_data async_transport_no_abc._base_transport_args.timeout_transport = timeout_transport - @TransportTimeout() + @timeout_wrapper async def _open(cls): return cls._base_transport_args.timeout_transport @@ -134,7 +134,7 @@ def test_channel_timeout_sync_signals(monkeypatch, sync_channel, test_data): timeout_ops = test_data sync_channel._base_channel_args.timeout_ops = timeout_ops - @ChannelTimeout() + @timeout_wrapper def _send_input(cls): return cls._base_channel_args.timeout_ops @@ -157,7 +157,7 @@ def test_channel_timeout_sync_multiprocessing(monkeypatch, sync_channel, test_da timeout_ops = test_data sync_channel._base_channel_args.timeout_ops = timeout_ops - @ChannelTimeout() + @timeout_wrapper def _send_input(cls): return cls._base_channel_args.timeout_ops @@ -173,7 +173,7 @@ def _send_input(cls): def test_channel_timeout_sync_timed_out_signals(monkeypatch, sync_channel): sync_channel._base_channel_args.timeout_ops = 0.1 - @ChannelTimeout() + @timeout_wrapper def _send_input(cls): time.sleep(0.5) @@ -187,7 +187,7 @@ def _send_input(cls): def test_channel_timeout_sync_timed_out_multiprocessing(monkeypatch, sync_channel): sync_channel._base_channel_args.timeout_ops = 0.1 - @ChannelTimeout() + @timeout_wrapper def _send_input(cls): time.sleep(0.5) @@ -204,7 +204,7 @@ def _send_input(cls): async def test_channel_timeout_async_timed_out(monkeypatch, async_channel): async_channel._base_channel_args.timeout_ops = 0.1 - @ChannelTimeout() + @timeout_wrapper async def _send_input(cls): await asyncio.sleep(0.5) @@ -227,7 +227,7 @@ async def test_channel_timeout_async(monkeypatch, async_channel, test_data): timeout_ops = test_data async_channel._base_channel_args.timeout_ops = timeout_ops - @ChannelTimeout() + @timeout_wrapper async def _send_input(cls): return cls._base_channel_args.timeout_ops From e39400637aa00919da6d71fbb8a3814bbfa0702e Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 14 May 2022 12:45:49 -0700 Subject: [PATCH 20/49] add kex for xe device in tests --- tests/devices.py | 6 ++++++ tests/prepare_devices.py | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/tests/devices.py b/tests/devices.py index 405660cc..c6044b4c 100644 --- a/tests/devices.py +++ b/tests/devices.py @@ -35,6 +35,12 @@ "host": "localhost" if not CLAB_BRIDGE else "172.18.0.11", "port": 21022 if not CLAB_BRIDGE else 22, "base_config": f"{TEST_DATA_PATH}/base_configs/cisco_iosxe", + "transport_options": { + "open_cmd": [ + "-o", + "KexAlgorithms=+diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1", + ] + }, }, "cisco_nxos": { "driver": NXOSDriver, diff --git a/tests/prepare_devices.py b/tests/prepare_devices.py index bfb79886..7c3c4df5 100644 --- a/tests/prepare_devices.py +++ b/tests/prepare_devices.py @@ -27,6 +27,13 @@ def prepare_device(test_devices): "platform": device, # nxos on macos w/out acceleration is... slooooooooooow "timeout_ops": 120, + # for xe, but won't hurt anything else anyway + "transport_options": { + "open_cmd": [ + "-o", + "KexAlgorithms=+diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1", + ] + }, } with Scrapli(**conn_dict) as conn: From 5fcd1d30d5d192b11b6eaff57d6c1fd47c00b946 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 14 May 2022 12:46:10 -0700 Subject: [PATCH 21/49] remove 3.6 asyncgenerator support --- scrapli/channel/async_channel.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scrapli/channel/async_channel.py b/scrapli/channel/async_channel.py index a03589f0..463aae2b 100644 --- a/scrapli/channel/async_channel.py +++ b/scrapli/channel/async_channel.py @@ -2,15 +2,9 @@ import asyncio import re import time -from io import BytesIO - -try: - from contextlib import asynccontextmanager -except ImportError: # pragma: nocover - # needed for 3.6 support, no asynccontextmanager until 3.7 - from async_generator import asynccontextmanager # type: ignore # pragma: nocover - +from contextlib import asynccontextmanager from datetime import datetime +from io import BytesIO from typing import AsyncIterator, List, Optional, Tuple from scrapli.channel.base_channel import BaseChannel, BaseChannelArgs From f0128d8c9e9ea146056a70854cdd17d8a25df9ce Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 14 May 2022 12:46:38 -0700 Subject: [PATCH 22/49] swap timeout modifier decorator to function, docstrings --- scrapli/decorators.py | 166 +++++++++++++------------ scrapli/driver/generic/async_driver.py | 8 +- scrapli/driver/generic/sync_driver.py | 8 +- scrapli/driver/network/async_driver.py | 2 +- scrapli/driver/network/sync_driver.py | 2 +- 5 files changed, 95 insertions(+), 91 deletions(-) diff --git a/scrapli/decorators.py b/scrapli/decorators.py index 4831a26c..3d95cb31 100644 --- a/scrapli/decorators.py +++ b/scrapli/decorators.py @@ -59,6 +59,9 @@ def _signal_raise_exception( Args: signum: singum from the singal handler, unused here frame: frame from the signal handler, unused here + transport: transport to close + logger: logger to write closing messages to + message: exception message Returns: None @@ -84,12 +87,12 @@ def _multiprocessing_timeout( Return appropriate timeout message for the given function name Args: - transport: - logger: - timeout: - wrapped_func: - args: - kwargs: + transport: transport to close (if timeout occurs) + logger: logger to write closing message to + timeout: timeout in seconds + wrapped_func: function being decorated + args: function args + kwargs: function kwargs Returns: Any: result of the wrapped function @@ -115,8 +118,9 @@ def _handle_timeout(transport: "BaseTransport", logger: LoggerAdapterT, message: Timeout handler method to close connections and raise ScrapliTimeout Args: - transport: - message: + transport: transport to close + logger: logger to write closing message to + message: message to pass to ScrapliTimeout exception Returns: None @@ -125,7 +129,7 @@ def _handle_timeout(transport: "BaseTransport", logger: LoggerAdapterT, message: ScrapliTimeout: always, if we hit this method we have already timed out! """ - logger.critical("operation timed out, closing transport") + logger.critical("operation timed out, closing connection") transport.close() raise ScrapliTimeout(message) @@ -137,13 +141,14 @@ def _get_transport_logger_timeout( Fetch the transport, logger and timeout from the channel or transport object Args: - cls: + cls: Channel or Transport object (self from wrapped function) to grab transport/logger and + timeout values from Returns: - Tuple: + Tuple: transport, logger, and timeout value Raises: - ScrapliTimeout: always, if we hit this method we have already timed out! + N/A """ if hasattr(cls, "transport"): @@ -165,13 +170,13 @@ def timeout_wrapper(wrapped_func: Callable[..., Any]) -> Callable[..., Any]: Timeout wrapper for transports Args: - wrapped_func: + wrapped_func: function being wrapped -- must be a method of Channel or Transport Returns: Any: result of wrapped function Raises: - ScrapliTimeout: if the function does not complete in time + N/A """ if asyncio.iscoroutinefunction(wrapped_func): @@ -239,70 +244,69 @@ def decorate(*args: Any, **kwargs: Any) -> Any: # type: ignore return decorate -class TimeoutOpsModifier: - def __call__(self, wrapped_func: Callable[..., Any]) -> Callable[..., Any]: - """ - Decorate an "operation" to modify the timeout_ops value for duration of that operation - - This decorator wraps send command/config ops and is used to allow users to set a - `timeout_ops` value for the duration of a single method call -- this makes it so users don't - need to manually set/reset the value - - Args: - wrapped_func: function being decorated - - Returns: - decorate: decorated func - - Raises: - N/A - - """ - if asyncio.iscoroutinefunction(wrapped_func): - - async def decorate(*args: Any, **kwargs: Any) -> Any: - driver_instance: "AsyncGenericDriver" = args[0] - driver_logger = driver_instance.logger - - timeout_ops_kwarg = kwargs.get("timeout_ops", None) - - if timeout_ops_kwarg is None or timeout_ops_kwarg == driver_instance.timeout_ops: - result = await wrapped_func(*args, **kwargs) - else: - driver_logger.info( - "modifying driver timeout for current operation, temporary timeout_ops " - f"value: '{timeout_ops_kwarg}'" - ) - base_timeout_ops = driver_instance.timeout_ops - driver_instance.timeout_ops = kwargs["timeout_ops"] - result = await wrapped_func(*args, **kwargs) - driver_instance.timeout_ops = base_timeout_ops - return result - - else: - # ignoring type error: - # "All conditional function variants must have identical signatures" - # one is sync one is async so never going to be identical here! - def decorate(*args: Any, **kwargs: Any) -> Any: # type: ignore - driver_instance: "GenericDriver" = args[0] - driver_logger = driver_instance.logger - - timeout_ops_kwarg = kwargs.get("timeout_ops", None) - - if timeout_ops_kwarg is None or timeout_ops_kwarg == driver_instance.timeout_ops: - result = wrapped_func(*args, **kwargs) - else: - driver_logger.info( - "modifying driver timeout for current operation, temporary timeout_ops " - f"value: '{timeout_ops_kwarg}'" - ) - base_timeout_ops = driver_instance.timeout_ops - driver_instance.timeout_ops = kwargs["timeout_ops"] - result = wrapped_func(*args, **kwargs) - driver_instance.timeout_ops = base_timeout_ops - return result - - # ensures that the wrapped function is updated w/ the original functions docs/etc. -- - # necessary for introspection for the auto gen docs to work! - update_wrapper(wrapper=decorate, wrapped=wrapped_func) - return decorate +def timeout_modifier(wrapped_func: Callable[..., Any]) -> Callable[..., Any]: + """ + Decorate an "operation" to modify the timeout_ops value for duration of that operation + + This decorator wraps send command/config ops and is used to allow users to set a + `timeout_ops` value for the duration of a single method call -- this makes it so users don't + need to manually set/reset the value + + Args: + wrapped_func: function being decorated + + Returns: + decorate: decorated func + + Raises: + N/A + + """ + if asyncio.iscoroutinefunction(wrapped_func): + + async def decorate(*args: Any, **kwargs: Any) -> Any: + driver_instance: "AsyncGenericDriver" = args[0] + driver_logger = driver_instance.logger + + timeout_ops_kwarg = kwargs.get("timeout_ops", None) + + if timeout_ops_kwarg is None or timeout_ops_kwarg == driver_instance.timeout_ops: + result = await wrapped_func(*args, **kwargs) + else: + driver_logger.info( + "modifying driver timeout for current operation, temporary timeout_ops " + f"value: '{timeout_ops_kwarg}'" + ) + base_timeout_ops = driver_instance.timeout_ops + driver_instance.timeout_ops = kwargs["timeout_ops"] + result = await wrapped_func(*args, **kwargs) + driver_instance.timeout_ops = base_timeout_ops + return result + + else: + # ignoring type error: + # "All conditional function variants must have identical signatures" + # one is sync one is async so never going to be identical here! + def decorate(*args: Any, **kwargs: Any) -> Any: # type: ignore + driver_instance: "GenericDriver" = args[0] + driver_logger = driver_instance.logger + + timeout_ops_kwarg = kwargs.get("timeout_ops", None) + + if timeout_ops_kwarg is None or timeout_ops_kwarg == driver_instance.timeout_ops: + result = wrapped_func(*args, **kwargs) + else: + driver_logger.info( + "modifying driver timeout for current operation, temporary timeout_ops " + f"value: '{timeout_ops_kwarg}'" + ) + base_timeout_ops = driver_instance.timeout_ops + driver_instance.timeout_ops = kwargs["timeout_ops"] + result = wrapped_func(*args, **kwargs) + driver_instance.timeout_ops = base_timeout_ops + return result + + # ensures that the wrapped function is updated w/ the original functions docs/etc. -- + # necessary for introspection for the auto gen docs to work! + update_wrapper(wrapper=decorate, wrapped=wrapped_func) + return decorate diff --git a/scrapli/driver/generic/async_driver.py b/scrapli/driver/generic/async_driver.py index 9f1af18b..8ae4bc3e 100644 --- a/scrapli/driver/generic/async_driver.py +++ b/scrapli/driver/generic/async_driver.py @@ -3,7 +3,7 @@ from io import BytesIO from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union -from scrapli.decorators import TimeoutOpsModifier +from scrapli.decorators import timeout_modifier from scrapli.driver import AsyncDriver from scrapli.driver.generic.base_driver import BaseGenericDriver from scrapli.exceptions import ScrapliTimeout, ScrapliValueError @@ -88,7 +88,7 @@ async def get_prompt(self) -> str: prompt: str = await self.channel.get_prompt() return prompt - @TimeoutOpsModifier() + @timeout_modifier async def _send_command( self, command: str, @@ -282,7 +282,7 @@ async def send_commands_from_file( timeout_ops=timeout_ops, ) - @TimeoutOpsModifier() + @timeout_modifier async def send_and_read( self, channel_input: str, @@ -342,7 +342,7 @@ async def send_and_read( raw_response=raw_response, processed_response=processed_response, response=response ) - @TimeoutOpsModifier() + @timeout_modifier async def send_interactive( self, interact_events: Union[List[Tuple[str, str]], List[Tuple[str, str, bool]]], diff --git a/scrapli/driver/generic/sync_driver.py b/scrapli/driver/generic/sync_driver.py index bdfa6710..54c636c5 100644 --- a/scrapli/driver/generic/sync_driver.py +++ b/scrapli/driver/generic/sync_driver.py @@ -3,7 +3,7 @@ from io import BytesIO from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union -from scrapli.decorators import TimeoutOpsModifier +from scrapli.decorators import timeout_modifier from scrapli.driver import Driver from scrapli.driver.generic.base_driver import BaseGenericDriver from scrapli.exceptions import ScrapliTimeout, ScrapliValueError @@ -89,7 +89,7 @@ def get_prompt(self) -> str: prompt: str = self.channel.get_prompt() return prompt - @TimeoutOpsModifier() + @timeout_modifier def _send_command( self, command: str, @@ -283,7 +283,7 @@ def send_commands_from_file( timeout_ops=timeout_ops, ) - @TimeoutOpsModifier() + @timeout_modifier def send_and_read( self, channel_input: str, @@ -343,7 +343,7 @@ def send_and_read( raw_response=raw_response, processed_response=processed_response, response=response ) - @TimeoutOpsModifier() + @timeout_modifier def send_interactive( self, interact_events: Union[List[Tuple[str, str]], List[Tuple[str, str, bool]]], diff --git a/scrapli/driver/network/async_driver.py b/scrapli/driver/network/async_driver.py index 13acab8e..7cc27d73 100644 --- a/scrapli/driver/network/async_driver.py +++ b/scrapli/driver/network/async_driver.py @@ -432,7 +432,7 @@ async def send_interactive( if failed_when_contains is None: failed_when_contains = self.failed_when_contains - # type hint is due to the TimeoutModifier wrapper returning `Any` so that we dont anger the + # type hint is due to the timeout_modifier wrapper returning `Any` so that we dont anger the # asyncio parts (which will get an awaitable not a Response returned) response: Response = await super().send_interactive( interact_events=interact_events, diff --git a/scrapli/driver/network/sync_driver.py b/scrapli/driver/network/sync_driver.py index a12934dc..2ac388fe 100644 --- a/scrapli/driver/network/sync_driver.py +++ b/scrapli/driver/network/sync_driver.py @@ -432,7 +432,7 @@ def send_interactive( if failed_when_contains is None: failed_when_contains = self.failed_when_contains - # type hint is due to the TimeoutModifier wrapper returning `Any` so that we dont anger the + # type hint is due to the timeout_modifier wrapper returning `Any` so that we dont anger the # asyncio parts (which will get an awaitable not a Response returned) response: Response = super().send_interactive( interact_events=interact_events, From d1e5e0a47dd08d73c44a2ebeb0616e475f032d43 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 14 May 2022 12:51:32 -0700 Subject: [PATCH 23/49] fixup timeout modifier test --- tests/unit/test_decorators.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_decorators.py b/tests/unit/test_decorators.py index 84b447a6..e2fe275b 100644 --- a/tests/unit/test_decorators.py +++ b/tests/unit/test_decorators.py @@ -3,7 +3,7 @@ import pytest -from scrapli.decorators import TimeoutOpsModifier, timeout_wrapper +from scrapli.decorators import timeout_modifier, timeout_wrapper from scrapli.exceptions import ScrapliTimeout @@ -251,7 +251,7 @@ def test_timeout_modifier(monkeypatch, sync_driver, test_data): timeout_ops = test_data assert sync_driver.timeout_ops == 30 - @TimeoutOpsModifier() + @timeout_modifier def _test_timeout_modifier(cls, timeout_ops): return cls.timeout_ops @@ -276,7 +276,7 @@ async def test_timeout_modifier_async(monkeypatch, async_driver, test_data): timeout_ops = test_data assert async_driver.timeout_ops == 30 - @TimeoutOpsModifier() + @timeout_modifier async def _test_timeout_modifier(cls, timeout_ops): return cls.timeout_ops From 7272508c49c80b48ff743e7249092bb1d1771a35 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 14 May 2022 13:08:37 -0700 Subject: [PATCH 24/49] bump pylint --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 36bbb099..c0a152d6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 pylama>=8.3.7,<9.0.0 -pylint==2.13.8 +pylint==2.13.9 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 From fcd35a8d671812dff627ad5c0ca3faabe23c1441 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 14 May 2022 13:12:22 -0700 Subject: [PATCH 25/49] docs --- docs/about/thank_you.md | 1 + docs/changelog.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/about/thank_you.md b/docs/about/thank_you.md index 38f6270e..3a240210 100644 --- a/docs/about/thank_you.md +++ b/docs/about/thank_you.md @@ -21,6 +21,7 @@ Thank you to the following people who have made contributions other than (and ma - [Marion](https://github.com/marionGh) for loads of testing hard to track down issues with the async transports! - [Roman Dodin](https://github.com/hellt) for inspiration to make the docs much better and for adding the doc testing to keep them looking good! +- [netixx](https://github.com/netixx) for helping unravel some particularly fun decorator timeout shenanigans! The following people have helped identify and report bugs in scrapli, thank you all! diff --git a/docs/changelog.md b/docs/changelog.md index a6f120af..67765a98 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -6,6 +6,7 @@ Changelog - Remove newline anchor in in-channel auth password pattern. Felt like a good/smart idea but Cisco in their infinite wisdom have some awful banner on IOL (CML/VIRL) things that doesn't end with a newline and too many people will hit that. +- Move decorators back to function style -- fixes possible timeout issues as seen in #233 ## 2022.01.30 From de271ec904eae84052eace5cb2f722e7f4c3c570 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 9 Apr 2022 15:57:40 -0700 Subject: [PATCH 26/49] bump pylint --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 29746637..310a06ed 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 pylama>=8.3.7,<9.0.0 -pylint==2.13.4 +pylint==2.13.5 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 From 5ee79b5832296ec0e7e7be9e9a96213ada1aea7b Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Thu, 21 Apr 2022 07:26:54 -0700 Subject: [PATCH 27/49] add thank you to jetbrains, because they are awesome! --- README.md | 4 ++-- docs/about/thank_you.md | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ce59a665..da4e2bee 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

+

[![Supported Versions](https://img.shields.io/pypi/pyversions/scrapli.svg)](https://pypi.org/project/scrapli) [![PyPI version](https://badge.fury.io/py/scrapli.svg)](https://badge.fury.io/py/scrapli) @@ -68,7 +68,7 @@ See the [docs](https://carlmontanari.github.io/scrapli/user_guide/installation) -## A simple Example +## A Simple Example ```python from scrapli import Scrapli diff --git a/docs/about/thank_you.md b/docs/about/thank_you.md index f53bfb91..38f6270e 100644 --- a/docs/about/thank_you.md +++ b/docs/about/thank_you.md @@ -22,7 +22,7 @@ Thank you to the following people who have made contributions other than (and ma - [Roman Dodin](https://github.com/hellt) for inspiration to make the docs much better and for adding the doc testing to keep them looking good! - + The following people have helped identify and report bugs in scrapli, thank you all! - [Kirill Pletnev](https://github.com/horseinthesky) @@ -37,3 +37,13 @@ The following people have helped identify and report bugs in scrapli, thank you - [Additional enable password prompt format IOSXE](https://github.com/carlmontanari/scrapli/issues/45) - [Natasha Samoylenko](https://github.com/natenka) - Missing open timeout on `asynctelnet` transport + +This list has not been kept up as well as it should, apologies for that! Thank you to everyone else who has +contributed in any way to scrapli! + +Last, but very much not least, a huge shoutout to JetBrains for building awesome tools and providing licenses for their +pro tools to open source developers (like me)! If you would like to use JetBrains awesome products, check out their +open source support page [here](https://jb.gg/OpenSourceSupport) for me info. + +

JetBrains Logo (Main) logo.

From 408f6ad46e350d1ec208f86049b76fe5b9d571fd Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 1 May 2022 05:29:28 -0700 Subject: [PATCH 28/49] bump pins --- .github/workflows/commit.yaml | 4 ++-- requirements-dev.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index ec546e8d..06b4b240 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -47,7 +47,7 @@ jobs: TERM: xterm run: python -m nox -s unit_tests - name: Upload coverage - uses: codecov/codecov-action@v2.1.0 + uses: codecov/codecov-action@v3.1.0 build_posix: runs-on: ${{ matrix.os }} @@ -89,7 +89,7 @@ jobs: - uses: actions/checkout@v3 - run: docker run -v $(pwd):/docs --entrypoint "" squidfunk/mkdocs-material:latest ash -c 'pip install mdx_gh_links && mkdocs build --clean --strict' - name: Cache htmltest external links - uses: actions/cache@v3.0.1 + uses: actions/cache@v3.0.2 with: path: tmp/.htmltest # key will contain hash of all md files to check if files have changed diff --git a/requirements-dev.txt b/requirements-dev.txt index 310a06ed..18a506be 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,13 +1,13 @@ black==22.3.0 darglint>=1.8.1,<2.0.0 isort>=5.10.1,<6.0.0 -mypy==0.942 +mypy==0.950 nox==2022.01.07 pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 pylama>=8.3.7,<9.0.0 -pylint==2.13.5 +pylint==2.13.7 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 From fe5d5f0c63597c84877c6e028e230738a307eb98 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:10:26 -0700 Subject: [PATCH 29/49] add 3.11 to ci, bump pylint --- .github/workflows/commit.yaml | 4 ++-- .github/workflows/weekly.yaml | 4 ++-- requirements-dev.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 06b4b240..3175bf9d 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -52,10 +52,10 @@ jobs: build_posix: runs-on: ${{ matrix.os }} strategy: - max-parallel: 8 + max-parallel: 10 matrix: os: [ubuntu-latest, macos-latest] - version: ["3.7", "3.8", "3.9", "3.10"] + version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} diff --git a/.github/workflows/weekly.yaml b/.github/workflows/weekly.yaml index b84b4b20..126d74ea 100644 --- a/.github/workflows/weekly.yaml +++ b/.github/workflows/weekly.yaml @@ -33,10 +33,10 @@ jobs: build_posix: runs-on: ${{ matrix.os }} strategy: - max-parallel: 8 + max-parallel: 10 matrix: os: [ubuntu-latest, macos-latest] - version: ["3.7", "3.8", "3.9", "3.10"] + version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 with: diff --git a/requirements-dev.txt b/requirements-dev.txt index 18a506be..36bbb099 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 pylama>=8.3.7,<9.0.0 -pylint==2.13.7 +pylint==2.13.8 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 From db27f3fed787a878dfed2b378da3cc86aa88c50a Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:16:53 -0700 Subject: [PATCH 30/49] add 'dev' to 3.11 for actions setup python --- .github/workflows/commit.yaml | 2 +- .github/workflows/weekly.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 3175bf9d..25eed013 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -55,7 +55,7 @@ jobs: max-parallel: 10 matrix: os: [ubuntu-latest, macos-latest] - version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"] steps: - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} diff --git a/.github/workflows/weekly.yaml b/.github/workflows/weekly.yaml index 126d74ea..cd8a5060 100644 --- a/.github/workflows/weekly.yaml +++ b/.github/workflows/weekly.yaml @@ -36,7 +36,7 @@ jobs: max-parallel: 10 matrix: os: [ubuntu-latest, macos-latest] - version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"] steps: - uses: actions/checkout@v3 with: From 0442b1627a247c0021820f4503653e13671185ee Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:18:47 -0700 Subject: [PATCH 31/49] add unit tests 3.11 in nox --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 2c4f8cb3..cca2f3f8 100644 --- a/noxfile.py +++ b/noxfile.py @@ -63,7 +63,7 @@ def parse_requirements(dev: bool = True) -> Dict[str, str]: SKIP_LIST: List[str] = [] -@nox.session(python=["3.7", "3.8", "3.9", "3.10"]) +@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"]) def unit_tests(session): """ Nox run unit tests From 02c1881efd42dcf74a049f832acbc912ad2ef6f7 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:28:08 -0700 Subject: [PATCH 32/49] skip ssh2-python tests on 3.11 --- requirements-ssh2.txt | 2 +- tests/unit/transport/plugins/ssh2/test_ssh2_transport.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/requirements-ssh2.txt b/requirements-ssh2.txt index 117a7884..1ad9fcbc 100644 --- a/requirements-ssh2.txt +++ b/requirements-ssh2.txt @@ -1 +1 @@ -ssh2-python>=0.23.0,<1.0.0 \ No newline at end of file +ssh2-python>=0.23.0,<1.0.0 ; sys_platform != "darwin" or sys_platform == "darwin" and python_version < "3.11" \ No newline at end of file diff --git a/tests/unit/transport/plugins/ssh2/test_ssh2_transport.py b/tests/unit/transport/plugins/ssh2/test_ssh2_transport.py index 8bed37a1..e372bccd 100644 --- a/tests/unit/transport/plugins/ssh2/test_ssh2_transport.py +++ b/tests/unit/transport/plugins/ssh2/test_ssh2_transport.py @@ -5,15 +5,18 @@ from scrapli.exceptions import ScrapliConnectionNotOpened +@pytest.mark.skipif(sys.version_info >= (3, 11), reason="skipping ssh2 on 3.11") def test_open_channel_no_session(ssh2_transport): with pytest.raises(ScrapliConnectionNotOpened): assert ssh2_transport._open_channel() +@pytest.mark.skipif(sys.version_info >= (3, 11), reason="skipping ssh2 on 3.11") def test_isalive_no_session(ssh2_transport): assert ssh2_transport.isalive() is False +@pytest.mark.skipif(sys.version_info >= (3, 11), reason="skipping ssh2 on 3.11") def test_write_exception(ssh2_transport): with pytest.raises(ScrapliConnectionNotOpened): ssh2_transport.write("blah") From aa35377271d1097199f2a8bbad6b2e33b5bb606f Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:46:55 -0700 Subject: [PATCH 33/49] jk no ssh2 on any 3.11 things! --- requirements-ssh2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-ssh2.txt b/requirements-ssh2.txt index 1ad9fcbc..89f4eed0 100644 --- a/requirements-ssh2.txt +++ b/requirements-ssh2.txt @@ -1 +1 @@ -ssh2-python>=0.23.0,<1.0.0 ; sys_platform != "darwin" or sys_platform == "darwin" and python_version < "3.11" \ No newline at end of file +ssh2-python>=0.23.0,<1.0.0 ; python_version < "3.11" \ No newline at end of file From 1cf97b8dc9f76ac839013db02d86819d6e10f005 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sun, 8 May 2022 08:53:06 -0700 Subject: [PATCH 34/49] change test to paramiko for transport timeout testing --- tests/unit/driver/base/test_base_common_driver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/driver/base/test_base_common_driver.py b/tests/unit/driver/base/test_base_common_driver.py index 30e9753a..d912b4a6 100644 --- a/tests/unit/driver/base/test_base_common_driver.py +++ b/tests/unit/driver/base/test_base_common_driver.py @@ -85,11 +85,11 @@ def test_timeout_properties_transport_plugin_set_timeout(monkeypatch): Specifically for plugins with set_timeout method -- i.e. ssh2/paramiko """ monkeypatch.setattr( - "scrapli.transport.plugins.ssh2.transport.Ssh2Transport._set_timeout", + "scrapli.transport.plugins.paramiko.transport.ParamikoTransport._set_timeout", lambda cls, value: None, ) - driver = BaseDriver(host="localhost", transport="ssh2") + driver = BaseDriver(host="localhost", transport="paramiko") assert driver.timeout_transport == 30.0 driver.timeout_transport = 999.99 assert driver.timeout_transport == 999.99 From d89816d435b5dde0361279d310a940ab16fb13d7 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 14 May 2022 13:08:37 -0700 Subject: [PATCH 35/49] bump pylint --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 36bbb099..c0a152d6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,7 +7,7 @@ pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 pylama>=8.3.7,<9.0.0 -pylint==2.13.8 +pylint==2.13.9 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 From 4f16d5a85e03e1020d3ac53f6b12e23b927d34bb Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Fri, 6 May 2022 08:47:30 -0700 Subject: [PATCH 36/49] handle seeing current priv again after trying to escalate auth --- docs/changelog.md | 4 ++ scrapli/driver/network/async_driver.py | 5 +- scrapli/driver/network/sync_driver.py | 5 +- .../network/test_network_async_driver.py | 62 +++++++++++++++++++ .../network/test_network_sync_driver.py | 62 ++++++++++++++++++- 5 files changed, 135 insertions(+), 3 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index a6f120af..3397282c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -6,6 +6,10 @@ Changelog - Remove newline anchor in in-channel auth password pattern. Felt like a good/smart idea but Cisco in their infinite wisdom have some awful banner on IOL (CML/VIRL) things that doesn't end with a newline and too many people will hit that. +- Modified `escalate_priv` methods to check for password prompt and desired prompt patterns *and* the current prompt + pattern. There was an issue in scrapligo/containerlab where a cEOS device would not let you auth past enable until + it is done "booting" up, and scrapli would just simply timeout as it didn't expect to see the exec prompt again. + Thanks to @hellt for helping track this one down! ## 2022.01.30 diff --git a/scrapli/driver/network/async_driver.py b/scrapli/driver/network/async_driver.py index 13acab8e..d1a16563 100644 --- a/scrapli/driver/network/async_driver.py +++ b/scrapli/driver/network/async_driver.py @@ -106,7 +106,10 @@ async def _escalate(self, escalate_priv: PrivilegeLevel) -> None: (escalate_priv.escalate, escalate_priv.escalate_prompt, False), (self.auth_secondary, escalate_priv.pattern, True), ], - interaction_complete_patterns=[escalate_priv.pattern], + interaction_complete_patterns=[ + self.privilege_levels[escalate_priv.previous_priv].pattern, + escalate_priv.pattern, + ], ) except ScrapliTimeout as exc: raise ScrapliAuthenticationFailed( diff --git a/scrapli/driver/network/sync_driver.py b/scrapli/driver/network/sync_driver.py index a12934dc..11027337 100644 --- a/scrapli/driver/network/sync_driver.py +++ b/scrapli/driver/network/sync_driver.py @@ -106,7 +106,10 @@ def _escalate(self, escalate_priv: PrivilegeLevel) -> None: (escalate_priv.escalate, escalate_priv.escalate_prompt, False), (self.auth_secondary, escalate_priv.pattern, True), ], - interaction_complete_patterns=[escalate_priv.pattern], + interaction_complete_patterns=[ + self.privilege_levels[escalate_priv.previous_priv].pattern, + escalate_priv.pattern, + ], ) except ScrapliTimeout as exc: raise ScrapliAuthenticationFailed( diff --git a/tests/unit/driver/network/test_network_async_driver.py b/tests/unit/driver/network/test_network_async_driver.py index 9251c884..4c3cafb2 100644 --- a/tests/unit/driver/network/test_network_async_driver.py +++ b/tests/unit/driver/network/test_network_async_driver.py @@ -112,6 +112,68 @@ async def _send_input(cls, channel_input, **kwargs): await async_network_driver.acquire_priv(desired_priv="privilege_exec") +async def test_acquire_priv_escalate_not_ready_same_priv(monkeypatch, async_network_driver): + """ + This tests to make sure that if the device does something like ceos does like this: + + ``` + info::ceos::"sending channelInput: enable; stripPrompt: false; eager: false + write::ceos::write: enable + debug::ceos::read: enable + write::ceos::write: + debug::ceos::read: + debug::ceos::read: % Authorization denied for command 'enable': Default authorization provider rejects all commands + debug::ceos::read: ceos> + ``` + + we gracefully handle returning to the current priv level -- rather than only being okay with + seeing a password prompt and/or the *next* pirv level. Thank you @ntdvps/@hellt (Roman) for + helping find this issue! + + """ + _prompt_counter = 0 + + async def _get_prompt(cls): + nonlocal _prompt_counter + if _prompt_counter == 0: + prompt = "scrapli>" + elif _prompt_counter == 1: + prompt = "scrapli>" + else: + prompt = "scrapli#" + _prompt_counter += 1 + return prompt + + async def __read_until_input(cls, channel_input): + return channel_input + + async def __read_until_explicit_prompt(cls, prompts): + # we dont really care what we return here, just needs to be bytes. but we *do* care that + # in this case we are receiving *three* prompt patterns -- the password pattern, the + # escalate priv pattern, and the *current* priv pattern. + assert len(prompts) == 3 + + return b"scrapli>" + + def _write(cls, channel_input, **kwargs): + return + + monkeypatch.setattr("scrapli.channel.async_channel.AsyncChannel.get_prompt", _get_prompt) + monkeypatch.setattr( + "scrapli.channel.async_channel.AsyncChannel._read_until_input", __read_until_input + ) + monkeypatch.setattr( + "scrapli.channel.async_channel.AsyncChannel._read_until_explicit_prompt", + __read_until_explicit_prompt, + ) + monkeypatch.setattr( + "scrapli.transport.plugins.asynctelnet.transport.AsynctelnetTransport.write", _write + ) + + async_network_driver._current_priv_level = async_network_driver.privilege_levels["exec"] + await async_network_driver.acquire_priv(desired_priv="privilege_exec") + + async def test_acquire_priv_failure(monkeypatch, async_network_driver): async def _get_prompt(cls): return "scrapli(config)#" diff --git a/tests/unit/driver/network/test_network_sync_driver.py b/tests/unit/driver/network/test_network_sync_driver.py index a3c78a2f..d1163622 100644 --- a/tests/unit/driver/network/test_network_sync_driver.py +++ b/tests/unit/driver/network/test_network_sync_driver.py @@ -1,6 +1,6 @@ import pytest -from scrapli.exceptions import ScrapliPrivilegeError +from scrapli.exceptions import ScrapliPrivilegeError, ScrapliTimeout def test_escalate(monkeypatch, sync_network_driver): @@ -101,6 +101,66 @@ def _send_input(cls, channel_input, **kwargs): sync_network_driver.acquire_priv(desired_priv="privilege_exec") +def test_acquire_priv_escalate_not_ready_same_priv(monkeypatch, sync_network_driver): + """ + This tests to make sure that if the device does something like ceos does like this: + + ``` + info::ceos::"sending channelInput: enable; stripPrompt: false; eager: false + write::ceos::write: enable + debug::ceos::read: enable + write::ceos::write: + debug::ceos::read: + debug::ceos::read: % Authorization denied for command 'enable': Default authorization provider rejects all commands + debug::ceos::read: ceos> + ``` + + we gracefully handle returning to the current priv level -- rather than only being okay with + seeing a password prompt and/or the *next* pirv level. Thank you @ntdvps/@hellt (Roman) for + helping find this issue! + + """ + _prompt_counter = 0 + + def _get_prompt(cls): + nonlocal _prompt_counter + if _prompt_counter == 0: + prompt = "scrapli>" + elif _prompt_counter == 1: + prompt = "scrapli>" + else: + prompt = "scrapli#" + _prompt_counter += 1 + return prompt + + def __read_until_input(cls, channel_input): + return channel_input + + def __read_until_explicit_prompt(cls, prompts): + # we dont really care what we return here, just needs to be bytes. but we *do* care that + # in this case we are receiving *three* prompt patterns -- the password pattern, the + # escalate priv pattern, and the *current* priv pattern. + assert len(prompts) == 3 + + return b"scrapli>" + + def _write(cls, channel_input, **kwargs): + return + + monkeypatch.setattr("scrapli.channel.sync_channel.Channel.get_prompt", _get_prompt) + monkeypatch.setattr( + "scrapli.channel.sync_channel.Channel._read_until_input", __read_until_input + ) + monkeypatch.setattr( + "scrapli.channel.sync_channel.Channel._read_until_explicit_prompt", + __read_until_explicit_prompt, + ) + monkeypatch.setattr("scrapli.transport.plugins.system.transport.SystemTransport.write", _write) + + sync_network_driver._current_priv_level = sync_network_driver.privilege_levels["exec"] + sync_network_driver.acquire_priv(desired_priv="privilege_exec") + + def test_acquire_priv_failure(monkeypatch, sync_network_driver): def _get_prompt(cls): return "scrapli(config)#" From f8f5679ea9bdc6cbe49cc8a4f3bd8cb4921d44fe Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 14 May 2022 13:46:24 -0700 Subject: [PATCH 37/49] changelog update --- docs/changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 3397282c..cf760409 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -10,6 +10,8 @@ Changelog pattern. There was an issue in scrapligo/containerlab where a cEOS device would not let you auth past enable until it is done "booting" up, and scrapli would just simply timeout as it didn't expect to see the exec prompt again. Thanks to @hellt for helping track this one down! +- Replaced standard library telnetlib transport with custom telnet transport (still no external requirements) in + very early preparation for telnetlib's deprecation. ## 2022.01.30 From 2656044187eb0b52f8468dd230b858d79e53267a Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 28 May 2022 15:12:20 -0700 Subject: [PATCH 38/49] bump mypy --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index c0a152d6..74a03ab4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ black==22.3.0 darglint>=1.8.1,<2.0.0 isort>=5.10.1,<6.0.0 -mypy==0.950 +mypy==0.960 nox==2022.01.07 pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 From 48840656d001b45a77db6c9ef17b943fcf74401c Mon Sep 17 00:00:00 2001 From: "v.garkaviy" Date: Fri, 17 Jun 2022 11:14:49 +0300 Subject: [PATCH 39/49] Let mypy to infer the correct context vars types --- .gitignore | 3 +++ scrapli/driver/base/async_driver.py | 4 ++-- scrapli/driver/base/sync_driver.py | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index df8eeee5..32fe4bd5 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,9 @@ venv.bak/ # pycharm .idea +# vscode +.vscode/ + # mypy .mypy_cache/ .dmypy.json diff --git a/scrapli/driver/base/async_driver.py b/scrapli/driver/base/async_driver.py index 6365f3e1..ec7139b6 100644 --- a/scrapli/driver/base/async_driver.py +++ b/scrapli/driver/base/async_driver.py @@ -23,7 +23,7 @@ def __init__(self, **kwargs: Any): base_channel_args=self._base_channel_args, ) - async def __aenter__(self) -> "AsyncDriver": + async def __aenter__(self): """ Enter method for context manager @@ -31,7 +31,7 @@ async def __aenter__(self) -> "AsyncDriver": N/A Returns: - AsyncDriver: opened AsyncDriver object + AsyncDriver: a concrete implementation of the opened AsyncDriver object Raises: N/A diff --git a/scrapli/driver/base/sync_driver.py b/scrapli/driver/base/sync_driver.py index 600aecff..09c898ee 100644 --- a/scrapli/driver/base/sync_driver.py +++ b/scrapli/driver/base/sync_driver.py @@ -23,7 +23,7 @@ def __init__(self, **kwargs: Any): base_channel_args=self._base_channel_args, ) - def __enter__(self) -> "Driver": + def __enter__(self): """ Enter method for context manager @@ -31,7 +31,7 @@ def __enter__(self) -> "Driver": N/A Returns: - Driver: opened Driver object + Driver: a concrete implementation of the opened Driver object Raises: N/A From 2dd059ea9e1c318a3bdda8058ee023540d7355ad Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 18 Jun 2022 09:45:01 -0700 Subject: [PATCH 40/49] bump pins, pylintrc update --- .github/workflows/commit.yaml | 2 +- .pylintrc | 733 +++++++++++++++++++++------------- examples/test_examples.py | 6 + requirements-dev.txt | 4 +- 4 files changed, 474 insertions(+), 271 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 25eed013..07fa8512 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -89,7 +89,7 @@ jobs: - uses: actions/checkout@v3 - run: docker run -v $(pwd):/docs --entrypoint "" squidfunk/mkdocs-material:latest ash -c 'pip install mdx_gh_links && mkdocs build --clean --strict' - name: Cache htmltest external links - uses: actions/cache@v3.0.2 + uses: actions/cache@v3 with: path: tmp/.htmltest # key will contain hash of all md files to check if files have changed diff --git a/.pylintrc b/.pylintrc index 162d46c6..f70376f3 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,414 +1,611 @@ -[MASTER] +[MAIN] -# Specify a configuration file. -#rcfile= +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Load and enable all available extensions. Use --list-extensions to see a list +# all available extensions. +#enable-all-extensions= + +# In error mode, messages with a category besides ERROR or FATAL are +# suppressed, and no reports are done by default. Error mode is compatible with +# disabling specific errors. +#errors-only= + +# Always return a 0 (non-error) status code, even if lint errors are found. +# This is primarily useful in continuous integration scripts. +#exit-zero= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-allow-list=ssh2 + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. (This is an alternative name to extension-pkg-allow-list +# for backward compatibility.) +extension-pkg-whitelist= + +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +fail-on= + +# Specify a score threshold to be exceeded before program exits with error. +fail-under=10 + +# Interpret the stdin as a python script, whose filename needs to be passed as +# the module_or_package argument. +#from-stdin= + +# Files or directories to be skipped. They should be base names, not paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the ignore-list. The +# regex matches against paths and can be in Posix or Windows format. +ignore-paths= + +# Files or directories matching the regex patterns are skipped. The regex +# matches against base names, not paths. The default value ignores Emacs file +# locks +ignore-patterns=^\.# + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis). It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= # Python code to execute, usually for sys.path manipulation such as # pygtk.require(). #init-hook= -# Add files or directories to the blacklist. They should be base names, not -# paths. -ignore=CVS +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use. +jobs=1 -# Add files or directories matching the regex patterns to the blacklist. The -# regex matches against base names, not paths. -ignore-patterns= +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +load-plugins= # Pickle collected data for later comparisons. persistent=yes -# List of plugins (as comma separated values of python modules names) to load, -# usually to register additional checkers. -load-plugins= +# Minimum Python version to use for version dependent checks. Will default to +# the version used to run pylint. +py-version=3.10 -# Use multiple processes to speed up Pylint. -jobs=1 +# Discover python modules and packages in the file system subtree. +recursive=no + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes # Allow loading of arbitrary C extensions. Extensions are imported into the # active Python interpreter and may run arbitrary code. -unsafe-load-any-extension=yes +unsafe-load-any-extension=no -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code -extension-pkg-whitelist=numpy +# In verbose mode, extra non-checker-related info will be displayed. +#verbose= -# Allow optimization of some AST trees. This will activate a peephole AST -# optimizer, which will apply various small optimizations. For instance, it can -# be used to obtain the result of joining multiple strings with the addition -# operator. Joining a lot of strings can lead to a maximum recursion error in -# Pylint and this flag can prevent that. It has one side effect, the resulting -# AST will be different than the one from reality. This option is deprecated -# and it will be removed in Pylint 2.0. -optimize-ast=no + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each +# category, as well as 'statement' which is the total number of statements +# analyzed. This score is used by the global evaluation report (RP0004). +evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +#output-format= + +# Tells whether to display a full report or only the messages. +reports=no + +# Activate the evaluation score. +score=yes [MESSAGES CONTROL] # Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED -confidence= - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -#enable= +# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, +# UNDEFINED. +confidence=HIGH, + CONTROL_FLOW, + INFERENCE, + INFERENCE_FAILURE, + UNDEFINED # Disable the message, report, category or checker with the given id(s). You # can either give multiple identifiers separated by comma (,) or put this # option multiple times (only on the command line, not in the configuration -# file where it should appear only once).You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then re-enable specific checks. For example, if # you want to run only the similarities checker, you can use "--disable=all # --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use"--disable=all --enable=classes -# --disable=W" -disable=C0103,C0115,C0330,R0901,R0902,R0913,W1202,W1203 +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=C0103,C0115,R0901,R0902,R0903,R0913,R0914,W1202,W1203 # C0103 = constant-name (a little too aggressive for some things that aren't "really" constants") # C0115 = class docstrings (init doc strings cover this already) -# C0330 = bad-continuation (hanging indent that black doesnt like) # W1202 = use % formatting for logging (ignore, using f-strings) # W1203 = logging-fstring-interpolation (py3.6, using f-strings so dont care) +# R0901 = too-many-ancestors # R0902 = too-many-instance-attributes +# R0903 = too-few-public methods # R0913 = too-many-arguments -# R0901 = too-many-ancestors (ignore because it counts mixins and i think thats not useful here) +# R0914 = too-many-local-variables -[REPORTS] +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable=c-extension-no-member -# Set the output format. Available formats are text, parseable, colorized, msvs -# (visual studio) and html. You can also give a reporter class, eg -# mypackage.mymodule.MyReporterClass. -output-format=text -# Put messages in a separate file for each module / package specified on the -# command line instead of printing them on stdout. Reports (if any) will be -# written in a file name "pylint_global.[txt|html]". This option is deprecated -# and it will be removed in Pylint 2.0. -files-output=no +[STRING] -# Tells whether to display a full report or only the messages -reports=yes +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no -# Python expression which should return a note less than 10 (10 is the highest -# note). You have access to the variables errors warning, statement which -# respectively contain the number of errors / warnings messages and the total -# number of statements analyzed. This is used by the global evaluation report -# (RP0004). -evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details -#msg-template= +[DESIGN] -[BASIC] +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +exclude-too-few-public-methods= -# Good variable names which should always be accepted, separated by a comma -good-names=i,j,k,ex,Run,_ +# List of qualified class names to ignore when counting class parents (see +# R0901) +ignored-parents= -# Bad variable names which should always be refused, separated by a comma -bad-names=foo,bar,baz,toto,tutu,tata +# Maximum number of arguments for function / method. +max-args=5 -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= +# Maximum number of attributes for a class (see R0902). +max-attributes=7 -# Include a hint for the correct naming format with invalid-name -include-naming-hint=no +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -property-classes=abc.abstractproperty +# Maximum number of branch for function / method body. +max-branches=12 -# Regular expression matching correct variable names -variable-rgx=[a-z_][a-z0-9_]{2,30}$ +# Maximum number of locals for function / method body. +max-locals=15 -# Naming hint for variable names -variable-name-hint=[a-z_][a-z0-9_]{2,30}$ +# Maximum number of parents for a class (see R0901). +max-parents=7 -# Regular expression matching correct class attribute names -class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 -# Naming hint for class attribute names -class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ +# Maximum number of return / yield for function / method body. +max-returns=6 -# Regular expression matching correct argument names -argument-rgx=[a-z_][a-z0-9_]{2,30}$ +# Maximum number of statements in function / method body. +max-statements=50 -# Naming hint for argument names -argument-name-hint=[a-z_][a-z0-9_]{2,30}$ +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 -# Regular expression matching correct module names -module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ -# Naming hint for module names -module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ +[LOGGING] -# Regular expression matching correct constant names -const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old -# Naming hint for constant names -const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging -# Regular expression matching correct inline iteration names -inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ -# Naming hint for inline iteration names -inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ +[TYPECHECK] -# Regular expression matching correct method names -method-rgx=[a-z_][a-z0-9_]{2,30}$ +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager -# Naming hint for method names -method-name-hint=[a-z_][a-z0-9_]{2,30}$ +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins=no-member, + not-async-context-manager, + not-context-manager, + attribute-defined-outside-init -# Regular expression matching correct function names -function-rgx=[a-z_][a-z0-9_]{2,30}$ +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace -# Naming hint for function names -function-name-hint=[a-z_][a-z0-9_]{2,30}$ +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes -# Regular expression matching correct attribute names -attr-rgx=[a-z_][a-z0-9_]{2,30}$ +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 -# Naming hint for attribute names -attr-name-hint=[a-z_][a-z0-9_]{2,30}$ +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 -# Regular expression matching correct class names -class-rgx=[A-Z_][a-zA-Z0-9]+$ +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx=.*[Mm]ixin -# Naming hint for class names -class-name-hint=[A-Z_][a-zA-Z0-9]+$ +# List of decorators that change the signature of a decorated function. +signature-mutators= -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^test_ -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 +[EXCEPTIONS] +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=BaseException, + Exception -[ELIF] -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 +[SIMILARITIES] +# Comments are removed from the similarity computation +ignore-comments=yes -[FORMAT] +# Docstrings are removed from the similarity computation +ignore-docstrings=yes -# Maximum number of characters on a single line. -max-line-length=100 +# Imports are removed from the similarity computation +ignore-imports=yes -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )??$ +# Signatures are removed from the similarity computation +ignore-signatures=yes -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=y +# Minimum lines number of a similarity. +min-similarity-lines=4 -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma,dict-separator -# Maximum number of lines in a module -max-module-lines=1000 +[BASIC] -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string=' ' +# Naming style matching correct argument names. +argument-naming-style=snake_case -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 +# Regular expression matching correct argument names. Overrides argument- +# naming-style. If left empty, argument names will be checked with the set +# naming style. +#argument-rgx= -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -expected-line-ending-format= +# Naming style matching correct attribute names. +attr-naming-style=snake_case +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. If left empty, attribute names will be checked with the set naming +# style. +#attr-rgx= -[LOGGING] +# Bad variable names which should always be refused, separated by a comma. +bad-names=foo, + bar, + baz, + toto, + tutu, + tata -# Logging modules to check that the string format arguments are in logging -# function parameter format -logging-modules=logging +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= +# Naming style matching correct class attribute names. +class-attribute-naming-style=any -[MISCELLANEOUS] +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. If left empty, class attribute names will be checked +# with the set naming style. +#class-attribute-rgx= -# List of note tags to take in consideration, separated by a comma. -notes=FIXME,XXX,TODO +# Naming style matching correct class constant names. +class-const-naming-style=UPPER_CASE +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. If left empty, class constant names will be checked with +# the set naming style. +#class-const-rgx= -[SIMILARITIES] +# Naming style matching correct class names. +class-naming-style=PascalCase -# Minimum lines number of a similarity. -min-similarity-lines=10 +# Regular expression matching correct class names. Overrides class-naming- +# style. If left empty, class names will be checked with the set naming style. +#class-rgx= -# Ignore comments when computing similarities. -ignore-comments=yes +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE -# Ignore docstrings when computing similarities. -ignore-docstrings=yes +# Regular expression matching correct constant names. Overrides const-naming- +# style. If left empty, constant names will be checked with the set naming +# style. +#const-rgx= -# Ignore imports when computing similarities. -ignore-imports=no +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 +# Naming style matching correct function names. +function-naming-style=snake_case -[SPELLING] +# Regular expression matching correct function names. Overrides function- +# naming-style. If left empty, function names will be checked with the set +# naming style. +#function-rgx= -# Spelling dictionary name. Available dictionaries: none. To make it working -# install python-enchant package. -spelling-dict= +# Good variable names which should always be accepted, separated by a comma. +good-names=i, + j, + k, + ex, + Run, + _ -# List of comma separated words that should not be checked. -spelling-ignore-words= +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= -# A path to a file that contains private dictionary; one word per line. -spelling-private-dict-file= +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=no -# Tells whether to store unknown words to indicated private dictionary in -# --spelling-private-dict-file option instead of raising a message. -spelling-store-unknown-words=no +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. If left empty, inline iteration names will be checked +# with the set naming style. +#inlinevar-rgx= -[TYPECHECK] +# Naming style matching correct method names. +method-naming-style=snake_case -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes +# Regular expression matching correct method names. Overrides method-naming- +# style. If left empty, method names will be checked with the set naming style. +#method-rgx= -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis. It -# supports qualified module names, as well as Unix pattern matching. -ignored-modules= +# Naming style matching correct module names. +module-naming-style=snake_case -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local,matplotlib.cm,tensorflow.python,tensorflow,tensorflow.train.Example,RunOptions +# Regular expression matching correct module names. Overrides module-naming- +# style. If left empty, module names will be checked with the set naming style. +#module-rgx= -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members=set_shape,np.float32 +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty -[VARIABLES] +# Regular expression matching correct type variable names. If left empty, type +# variable names will be checked with the set naming style. +#typevar-rgx= -# Tells whether we should check for unused import in __init__ files. -init-import=yes +# Naming style matching correct variable names. +variable-naming-style=snake_case -# A regular expression matching the name of dummy variables (i.e. expectedly -# not used). -dummy-variables-rgx=(_+[a-zA-Z0-9_]*?$)|dummy +# Regular expression matching correct variable names. Overrides variable- +# naming-style. If left empty, variable names will be checked with the set +# naming style. +#variable-rgx= -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid to define new builtins when possible. -additional-builtins= -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_,_cb +[FORMAT] -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,future.builtins +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ -[CLASSES] +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__,__new__,setUp +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls +# Maximum number of characters on a single line. +max-line-length=100 -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=mcs +# Maximum number of lines in a module. +max-module-lines=1000 + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules= + +# Output a graph (.gv or any supported image format) of external dependencies +# to the given file (report RP0402 must not be disabled). +ext-import-graph= + +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be +# disabled). +import-graph= + +# Output a graph (.gv or any supported image format) of internal dependencies +# to the given file (report RP0402 must not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + +# Regular expression of note tags to take in consideration. +notes-rgx= + + +[CLASSES] + +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp, + __post_init__ # List of member names, which should be excluded from the protected access # warning. -exclude-protected=_asdict,_fields,_replace,_source,_make - +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make -[DESIGN] +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls -# Maximum number of arguments for function / method -max-args=10 +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=cls -# Argument names that match this expression will be ignored. Default to name -# with leading underscore -ignored-argument-names=_.* -# Maximum number of locals for function / method body -max-locals=30 +[REFACTORING] -# Maximum number of return / yield for function / method body -max-returns=6 +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 -# Maximum number of branch for function / method body -max-branches=12 +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit,argparse.parse_error -# Maximum number of statements in function / method body -max-statements=100 -# Maximum number of parents for a class (see R0901). -max-parents=7 +[VARIABLES] -# Maximum number of attributes for a class (see R0902). -max-attributes=10 +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= -# Minimum number of public methods for a class (see R0903). -min-public-methods=0 +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes -# Maximum number of public methods for a class (see R0904). -max-public-methods=20 +# List of names allowed to shadow builtins +allowed-redefined-builtins= -# Maximum number of boolean expressions in a if statement -max-bool-expr=5 +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ -[IMPORTS] +# Argument names that match this expression will be ignored. Default to name +# with leading underscore. +ignored-argument-names=_.*|^ignored_|^unused_ -# Deprecated modules which should not be used, separated by a comma -deprecated-modules=optparse +# Tells whether we should check for unused import in __init__ files. +init-import=no -# Create a graph of every (i.e. internal and external) dependencies in the -# given file (report RP0402 must not be disabled) -import-graph= +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io -# Create a graph of external dependencies in the given file (report RP0402 must -# not be disabled) -ext-import-graph= -# Create a graph of internal dependencies in the given file (report RP0402 must -# not be disabled) -int-import-graph= +[SPELLING] -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant +# Spelling dictionary name. Available dictionaries: en_GB (aspell), en_US +# (hunspell), en_AU (aspell), en (aspell), en_CA (aspell). +spelling-dict= -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no +# List of comma separated words that should be considered directives if they +# appear at the beginning of a comment and should not be checked. +spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: +# List of comma separated words that should not be checked. +spelling-ignore-words= -[EXCEPTIONS] +# A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file= -# Exceptions that will emit a warning when being caught. Defaults to -# "Exception" -overgeneral-exceptions=Exception +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=no \ No newline at end of file diff --git a/examples/test_examples.py b/examples/test_examples.py index 9197ed05..0bd49a26 100644 --- a/examples/test_examples.py +++ b/examples/test_examples.py @@ -12,6 +12,7 @@ async def test_async_usage(): + """Test async usage example""" await async_iosxe_driver.main() @@ -21,6 +22,7 @@ async def test_async_usage(): ids=["generic_driver", "iosxe_driver", "scrapli_driver", "scrapli_factory"], ) def test_basic_usage(example_script): + """Test basic usage example""" example_script.main() @@ -30,14 +32,17 @@ def test_basic_usage(example_script): ids=["iosxr_configure_exclusive", "eos_configure_session"], ) def test_configuration_modes(example_script): + """Test configuration mode example""" example_script.main() def test_logging(): + """Test logging example""" basic_logging.main() def test_ssh_keys(): + """Test ssh keys example""" ssh_keys.main() @@ -47,4 +52,5 @@ def test_ssh_keys(): ids=["genie", "textfsm"], ) def test_structured_data(example_script): + """Test structured data example""" example_script.main() diff --git a/requirements-dev.txt b/requirements-dev.txt index 74a03ab4..058445f8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,13 +1,13 @@ black==22.3.0 darglint>=1.8.1,<2.0.0 isort>=5.10.1,<6.0.0 -mypy==0.960 +mypy==0.961 nox==2022.01.07 pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 pylama>=8.3.7,<9.0.0 -pylint==2.13.9 +pylint==2.14.3 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 From 405576ec5fb8c4c14b16e8be36579316ba3f01b7 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 18 Jun 2022 09:49:16 -0700 Subject: [PATCH 41/49] remove doctest (for now?) --- .github/workflows/commit.yaml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 07fa8512..03024a39 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -83,23 +83,3 @@ jobs: TERM: xterm run: python -m nox -p $FRIENDLY_PYTHON_VERSION -k "not darglint" - docs-test: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - run: docker run -v $(pwd):/docs --entrypoint "" squidfunk/mkdocs-material:latest ash -c 'pip install mdx_gh_links && mkdocs build --clean --strict' - - name: Cache htmltest external links - uses: actions/cache@v3 - with: - path: tmp/.htmltest - # key will contain hash of all md files to check if files have changed - # when files are changed, a new key name is formed, and thus a new cache will be saved - key: htmltest-${{ hashFiles('docs/**/*.md') }} - # the restore key will fetch any previously saved cache even if there is no match on key - # this allows to use cache from prev runs and update it - restore-keys: | - htmltest- - - name: htmltest - uses: wjdp/htmltest-action@v0.13.0-rc1 - with: - config: docs/htmltest.yml From 39991f5ce3ba5931971615d1c118fc9fb5cb27c6 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Sat, 2 Jul 2022 11:33:13 -0700 Subject: [PATCH 42/49] update pins --- .github/workflows/commit.yaml | 6 +++--- .github/workflows/weekly.yaml | 4 ++-- requirements-dev.txt | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 03024a39..e59b6794 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.version }} - name: setup test env @@ -34,7 +34,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.version }} - name: setup test env @@ -59,7 +59,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: set up python ${{ matrix.version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.version }} - name: get friendly (for nox) python version diff --git a/.github/workflows/weekly.yaml b/.github/workflows/weekly.yaml index cd8a5060..0893906b 100644 --- a/.github/workflows/weekly.yaml +++ b/.github/workflows/weekly.yaml @@ -19,7 +19,7 @@ jobs: with: ref: develop - name: set up python ${{ matrix.version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.version }} - name: setup test env @@ -42,7 +42,7 @@ jobs: with: ref: develop - name: set up python ${{ matrix.version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.version }} - name: get friendly (for nox) python version diff --git a/requirements-dev.txt b/requirements-dev.txt index 058445f8..e6f3b506 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -black==22.3.0 +black==22.6.0 darglint>=1.8.1,<2.0.0 isort>=5.10.1,<6.0.0 mypy==0.961 @@ -7,7 +7,7 @@ pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 pylama>=8.3.7,<9.0.0 -pylint==2.14.3 +pylint==2.14.4 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 From c5286de0aa19a313d350415e48fcfc6b8a60e111 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Tue, 19 Jul 2022 14:23:00 -0700 Subject: [PATCH 43/49] func test overhaul --- .clab/topo.yaml | 39 ++ Makefile | 86 +-- docker-compose.yaml | 60 -- docs/user_guide/linting_testing.md | 128 ++-- requirements-dev.txt | 4 +- .../driver/core/juniper_junos/base_driver.py | 2 +- .../transport/plugins/paramiko/transport.py | 6 +- tests/conftest.py | 201 +----- tests/devices.py | 113 ++-- tests/functional/conftest.py | 53 +- tests/functional/expected.py | 25 + ...re_priv[arista_eos-asyncssh-configuration] | 1 + ...and_acquire_priv[arista_eos-asyncssh-exec] | 1 + ...e_priv[arista_eos-asyncssh-privilege_exec] | 1 + ...priv[arista_eos-asynctelnet-configuration] | 1 + ..._acquire_priv[arista_eos-asynctelnet-exec] | 1 + ...riv[arista_eos-asynctelnet-privilege_exec] | 1 + ...re_priv[arista_eos-paramiko-configuration] | 1 + ...and_acquire_priv[arista_eos-paramiko-exec] | 1 + ...e_priv[arista_eos-paramiko-privilege_exec] | 1 + ...cquire_priv[arista_eos-ssh2-configuration] | 1 + ...mpt_and_acquire_priv[arista_eos-ssh2-exec] | 1 + ...quire_priv[arista_eos-ssh2-privilege_exec] | 1 + ...uire_priv[arista_eos-system-configuration] | 1 + ...t_and_acquire_priv[arista_eos-system-exec] | 1 + ...ire_priv[arista_eos-system-privilege_exec] | 1 + ...uire_priv[arista_eos-telnet-configuration] | 1 + ...t_and_acquire_priv[arista_eos-telnet-exec] | 1 + ...ire_priv[arista_eos-telnet-privilege_exec] | 1 + ...e_priv[cisco_iosxe-asyncssh-configuration] | 1 + ...nd_acquire_priv[cisco_iosxe-asyncssh-exec] | 1 + ..._priv[cisco_iosxe-asyncssh-privilege_exec] | 1 + ...riv[cisco_iosxe-asynctelnet-configuration] | 1 + ...acquire_priv[cisco_iosxe-asynctelnet-exec] | 1 + ...iv[cisco_iosxe-asynctelnet-privilege_exec] | 1 + ...e_priv[cisco_iosxe-paramiko-configuration] | 1 + ...nd_acquire_priv[cisco_iosxe-paramiko-exec] | 1 + ..._priv[cisco_iosxe-paramiko-privilege_exec] | 1 + ...quire_priv[cisco_iosxe-ssh2-configuration] | 1 + ...pt_and_acquire_priv[cisco_iosxe-ssh2-exec] | 1 + ...uire_priv[cisco_iosxe-ssh2-privilege_exec] | 1 + ...ire_priv[cisco_iosxe-system-configuration] | 1 + ..._and_acquire_priv[cisco_iosxe-system-exec] | 1 + ...re_priv[cisco_iosxe-system-privilege_exec] | 1 + ...ire_priv[cisco_iosxe-telnet-configuration] | 1 + ..._and_acquire_priv[cisco_iosxe-telnet-exec] | 1 + ...re_priv[cisco_iosxe-telnet-privilege_exec] | 1 + ...e_priv[cisco_iosxr-asyncssh-configuration] | 1 + ..._priv[cisco_iosxr-asyncssh-privilege_exec] | 1 + ...riv[cisco_iosxr-asynctelnet-configuration] | 1 + ...iv[cisco_iosxr-asynctelnet-privilege_exec] | 1 + ...e_priv[cisco_iosxr-paramiko-configuration] | 1 + ..._priv[cisco_iosxr-paramiko-privilege_exec] | 1 + ...quire_priv[cisco_iosxr-ssh2-configuration] | 1 + ...uire_priv[cisco_iosxr-ssh2-privilege_exec] | 1 + ...ire_priv[cisco_iosxr-system-configuration] | 1 + ...re_priv[cisco_iosxr-system-privilege_exec] | 1 + ...ire_priv[cisco_iosxr-telnet-configuration] | 1 + ...re_priv[cisco_iosxr-telnet-privilege_exec] | 1 + ...re_priv[cisco_nxos-asyncssh-configuration] | 1 + ...e_priv[cisco_nxos-asyncssh-privilege_exec] | 1 + ...priv[cisco_nxos-asynctelnet-configuration] | 1 + ...riv[cisco_nxos-asynctelnet-privilege_exec] | 1 + ...re_priv[cisco_nxos-paramiko-configuration] | 1 + ...e_priv[cisco_nxos-paramiko-privilege_exec] | 1 + ...cquire_priv[cisco_nxos-ssh2-configuration] | 1 + ...quire_priv[cisco_nxos-ssh2-privilege_exec] | 1 + ...uire_priv[cisco_nxos-system-configuration] | 1 + ...ire_priv[cisco_nxos-system-privilege_exec] | 1 + ...uire_priv[cisco_nxos-telnet-configuration] | 1 + ...ire_priv[cisco_nxos-telnet-privilege_exec] | 1 + ...priv[juniper_junos-asyncssh-configuration] | 1 + ..._acquire_priv[juniper_junos-asyncssh-exec] | 1 + ...v[juniper_junos-asynctelnet-configuration] | 1 + ...quire_priv[juniper_junos-asynctelnet-exec] | 1 + ...priv[juniper_junos-paramiko-configuration] | 1 + ..._acquire_priv[juniper_junos-paramiko-exec] | 1 + ...ire_priv[juniper_junos-ssh2-configuration] | 1 + ..._and_acquire_priv[juniper_junos-ssh2-exec] | 1 + ...e_priv[juniper_junos-system-configuration] | 1 + ...nd_acquire_priv[juniper_junos-system-exec] | 1 + ...e_priv[juniper_junos-telnet-configuration] | 1 + ...nd_acquire_priv[juniper_junos-telnet-exec] | 1 + ..._long[arista_eos-asyncssh-no_strip_prompt] | 42 ++ ...and_long[arista_eos-asyncssh-strip_prompt] | 41 ++ ...ng[arista_eos-asynctelnet-no_strip_prompt] | 42 ++ ..._long[arista_eos-asynctelnet-strip_prompt] | 41 ++ ..._long[arista_eos-paramiko-no_strip_prompt] | 42 ++ ...and_long[arista_eos-paramiko-strip_prompt] | 41 ++ ...mand_long[arista_eos-ssh2-no_strip_prompt] | 42 ++ ...command_long[arista_eos-ssh2-strip_prompt] | 41 ++ ...nd_long[arista_eos-system-no_strip_prompt] | 42 ++ ...mmand_long[arista_eos-system-strip_prompt] | 41 ++ ...nd_long[arista_eos-telnet-no_strip_prompt] | 42 ++ ...mmand_long[arista_eos-telnet-strip_prompt] | 41 ++ ...ong[cisco_iosxe-asyncssh-no_strip_prompt]} | 30 +- ...d_long[cisco_iosxe-asyncssh-strip_prompt]} | 28 +- ...g[cisco_iosxe-asynctelnet-no_strip_prompt] | 221 ++++++ ...long[cisco_iosxe-asynctelnet-strip_prompt] | 219 ++++++ ...long[cisco_iosxe-paramiko-no_strip_prompt] | 221 ++++++ ...nd_long[cisco_iosxe-paramiko-strip_prompt] | 219 ++++++ ...and_long[cisco_iosxe-ssh2-no_strip_prompt] | 221 ++++++ ...ommand_long[cisco_iosxe-ssh2-strip_prompt] | 219 ++++++ ...d_long[cisco_iosxe-system-no_strip_prompt] | 221 ++++++ ...mand_long[cisco_iosxe-system-strip_prompt] | 219 ++++++ ...d_long[cisco_iosxe-telnet-no_strip_prompt] | 221 ++++++ ...mand_long[cisco_iosxe-telnet-strip_prompt] | 219 ++++++ ...long[cisco_iosxr-asyncssh-no_strip_prompt] | 89 +++ ...nd_long[cisco_iosxr-asyncssh-strip_prompt] | 87 +++ ...g[cisco_iosxr-asynctelnet-no_strip_prompt] | 89 +++ ...long[cisco_iosxr-asynctelnet-strip_prompt] | 87 +++ ...long[cisco_iosxr-paramiko-no_strip_prompt] | 89 +++ ...nd_long[cisco_iosxr-paramiko-strip_prompt] | 87 +++ ...and_long[cisco_iosxr-ssh2-no_strip_prompt] | 89 +++ ...ommand_long[cisco_iosxr-ssh2-strip_prompt] | 87 +++ ...d_long[cisco_iosxr-system-no_strip_prompt] | 89 +++ ...mand_long[cisco_iosxr-system-strip_prompt] | 87 +++ ...d_long[cisco_iosxr-telnet-no_strip_prompt] | 89 +++ ...mand_long[cisco_iosxr-telnet-strip_prompt] | 87 +++ ...long[cisco_nxos-asyncssh-no_strip_prompt]} | 8 +- ...nd_long[cisco_nxos-asyncssh-strip_prompt]} | 6 +- ...ng[cisco_nxos-asynctelnet-no_strip_prompt] | 305 +++++++++ ..._long[cisco_nxos-asynctelnet-strip_prompt] | 301 +++++++++ ..._long[cisco_nxos-paramiko-no_strip_prompt] | 305 +++++++++ ...and_long[cisco_nxos-paramiko-strip_prompt] | 301 +++++++++ ...mand_long[cisco_nxos-ssh2-no_strip_prompt] | 305 +++++++++ ...command_long[cisco_nxos-ssh2-strip_prompt] | 301 +++++++++ ...nd_long[cisco_nxos-system-no_strip_prompt] | 305 +++++++++ ...mmand_long[cisco_nxos-system-strip_prompt] | 301 +++++++++ ...nd_long[cisco_nxos-telnet-no_strip_prompt] | 305 +++++++++ ...mmand_long[cisco_nxos-telnet-strip_prompt] | 301 +++++++++ ...ng[juniper_junos-asyncssh-no_strip_prompt] | 123 ++++ ...long[juniper_junos-asyncssh-strip_prompt]} | 13 +- ...juniper_junos-asynctelnet-no_strip_prompt] | 123 ++++ ...g[juniper_junos-asynctelnet-strip_prompt]} | 17 +- ...ng[juniper_junos-paramiko-no_strip_prompt] | 123 ++++ ..._long[juniper_junos-paramiko-strip_prompt] | 121 ++++ ...d_long[juniper_junos-ssh2-no_strip_prompt] | 123 ++++ ...mand_long[juniper_junos-ssh2-strip_prompt] | 121 ++++ ...long[juniper_junos-system-no_strip_prompt] | 123 ++++ ...nd_long[juniper_junos-system-strip_prompt] | 121 ++++ ...long[juniper_junos-telnet-no_strip_prompt] | 123 ++++ ...nd_long[juniper_junos-telnet-strip_prompt] | 121 ++++ ...short[arista_eos-asyncssh-no_strip_prompt] | 1 + ...nd_short[arista_eos-asyncssh-strip_prompt] | 0 ...rt[arista_eos-asynctelnet-no_strip_prompt] | 1 + ...short[arista_eos-asynctelnet-strip_prompt] | 0 ...short[arista_eos-paramiko-no_strip_prompt] | 1 + ...nd_short[arista_eos-paramiko-strip_prompt] | 0 ...and_short[arista_eos-ssh2-no_strip_prompt] | 1 + ...ommand_short[arista_eos-ssh2-strip_prompt] | 0 ...d_short[arista_eos-system-no_strip_prompt] | 1 + ...mand_short[arista_eos-system-strip_prompt] | 0 ...d_short[arista_eos-telnet-no_strip_prompt] | 1 + ...mand_short[arista_eos-telnet-strip_prompt] | 0 ...hort[cisco_iosxe-asyncssh-no_strip_prompt] | 2 + ...d_short[cisco_iosxe-asyncssh-strip_prompt] | 1 + ...t[cisco_iosxe-asynctelnet-no_strip_prompt] | 2 + ...hort[cisco_iosxe-asynctelnet-strip_prompt] | 1 + ...hort[cisco_iosxe-paramiko-no_strip_prompt] | 2 + ...d_short[cisco_iosxe-paramiko-strip_prompt] | 1 + ...nd_short[cisco_iosxe-ssh2-no_strip_prompt] | 2 + ...mmand_short[cisco_iosxe-ssh2-strip_prompt] | 1 + ..._short[cisco_iosxe-system-no_strip_prompt] | 2 + ...and_short[cisco_iosxe-system-strip_prompt] | 1 + ..._short[cisco_iosxe-telnet-no_strip_prompt] | 2 + ...and_short[cisco_iosxe-telnet-strip_prompt] | 1 + ...hort[cisco_iosxr-asyncssh-no_strip_prompt] | 4 + ...d_short[cisco_iosxr-asyncssh-strip_prompt] | 3 + ...t[cisco_iosxr-asynctelnet-no_strip_prompt] | 4 + ...hort[cisco_iosxr-asynctelnet-strip_prompt] | 3 + ...hort[cisco_iosxr-paramiko-no_strip_prompt] | 4 + ...d_short[cisco_iosxr-paramiko-strip_prompt] | 3 + ...nd_short[cisco_iosxr-ssh2-no_strip_prompt] | 4 + ...mmand_short[cisco_iosxr-ssh2-strip_prompt] | 3 + ..._short[cisco_iosxr-system-no_strip_prompt] | 4 + ...and_short[cisco_iosxr-system-strip_prompt] | 3 + ..._short[cisco_iosxr-telnet-no_strip_prompt] | 4 + ...and_short[cisco_iosxr-telnet-strip_prompt] | 3 + ...short[cisco_nxos-asyncssh-no_strip_prompt] | 2 + ...nd_short[cisco_nxos-asyncssh-strip_prompt] | 1 + ...rt[cisco_nxos-asynctelnet-no_strip_prompt] | 2 + ...short[cisco_nxos-asynctelnet-strip_prompt] | 1 + ...short[cisco_nxos-paramiko-no_strip_prompt] | 2 + ...nd_short[cisco_nxos-paramiko-strip_prompt] | 1 + ...and_short[cisco_nxos-ssh2-no_strip_prompt] | 2 + ...ommand_short[cisco_nxos-ssh2-strip_prompt] | 1 + ...d_short[cisco_nxos-system-no_strip_prompt] | 2 + ...mand_short[cisco_nxos-system-strip_prompt] | 1 + ...d_short[cisco_nxos-telnet-no_strip_prompt] | 2 + ...mand_short[cisco_nxos-telnet-strip_prompt] | 1 + ...rt[juniper_junos-asyncssh-no_strip_prompt] | 3 + ...short[juniper_junos-asyncssh-strip_prompt] | 1 + ...juniper_junos-asynctelnet-no_strip_prompt] | 3 + ...rt[juniper_junos-asynctelnet-strip_prompt] | 1 + ...rt[juniper_junos-paramiko-no_strip_prompt] | 3 + ...short[juniper_junos-paramiko-strip_prompt] | 1 + ..._short[juniper_junos-ssh2-no_strip_prompt] | 3 + ...and_short[juniper_junos-ssh2-strip_prompt] | 1 + ...hort[juniper_junos-system-no_strip_prompt] | 3 + ...d_short[juniper_junos-system-strip_prompt] | 1 + ...hort[juniper_junos-telnet-no_strip_prompt] | 3 + ...d_short[juniper_junos-telnet-strip_prompt] | 1 + ...mands[arista_eos-asyncssh-no_strip_prompt] | 44 ++ ...commands[arista_eos-asyncssh-strip_prompt] | 43 ++ ...ds[arista_eos-asynctelnet-no_strip_prompt] | 44 ++ ...mands[arista_eos-asynctelnet-strip_prompt] | 43 ++ ...mands[arista_eos-paramiko-no_strip_prompt] | 44 ++ ...commands[arista_eos-paramiko-strip_prompt] | 43 ++ ..._commands[arista_eos-ssh2-no_strip_prompt] | 44 ++ ...end_commands[arista_eos-ssh2-strip_prompt] | 43 ++ ...ommands[arista_eos-system-no_strip_prompt] | 44 ++ ...d_commands[arista_eos-system-strip_prompt] | 43 ++ ...ommands[arista_eos-telnet-no_strip_prompt] | 44 ++ ...d_commands[arista_eos-telnet-strip_prompt] | 43 ++ ...ands[cisco_iosxe-asyncssh-no_strip_prompt] | 224 +++++++ ...ommands[cisco_iosxe-asyncssh-strip_prompt] | 221 ++++++ ...s[cisco_iosxe-asynctelnet-no_strip_prompt] | 224 +++++++ ...ands[cisco_iosxe-asynctelnet-strip_prompt] | 221 ++++++ ...ands[cisco_iosxe-paramiko-no_strip_prompt] | 224 +++++++ ...ommands[cisco_iosxe-paramiko-strip_prompt] | 221 ++++++ ...commands[cisco_iosxe-ssh2-no_strip_prompt] | 224 +++++++ ...nd_commands[cisco_iosxe-ssh2-strip_prompt] | 221 ++++++ ...mmands[cisco_iosxe-system-no_strip_prompt] | 224 +++++++ ..._commands[cisco_iosxe-system-strip_prompt] | 221 ++++++ ...mmands[cisco_iosxe-telnet-no_strip_prompt] | 224 +++++++ ..._commands[cisco_iosxe-telnet-strip_prompt] | 221 ++++++ ...ands[cisco_iosxr-asyncssh-no_strip_prompt] | 94 +++ ...ommands[cisco_iosxr-asyncssh-strip_prompt] | 91 +++ ...s[cisco_iosxr-asynctelnet-no_strip_prompt] | 94 +++ ...ands[cisco_iosxr-asynctelnet-strip_prompt] | 91 +++ ...ands[cisco_iosxr-paramiko-no_strip_prompt] | 94 +++ ...ommands[cisco_iosxr-paramiko-strip_prompt] | 91 +++ ...commands[cisco_iosxr-ssh2-no_strip_prompt] | 94 +++ ...nd_commands[cisco_iosxr-ssh2-strip_prompt] | 91 +++ ...mmands[cisco_iosxr-system-no_strip_prompt] | 94 +++ ..._commands[cisco_iosxr-system-strip_prompt] | 91 +++ ...mmands[cisco_iosxr-telnet-no_strip_prompt] | 94 +++ ..._commands[cisco_iosxr-telnet-strip_prompt] | 91 +++ ...mands[cisco_nxos-asyncssh-no_strip_prompt] | 308 +++++++++ ...commands[cisco_nxos-asyncssh-strip_prompt] | 303 +++++++++ ...ds[cisco_nxos-asynctelnet-no_strip_prompt] | 308 +++++++++ ...mands[cisco_nxos-asynctelnet-strip_prompt] | 303 +++++++++ ...mands[cisco_nxos-paramiko-no_strip_prompt] | 308 +++++++++ ...commands[cisco_nxos-paramiko-strip_prompt] | 303 +++++++++ ..._commands[cisco_nxos-ssh2-no_strip_prompt] | 308 +++++++++ ...end_commands[cisco_nxos-ssh2-strip_prompt] | 303 +++++++++ ...ommands[cisco_nxos-system-no_strip_prompt] | 308 +++++++++ ...d_commands[cisco_nxos-system-strip_prompt] | 303 +++++++++ ...ommands[cisco_nxos-telnet-no_strip_prompt] | 308 +++++++++ ...d_commands[cisco_nxos-telnet-strip_prompt] | 303 +++++++++ ...ds[juniper_junos-asyncssh-no_strip_prompt] | 127 ++++ ...mands[juniper_junos-asyncssh-strip_prompt] | 123 ++++ ...juniper_junos-asynctelnet-no_strip_prompt] | 127 ++++ ...ds[juniper_junos-asynctelnet-strip_prompt] | 123 ++++ ...ds[juniper_junos-paramiko-no_strip_prompt] | 127 ++++ ...mands[juniper_junos-paramiko-strip_prompt] | 123 ++++ ...mmands[juniper_junos-ssh2-no_strip_prompt] | 127 ++++ ..._commands[juniper_junos-ssh2-strip_prompt] | 123 ++++ ...ands[juniper_junos-system-no_strip_prompt] | 127 ++++ ...ommands[juniper_junos-system-strip_prompt] | 123 ++++ ...ands[juniper_junos-telnet-no_strip_prompt] | 127 ++++ ...ommands[juniper_junos-telnet-strip_prompt] | 123 ++++ ..._file[arista_eos-asyncssh-no_strip_prompt] | 3 + ...rom_file[arista_eos-asyncssh-strip_prompt] | 2 + ...le[arista_eos-asynctelnet-no_strip_prompt] | 3 + ..._file[arista_eos-asynctelnet-strip_prompt] | 2 + ..._file[arista_eos-paramiko-no_strip_prompt] | 3 + ...rom_file[arista_eos-paramiko-strip_prompt] | 2 + ...from_file[arista_eos-ssh2-no_strip_prompt] | 3 + ...ds_from_file[arista_eos-ssh2-strip_prompt] | 2 + ...om_file[arista_eos-system-no_strip_prompt] | 3 + ..._from_file[arista_eos-system-strip_prompt] | 2 + ...om_file[arista_eos-telnet-no_strip_prompt] | 3 + ..._from_file[arista_eos-telnet-strip_prompt] | 2 + ...file[cisco_iosxe-asyncssh-no_strip_prompt] | 5 + ...om_file[cisco_iosxe-asyncssh-strip_prompt] | 3 + ...e[cisco_iosxe-asynctelnet-no_strip_prompt] | 5 + ...file[cisco_iosxe-asynctelnet-strip_prompt] | 3 + ...file[cisco_iosxe-paramiko-no_strip_prompt] | 5 + ...om_file[cisco_iosxe-paramiko-strip_prompt] | 3 + ...rom_file[cisco_iosxe-ssh2-no_strip_prompt] | 5 + ...s_from_file[cisco_iosxe-ssh2-strip_prompt] | 3 + ...m_file[cisco_iosxe-system-no_strip_prompt] | 5 + ...from_file[cisco_iosxe-system-strip_prompt] | 3 + ...m_file[cisco_iosxe-telnet-no_strip_prompt] | 5 + ...from_file[cisco_iosxe-telnet-strip_prompt] | 3 + ...file[cisco_iosxr-asyncssh-no_strip_prompt] | 9 + ...om_file[cisco_iosxr-asyncssh-strip_prompt] | 7 + ...e[cisco_iosxr-asynctelnet-no_strip_prompt] | 9 + ...file[cisco_iosxr-asynctelnet-strip_prompt] | 7 + ...file[cisco_iosxr-paramiko-no_strip_prompt] | 9 + ...om_file[cisco_iosxr-paramiko-strip_prompt] | 7 + ...rom_file[cisco_iosxr-ssh2-no_strip_prompt] | 9 + ...s_from_file[cisco_iosxr-ssh2-strip_prompt] | 7 + ...m_file[cisco_iosxr-system-no_strip_prompt] | 9 + ...from_file[cisco_iosxr-system-strip_prompt] | 7 + ...m_file[cisco_iosxr-telnet-no_strip_prompt] | 9 + ...from_file[cisco_iosxr-telnet-strip_prompt] | 7 + ..._file[cisco_nxos-asyncssh-no_strip_prompt] | 5 + ...rom_file[cisco_nxos-asyncssh-strip_prompt] | 3 + ...le[cisco_nxos-asynctelnet-no_strip_prompt] | 5 + ..._file[cisco_nxos-asynctelnet-strip_prompt] | 3 + ..._file[cisco_nxos-paramiko-no_strip_prompt] | 5 + ...rom_file[cisco_nxos-paramiko-strip_prompt] | 3 + ...from_file[cisco_nxos-ssh2-no_strip_prompt] | 5 + ...ds_from_file[cisco_nxos-ssh2-strip_prompt] | 3 + ...om_file[cisco_nxos-system-no_strip_prompt] | 5 + ..._from_file[cisco_nxos-system-strip_prompt] | 3 + ...om_file[cisco_nxos-telnet-no_strip_prompt] | 5 + ..._from_file[cisco_nxos-telnet-strip_prompt] | 3 + ...le[juniper_junos-asyncssh-no_strip_prompt] | 7 + ..._file[juniper_junos-asyncssh-strip_prompt] | 3 + ...juniper_junos-asynctelnet-no_strip_prompt] | 7 + ...le[juniper_junos-asynctelnet-strip_prompt] | 3 + ...le[juniper_junos-paramiko-no_strip_prompt] | 7 + ..._file[juniper_junos-paramiko-strip_prompt] | 3 + ...m_file[juniper_junos-ssh2-no_strip_prompt] | 7 + ...from_file[juniper_junos-ssh2-strip_prompt] | 3 + ...file[juniper_junos-system-no_strip_prompt] | 7 + ...om_file[juniper_junos-system-strip_prompt] | 3 + ...file[juniper_junos-telnet-no_strip_prompt] | 7 + ...om_file[juniper_junos-telnet-strip_prompt] | 3 + ...onfig[arista_eos-asyncssh-no_strip_prompt] | 1 + ...d_config[arista_eos-asyncssh-strip_prompt] | 1 + ...ig[arista_eos-asynctelnet-no_strip_prompt] | 1 + ...onfig[arista_eos-asynctelnet-strip_prompt] | 1 + ...onfig[arista_eos-paramiko-no_strip_prompt] | 1 + ...d_config[arista_eos-paramiko-strip_prompt] | 1 + ...nd_config[arista_eos-ssh2-no_strip_prompt] | 1 + ..._send_config[arista_eos-ssh2-strip_prompt] | 1 + ..._config[arista_eos-system-no_strip_prompt] | 1 + ...end_config[arista_eos-system-strip_prompt] | 1 + ..._config[arista_eos-telnet-no_strip_prompt] | 1 + ...end_config[arista_eos-telnet-strip_prompt] | 1 + ...nfig[cisco_iosxe-asyncssh-no_strip_prompt] | 1 + ..._config[cisco_iosxe-asyncssh-strip_prompt] | 1 + ...g[cisco_iosxe-asynctelnet-no_strip_prompt] | 1 + ...nfig[cisco_iosxe-asynctelnet-strip_prompt] | 1 + ...nfig[cisco_iosxe-paramiko-no_strip_prompt] | 1 + ..._config[cisco_iosxe-paramiko-strip_prompt] | 1 + ...d_config[cisco_iosxe-ssh2-no_strip_prompt] | 1 + ...send_config[cisco_iosxe-ssh2-strip_prompt] | 1 + ...config[cisco_iosxe-system-no_strip_prompt] | 1 + ...nd_config[cisco_iosxe-system-strip_prompt] | 1 + ...config[cisco_iosxe-telnet-no_strip_prompt] | 1 + ...nd_config[cisco_iosxe-telnet-strip_prompt] | 1 + ...nfig[cisco_iosxr-asyncssh-no_strip_prompt] | 3 + ..._config[cisco_iosxr-asyncssh-strip_prompt] | 3 + ...g[cisco_iosxr-asynctelnet-no_strip_prompt] | 3 + ...nfig[cisco_iosxr-asynctelnet-strip_prompt] | 3 + ...nfig[cisco_iosxr-paramiko-no_strip_prompt] | 3 + ..._config[cisco_iosxr-paramiko-strip_prompt] | 3 + ...d_config[cisco_iosxr-ssh2-no_strip_prompt] | 3 + ...send_config[cisco_iosxr-ssh2-strip_prompt] | 3 + ...config[cisco_iosxr-system-no_strip_prompt] | 3 + ...nd_config[cisco_iosxr-system-strip_prompt] | 3 + ...config[cisco_iosxr-telnet-no_strip_prompt] | 3 + ...nd_config[cisco_iosxr-telnet-strip_prompt] | 3 + ...onfig[cisco_nxos-asyncssh-no_strip_prompt] | 1 + ...d_config[cisco_nxos-asyncssh-strip_prompt] | 1 + ...ig[cisco_nxos-asynctelnet-no_strip_prompt] | 1 + ...onfig[cisco_nxos-asynctelnet-strip_prompt] | 1 + ...onfig[cisco_nxos-paramiko-no_strip_prompt] | 1 + ...d_config[cisco_nxos-paramiko-strip_prompt] | 1 + ...nd_config[cisco_nxos-ssh2-no_strip_prompt] | 1 + ..._send_config[cisco_nxos-ssh2-strip_prompt] | 1 + ..._config[cisco_nxos-system-no_strip_prompt] | 1 + ...end_config[cisco_nxos-system-strip_prompt] | 1 + ..._config[cisco_nxos-telnet-no_strip_prompt] | 1 + ...end_config[cisco_nxos-telnet-strip_prompt] | 1 + ...ig[juniper_junos-asyncssh-no_strip_prompt] | 4 + ...onfig[juniper_junos-asyncssh-strip_prompt] | 4 + ...juniper_junos-asynctelnet-no_strip_prompt] | 4 + ...ig[juniper_junos-asynctelnet-strip_prompt] | 4 + ...ig[juniper_junos-paramiko-no_strip_prompt] | 4 + ...onfig[juniper_junos-paramiko-strip_prompt] | 4 + ...config[juniper_junos-ssh2-no_strip_prompt] | 4 + ...nd_config[juniper_junos-ssh2-strip_prompt] | 4 + ...nfig[juniper_junos-system-no_strip_prompt] | 4 + ..._config[juniper_junos-system-strip_prompt] | 4 + ...nfig[juniper_junos-telnet-no_strip_prompt] | 4 + ..._config[juniper_junos-telnet-strip_prompt] | 4 + ...nfigs[arista_eos-asyncssh-no_strip_prompt] | 2 + ..._configs[arista_eos-asyncssh-strip_prompt] | 2 + ...gs[arista_eos-asynctelnet-no_strip_prompt] | 2 + ...nfigs[arista_eos-asynctelnet-strip_prompt] | 2 + ...nfigs[arista_eos-paramiko-no_strip_prompt] | 2 + ..._configs[arista_eos-paramiko-strip_prompt] | 2 + ...d_configs[arista_eos-ssh2-no_strip_prompt] | 2 + ...send_configs[arista_eos-ssh2-strip_prompt] | 2 + ...configs[arista_eos-system-no_strip_prompt] | 2 + ...nd_configs[arista_eos-system-strip_prompt] | 2 + ...configs[arista_eos-telnet-no_strip_prompt] | 2 + ...nd_configs[arista_eos-telnet-strip_prompt] | 2 + ...figs[cisco_iosxe-asyncssh-no_strip_prompt] | 2 + ...configs[cisco_iosxe-asyncssh-strip_prompt] | 2 + ...s[cisco_iosxe-asynctelnet-no_strip_prompt] | 2 + ...figs[cisco_iosxe-asynctelnet-strip_prompt] | 2 + ...figs[cisco_iosxe-paramiko-no_strip_prompt] | 2 + ...configs[cisco_iosxe-paramiko-strip_prompt] | 2 + ..._configs[cisco_iosxe-ssh2-no_strip_prompt] | 2 + ...end_configs[cisco_iosxe-ssh2-strip_prompt] | 2 + ...onfigs[cisco_iosxe-system-no_strip_prompt] | 2 + ...d_configs[cisco_iosxe-system-strip_prompt] | 2 + ...onfigs[cisco_iosxe-telnet-no_strip_prompt] | 2 + ...d_configs[cisco_iosxe-telnet-strip_prompt] | 2 + ...figs[cisco_iosxr-asyncssh-no_strip_prompt] | 4 + ...configs[cisco_iosxr-asyncssh-strip_prompt] | 4 + ...s[cisco_iosxr-asynctelnet-no_strip_prompt] | 4 + ...figs[cisco_iosxr-asynctelnet-strip_prompt] | 4 + ...figs[cisco_iosxr-paramiko-no_strip_prompt] | 4 + ...configs[cisco_iosxr-paramiko-strip_prompt] | 4 + ..._configs[cisco_iosxr-ssh2-no_strip_prompt] | 4 + ...end_configs[cisco_iosxr-ssh2-strip_prompt] | 4 + ...onfigs[cisco_iosxr-system-no_strip_prompt] | 4 + ...d_configs[cisco_iosxr-system-strip_prompt] | 4 + ...onfigs[cisco_iosxr-telnet-no_strip_prompt] | 4 + ...d_configs[cisco_iosxr-telnet-strip_prompt] | 4 + ...nfigs[cisco_nxos-asyncssh-no_strip_prompt] | 2 + ..._configs[cisco_nxos-asyncssh-strip_prompt] | 2 + ...gs[cisco_nxos-asynctelnet-no_strip_prompt] | 2 + ...nfigs[cisco_nxos-asynctelnet-strip_prompt] | 2 + ...nfigs[cisco_nxos-paramiko-no_strip_prompt] | 2 + ..._configs[cisco_nxos-paramiko-strip_prompt] | 2 + ...d_configs[cisco_nxos-ssh2-no_strip_prompt] | 2 + ...send_configs[cisco_nxos-ssh2-strip_prompt] | 2 + ...configs[cisco_nxos-system-no_strip_prompt] | 2 + ...nd_configs[cisco_nxos-system-strip_prompt] | 2 + ...configs[cisco_nxos-telnet-no_strip_prompt] | 2 + ...nd_configs[cisco_nxos-telnet-strip_prompt] | 2 + ...gs[juniper_junos-asyncssh-no_strip_prompt] | 5 + ...nfigs[juniper_junos-asyncssh-strip_prompt] | 5 + ...juniper_junos-asynctelnet-no_strip_prompt] | 5 + ...gs[juniper_junos-asynctelnet-strip_prompt] | 5 + ...gs[juniper_junos-paramiko-no_strip_prompt] | 5 + ...nfigs[juniper_junos-paramiko-strip_prompt] | 5 + ...onfigs[juniper_junos-ssh2-no_strip_prompt] | 5 + ...d_configs[juniper_junos-ssh2-strip_prompt] | 5 + ...figs[juniper_junos-system-no_strip_prompt] | 5 + ...configs[juniper_junos-system-strip_prompt] | 5 + ...figs[juniper_junos-telnet-no_strip_prompt] | 5 + ...configs[juniper_junos-telnet-strip_prompt] | 5 + ..._file[arista_eos-asyncssh-no_strip_prompt] | 2 + ...rom_file[arista_eos-asyncssh-strip_prompt] | 2 + ...le[arista_eos-asynctelnet-no_strip_prompt] | 2 + ..._file[arista_eos-asynctelnet-strip_prompt] | 2 + ..._file[arista_eos-paramiko-no_strip_prompt] | 2 + ...rom_file[arista_eos-paramiko-strip_prompt] | 2 + ...from_file[arista_eos-ssh2-no_strip_prompt] | 2 + ...gs_from_file[arista_eos-ssh2-strip_prompt] | 2 + ...om_file[arista_eos-system-no_strip_prompt] | 2 + ..._from_file[arista_eos-system-strip_prompt] | 2 + ...om_file[arista_eos-telnet-no_strip_prompt] | 2 + ..._from_file[arista_eos-telnet-strip_prompt] | 2 + ...file[cisco_iosxe-asyncssh-no_strip_prompt] | 2 + ...om_file[cisco_iosxe-asyncssh-strip_prompt] | 2 + ...e[cisco_iosxe-asynctelnet-no_strip_prompt] | 2 + ...file[cisco_iosxe-asynctelnet-strip_prompt] | 2 + ...file[cisco_iosxe-paramiko-no_strip_prompt] | 2 + ...om_file[cisco_iosxe-paramiko-strip_prompt] | 2 + ...rom_file[cisco_iosxe-ssh2-no_strip_prompt] | 2 + ...s_from_file[cisco_iosxe-ssh2-strip_prompt] | 2 + ...m_file[cisco_iosxe-system-no_strip_prompt] | 2 + ...from_file[cisco_iosxe-system-strip_prompt] | 2 + ...m_file[cisco_iosxe-telnet-no_strip_prompt] | 2 + ...from_file[cisco_iosxe-telnet-strip_prompt] | 2 + ...file[cisco_iosxr-asyncssh-no_strip_prompt] | 4 + ...om_file[cisco_iosxr-asyncssh-strip_prompt] | 4 + ...e[cisco_iosxr-asynctelnet-no_strip_prompt] | 4 + ...file[cisco_iosxr-asynctelnet-strip_prompt] | 4 + ...file[cisco_iosxr-paramiko-no_strip_prompt] | 4 + ...om_file[cisco_iosxr-paramiko-strip_prompt] | 4 + ...rom_file[cisco_iosxr-ssh2-no_strip_prompt] | 4 + ...s_from_file[cisco_iosxr-ssh2-strip_prompt] | 4 + ...m_file[cisco_iosxr-system-no_strip_prompt] | 4 + ...from_file[cisco_iosxr-system-strip_prompt] | 4 + ...m_file[cisco_iosxr-telnet-no_strip_prompt] | 4 + ...from_file[cisco_iosxr-telnet-strip_prompt] | 4 + ..._file[cisco_nxos-asyncssh-no_strip_prompt] | 2 + ...rom_file[cisco_nxos-asyncssh-strip_prompt] | 2 + ...le[cisco_nxos-asynctelnet-no_strip_prompt] | 2 + ..._file[cisco_nxos-asynctelnet-strip_prompt] | 2 + ..._file[cisco_nxos-paramiko-no_strip_prompt] | 2 + ...rom_file[cisco_nxos-paramiko-strip_prompt] | 2 + ...from_file[cisco_nxos-ssh2-no_strip_prompt] | 2 + ...gs_from_file[cisco_nxos-ssh2-strip_prompt] | 2 + ...om_file[cisco_nxos-system-no_strip_prompt] | 2 + ..._from_file[cisco_nxos-system-strip_prompt] | 2 + ...om_file[cisco_nxos-telnet-no_strip_prompt] | 2 + ..._from_file[cisco_nxos-telnet-strip_prompt] | 2 + ...le[juniper_junos-asyncssh-no_strip_prompt] | 5 + ..._file[juniper_junos-asyncssh-strip_prompt] | 5 + ...juniper_junos-asynctelnet-no_strip_prompt] | 5 + ...le[juniper_junos-asynctelnet-strip_prompt] | 5 + ...le[juniper_junos-paramiko-no_strip_prompt] | 5 + ..._file[juniper_junos-paramiko-strip_prompt] | 5 + ...m_file[juniper_junos-ssh2-no_strip_prompt] | 5 + ...from_file[juniper_junos-ssh2-strip_prompt] | 5 + ...file[juniper_junos-system-no_strip_prompt] | 5 + ...om_file[juniper_junos-system-strip_prompt] | 5 + ...file[juniper_junos-telnet-no_strip_prompt] | 5 + ...om_file[juniper_junos-telnet-strip_prompt] | 5 + ...tive_normal_response[cisco_iosxe-asyncssh] | 4 + ...e_normal_response[cisco_iosxe-asynctelnet] | 4 + ...tive_normal_response[cisco_iosxe-paramiko] | 4 + ...eractive_normal_response[cisco_iosxe-ssh2] | 4 + ...active_normal_response[cisco_iosxe-system] | 4 + ...active_normal_response[cisco_iosxe-telnet] | 4 + ...ctive_normal_response[cisco_nxos-asyncssh] | 3 + ...ve_normal_response[cisco_nxos-asynctelnet] | 3 + ...ctive_normal_response[cisco_nxos-paramiko] | 3 + ...teractive_normal_response[cisco_nxos-ssh2] | 3 + ...ractive_normal_response[cisco_nxos-system] | 3 + ...ractive_normal_response[cisco_nxos-telnet] | 3 + tests/functional/test_arista_eos.py | 2 +- tests/functional/test_cisco_iosxe.py | 2 +- tests/functional/test_cisco_nxos.py | 2 +- tests/functional/test_drivers_functional.py | 628 ------------------ tests/functional/test_drivers_network.py | 332 +++++++++ .../functional/test_drivers_network_async.py | 224 +++++++ tests/prepare_devices.py | 7 - tests/test_data/base_configs/arista_eos | 281 +------- tests/test_data/base_configs/cisco_iosxe.j2 | 43 +- tests/test_data/base_configs/cisco_iosxr | 349 +--------- tests/test_data/base_configs/cisco_nxos | 471 +------------ tests/test_data/base_configs/juniper_junos | 18 +- .../arista_eos/send_command_long_no_strip | 287 -------- .../arista_eos/send_command_long_strip | 286 -------- .../cisco_iosxr/send_command_long_no_strip | 416 ------------ .../cisco_iosxr/send_command_long_strip | 414 ------------ .../expected/linux/send_command_long_no_strip | 101 --- .../expected/linux/send_command_long_strip | 100 --- tests/unit/conftest.py | 1 - 534 files changed, 19380 insertions(+), 3861 deletions(-) create mode 100644 .clab/topo.yaml delete mode 100644 docker-compose.yaml create mode 100644 tests/functional/expected.py create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asyncssh-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asyncssh-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asynctelnet-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asynctelnet-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-paramiko-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-paramiko-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-ssh2-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-ssh2-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-system-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-system-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-telnet-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-telnet-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asyncssh-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asyncssh-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asynctelnet-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asynctelnet-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-paramiko-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-paramiko-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-ssh2-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-ssh2-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-system-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-system-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-telnet-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-telnet-privilege_exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asyncssh-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asyncssh-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asynctelnet-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asynctelnet-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-paramiko-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-paramiko-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-ssh2-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-ssh2-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-system-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-system-exec] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-telnet-configuration] create mode 100644 tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-telnet-exec] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[arista_eos-telnet-strip_prompt] rename tests/{test_data/expected/cisco_iosxe/send_command_long_no_strip => functional/expected/test_send_command_long[cisco_iosxe-asyncssh-no_strip_prompt]} (89%) rename tests/{test_data/expected/cisco_iosxe/send_command_long_strip => functional/expected/test_send_command_long[cisco_iosxe-asyncssh-strip_prompt]} (89%) create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxe-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxe-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxe-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxe-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxe-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxe-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxe-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxe-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxe-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxe-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_iosxr-telnet-strip_prompt] rename tests/{test_data/expected/cisco_nxos/send_command_long_no_strip => functional/expected/test_send_command_long[cisco_nxos-asyncssh-no_strip_prompt]} (98%) rename tests/{test_data/expected/cisco_nxos/send_command_long_strip => functional/expected/test_send_command_long[cisco_nxos-asyncssh-strip_prompt]} (98%) create mode 100644 tests/functional/expected/test_send_command_long[cisco_nxos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_nxos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_nxos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_nxos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_nxos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_nxos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_nxos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_nxos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_nxos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[cisco_nxos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[juniper_junos-asyncssh-no_strip_prompt] rename tests/{test_data/expected/juniper_junos/send_command_long_strip => functional/expected/test_send_command_long[juniper_junos-asyncssh-strip_prompt]} (92%) create mode 100644 tests/functional/expected/test_send_command_long[juniper_junos-asynctelnet-no_strip_prompt] rename tests/{test_data/expected/juniper_junos/send_command_long_no_strip => functional/expected/test_send_command_long[juniper_junos-asynctelnet-strip_prompt]} (92%) create mode 100644 tests/functional/expected/test_send_command_long[juniper_junos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[juniper_junos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[juniper_junos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[juniper_junos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[juniper_junos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[juniper_junos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[juniper_junos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_long[juniper_junos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[arista_eos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxe-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_iosxr-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[cisco_nxos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_command_short[juniper_junos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[arista_eos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxe-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_iosxr-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[cisco_nxos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands[juniper_junos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[arista_eos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxe-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_iosxr-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[cisco_nxos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_commands_from_file[juniper_junos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[arista_eos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxe-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_iosxr-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[cisco_nxos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_config[juniper_junos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[arista_eos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxe-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_iosxr-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[cisco_nxos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs[juniper_junos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[arista_eos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxe-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_iosxr-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[cisco_nxos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-asyncssh-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-asyncssh-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-asynctelnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-asynctelnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-paramiko-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-paramiko-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-ssh2-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-ssh2-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-system-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-system-strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-telnet-no_strip_prompt] create mode 100644 tests/functional/expected/test_send_configs_from_file[juniper_junos-telnet-strip_prompt] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-asyncssh] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-asynctelnet] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-paramiko] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-ssh2] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-system] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-telnet] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-asyncssh] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-asynctelnet] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-paramiko] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-ssh2] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-system] create mode 100644 tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-telnet] delete mode 100644 tests/functional/test_drivers_functional.py create mode 100644 tests/functional/test_drivers_network.py create mode 100644 tests/functional/test_drivers_network_async.py delete mode 100644 tests/test_data/expected/arista_eos/send_command_long_no_strip delete mode 100644 tests/test_data/expected/arista_eos/send_command_long_strip delete mode 100644 tests/test_data/expected/cisco_iosxr/send_command_long_no_strip delete mode 100644 tests/test_data/expected/cisco_iosxr/send_command_long_strip delete mode 100644 tests/test_data/expected/linux/send_command_long_no_strip delete mode 100644 tests/test_data/expected/linux/send_command_long_strip diff --git a/.clab/topo.yaml b/.clab/topo.yaml new file mode 100644 index 00000000..5f1d6b5f --- /dev/null +++ b/.clab/topo.yaml @@ -0,0 +1,39 @@ +--- +name: scrapli + +topology: + kinds: + vr-csr: + image: boxen_cisco_csr1000v:16.12.03 + vr-xrv9k: + image: boxen_cisco_xrv9k:6.5.3 + vr-n9kv: + image: boxen_cisco_n9kv:9.2.4 + ceos: + image: ceos:4.28.0F + vr-vqfx: + image: boxen_juniper_vsrx:17.3R2.10 + nodes: + vr-csr: + kind: vr-csr + mgmt_ipv4: 172.20.20.11 + mgmt_ipv6: 2001:172:20:20::11 + vr-xrv9k: + kind: vr-xrv9k + mgmt_ipv4: 172.20.20.12 + mgmt_ipv6: 2001:172:20:20::12 + vr-n9kv: + kind: vr-n9kv + mgmt_ipv4: 172.20.20.13 + mgmt_ipv6: 2001:172:20:20::13 + ceos: + kind: ceos + mgmt_ipv4: 172.20.20.14 + mgmt_ipv6: 2001:172:20:20::14 + vr-vqfx: + kind: vr-vqfx + mgmt_ipv4: 172.20.20.15 + mgmt_ipv6: 2001:172:20:20::15 + links: + # forces "front panel port" for ceos, without this there is no ip routing + - endpoints: ["ceos:eth1", "ceos:eth2"] diff --git a/Makefile b/Makefile index 17cc38ab..5898e9ff 100644 --- a/Makefile +++ b/Makefile @@ -1,51 +1,56 @@ -lint: +.DEFAULT_GOAL := help + +help: + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +lint: ## Run linters python -m isort . python -m black . python -m pylama . python -m pydocstyle . python -m mypy --strict scrapli/ -darglint: +darglint: # Run darglint (docstring/arg checker) find scrapli -type f \( -iname "*.py" \) | xargs darglint -x -test: +test: ## Run all tests python -m pytest \ tests/ -cov: +cov: ## Run all tests with term and html coverage report python -m pytest \ --cov=scrapli \ --cov-report html \ --cov-report term \ tests/ -test_unit: +test_unit: ## Run all unit tests python -m pytest \ tests/unit/ -cov_unit: +cov_unit: ## Run all unit tests with term and html coverage report python -m pytest \ --cov=scrapli \ --cov-report html \ --cov-report term \ tests/unit/ -test_integration: +test_integration: ## Run integration tests python -m pytest \ tests/integration/ -cov_integration: +cov_integration: ## Run integration with term and html coverage report python -m pytest \ --cov=scrapli \ --cov-report html \ --cov-report term \ tests/integration/ -test_functional: +test_functional: # Run functional tests python -m pytest \ tests/functional/ -cov_functional: +cov_functional: # Run functional tests with term and html coverage report python -m pytest \ --cov=scrapli \ --cov-report html \ @@ -53,67 +58,22 @@ cov_functional: tests/functional/ .PHONY: docs -docs: +docs: ## Regenerate docs python docs/generate/generate_docs.py -test_docs: +test_docs: ## Run doc testing mkdocs build --clean --strict htmltest -c docs/htmltest.yml -s rm -rf tmp -deploy_docs: +deploy_docs: ## Deploy docs to github mkdocs gh-deploy -DOCKER_COMPOSE_FILE=docker-compose.yaml -DOCKER_COMPOSE=docker-compose -f ${DOCKER_COMPOSE_FILE} - -start_dev_env_iosxe: - ${DOCKER_COMPOSE} \ - up -d \ - iosxe - -start_dev_env_nxos: - ${DOCKER_COMPOSE} \ - up -d \ - nxos - -start_dev_env_iosxr: - ${DOCKER_COMPOSE} \ - up -d \ - iosxr - -start_dev_env_eos: - ${DOCKER_COMPOSE} \ - up -d \ - eos - -start_dev_env_junos: - ${DOCKER_COMPOSE} \ - up -d \ - junos +deploy_clab: ## Deploy functional clab test topology + cd .clab && sudo clab deploy -t topo-full.yaml -start_dev_env_linux: - ${DOCKER_COMPOSE} \ - up -d \ - linux +destroy_clab: ## Destroy functional clab test topology + cd .clab && sudo clab destroy -t topo-full.yaml -stop_dev_env: - ${DOCKER_COMPOSE} \ - -prepare_dev_env: +prepare_dev_env: ## Prepare a running clab environment with base configs for testing python tests/prepare_devices.py cisco_iosxe,cisco_nxos,cisco_iosxr,arista_eos,juniper_junos - -prepare_dev_env_iosxe: - python tests/prepare_devices.py cisco_iosxe - -prepare_dev_env_nxos: - python tests/prepare_devices.py cisco_nxos - -prepare_dev_env_iosxr: - python tests/prepare_devices.py cisco_iosxr - -prepare_dev_env_eos: - python tests/prepare_devices.py arista_eos - -prepare_dev_env_junos: - python tests/prepare_devices.py juniper_junos diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index e9263644..00000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -version: "3.3" - -services: - iosxe: - hostname: cisco_iosxe - privileged: true - image: scrapli-cisco-iosxe - networks: - net1: - ipv4_address: 172.18.0.11 - - nxos: - hostname: cisco_nxos - privileged: true - image: scrapli-cisco-nxos - networks: - net1: - ipv4_address: 172.18.0.12 - - iosxr: - hostname: cisco_iosxr - privileged: true - image: scrapli-cisco-iosxr - networks: - net1: - ipv4_address: 172.18.0.13 - - eos: - hostname: arista_eos - privileged: true - image: scrapli-arista-eos - networks: - net1: - ipv4_address: 172.18.0.14 - - junos: - hostname: juniper_junos - privileged: true - image: scrapli-juniper-junos - networks: - net1: - ipv4_address: 172.18.0.15 - - linux: - hostname: linux - image: dbarroso/stupid_ssh_container - networks: - net1: - ipv4_address: 172.18.0.20 - -networks: - net1: - driver: bridge - ipam: - config: - - subnet: 172.18.0.0/26 - driver_opts: - com.docker.network.bridge.name: br_scrapli - diff --git a/docs/user_guide/linting_testing.md b/docs/user_guide/linting_testing.md index 7cf301e9..758bf71a 100644 --- a/docs/user_guide/linting_testing.md +++ b/docs/user_guide/linting_testing.md @@ -25,8 +25,7 @@ Testing is broken into three main categories -- unit, integration, and functiona Unit is what you would expect -- unit testing the code. -Integration tests (coming soon!) test scrapli against auto generated ssh server that looks/feels like real network -devices. +Integration tests run scrapli against auto generated ssh server that looks/feels like real network devices. Functional testing connects to virtual devices in order to more accurately test the code. @@ -61,116 +60,71 @@ make cov_unit ### Setting up Functional Test Environment -Executing the functional tests is a bit more complicated! First, thank you to Kristian Larsson for his great tool - [vrnetlab](https://github.com/plajjan/vrnetlab)! All functional tests are built on this awesome platform that allows - for easy creation of containerized network devices. - -Basic functional tests exist for all "core" platform types (IOSXE, NXOS, IOSXR, EOS, Junos) as well as basic testing - for Linux. Vrnetlab currently only supports the older emulation style NX-OS devices, and *not* the newer VM image - n9kv. I have made some very minor tweaks to vrnetlab locally in order to get the n9kv image running. I also have - made some changes to enable scp-server for IOSXE/NXOS devices to allow for config replaces with NAPALM right out - of the box. You can get these tweaks in my fork of vrnetlab. Getting going with vrnetlab is fairly - straightforward -- simply follow Kristian's great readme docs. - -For the Arista EOS image -- prior to creating the container you should boot the device and enter the `zerotouch - disable` command. This allows for the config to actually be saved and prevents the interfaces from cycling through - interface types in the container (I'm not clear why it does that but executing this command before building the - container "fixes" this!). An example qemu command to boot up the EOS device is: - -``` -qemu-system-x86_64 -enable-kvm -display none -machine pc -monitor tcp:0.0.0.0:4999,server,nowait -m 4096 -serial telnet:0.0.0.0:5999,server,nowait -drive if=ide,file=vEOS-lab-4.22.1F.vmdk -device pci-bridge,chassis_nr=1,id=pci.1 -device e1000,netdev=p00,mac=52:54:00:54:e9:00 -netdev user,id=p00,net=10.0.0.0/24,tftp=/tftpboot,hostfwd=tcp::2022-10.0.0.15:22,hostfwd=tcp::2023-10.0.0.15:23,hostfwd=udp::2161-10.0.0.15:161,hostfwd=tcp::2830-10.0.0.15:830,hostfwd=tcp::2080-10.0.0.15:80,hostfwd=tcp::2443-10.0.0.15:443 -``` - -Once booted, connect to the device (telnet to container IP on port 5999 if using above command), issue the command - `zerotouch disable`, save the config and then you can shut it down, and make the container. - -The docker-compose file here will be looking for the container images matching this pattern, so this is an important - bit! The container image names should be: +In order to try to be as consistent as possible when running functional testing, we rely on the very awesome +[containerlab](https://github.com/srl-labs/containerlab) project. Containerlab allows us to have a reliable and +consistent testing environment and spin it up easily on any linux host (with nested virtualization capabilities). -``` -scrapli-cisco-iosxe -scrapli-cisco-nxos -scrapli-cisco-iosxr -scrapli-arista-eos -scrapli-juniper-junos -``` +You can see the containerlab topology file in the `.clab` directory at the root of scrapli. The topology file in +this directory outlines the container images that containerlab requires in order to spin up the topology. +Unfortunately, networking vendors suck at giving us free and easy access to container images for testing (notable +exception of Nokia and SR-Linux, so shout out to them!), so you are going to need to bring your own images to use. -You can tag the image names on creation (following the vrnetlab readme docs), or create a new tag once the image is built: +For the Arista EOS platform, you can simply create an account on the Arista website and download the cEOS container +image and import it into docker. The other platforms all require you to obtain a Qcow2 disk image of the platform, +and to use the [boxen](https://github.com/carlmontanari/boxen) project to convert the disk image into a container +image that containerlab can launch. The containerlab topology file indicates the version of the platforms the +testing suite expects -- other versions may be fine, but try to stick to the versions here if you can so tests run +exactly as expected! Once you have the Qcow files in hand, you can use boxen to build the container image -- please +check out the boxen docs for how to do this. -``` -docker tag [TAG OF IMAGE CREATED] scrapli-[VENDOR]-[OS] -``` +If you elect to run tests with boxen *only* (in "local" mode -- not described here, but should be straight forward +enough) and *not* use containerlab - set the `SCRAPLI_HOST_FWD` environment variable to some non-empty string; this +will force scrapli to connect to localhost on the ports described below rather than the clab specified (bridged) IP +addresses: -*NOTE* If you are going to test scrapli, use [my fork of vrnetlab](https://github.com/carlmontanari/vrnetlab) -- I've - enabled telnet, set ports, taken care of setting things up so that NAPALM can config replace, etc. +| Device | Local Port | +| --------------|------------| +| iosxe | 21022 | +| iosxr | 22022 | +| nxos | 23022 | +| eos | 24022 | +| junos | 25022 | -### Functional Tests +### Deploying/Destroying Containerlab Test Environment -Once you have created the images, you can start all of the containers with a make command: +Once you have created the images, you can start containerlab with a make command: ``` -make start_dev_env +make deploy_clab ``` Conversely, you can terminate the containers: ``` -make stop_dev_env +make destroy_clab ``` -To start a specific platform container: -``` -make start_dev_env_iosxe -``` - -Substitute "iosxe" for the platform type you want to start. - -Most of the containers don't take too long to fire up, maybe a few minutes (running on my old macmini with Ubuntu, so - not exactly a powerhouse!). That said, the IOS-XR device takes about 15 minutes to go to "healthy" status. Once - booted up you can connect to their console or via SSH: +### Ensuring Base Test Configs -| Device | Local IP | -| --------------|---------------| -| iosxe | 172.18.0.11 | -| nxos | 172.18.0.12 | -| iosxr | 172.18.0.13 | -| eos | 172.18.0.14 | -| junos | 172.18.0.15 | -| linux | 172.18.0.20 | - -The console port for all devices is 5000, so to connect to the console of the iosxe device you can simply telnet to - that port locally: - -``` -telnet 172.18.0.11 5000 -``` +To ensure that the base test configs are enforced, run the `prepare_dev_env` make directive, this uses scrapli-cfg +to load and replace the configurations running on these devices. This will do things like ensure telnet is enabled +(which is not the case by default for most platforms in clab/boxen), etc.. -Credentials for all devices use the default vrnetlab credentials: -Username: `vrnetlab` +### Running Functional Tests -Password: `VR-netlab9` +To run functional tests you can simply use the make directive: -You should also run the `prepare_devices` script in the functional tests, or use the Make commands to do so for you -. This script will deploy the base config needed for testing. The make commands for this step follow the same pattern - as the others: +`make test_functional` -- `prepare_dev_env` will push the base config to all devices -- `prepare_dev_env_XYZ` where XYZ == "iosxe", "nxos", etc. will push the base config for the specified device. +If you are adding tests and/or need to "regenerate" the expected output, you can use the `--update` flag like: -Once the container(s) are ready, you can use the make commands to execute tests as needed: +`python -m pytest tests/functional --update` -- `test` will execute all currently implemented functional tests as well as the unit tests -- `test_functional` will execute all currently implemented functional tests -- `test_iosxe` will execute all unit tests and iosxe functional tests -- `test_nxos` will execute all unit tests and nxos functional tests -- `test_iosxr` will execute all unit tests and iosxr functional tests -- `test_eos` will execute all unit tests and eos functional tests -- `test_junos` will execute all unit tests and junos functional tests -- `test_linux` will execute all unit tests and basic linux functional tests (this is really intended to test the base - `Scrape` driver instead of the network drivers) +This flag causes the test suite to capture the output and write it into the expected directory. This expected output +is then compared to the "real" output we get from the device during subsequent tests. ### Other Functional Test Info diff --git a/requirements-dev.txt b/requirements-dev.txt index e6f3b506..4498c038 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,13 +1,13 @@ black==22.6.0 darglint>=1.8.1,<2.0.0 isort>=5.10.1,<6.0.0 -mypy==0.961 +mypy==0.971 nox==2022.01.07 pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=4.5.4,<5.0.0 pylama>=8.3.7,<9.0.0 -pylint==2.14.4 +pylint==2.14.5 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<4.0.0 pytest>=7.0.0,<8.0.0 diff --git a/scrapli/driver/core/juniper_junos/base_driver.py b/scrapli/driver/core/juniper_junos/base_driver.py index d2ea8496..96a61166 100644 --- a/scrapli/driver/core/juniper_junos/base_driver.py +++ b/scrapli/driver/core/juniper_junos/base_driver.py @@ -60,7 +60,7 @@ ), "root_shell": ( PrivilegeLevel( - pattern=r"^.*root@(?:\S*:\S*\s?)?[%\#]\s?$", + pattern=r"^.*root@(?:\S*:?\S*\s?)?[%\#]\s?$", name="root_shell", previous_priv="exec", deescalate="exit", diff --git a/scrapli/transport/plugins/paramiko/transport.py b/scrapli/transport/plugins/paramiko/transport.py index 8694e7aa..3e59afea 100644 --- a/scrapli/transport/plugins/paramiko/transport.py +++ b/scrapli/transport/plugins/paramiko/transport.py @@ -186,7 +186,11 @@ def _authenticate_public_key(self) -> None: raise ScrapliConnectionNotOpened if self._base_transport_args.transport_options.get("enable_rsa2", False) is False: - self.session.disabled_algorithms = {"keys": ["rsa-sha2-256", "rsa-sha2-512"]} + # do this for "keys" and "pubkeys": https://github.com/paramiko/paramiko/issues/1984 + self.session.disabled_algorithms = { + "keys": ["rsa-sha2-256", "rsa-sha2-512"], + "pubkeys": ["rsa-sha2-256", "rsa-sha2-512"], + } try: paramiko_key = RSAKey(filename=self.plugin_transport_args.auth_private_key) diff --git a/tests/conftest.py b/tests/conftest.py index 67923d79..ae0c35f9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -29,68 +29,31 @@ def test_devices_dict(): TEST_CASES = { "cisco_iosxe": { - "get_prompt": { - "exec": "csr1000v>", - "privilege_exec": "csr1000v#", - "configuration": "csr1000v(config)#", - }, "send_command_short": { "command": "show run | i hostname", - "expected_no_strip": "hostname csr1000v\ncsr1000v#", - "expected_strip": "hostname csr1000v", }, "send_command_long": { "command": "show run", - "expected_no_strip": open( - f"{TEST_DATA_PATH}/expected/cisco_iosxe/send_command_long_no_strip" - ).read(), - "expected_strip": open( - f"{TEST_DATA_PATH}/expected/cisco_iosxe/send_command_long_strip" - ).read(), }, "send_commands_from_file": { "file": f"{TEST_DATA_PATH}/source/cisco_iosxe/send_commands", - "expected_no_strip": ["hostname csr1000v\ncsr1000v#", "hostname csr1000v\ncsr1000v#"], - "expected_strip": ["hostname csr1000v", "hostname csr1000v"], }, "send_commands_error": { "commands": ["show version", "show tacocat", "show version"], }, "send_interactive_normal_response": { - "command": [("clear logg", "Clear logging buffer [confirm]"), ("", "csr1000v#")], - "expected": "clear logg\nClear logging buffer [confirm]\n\ncsr1000v#", + "command": [("clear logg", "Clear logging buffer [confirm]"), ("", "#")], }, - "send_interactive_hidden_response": None, "send_config": { "configs": "interface loopback123\ndescription scrapli was here", - "expected_no_strip": "csr1000v(config-if)#\ncsr1000v(config-if)#", - "expected_strip": "\n", - "verification": "show run int loopback123", - "verification_expected_no_strip": "Building configuration...\n\nCurrent configuration : CONFIG_BYTES" - "\n!\ninterface Loopback123\n description scrapli was here\n no ip" - " address\nend\n\ncsr1000v#", - "verification_expected_strip": "Building configuration...\n\nCurrent configuration : CONFIG_BYTES" - "\n!\ninterface Loopback123\n description scrapli was here\n no ip " - "address\nend", "teardown_configs": "no interface loopback123", }, "send_configs": { "configs": ["interface loopback123", "description scrapli was here"], - "expected_no_strip": ["csr1000v(config-if)#", "csr1000v(config-if)#"], - "expected_strip": ["", ""], - "verification": "show run int loopback123", - "verification_expected_no_strip": "Building configuration...\n\nCurrent configuration : CONFIG_BYTES" - "\n!\ninterface Loopback123\n description scrapli was here\n no ip" - " address\nend\n\ncsr1000v#", - "verification_expected_strip": "Building configuration...\n\nCurrent configuration : CONFIG_BYTES" - "\n!\ninterface Loopback123\n description scrapli was here\n no ip " - "address\nend", "teardown_configs": "no interface loopback123", }, "send_configs_from_file": { "file": f"{TEST_DATA_PATH}/source/cisco_iosxe/send_configs", - "expected_no_strip": ["csr1000v(config-if)#", "csr1000v(config-if)#"], - "expected_strip": ["", ""], "teardown_configs": "no interface loopback123", }, "send_configs_error": { @@ -100,29 +63,14 @@ def test_devices_dict(): "sanitize_response": cisco_iosxe_clean_response, }, "cisco_nxos": { - "get_prompt": { - "exec": None, - "privilege_exec": "switch#", - "configuration": "switch(config)#", - }, "send_command_short": { "command": "show run | i scp-server", - "expected_no_strip": "feature scp-server\nswitch#", - "expected_strip": "feature scp-server", }, "send_command_long": { "command": "show run", - "expected_no_strip": open( - f"{TEST_DATA_PATH}/expected/cisco_nxos/send_command_long_no_strip" - ).read(), - "expected_strip": open( - f"{TEST_DATA_PATH}/expected/cisco_nxos/send_command_long_strip" - ).read(), }, "send_commands_from_file": { "file": f"{TEST_DATA_PATH}/source/cisco_nxos/send_commands", - "expected_no_strip": ["feature scp-server\nswitch#", "feature scp-server\nswitch#"], - "expected_strip": ["feature scp-server", "feature scp-server"], }, "send_commands_error": { "commands": ["show version", "show tacocat", "show version"], @@ -130,45 +78,19 @@ def test_devices_dict(): "send_interactive_normal_response": { "command": [ ("delete bootflash:virtual-instance.conf", "(yes/no/abort) [y]"), - ("n", "switch#"), + ("n", "#"), ], - "expected": 'delete bootflash:virtual-instance.conf\nDo you want to delete "/virtual-instance.conf" ? (yes/no/abort) [y] n\nswitch#', }, - "send_interactive_hidden_response": None, "send_config": { "configs": "interface loopback123\ndescription scrapli was here", - "expected_no_strip": "switch(config-if)#\nswitch(config-if)#", - "expected_strip": "\n", - "verification": "show run int loopback123", - "verification_expected_no_strip": "!Command: show running-config interface loopback123\n!Running " - "configuration last done at: TIME_STAMP_REPLACED\n!Time: " - "TIME_STAMP_REPLACED\n\nversion 9.2(4) Bios:version\n\ninterface " - "loopback123\n description scrapli was here\n\nswitch#", - "verification_expected_strip": "!Command: show running-config interface loopback123\n!Running " - "configuration last done at: TIME_STAMP_REPLACED\n!Time: " - "TIME_STAMP_REPLACED\n\nversion 9.2(4) Bios:version\n\ninterface " - "loopback123\n description scrapli was here", "teardown_configs": "no interface loopback123", }, "send_configs": { "configs": ["interface loopback123", "description scrapli was here"], - "expected_no_strip": ["switch(config-if)#", "switch(config-if)#"], - "expected_strip": ["", ""], - "verification": "show run int loopback123", - "verification_expected_no_strip": "!Command: show running-config interface loopback123\n!Running " - "configuration last done at: TIME_STAMP_REPLACED\n!Time: " - "TIME_STAMP_REPLACED\n\nversion 9.2(4) Bios:version\n\ninterface " - "loopback123\n description scrapli was here\n\nswitch#", - "verification_expected_strip": "!Command: show running-config interface loopback123\n!Running " - "configuration last done at: TIME_STAMP_REPLACED\n!Time: " - "TIME_STAMP_REPLACED\n\nversion 9.2(4) Bios:version\n\ninterface " - "loopback123\n description scrapli was here", "teardown_configs": "no interface loopback123", }, "send_configs_from_file": { "file": f"{TEST_DATA_PATH}/source/cisco_nxos/send_configs", - "expected_no_strip": ["switch(config-if)#", "switch(config-if)#"], - "expected_strip": ["", ""], "teardown_configs": "no interface loopback123", }, "send_configs_error": { @@ -178,63 +100,29 @@ def test_devices_dict(): "sanitize_response": cisco_nxos_clean_response, }, "cisco_iosxr": { - "get_prompt": { - "exec": None, - "privilege_exec": "RP/0/RP0/CPU0:ios#", - "configuration": "RP/0/RP0/CPU0:ios(config)#", - }, "send_command_short": { "command": "show run | i MgmtEth0", - "expected_no_strip": "TIME_STAMP_REPLACED\nBuilding configuration...\ninterface MgmtEth0/RP0/CPU0/0\nRP/0/RP0/CPU0:ios#", - "expected_strip": "TIME_STAMP_REPLACED\nBuilding configuration...\ninterface MgmtEth0/RP0/CPU0/0", }, "send_command_long": { "command": "show run", - "expected_no_strip": open( - f"{TEST_DATA_PATH}/expected/cisco_iosxr/send_command_long_no_strip" - ).read(), - "expected_strip": open( - f"{TEST_DATA_PATH}/expected/cisco_iosxr/send_command_long_strip" - ).read(), }, "send_commands_from_file": { "file": f"{TEST_DATA_PATH}/source/cisco_iosxr/send_commands", - "expected_no_strip": [ - "TIME_STAMP_REPLACED\nBuilding configuration...\ninterface MgmtEth0/RP0/CPU0/0\nRP/0/RP0/CPU0:ios#", - "TIME_STAMP_REPLACED\nBuilding configuration...\ninterface MgmtEth0/RP0/CPU0/0\nRP/0/RP0/CPU0:ios#", - ], - "expected_strip": [ - "TIME_STAMP_REPLACED\nBuilding configuration...\ninterface MgmtEth0/RP0/CPU0/0", - "TIME_STAMP_REPLACED\nBuilding configuration...\ninterface MgmtEth0/RP0/CPU0/0", - ], }, "send_commands_error": { "commands": ["show version", "show tacocat", "show version"], }, "send_interactive_normal_response": None, - "send_interactive_hidden_response": None, "send_config": { "configs": "interface loopback123\ndescription scrapli was here\ncommit", - "expected_no_strip": "RP/0/RP0/CPU0:ios(config-if)#\nRP/0/RP0/CPU0:ios(config-if)#\nTIME_STAMP_REPLACED\nRP/0/RP0/CPU0:ios(config-if)#", - "expected_strip": "\n\nTIME_STAMP_REPLACED", # we get the timestamp of the commit in this output - "verification": "show run int loopback123", - "verification_expected_no_strip": "TIME_STAMP_REPLACED\ninterface Loopback123\n description scrapli was here\n!\n\nRP/0/RP0/CPU0:ios#", - "verification_expected_strip": "TIME_STAMP_REPLACED\ninterface Loopback123\n description scrapli was here\n!", "teardown_configs": ["no interface loopback123", "commit"], }, "send_configs": { "configs": ["interface loopback123", "description scrapli was here", "commit"], - "expected_no_strip": ["RP/0/RP0/CPU0:ios(config-if)#", "RP/0/RP0/CPU0:ios(config-if)#"], - "expected_strip": ["", ""], - "verification": "show run int loopback123", - "verification_expected_no_strip": "TIME_STAMP_REPLACED\ninterface Loopback123\n description scrapli was here\n!\n\nRP/0/RP0/CPU0:ios#", - "verification_expected_strip": "TIME_STAMP_REPLACED\ninterface Loopback123\n description scrapli was here\n!", "teardown_configs": ["no interface loopback123", "commit"], }, "send_configs_from_file": { "file": f"{TEST_DATA_PATH}/source/cisco_iosxr/send_configs", - "expected_no_strip": ["RP/0/RP0/CPU0:ios(config-if)#", "RP/0/RP0/CPU0:ios(config-if)#"], - "expected_strip": ["", ""], "teardown_configs": ["no interface loopback123", "commit"], }, "send_configs_error": { @@ -244,63 +132,29 @@ def test_devices_dict(): "sanitize_response": cisco_iosxr_clean_response, }, "arista_eos": { - "get_prompt": { - "exec": "localhost>", - "privilege_exec": "localhost#", - "configuration": "localhost(config)#", - }, "send_command_short": { "command": "show run | i ZTP", - "expected_no_strip": "logging level ZTP informational\nlocalhost#", - "expected_strip": "logging level ZTP informational", }, "send_command_long": { "command": "show run", - "expected_no_strip": open( - f"{TEST_DATA_PATH}/expected/arista_eos/send_command_long_no_strip" - ).read(), - "expected_strip": open( - f"{TEST_DATA_PATH}/expected/arista_eos/send_command_long_strip" - ).read(), }, "send_commands_from_file": { "file": f"{TEST_DATA_PATH}/source/arista_eos/send_commands", - "expected_no_strip": [ - "logging level ZTP informational\nlocalhost#", - "logging level ZTP informational\nlocalhost#", - ], - "expected_strip": [ - "logging level ZTP informational", - "logging level ZTP informational", - ], }, "send_commands_error": { "commands": ["show version", "show tacocat", "show version"], }, "send_interactive_normal_response": None, - "send_interactive_hidden_response": None, "send_config": { "configs": "interface loopback123\ndescription scrapli was here", - "expected_no_strip": "localhost(config-if-Lo123)#\nlocalhost(config-if-Lo123)#", - "expected_strip": "\n", - "verification": "show run int loopback123", - "verification_expected_no_strip": "interface Loopback123\n description scrapli was here\nlocalhost#", - "verification_expected_strip": "interface Loopback123\n description scrapli was here", "teardown_configs": "no interface loopback123", }, "send_configs": { "configs": ["interface loopback123", "description scrapli was here"], - "expected_no_strip": ["localhost(config-if-Lo123)#", "localhost(config-if-Lo123)#"], - "expected_strip": ["", ""], - "verification": "show run int loopback123", - "verification_expected_no_strip": "interface Loopback123\n description scrapli was here\nlocalhost#", - "verification_expected_strip": "interface Loopback123\n description scrapli was here", "teardown_configs": "no interface loopback123", }, "send_configs_from_file": { "file": f"{TEST_DATA_PATH}/source/arista_eos/send_configs", - "expected_no_strip": ["localhost(config-if-Lo123)#", "localhost(config-if-Lo123)#"], - "expected_strip": ["", ""], "teardown_configs": "no interface loopback123", }, "send_configs_error": { @@ -310,63 +164,29 @@ def test_devices_dict(): "sanitize_response": arista_eos_clean_response, }, "juniper_junos": { - "get_prompt": { - "exec": "boxen>", - "privilege_exec": None, - "configuration": "boxen#", - }, "send_command_short": { "command": "show configuration | match 10.0.0.15", - "expected_no_strip": " address 10.0.0.15/24;\n\nboxen>", - "expected_strip": " address 10.0.0.15/24;", }, "send_command_long": { "command": "show configuration", - "expected_no_strip": open( - f"{TEST_DATA_PATH}/expected/juniper_junos/send_command_long_no_strip" - ).read(), - "expected_strip": open( - f"{TEST_DATA_PATH}/expected/juniper_junos/send_command_long_strip" - ).read(), }, "send_commands_from_file": { "file": f"{TEST_DATA_PATH}/source/juniper_junos/send_commands", - "expected_no_strip": [ - " address 10.0.0.15/24;\n\nboxen>", - " address 10.0.0.15/24;\n\nboxen>", - ], - "expected_strip": [ - " address 10.0.0.15/24;", - " address 10.0.0.15/24;", - ], }, "send_commands_error": { "commands": ["show version", "show tacocat", "show version"], }, "send_interactive_normal_response": None, - "send_interactive_hidden_response": None, "send_config": { "configs": 'set interfaces fxp0 unit 0 description "scrapli was here"\ncommit', - "expected_no_strip": "[edit]\nboxen#\ncommit complete\n\n[edit]\nboxen#", - "expected_strip": "[edit]\ncommit complete\n\n[edit]", - "verification": "show configuration interfaces fxp0", - "verification_expected_no_strip": 'unit 0 {\n description "scrapli was here";\n family inet {\n address 10.0.0.15/24;\n }\n}\n\nboxen>', - "verification_expected_strip": 'unit 0 {\n description "scrapli was here";\n family inet {\n address 10.0.0.15/24;\n }\n}', "teardown_configs": ["delete interfaces fxp0 unit 0 description", "commit"], }, "send_configs": { "configs": ['set interfaces fxp0 unit 0 description "scrapli was here"', "commit"], - "expected_no_strip": ["[edit]\nboxen#", "commit complete\n\n[edit]\nboxen#"], - "expected_strip": ["[edit]", "commit complete\n\n[edit]"], - "verification": "show configuration interfaces fxp0", - "verification_expected_no_strip": 'unit 0 {\n description "scrapli was here";\n family inet {\n address 10.0.0.15/24;\n }\n}\n\nboxen>', - "verification_expected_strip": 'unit 0 {\n description "scrapli was here";\n family inet {\n address 10.0.0.15/24;\n }\n}', "teardown_configs": ["delete interfaces fxp0 unit 0 description", "commit"], }, "send_configs_from_file": { "file": f"{TEST_DATA_PATH}/source/juniper_junos/send_configs", - "expected_no_strip": ["[edit]\nboxen#", "commit complete\n\n[edit]\nboxen#"], - "expected_strip": ["[edit]", "commit complete\n\n[edit]"], "teardown_configs": ["delete interfaces fxp0 unit 0 description", "commit"], }, "send_configs_error": { @@ -379,23 +199,6 @@ def test_devices_dict(): }, "sanitize_response": juniper_junos_clean_response, }, - "linux": { - "get_prompt": "linux:~#", - "send_command_short": { - "command": "cat /etc/hostname", - "expected_no_strip": "linux\nlinux:~#", - "expected_strip": "linux", - }, - "send_command_long": { - "command": "cat /etc/init.d/sshd", - "expected_no_strip": open( - f"{TEST_DATA_PATH}/expected/linux/send_command_long_no_strip" - ).read(), - "expected_strip": open( - f"{TEST_DATA_PATH}/expected/linux/send_command_long_strip" - ).read(), - }, - }, } diff --git a/tests/devices.py b/tests/devices.py index c6044b4c..c4c681e7 100644 --- a/tests/devices.py +++ b/tests/devices.py @@ -1,8 +1,9 @@ import os +import sys from pathlib import Path +from typing import Tuple import scrapli -from scrapli import AsyncDriver, Driver from scrapli.driver.core import ( AsyncEOSDriver, AsyncIOSXEDriver, @@ -18,22 +19,68 @@ TEST_DATA_PATH = f"{Path(scrapli.__file__).parents[1]}/tests/test_data" -CLAB_BRIDGE = bool(os.environ.get("SCRAPLI_CLAB_BRIDGE", False)) -USERNAME = "boxen" -PASSWORD = "b0x3N-b0x3N" PRIVATE_KEY = f"{TEST_DATA_PATH}/scrapli_key" INVALID_PRIVATE_KEY = f"{TEST_DATA_PATH}/__init__.py" + +def get_env_or_default(key: str, default: str) -> str: + return os.getenv(key, default) + + +def get_functional_host_ip_port_linux_or_remote(platform: str) -> Tuple[str, int]: + plats = { + "cisco_iosxe": ("172.20.20.11", 22), + "cisco_iosxr": ("172.20.20.12", 22), + "cisco_nxos": ("172.20.20.13", 22), + "arista_eos": ("172.20.20.14", 22), + "juniper_junos": ("172.20.20.15", 22), + } + + return get_env_or_default(f"SCRAPLI_{platform.upper()}_HOST", plats[platform][0]), int( + get_env_or_default(f"SCRAPLI_{platform.upper()}_PORT", plats[platform][1]) + ) + + +def get_functional_host_ip_port(platform: str) -> Tuple[str, int]: + if not get_env_or_default("SCRAPLI_HOST_FWD", ""): + return get_functional_host_ip_port_linux_or_remote(platform) + + # otherwise we are running on darwin w/ local boxen w/ nat + host = "localhost" + + if platform == "cisco_iosxe": + return host, 21022 + if platform == "cisco_iosxr": + return host, 22022 + if platform == "cisco_nxos": + return host, 23022 + if platform == "arista_eos": + return host, 24022 + if platform == "juniper_junos": + return host, 25022 + + +def get_functional_host_user_pass(platform: str) -> Tuple[str, str]: + user = "admin" + pwd = "admin" + + if platform == "cisco_iosxe": + return user, pwd + if platform == "cisco_iosxr": + return "clab", "clab@123" + if platform == "cisco_nxos": + return user, pwd + if platform == "arista_eos": + return user, pwd + if platform == "juniper_junos": + return user, "admin@123" + + DEVICES = { "cisco_iosxe": { "driver": IOSXEDriver, "async_driver": AsyncIOSXEDriver, - "auth_username": USERNAME, - "auth_password": PASSWORD, - "auth_secondary": PASSWORD, "auth_strict_key": False, - "host": "localhost" if not CLAB_BRIDGE else "172.18.0.11", - "port": 21022 if not CLAB_BRIDGE else 22, "base_config": f"{TEST_DATA_PATH}/base_configs/cisco_iosxe", "transport_options": { "open_cmd": [ @@ -45,55 +92,43 @@ "cisco_nxos": { "driver": NXOSDriver, "async_driver": AsyncNXOSDriver, - "auth_username": USERNAME, - "auth_password": PASSWORD, - "auth_secondary": PASSWORD, "auth_strict_key": False, - "host": "localhost" if not CLAB_BRIDGE else "172.18.0.12", - "port": 22022 if not CLAB_BRIDGE else 22, "base_config": f"{TEST_DATA_PATH}/base_configs/cisco_nxos", }, "cisco_iosxr": { "driver": IOSXRDriver, "async_driver": AsyncIOSXRDriver, - "auth_username": USERNAME, - "auth_password": PASSWORD, - "auth_secondary": PASSWORD, "auth_strict_key": False, - "host": "localhost" if not CLAB_BRIDGE else "172.18.0.13", - "port": 23022 if not CLAB_BRIDGE else 22, "base_config": f"{TEST_DATA_PATH}/base_configs/cisco_iosxr", }, "arista_eos": { "driver": EOSDriver, "async_driver": AsyncEOSDriver, - "auth_username": USERNAME, - "auth_password": PASSWORD, - "auth_secondary": PASSWORD, "auth_strict_key": False, - "host": "localhost" if not CLAB_BRIDGE else "172.18.0.14", - "port": 24022 if not CLAB_BRIDGE else 22, "base_config": f"{TEST_DATA_PATH}/base_configs/arista_eos", }, "juniper_junos": { "driver": JunosDriver, "async_driver": AsyncJunosDriver, - "auth_username": USERNAME, - "auth_password": PASSWORD, - "auth_secondary": PASSWORD, "auth_strict_key": False, - "host": "localhost" if not CLAB_BRIDGE else "172.18.0.15", - "port": 25022 if not CLAB_BRIDGE else 22, "base_config": f"{TEST_DATA_PATH}/base_configs/juniper_junos", }, - "linux": { - "driver": Driver, - "async_driver": AsyncDriver, - "auth_username": "root", - "auth_password": "docker", - "auth_strict_key": False, - "host": "localhost" if not CLAB_BRIDGE else "172.18.0.20", - "port": 26022 if not CLAB_BRIDGE else 22, - "comms_prompt_pattern": r"^linux:~#\s*$", - }, } + + +def render_devices(): + for platform in ("cisco_iosxe", "cisco_iosxr", "cisco_nxos", "arista_eos", "juniper_junos"): + host, port = get_functional_host_ip_port(platform) + user, pwd = get_functional_host_user_pass(platform) + + DEVICES[platform]["host"] = host + DEVICES[platform]["port"] = port + DEVICES[platform]["auth_username"] = user + DEVICES[platform]["auth_password"] = pwd + + # always boxen as it should only matter for iosxe and will have been set *by* boxen in + # most cases + DEVICES[platform]["auth_secondary"] = "b0x3N-b0x3N" + + +render_devices() diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py index b51c2e56..a49d1954 100644 --- a/tests/functional/conftest.py +++ b/tests/functional/conftest.py @@ -1,16 +1,25 @@ import pytest -from scrapli.driver import GenericDriver - -TIMEOUT_SOCKET = 10 -TIMEOUT_TRANSPORT = 10 -TIMEOUT_OPS = 30 +TIMEOUT_SOCKET = 60 +TIMEOUT_TRANSPORT = 60 +TIMEOUT_OPS = 60 TELNET_TRANSPORTS = ( "telnet", "asynctelnet", ) +def pytest_addoption(parser): + parser.addoption( + "--update", action="store_true", default=False, help="pass to update test output" + ) + + +@pytest.fixture +def update(request): + return request.config.getoption("--update") + + @pytest.fixture(scope="session") def real_invalid_ssh_key_path(test_data_path): return f"{test_data_path}/files/invalid_key" @@ -39,40 +48,6 @@ def async_transport(request): yield request.param -@pytest.fixture(scope="class") -def nix_conn(test_devices_dict, transport): - if transport in TELNET_TRANSPORTS: - pytest.skip("skipping telnet for linux hosts") - - device = test_devices_dict["linux"].copy() - driver = device.pop("driver") - device.pop("async_driver") - - conn = driver( - **device, - transport=transport, - ) - conn.open() - return conn - - -@pytest.fixture(scope="class") -def nix_conn_generic(test_devices_dict, transport): - if transport in TELNET_TRANSPORTS: - pytest.skip("skipping telnet for linux hosts") - - device = test_devices_dict["linux"].copy() - device.pop("driver") - device.pop("async_driver") - - conn = GenericDriver( - **device, - transport=transport, - ) - conn.open() - return conn - - @pytest.fixture(scope="class") def conn(test_devices_dict, device_type, transport): device = test_devices_dict[device_type].copy() diff --git a/tests/functional/expected.py b/tests/functional/expected.py new file mode 100644 index 00000000..1436acd0 --- /dev/null +++ b/tests/functional/expected.py @@ -0,0 +1,25 @@ +import os +from pathlib import Path + +PYTEST_CURRENT_TEST = "PYTEST_CURRENT_TEST" + + +def write_expected(f: str, result: str): + expected_dir = Path(os.path.abspath(f)).parent + + current_test = os.getenv(PYTEST_CURRENT_TEST).split("::")[-1].split(" ")[0] + + with open(f"{expected_dir}/expected/{current_test}", "w") as out: + out.write(result) + + +def get_expected(f: str) -> str: + expected_dir = Path(os.path.abspath(f)).parent + + current_test = os.getenv(PYTEST_CURRENT_TEST).split("::")[-1].split(" ")[0] + + try: + with open(f"{expected_dir}/expected/{current_test}", "r") as out: + return out.read() + except NotADirectoryError: + return "" diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-configuration] new file mode 100644 index 00000000..a40fbfa4 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-configuration] @@ -0,0 +1 @@ +ceos(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-exec] new file mode 100644 index 00000000..66aab541 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-exec] @@ -0,0 +1 @@ +ceos> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-privilege_exec] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asyncssh-privilege_exec] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-configuration] new file mode 100644 index 00000000..a40fbfa4 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-configuration] @@ -0,0 +1 @@ +ceos(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-exec] new file mode 100644 index 00000000..66aab541 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-exec] @@ -0,0 +1 @@ +ceos> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-privilege_exec] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-asynctelnet-privilege_exec] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-configuration] new file mode 100644 index 00000000..a40fbfa4 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-configuration] @@ -0,0 +1 @@ +ceos(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-exec] new file mode 100644 index 00000000..66aab541 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-exec] @@ -0,0 +1 @@ +ceos> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-privilege_exec] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-paramiko-privilege_exec] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-configuration] new file mode 100644 index 00000000..a40fbfa4 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-configuration] @@ -0,0 +1 @@ +ceos(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-exec] new file mode 100644 index 00000000..66aab541 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-exec] @@ -0,0 +1 @@ +ceos> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-privilege_exec] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-ssh2-privilege_exec] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-configuration] new file mode 100644 index 00000000..a40fbfa4 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-configuration] @@ -0,0 +1 @@ +ceos(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-exec] new file mode 100644 index 00000000..66aab541 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-exec] @@ -0,0 +1 @@ +ceos> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-privilege_exec] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-system-privilege_exec] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-configuration] new file mode 100644 index 00000000..a40fbfa4 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-configuration] @@ -0,0 +1 @@ +ceos(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-exec] new file mode 100644 index 00000000..66aab541 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-exec] @@ -0,0 +1 @@ +ceos> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-privilege_exec] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[arista_eos-telnet-privilege_exec] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-configuration] new file mode 100644 index 00000000..78b6468e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-configuration] @@ -0,0 +1 @@ +vr-csr(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-exec] new file mode 100644 index 00000000..ebd728fd --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-exec] @@ -0,0 +1 @@ +vr-csr> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-privilege_exec] new file mode 100644 index 00000000..f22f4ba8 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asyncssh-privilege_exec] @@ -0,0 +1 @@ +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-configuration] new file mode 100644 index 00000000..78b6468e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-configuration] @@ -0,0 +1 @@ +vr-csr(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-exec] new file mode 100644 index 00000000..ebd728fd --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-exec] @@ -0,0 +1 @@ +vr-csr> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-privilege_exec] new file mode 100644 index 00000000..f22f4ba8 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-asynctelnet-privilege_exec] @@ -0,0 +1 @@ +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-configuration] new file mode 100644 index 00000000..78b6468e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-configuration] @@ -0,0 +1 @@ +vr-csr(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-exec] new file mode 100644 index 00000000..ebd728fd --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-exec] @@ -0,0 +1 @@ +vr-csr> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-privilege_exec] new file mode 100644 index 00000000..f22f4ba8 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-paramiko-privilege_exec] @@ -0,0 +1 @@ +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-configuration] new file mode 100644 index 00000000..78b6468e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-configuration] @@ -0,0 +1 @@ +vr-csr(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-exec] new file mode 100644 index 00000000..ebd728fd --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-exec] @@ -0,0 +1 @@ +vr-csr> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-privilege_exec] new file mode 100644 index 00000000..f22f4ba8 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-ssh2-privilege_exec] @@ -0,0 +1 @@ +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-configuration] new file mode 100644 index 00000000..78b6468e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-configuration] @@ -0,0 +1 @@ +vr-csr(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-exec] new file mode 100644 index 00000000..ebd728fd --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-exec] @@ -0,0 +1 @@ +vr-csr> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-privilege_exec] new file mode 100644 index 00000000..f22f4ba8 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-system-privilege_exec] @@ -0,0 +1 @@ +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-configuration] new file mode 100644 index 00000000..78b6468e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-configuration] @@ -0,0 +1 @@ +vr-csr(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-exec] new file mode 100644 index 00000000..ebd728fd --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-exec] @@ -0,0 +1 @@ +vr-csr> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-privilege_exec] new file mode 100644 index 00000000..f22f4ba8 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxe-telnet-privilege_exec] @@ -0,0 +1 @@ +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asyncssh-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asyncssh-configuration] new file mode 100644 index 00000000..6534359e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asyncssh-configuration] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asyncssh-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asyncssh-privilege_exec] new file mode 100644 index 00000000..3911c157 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asyncssh-privilege_exec] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asynctelnet-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asynctelnet-configuration] new file mode 100644 index 00000000..6534359e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asynctelnet-configuration] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asynctelnet-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asynctelnet-privilege_exec] new file mode 100644 index 00000000..3911c157 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-asynctelnet-privilege_exec] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-paramiko-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-paramiko-configuration] new file mode 100644 index 00000000..6534359e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-paramiko-configuration] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-paramiko-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-paramiko-privilege_exec] new file mode 100644 index 00000000..3911c157 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-paramiko-privilege_exec] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-ssh2-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-ssh2-configuration] new file mode 100644 index 00000000..6534359e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-ssh2-configuration] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-ssh2-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-ssh2-privilege_exec] new file mode 100644 index 00000000..3911c157 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-ssh2-privilege_exec] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-system-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-system-configuration] new file mode 100644 index 00000000..6534359e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-system-configuration] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-system-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-system-privilege_exec] new file mode 100644 index 00000000..3911c157 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-system-privilege_exec] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-telnet-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-telnet-configuration] new file mode 100644 index 00000000..6534359e --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-telnet-configuration] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-telnet-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-telnet-privilege_exec] new file mode 100644 index 00000000..3911c157 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_iosxr-telnet-privilege_exec] @@ -0,0 +1 @@ +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asyncssh-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asyncssh-configuration] new file mode 100644 index 00000000..06dbc495 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asyncssh-configuration] @@ -0,0 +1 @@ +vr-n9kv(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asyncssh-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asyncssh-privilege_exec] new file mode 100644 index 00000000..4722e04b --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asyncssh-privilege_exec] @@ -0,0 +1 @@ +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asynctelnet-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asynctelnet-configuration] new file mode 100644 index 00000000..06dbc495 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asynctelnet-configuration] @@ -0,0 +1 @@ +vr-n9kv(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asynctelnet-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asynctelnet-privilege_exec] new file mode 100644 index 00000000..4722e04b --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-asynctelnet-privilege_exec] @@ -0,0 +1 @@ +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-paramiko-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-paramiko-configuration] new file mode 100644 index 00000000..06dbc495 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-paramiko-configuration] @@ -0,0 +1 @@ +vr-n9kv(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-paramiko-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-paramiko-privilege_exec] new file mode 100644 index 00000000..4722e04b --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-paramiko-privilege_exec] @@ -0,0 +1 @@ +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-ssh2-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-ssh2-configuration] new file mode 100644 index 00000000..06dbc495 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-ssh2-configuration] @@ -0,0 +1 @@ +vr-n9kv(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-ssh2-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-ssh2-privilege_exec] new file mode 100644 index 00000000..4722e04b --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-ssh2-privilege_exec] @@ -0,0 +1 @@ +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-system-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-system-configuration] new file mode 100644 index 00000000..06dbc495 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-system-configuration] @@ -0,0 +1 @@ +vr-n9kv(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-system-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-system-privilege_exec] new file mode 100644 index 00000000..4722e04b --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-system-privilege_exec] @@ -0,0 +1 @@ +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-telnet-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-telnet-configuration] new file mode 100644 index 00000000..06dbc495 --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-telnet-configuration] @@ -0,0 +1 @@ +vr-n9kv(config)# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-telnet-privilege_exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-telnet-privilege_exec] new file mode 100644 index 00000000..4722e04b --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[cisco_nxos-telnet-privilege_exec] @@ -0,0 +1 @@ +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asyncssh-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asyncssh-configuration] new file mode 100644 index 00000000..926604be --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asyncssh-configuration] @@ -0,0 +1 @@ +admin@vr-vqfx# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asyncssh-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asyncssh-exec] new file mode 100644 index 00000000..63b4778f --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asyncssh-exec] @@ -0,0 +1 @@ +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asynctelnet-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asynctelnet-configuration] new file mode 100644 index 00000000..926604be --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asynctelnet-configuration] @@ -0,0 +1 @@ +admin@vr-vqfx# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asynctelnet-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asynctelnet-exec] new file mode 100644 index 00000000..63b4778f --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-asynctelnet-exec] @@ -0,0 +1 @@ +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-paramiko-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-paramiko-configuration] new file mode 100644 index 00000000..926604be --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-paramiko-configuration] @@ -0,0 +1 @@ +admin@vr-vqfx# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-paramiko-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-paramiko-exec] new file mode 100644 index 00000000..63b4778f --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-paramiko-exec] @@ -0,0 +1 @@ +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-ssh2-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-ssh2-configuration] new file mode 100644 index 00000000..926604be --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-ssh2-configuration] @@ -0,0 +1 @@ +admin@vr-vqfx# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-ssh2-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-ssh2-exec] new file mode 100644 index 00000000..63b4778f --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-ssh2-exec] @@ -0,0 +1 @@ +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-system-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-system-configuration] new file mode 100644 index 00000000..926604be --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-system-configuration] @@ -0,0 +1 @@ +admin@vr-vqfx# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-system-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-system-exec] new file mode 100644 index 00000000..63b4778f --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-system-exec] @@ -0,0 +1 @@ +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-telnet-configuration] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-telnet-configuration] new file mode 100644 index 00000000..926604be --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-telnet-configuration] @@ -0,0 +1 @@ +admin@vr-vqfx# \ No newline at end of file diff --git a/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-telnet-exec] b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-telnet-exec] new file mode 100644 index 00000000..63b4778f --- /dev/null +++ b/tests/functional/expected/test_get_prompt_and_acquire_priv[juniper_junos-telnet-exec] @@ -0,0 +1 @@ +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..917de1bb --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-asyncssh-no_strip_prompt] @@ -0,0 +1,42 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-asyncssh-strip_prompt] new file mode 100644 index 00000000..35b13a3e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-asyncssh-strip_prompt] @@ -0,0 +1,41 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..917de1bb --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-asynctelnet-no_strip_prompt] @@ -0,0 +1,42 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..35b13a3e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-asynctelnet-strip_prompt] @@ -0,0 +1,41 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..917de1bb --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-paramiko-no_strip_prompt] @@ -0,0 +1,42 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-paramiko-strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-paramiko-strip_prompt] new file mode 100644 index 00000000..35b13a3e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-paramiko-strip_prompt] @@ -0,0 +1,41 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..917de1bb --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-ssh2-no_strip_prompt] @@ -0,0 +1,42 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-ssh2-strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-ssh2-strip_prompt] new file mode 100644 index 00000000..35b13a3e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-ssh2-strip_prompt] @@ -0,0 +1,41 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-system-no_strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-system-no_strip_prompt] new file mode 100644 index 00000000..917de1bb --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-system-no_strip_prompt] @@ -0,0 +1,42 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-system-strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-system-strip_prompt] new file mode 100644 index 00000000..35b13a3e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-system-strip_prompt] @@ -0,0 +1,41 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-telnet-no_strip_prompt] new file mode 100644 index 00000000..917de1bb --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-telnet-no_strip_prompt] @@ -0,0 +1,42 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[arista_eos-telnet-strip_prompt] b/tests/functional/expected/test_send_command_long[arista_eos-telnet-strip_prompt] new file mode 100644 index 00000000..35b13a3e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[arista_eos-telnet-strip_prompt] @@ -0,0 +1,41 @@ +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/test_data/expected/cisco_iosxe/send_command_long_no_strip b/tests/functional/expected/test_send_command_long[cisco_iosxe-asyncssh-no_strip_prompt] similarity index 89% rename from tests/test_data/expected/cisco_iosxe/send_command_long_no_strip rename to tests/functional/expected/test_send_command_long[cisco_iosxe-asyncssh-no_strip_prompt] index d2836d4a..f8793bc5 100644 --- a/tests/test_data/expected/cisco_iosxe/send_command_long_no_strip +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-asyncssh-no_strip_prompt] @@ -12,13 +12,13 @@ platform qfp utilization monitor load 80 platform punt-keepalive disable-kernel-core platform console serial ! -hostname csr1000v +hostname vr-csr ! boot-start-marker boot-end-marker ! ! -enable secret 9 $9$xvWnx8Fe35f8xE$E9ijp7GM/V48P5y1Uz3IEPtotXgwkJKYJmN0q3q2E92 +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc ! no aaa new-model call-home @@ -36,7 +36,7 @@ call-home ! ! ! -ip domain name example.com +ip domain name boxen.box ! ! ! @@ -73,16 +73,13 @@ multilink bundle-name authenticated ! CERTIFICATES AND LICENSE diagnostic bootup level minimal -archive - log config - logging enable - path bootflash: memory free low-watermark processor 72329 ! ! spanning-tree extend system-id ! username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin ! redundancy ! @@ -177,15 +174,12 @@ interface GigabitEthernet10 no mop enabled no mop sysid ! -! -virtual-service csr_mgmt -! ip forward-protocol nd no ip http server -no ip http secure-server +ip http secure-server ! ip ssh pubkey-chain - username boxen + username admin key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F ip scp server enable ! @@ -204,20 +198,24 @@ control-plane ! line con 0 stopbits 1 -line vty 0 4 +line vty 0 + login local + transport input all +line vty 1 login local + length 0 transport input all -line vty 5 15 +line vty 2 4 login local transport input all ! -netconf ssh ! ! ! ! ! netconf-yang +restconf end -csr1000v# \ No newline at end of file +vr-csr# \ No newline at end of file diff --git a/tests/test_data/expected/cisco_iosxe/send_command_long_strip b/tests/functional/expected/test_send_command_long[cisco_iosxe-asyncssh-strip_prompt] similarity index 89% rename from tests/test_data/expected/cisco_iosxe/send_command_long_strip rename to tests/functional/expected/test_send_command_long[cisco_iosxe-asyncssh-strip_prompt] index 2cdc15e1..f6e9bd2c 100644 --- a/tests/test_data/expected/cisco_iosxe/send_command_long_strip +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-asyncssh-strip_prompt] @@ -12,13 +12,13 @@ platform qfp utilization monitor load 80 platform punt-keepalive disable-kernel-core platform console serial ! -hostname csr1000v +hostname vr-csr ! boot-start-marker boot-end-marker ! ! -enable secret 9 $9$xvWnx8Fe35f8xE$E9ijp7GM/V48P5y1Uz3IEPtotXgwkJKYJmN0q3q2E92 +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc ! no aaa new-model call-home @@ -36,7 +36,7 @@ call-home ! ! ! -ip domain name example.com +ip domain name boxen.box ! ! ! @@ -73,16 +73,13 @@ multilink bundle-name authenticated ! CERTIFICATES AND LICENSE diagnostic bootup level minimal -archive - log config - logging enable - path bootflash: memory free low-watermark processor 72329 ! ! spanning-tree extend system-id ! username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin ! redundancy ! @@ -177,15 +174,12 @@ interface GigabitEthernet10 no mop enabled no mop sysid ! -! -virtual-service csr_mgmt -! ip forward-protocol nd no ip http server -no ip http secure-server +ip http secure-server ! ip ssh pubkey-chain - username boxen + username admin key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F ip scp server enable ! @@ -204,18 +198,22 @@ control-plane ! line con 0 stopbits 1 -line vty 0 4 +line vty 0 + login local + transport input all +line vty 1 login local + length 0 transport input all -line vty 5 15 +line vty 2 4 login local transport input all ! -netconf ssh ! ! ! ! ! netconf-yang +restconf end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxe-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxe-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..f8793bc5 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-asynctelnet-no_strip_prompt] @@ -0,0 +1,221 @@ +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxe-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxe-asynctelnet-strip_prompt] new file mode 100644 index 00000000..f6e9bd2c --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-asynctelnet-strip_prompt] @@ -0,0 +1,219 @@ +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxe-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxe-paramiko-no_strip_prompt] new file mode 100644 index 00000000..f8793bc5 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-paramiko-no_strip_prompt] @@ -0,0 +1,221 @@ +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxe-paramiko-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxe-paramiko-strip_prompt] new file mode 100644 index 00000000..f6e9bd2c --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-paramiko-strip_prompt] @@ -0,0 +1,219 @@ +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxe-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxe-ssh2-no_strip_prompt] new file mode 100644 index 00000000..f8793bc5 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-ssh2-no_strip_prompt] @@ -0,0 +1,221 @@ +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxe-ssh2-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxe-ssh2-strip_prompt] new file mode 100644 index 00000000..f6e9bd2c --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-ssh2-strip_prompt] @@ -0,0 +1,219 @@ +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxe-system-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxe-system-no_strip_prompt] new file mode 100644 index 00000000..f8793bc5 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-system-no_strip_prompt] @@ -0,0 +1,221 @@ +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxe-system-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxe-system-strip_prompt] new file mode 100644 index 00000000..f6e9bd2c --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-system-strip_prompt] @@ -0,0 +1,219 @@ +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxe-telnet-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxe-telnet-no_strip_prompt] new file mode 100644 index 00000000..f8793bc5 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-telnet-no_strip_prompt] @@ -0,0 +1,221 @@ +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxe-telnet-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxe-telnet-strip_prompt] new file mode 100644 index 00000000..f6e9bd2c --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxe-telnet-strip_prompt] @@ -0,0 +1,219 @@ +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..56efe6d8 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-asyncssh-no_strip_prompt] @@ -0,0 +1,89 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-asyncssh-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-asyncssh-strip_prompt] new file mode 100644 index 00000000..e4528e5e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-asyncssh-strip_prompt] @@ -0,0 +1,87 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..56efe6d8 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-asynctelnet-no_strip_prompt] @@ -0,0 +1,89 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-asynctelnet-strip_prompt] new file mode 100644 index 00000000..e4528e5e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-asynctelnet-strip_prompt] @@ -0,0 +1,87 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-paramiko-no_strip_prompt] new file mode 100644 index 00000000..56efe6d8 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-paramiko-no_strip_prompt] @@ -0,0 +1,89 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-paramiko-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-paramiko-strip_prompt] new file mode 100644 index 00000000..e4528e5e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-paramiko-strip_prompt] @@ -0,0 +1,87 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-ssh2-no_strip_prompt] new file mode 100644 index 00000000..56efe6d8 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-ssh2-no_strip_prompt] @@ -0,0 +1,89 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-ssh2-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-ssh2-strip_prompt] new file mode 100644 index 00000000..e4528e5e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-ssh2-strip_prompt] @@ -0,0 +1,87 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-system-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-system-no_strip_prompt] new file mode 100644 index 00000000..56efe6d8 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-system-no_strip_prompt] @@ -0,0 +1,89 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-system-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-system-strip_prompt] new file mode 100644 index 00000000..e4528e5e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-system-strip_prompt] @@ -0,0 +1,87 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-telnet-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-telnet-no_strip_prompt] new file mode 100644 index 00000000..56efe6d8 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-telnet-no_strip_prompt] @@ -0,0 +1,89 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_iosxr-telnet-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_iosxr-telnet-strip_prompt] new file mode 100644 index 00000000..e4528e5e --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_iosxr-telnet-strip_prompt] @@ -0,0 +1,87 @@ +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/test_data/expected/cisco_nxos/send_command_long_no_strip b/tests/functional/expected/test_send_command_long[cisco_nxos-asyncssh-no_strip_prompt] similarity index 98% rename from tests/test_data/expected/cisco_nxos/send_command_long_no_strip rename to tests/functional/expected/test_send_command_long[cisco_nxos-asyncssh-no_strip_prompt] index 243d5bd0..2769fd07 100644 --- a/tests/test_data/expected/cisco_nxos/send_command_long_no_strip +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-asyncssh-no_strip_prompt] @@ -3,7 +3,8 @@ !Time: TIME_STAMP_REPLACED version 9.2(4) Bios:version -vdc switch id 1 +hostname vr-n9kv +vdc vr-n9kv id 1 limit-resource vlan minimum N maximum N limit-resource vrf minimum N maximum N limit-resource port-channel minimum N maximum N @@ -11,9 +12,12 @@ vdc switch id 1 limit-resource u6route-mem minimum N maximum N limit-resource m4route-mem minimum N maximum N limit-resource m6route-mem minimum N maximum N + feature telnet feature nxapi feature scp-server +feature netconf +feature grpc no password strength-check CRYPTO_REPLACED @@ -298,4 +302,4 @@ boot nxos bootflash:/nxos.9.2.4.bin -switch# \ No newline at end of file +vr-n9kv# \ No newline at end of file diff --git a/tests/test_data/expected/cisco_nxos/send_command_long_strip b/tests/functional/expected/test_send_command_long[cisco_nxos-asyncssh-strip_prompt] similarity index 98% rename from tests/test_data/expected/cisco_nxos/send_command_long_strip rename to tests/functional/expected/test_send_command_long[cisco_nxos-asyncssh-strip_prompt] index 28b92427..8239b64c 100644 --- a/tests/test_data/expected/cisco_nxos/send_command_long_strip +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-asyncssh-strip_prompt] @@ -3,7 +3,8 @@ !Time: TIME_STAMP_REPLACED version 9.2(4) Bios:version -vdc switch id 1 +hostname vr-n9kv +vdc vr-n9kv id 1 limit-resource vlan minimum N maximum N limit-resource vrf minimum N maximum N limit-resource port-channel minimum N maximum N @@ -11,9 +12,12 @@ vdc switch id 1 limit-resource u6route-mem minimum N maximum N limit-resource m4route-mem minimum N maximum N limit-resource m6route-mem minimum N maximum N + feature telnet feature nxapi feature scp-server +feature netconf +feature grpc no password strength-check CRYPTO_REPLACED diff --git a/tests/functional/expected/test_send_command_long[cisco_nxos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_nxos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..2769fd07 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-asynctelnet-no_strip_prompt] @@ -0,0 +1,305 @@ +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin + + + +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_nxos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_nxos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..8239b64c --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-asynctelnet-strip_prompt] @@ -0,0 +1,301 @@ +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_nxos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_nxos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..2769fd07 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-paramiko-no_strip_prompt] @@ -0,0 +1,305 @@ +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin + + + +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_nxos-paramiko-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_nxos-paramiko-strip_prompt] new file mode 100644 index 00000000..8239b64c --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-paramiko-strip_prompt] @@ -0,0 +1,301 @@ +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_nxos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_nxos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..2769fd07 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-ssh2-no_strip_prompt] @@ -0,0 +1,305 @@ +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin + + + +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_nxos-ssh2-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_nxos-ssh2-strip_prompt] new file mode 100644 index 00000000..8239b64c --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-ssh2-strip_prompt] @@ -0,0 +1,301 @@ +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_nxos-system-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_nxos-system-no_strip_prompt] new file mode 100644 index 00000000..2769fd07 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-system-no_strip_prompt] @@ -0,0 +1,305 @@ +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin + + + +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_nxos-system-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_nxos-system-strip_prompt] new file mode 100644 index 00000000..8239b64c --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-system-strip_prompt] @@ -0,0 +1,301 @@ +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_nxos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_nxos-telnet-no_strip_prompt] new file mode 100644 index 00000000..2769fd07 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-telnet-no_strip_prompt] @@ -0,0 +1,305 @@ +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin + + + +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[cisco_nxos-telnet-strip_prompt] b/tests/functional/expected/test_send_command_long[cisco_nxos-telnet-strip_prompt] new file mode 100644 index 00000000..8239b64c --- /dev/null +++ b/tests/functional/expected/test_send_command_long[cisco_nxos-telnet-strip_prompt] @@ -0,0 +1,301 @@ +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[juniper_junos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_command_long[juniper_junos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..25e9de06 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[juniper_junos-asyncssh-no_strip_prompt] @@ -0,0 +1,123 @@ +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/test_data/expected/juniper_junos/send_command_long_strip b/tests/functional/expected/test_send_command_long[juniper_junos-asyncssh-strip_prompt] similarity index 92% rename from tests/test_data/expected/juniper_junos/send_command_long_strip rename to tests/functional/expected/test_send_command_long[juniper_junos-asyncssh-strip_prompt] index 7173dde4..81fec2bb 100644 --- a/tests/test_data/expected/juniper_junos/send_command_long_strip +++ b/tests/functional/expected/test_send_command_long[juniper_junos-asyncssh-strip_prompt] @@ -1,10 +1,18 @@ TIME_STAMP_REPLACED version 17.3R2.10; system { + host-name vr-vqfx; root-authentication { CRYPTO_REPLACED } login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } user boxen { uid 2000; class super-user; @@ -14,12 +22,11 @@ CRYPTO_REPLACED } } services { - ssh { - protocol-version v2; - } + ssh; telnet; netconf { ssh; + rfc-compliant; } web-management { http { diff --git a/tests/functional/expected/test_send_command_long[juniper_junos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_command_long[juniper_junos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..25e9de06 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[juniper_junos-asynctelnet-no_strip_prompt] @@ -0,0 +1,123 @@ +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/test_data/expected/juniper_junos/send_command_long_no_strip b/tests/functional/expected/test_send_command_long[juniper_junos-asynctelnet-strip_prompt] similarity index 92% rename from tests/test_data/expected/juniper_junos/send_command_long_no_strip rename to tests/functional/expected/test_send_command_long[juniper_junos-asynctelnet-strip_prompt] index 1ec26a9a..81fec2bb 100644 --- a/tests/test_data/expected/juniper_junos/send_command_long_no_strip +++ b/tests/functional/expected/test_send_command_long[juniper_junos-asynctelnet-strip_prompt] @@ -1,10 +1,18 @@ TIME_STAMP_REPLACED version 17.3R2.10; system { + host-name vr-vqfx; root-authentication { CRYPTO_REPLACED } login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } user boxen { uid 2000; class super-user; @@ -14,12 +22,11 @@ CRYPTO_REPLACED } } services { - ssh { - protocol-version v2; - } + ssh; telnet; netconf { ssh; + rfc-compliant; } web-management { http { @@ -111,6 +118,4 @@ interfaces { } } } -} - -boxen> \ No newline at end of file +} \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[juniper_junos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_command_long[juniper_junos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..25e9de06 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[juniper_junos-paramiko-no_strip_prompt] @@ -0,0 +1,123 @@ +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[juniper_junos-paramiko-strip_prompt] b/tests/functional/expected/test_send_command_long[juniper_junos-paramiko-strip_prompt] new file mode 100644 index 00000000..81fec2bb --- /dev/null +++ b/tests/functional/expected/test_send_command_long[juniper_junos-paramiko-strip_prompt] @@ -0,0 +1,121 @@ +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[juniper_junos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_command_long[juniper_junos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..25e9de06 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[juniper_junos-ssh2-no_strip_prompt] @@ -0,0 +1,123 @@ +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[juniper_junos-ssh2-strip_prompt] b/tests/functional/expected/test_send_command_long[juniper_junos-ssh2-strip_prompt] new file mode 100644 index 00000000..81fec2bb --- /dev/null +++ b/tests/functional/expected/test_send_command_long[juniper_junos-ssh2-strip_prompt] @@ -0,0 +1,121 @@ +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[juniper_junos-system-no_strip_prompt] b/tests/functional/expected/test_send_command_long[juniper_junos-system-no_strip_prompt] new file mode 100644 index 00000000..25e9de06 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[juniper_junos-system-no_strip_prompt] @@ -0,0 +1,123 @@ +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[juniper_junos-system-strip_prompt] b/tests/functional/expected/test_send_command_long[juniper_junos-system-strip_prompt] new file mode 100644 index 00000000..81fec2bb --- /dev/null +++ b/tests/functional/expected/test_send_command_long[juniper_junos-system-strip_prompt] @@ -0,0 +1,121 @@ +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[juniper_junos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_command_long[juniper_junos-telnet-no_strip_prompt] new file mode 100644 index 00000000..25e9de06 --- /dev/null +++ b/tests/functional/expected/test_send_command_long[juniper_junos-telnet-no_strip_prompt] @@ -0,0 +1,123 @@ +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_long[juniper_junos-telnet-strip_prompt] b/tests/functional/expected/test_send_command_long[juniper_junos-telnet-strip_prompt] new file mode 100644 index 00000000..81fec2bb --- /dev/null +++ b/tests/functional/expected/test_send_command_long[juniper_junos-telnet-strip_prompt] @@ -0,0 +1,121 @@ +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[arista_eos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_send_command_short[arista_eos-asyncssh-no_strip_prompt] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[arista_eos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-asyncssh-strip_prompt] new file mode 100644 index 00000000..e69de29b diff --git a/tests/functional/expected/test_send_command_short[arista_eos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_send_command_short[arista_eos-asynctelnet-no_strip_prompt] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[arista_eos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..e69de29b diff --git a/tests/functional/expected/test_send_command_short[arista_eos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_send_command_short[arista_eos-paramiko-no_strip_prompt] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[arista_eos-paramiko-strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-paramiko-strip_prompt] new file mode 100644 index 00000000..e69de29b diff --git a/tests/functional/expected/test_send_command_short[arista_eos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_send_command_short[arista_eos-ssh2-no_strip_prompt] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[arista_eos-ssh2-strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-ssh2-strip_prompt] new file mode 100644 index 00000000..e69de29b diff --git a/tests/functional/expected/test_send_command_short[arista_eos-system-no_strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-system-no_strip_prompt] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_send_command_short[arista_eos-system-no_strip_prompt] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[arista_eos-system-strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-system-strip_prompt] new file mode 100644 index 00000000..e69de29b diff --git a/tests/functional/expected/test_send_command_short[arista_eos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-telnet-no_strip_prompt] new file mode 100644 index 00000000..7916fdef --- /dev/null +++ b/tests/functional/expected/test_send_command_short[arista_eos-telnet-no_strip_prompt] @@ -0,0 +1 @@ +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[arista_eos-telnet-strip_prompt] b/tests/functional/expected/test_send_command_short[arista_eos-telnet-strip_prompt] new file mode 100644 index 00000000..e69de29b diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..e5a35012 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-asyncssh-no_strip_prompt] @@ -0,0 +1,2 @@ +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-asyncssh-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-asyncssh-strip_prompt] new file mode 100644 index 00000000..f11095e5 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-asyncssh-strip_prompt] @@ -0,0 +1 @@ +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..e5a35012 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-asynctelnet-no_strip_prompt] @@ -0,0 +1,2 @@ +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-asynctelnet-strip_prompt] new file mode 100644 index 00000000..f11095e5 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-asynctelnet-strip_prompt] @@ -0,0 +1 @@ +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-paramiko-no_strip_prompt] new file mode 100644 index 00000000..e5a35012 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-paramiko-no_strip_prompt] @@ -0,0 +1,2 @@ +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-paramiko-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-paramiko-strip_prompt] new file mode 100644 index 00000000..f11095e5 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-paramiko-strip_prompt] @@ -0,0 +1 @@ +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-ssh2-no_strip_prompt] new file mode 100644 index 00000000..e5a35012 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-ssh2-no_strip_prompt] @@ -0,0 +1,2 @@ +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-ssh2-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-ssh2-strip_prompt] new file mode 100644 index 00000000..f11095e5 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-ssh2-strip_prompt] @@ -0,0 +1 @@ +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-system-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-system-no_strip_prompt] new file mode 100644 index 00000000..e5a35012 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-system-no_strip_prompt] @@ -0,0 +1,2 @@ +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-system-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-system-strip_prompt] new file mode 100644 index 00000000..f11095e5 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-system-strip_prompt] @@ -0,0 +1 @@ +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-telnet-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-telnet-no_strip_prompt] new file mode 100644 index 00000000..e5a35012 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-telnet-no_strip_prompt] @@ -0,0 +1,2 @@ +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxe-telnet-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxe-telnet-strip_prompt] new file mode 100644 index 00000000..f11095e5 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxe-telnet-strip_prompt] @@ -0,0 +1 @@ +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..598ffbf2 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-asyncssh-no_strip_prompt] @@ -0,0 +1,4 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-asyncssh-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-asyncssh-strip_prompt] new file mode 100644 index 00000000..ae90c0c7 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-asyncssh-strip_prompt] @@ -0,0 +1,3 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..598ffbf2 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-asynctelnet-no_strip_prompt] @@ -0,0 +1,4 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-asynctelnet-strip_prompt] new file mode 100644 index 00000000..ae90c0c7 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-asynctelnet-strip_prompt] @@ -0,0 +1,3 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-paramiko-no_strip_prompt] new file mode 100644 index 00000000..598ffbf2 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-paramiko-no_strip_prompt] @@ -0,0 +1,4 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-paramiko-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-paramiko-strip_prompt] new file mode 100644 index 00000000..ae90c0c7 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-paramiko-strip_prompt] @@ -0,0 +1,3 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-ssh2-no_strip_prompt] new file mode 100644 index 00000000..598ffbf2 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-ssh2-no_strip_prompt] @@ -0,0 +1,4 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-ssh2-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-ssh2-strip_prompt] new file mode 100644 index 00000000..ae90c0c7 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-ssh2-strip_prompt] @@ -0,0 +1,3 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-system-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-system-no_strip_prompt] new file mode 100644 index 00000000..598ffbf2 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-system-no_strip_prompt] @@ -0,0 +1,4 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-system-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-system-strip_prompt] new file mode 100644 index 00000000..ae90c0c7 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-system-strip_prompt] @@ -0,0 +1,3 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-telnet-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-telnet-no_strip_prompt] new file mode 100644 index 00000000..598ffbf2 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-telnet-no_strip_prompt] @@ -0,0 +1,4 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_iosxr-telnet-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_iosxr-telnet-strip_prompt] new file mode 100644 index 00000000..ae90c0c7 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_iosxr-telnet-strip_prompt] @@ -0,0 +1,3 @@ +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..e0ecba60 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-asyncssh-no_strip_prompt] @@ -0,0 +1,2 @@ +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-asyncssh-strip_prompt] new file mode 100644 index 00000000..1f241a7d --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-asyncssh-strip_prompt] @@ -0,0 +1 @@ +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..e0ecba60 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-asynctelnet-no_strip_prompt] @@ -0,0 +1,2 @@ +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..1f241a7d --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-asynctelnet-strip_prompt] @@ -0,0 +1 @@ +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..e0ecba60 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-paramiko-no_strip_prompt] @@ -0,0 +1,2 @@ +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-paramiko-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-paramiko-strip_prompt] new file mode 100644 index 00000000..1f241a7d --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-paramiko-strip_prompt] @@ -0,0 +1 @@ +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..e0ecba60 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-ssh2-no_strip_prompt] @@ -0,0 +1,2 @@ +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-ssh2-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-ssh2-strip_prompt] new file mode 100644 index 00000000..1f241a7d --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-ssh2-strip_prompt] @@ -0,0 +1 @@ +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-system-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-system-no_strip_prompt] new file mode 100644 index 00000000..e0ecba60 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-system-no_strip_prompt] @@ -0,0 +1,2 @@ +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-system-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-system-strip_prompt] new file mode 100644 index 00000000..1f241a7d --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-system-strip_prompt] @@ -0,0 +1 @@ +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-telnet-no_strip_prompt] new file mode 100644 index 00000000..e0ecba60 --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-telnet-no_strip_prompt] @@ -0,0 +1,2 @@ +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[cisco_nxos-telnet-strip_prompt] b/tests/functional/expected/test_send_command_short[cisco_nxos-telnet-strip_prompt] new file mode 100644 index 00000000..1f241a7d --- /dev/null +++ b/tests/functional/expected/test_send_command_short[cisco_nxos-telnet-strip_prompt] @@ -0,0 +1 @@ +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..72b874cd --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-asyncssh-no_strip_prompt] @@ -0,0 +1,3 @@ + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-asyncssh-strip_prompt] new file mode 100644 index 00000000..7d9466df --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-asyncssh-strip_prompt] @@ -0,0 +1 @@ + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..72b874cd --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-asynctelnet-no_strip_prompt] @@ -0,0 +1,3 @@ + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..7d9466df --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-asynctelnet-strip_prompt] @@ -0,0 +1 @@ + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..72b874cd --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-paramiko-no_strip_prompt] @@ -0,0 +1,3 @@ + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-paramiko-strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-paramiko-strip_prompt] new file mode 100644 index 00000000..7d9466df --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-paramiko-strip_prompt] @@ -0,0 +1 @@ + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..72b874cd --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-ssh2-no_strip_prompt] @@ -0,0 +1,3 @@ + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-ssh2-strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-ssh2-strip_prompt] new file mode 100644 index 00000000..7d9466df --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-ssh2-strip_prompt] @@ -0,0 +1 @@ + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-system-no_strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-system-no_strip_prompt] new file mode 100644 index 00000000..72b874cd --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-system-no_strip_prompt] @@ -0,0 +1,3 @@ + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-system-strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-system-strip_prompt] new file mode 100644 index 00000000..7d9466df --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-system-strip_prompt] @@ -0,0 +1 @@ + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-telnet-no_strip_prompt] new file mode 100644 index 00000000..72b874cd --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-telnet-no_strip_prompt] @@ -0,0 +1,3 @@ + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_command_short[juniper_junos-telnet-strip_prompt] b/tests/functional/expected/test_send_command_short[juniper_junos-telnet-strip_prompt] new file mode 100644 index 00000000..7d9466df --- /dev/null +++ b/tests/functional/expected/test_send_command_short[juniper_junos-telnet-strip_prompt] @@ -0,0 +1 @@ + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..504930d9 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-asyncssh-no_strip_prompt] @@ -0,0 +1,44 @@ +show run | i ZTP +ceos#show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-asyncssh-strip_prompt] new file mode 100644 index 00000000..83a9cb90 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-asyncssh-strip_prompt] @@ -0,0 +1,43 @@ +show run | i ZTP +show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..504930d9 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-asynctelnet-no_strip_prompt] @@ -0,0 +1,44 @@ +show run | i ZTP +ceos#show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..83a9cb90 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-asynctelnet-strip_prompt] @@ -0,0 +1,43 @@ +show run | i ZTP +show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..504930d9 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-paramiko-no_strip_prompt] @@ -0,0 +1,44 @@ +show run | i ZTP +ceos#show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-paramiko-strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-paramiko-strip_prompt] new file mode 100644 index 00000000..83a9cb90 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-paramiko-strip_prompt] @@ -0,0 +1,43 @@ +show run | i ZTP +show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..504930d9 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-ssh2-no_strip_prompt] @@ -0,0 +1,44 @@ +show run | i ZTP +ceos#show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-ssh2-strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-ssh2-strip_prompt] new file mode 100644 index 00000000..83a9cb90 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-ssh2-strip_prompt] @@ -0,0 +1,43 @@ +show run | i ZTP +show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-system-no_strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-system-no_strip_prompt] new file mode 100644 index 00000000..504930d9 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-system-no_strip_prompt] @@ -0,0 +1,44 @@ +show run | i ZTP +ceos#show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-system-strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-system-strip_prompt] new file mode 100644 index 00000000..83a9cb90 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-system-strip_prompt] @@ -0,0 +1,43 @@ +show run | i ZTP +show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-telnet-no_strip_prompt] new file mode 100644 index 00000000..504930d9 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-telnet-no_strip_prompt] @@ -0,0 +1,44 @@ +show run | i ZTP +ceos#show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[arista_eos-telnet-strip_prompt] b/tests/functional/expected/test_send_commands[arista_eos-telnet-strip_prompt] new file mode 100644 index 00000000..83a9cb90 --- /dev/null +++ b/tests/functional/expected/test_send_commands[arista_eos-telnet-strip_prompt] @@ -0,0 +1,43 @@ +show run | i ZTP +show run +! Command: show running-config +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) +! +no aaa root +! +username admin privilege 15 role network-admin CRYPTO_REPLACED +! +transceiver qsfp default-mode 4x10G +! +service routing protocols model multi-agent +! +hostname ceos +! +spanning-tree mode mstp +! +management api http-commands + no shutdown +! +management api gnmi + transport grpc default +! +management api netconf + transport ssh default +! +interface Ethernet1 + description tacocat +! +interface Ethernet2 +! +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 +! +ip routing +! +ip route 0.0.0.0/0 172.20.20.1 +! +management telnet + no shutdown +! +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..9151bc38 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-asyncssh-no_strip_prompt] @@ -0,0 +1,224 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-asyncssh-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-asyncssh-strip_prompt] new file mode 100644 index 00000000..ecd513ee --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-asyncssh-strip_prompt] @@ -0,0 +1,221 @@ +show run | i hostname +hostname vr-csrshow run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..9151bc38 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-asynctelnet-no_strip_prompt] @@ -0,0 +1,224 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-asynctelnet-strip_prompt] new file mode 100644 index 00000000..ecd513ee --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-asynctelnet-strip_prompt] @@ -0,0 +1,221 @@ +show run | i hostname +hostname vr-csrshow run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-paramiko-no_strip_prompt] new file mode 100644 index 00000000..9151bc38 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-paramiko-no_strip_prompt] @@ -0,0 +1,224 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-paramiko-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-paramiko-strip_prompt] new file mode 100644 index 00000000..ecd513ee --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-paramiko-strip_prompt] @@ -0,0 +1,221 @@ +show run | i hostname +hostname vr-csrshow run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-ssh2-no_strip_prompt] new file mode 100644 index 00000000..9151bc38 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-ssh2-no_strip_prompt] @@ -0,0 +1,224 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-ssh2-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-ssh2-strip_prompt] new file mode 100644 index 00000000..ecd513ee --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-ssh2-strip_prompt] @@ -0,0 +1,221 @@ +show run | i hostname +hostname vr-csrshow run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-system-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-system-no_strip_prompt] new file mode 100644 index 00000000..9151bc38 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-system-no_strip_prompt] @@ -0,0 +1,224 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-system-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-system-strip_prompt] new file mode 100644 index 00000000..ecd513ee --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-system-strip_prompt] @@ -0,0 +1,221 @@ +show run | i hostname +hostname vr-csrshow run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-telnet-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-telnet-no_strip_prompt] new file mode 100644 index 00000000..9151bc38 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-telnet-no_strip_prompt] @@ -0,0 +1,224 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxe-telnet-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxe-telnet-strip_prompt] new file mode 100644 index 00000000..ecd513ee --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxe-telnet-strip_prompt] @@ -0,0 +1,221 @@ +show run | i hostname +hostname vr-csrshow run +Building configuration... + +Current configuration : CONFIG_BYTES +! +! Last configuration change at TIME_STAMP_REPLACED +! +version 16.12 +service timestamps debug datetime msec +service timestamps log datetime msec +service call-home +platform qfp utilization monitor load 80 +platform punt-keepalive disable-kernel-core +platform console serial +! +hostname vr-csr +! +boot-start-marker +boot-end-marker +! +! +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc +! +no aaa new-model +call-home + ! If contact email address in call-home is configured as sch-smart-licensing@cisco.com + ! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications. + contact-email-addr sch-smart-licensing@cisco.com + profile "CiscoTAC-1" + active + destination transport-method http + no destination transport-method email +! +! +! +! +! +! +! +ip domain name boxen.box +! +! +! +login on-success log +! +! +! +! +! +! +! +subscriber templating +! +! +! +! +! +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +CERTIFICATES AND LICENSE +diagnostic bootup level minimal +memory free low-watermark processor 72329 +! +! +spanning-tree extend system-id +! +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface GigabitEthernet1 + ip address 10.0.0.15 255.255.255.0 + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet2 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet4 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet5 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet6 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet7 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet8 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet9 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +interface GigabitEthernet10 + no ip address + shutdown + negotiation auto + no mop enabled + no mop sysid +! +ip forward-protocol nd +no ip http server +ip http secure-server +! +ip ssh pubkey-chain + username admin + key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F +ip scp server enable +! +! +! +! +! +! +! +control-plane +! +! +! +! +! +! +line con 0 + stopbits 1 +line vty 0 + login local + transport input all +line vty 1 + login local + length 0 + transport input all +line vty 2 4 + login local + transport input all +! +! +! +! +! +! +netconf-yang +restconf +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..38ecf917 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-asyncssh-no_strip_prompt] @@ -0,0 +1,94 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-asyncssh-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-asyncssh-strip_prompt] new file mode 100644 index 00000000..e8d27221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-asyncssh-strip_prompt] @@ -0,0 +1,91 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..38ecf917 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-asynctelnet-no_strip_prompt] @@ -0,0 +1,94 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-asynctelnet-strip_prompt] new file mode 100644 index 00000000..e8d27221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-asynctelnet-strip_prompt] @@ -0,0 +1,91 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-paramiko-no_strip_prompt] new file mode 100644 index 00000000..38ecf917 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-paramiko-no_strip_prompt] @@ -0,0 +1,94 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-paramiko-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-paramiko-strip_prompt] new file mode 100644 index 00000000..e8d27221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-paramiko-strip_prompt] @@ -0,0 +1,91 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-ssh2-no_strip_prompt] new file mode 100644 index 00000000..38ecf917 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-ssh2-no_strip_prompt] @@ -0,0 +1,94 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-ssh2-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-ssh2-strip_prompt] new file mode 100644 index 00000000..e8d27221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-ssh2-strip_prompt] @@ -0,0 +1,91 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-system-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-system-no_strip_prompt] new file mode 100644 index 00000000..38ecf917 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-system-no_strip_prompt] @@ -0,0 +1,94 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-system-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-system-strip_prompt] new file mode 100644 index 00000000..e8d27221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-system-strip_prompt] @@ -0,0 +1,91 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-telnet-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-telnet-no_strip_prompt] new file mode 100644 index 00000000..38ecf917 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-telnet-no_strip_prompt] @@ -0,0 +1,94 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end + +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_iosxr-telnet-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_iosxr-telnet-strip_prompt] new file mode 100644 index 00000000..e8d27221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_iosxr-telnet-strip_prompt] @@ -0,0 +1,91 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run +TIME_STAMP_REPLACED +Building configuration... +!! IOS XR Configuration version = 6.5.3 +!! Last configuration change at TIME_STAMP_REPLACED +! +hostname vr-xrv9k +telnet vrf default ipv4 server max-servers 10 +username boxen + group root-lr + group cisco-support +CRYPTO_REPLACED +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + ipv4 address 10.0.0.15 255.255.255.0 +! +interface GigabitEthernet0/0/0/0 + shutdown +! +interface GigabitEthernet0/0/0/1 + shutdown +! +interface GigabitEthernet0/0/0/2 + shutdown +! +interface GigabitEthernet0/0/0/3 + shutdown +! +interface GigabitEthernet0/0/0/4 + shutdown +! +interface GigabitEthernet0/0/0/5 + shutdown +! +interface GigabitEthernet0/0/0/6 + shutdown +! +interface GigabitEthernet0/0/0/7 + shutdown +! +interface GigabitEthernet0/0/0/8 + shutdown +! +interface GigabitEthernet0/0/0/9 + shutdown +! +interface GigabitEthernet0/0/0/10 + shutdown +! +interface GigabitEthernet0/0/0/11 + shutdown +! +interface GigabitEthernet0/0/0/12 + shutdown +! +interface GigabitEthernet0/0/0/13 + shutdown +! +interface GigabitEthernet0/0/0/14 + shutdown +! +interface GigabitEthernet0/0/0/15 + shutdown +! +grpc + port 57400 + no-tls +! +netconf-yang agent + ssh +! +ssh server rate-limit 600 +ssh server v2 +ssh server netconf vrf default +end \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..d6f52b99 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-asyncssh-no_strip_prompt] @@ -0,0 +1,308 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin + + + +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-asyncssh-strip_prompt] new file mode 100644 index 00000000..974ce221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-asyncssh-strip_prompt] @@ -0,0 +1,303 @@ +show run | i scp-server +feature scp-servershow run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..d6f52b99 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-asynctelnet-no_strip_prompt] @@ -0,0 +1,308 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin + + + +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..974ce221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-asynctelnet-strip_prompt] @@ -0,0 +1,303 @@ +show run | i scp-server +feature scp-servershow run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..d6f52b99 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-paramiko-no_strip_prompt] @@ -0,0 +1,308 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin + + + +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-paramiko-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-paramiko-strip_prompt] new file mode 100644 index 00000000..974ce221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-paramiko-strip_prompt] @@ -0,0 +1,303 @@ +show run | i scp-server +feature scp-servershow run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..d6f52b99 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-ssh2-no_strip_prompt] @@ -0,0 +1,308 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin + + + +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-ssh2-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-ssh2-strip_prompt] new file mode 100644 index 00000000..974ce221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-ssh2-strip_prompt] @@ -0,0 +1,303 @@ +show run | i scp-server +feature scp-servershow run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-system-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-system-no_strip_prompt] new file mode 100644 index 00000000..d6f52b99 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-system-no_strip_prompt] @@ -0,0 +1,308 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin + + + +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-system-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-system-strip_prompt] new file mode 100644 index 00000000..974ce221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-system-strip_prompt] @@ -0,0 +1,303 @@ +show run | i scp-server +feature scp-servershow run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-telnet-no_strip_prompt] new file mode 100644 index 00000000..d6f52b99 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-telnet-no_strip_prompt] @@ -0,0 +1,308 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin + + + +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[cisco_nxos-telnet-strip_prompt] b/tests/functional/expected/test_send_commands[cisco_nxos-telnet-strip_prompt] new file mode 100644 index 00000000..974ce221 --- /dev/null +++ b/tests/functional/expected/test_send_commands[cisco_nxos-telnet-strip_prompt] @@ -0,0 +1,303 @@ +show run | i scp-server +feature scp-servershow run +!Command: show running-config +!Running configuration last done at: TIME_STAMP_REPLACED +!Time: TIME_STAMP_REPLACED + +version 9.2(4) Bios:version +hostname vr-n9kv +vdc vr-n9kv id 1 + limit-resource vlan minimum N maximum N + limit-resource vrf minimum N maximum N + limit-resource port-channel minimum N maximum N + limit-resource u4route-mem minimum N maximum N + limit-resource u6route-mem minimum N maximum N + limit-resource m4route-mem minimum N maximum N + limit-resource m6route-mem minimum N maximum N + +feature telnet +feature nxapi +feature scp-server +feature netconf +feature grpc + +no password strength-check +CRYPTO_REPLACED +CRYPTO_REPLACED +username boxen passphrase lifetime 99999 warntime 14 gracetime 3 +ip domain-lookup +copp profile strict +CRYPTO_REPLACED +CRYPTO_REPLACED +rmon event 1 description FATAL(1) owner PMON@FATAL +rmon event 2 description CRITICAL(2) owner PMON@CRITICAL +rmon event 3 description ERROR(3) owner PMON@ERROR +rmon event 4 description WARNING(4) owner PMON@WARNING +CRYPTO_REPLACED + +vlan 1 + +vrf context management + +interface Ethernet1/1 + +interface Ethernet1/2 + +interface Ethernet1/3 + +interface Ethernet1/4 + +interface Ethernet1/5 + +interface Ethernet1/6 + +interface Ethernet1/7 + +interface Ethernet1/8 + +interface Ethernet1/9 + +interface Ethernet1/10 + +interface Ethernet1/11 + +interface Ethernet1/12 + +interface Ethernet1/13 + +interface Ethernet1/14 + +interface Ethernet1/15 + +interface Ethernet1/16 + +interface Ethernet1/17 + +interface Ethernet1/18 + +interface Ethernet1/19 + +interface Ethernet1/20 + +interface Ethernet1/21 + +interface Ethernet1/22 + +interface Ethernet1/23 + +interface Ethernet1/24 + +interface Ethernet1/25 + +interface Ethernet1/26 + +interface Ethernet1/27 + +interface Ethernet1/28 + +interface Ethernet1/29 + +interface Ethernet1/30 + +interface Ethernet1/31 + +interface Ethernet1/32 + +interface Ethernet1/33 + +interface Ethernet1/34 + +interface Ethernet1/35 + +interface Ethernet1/36 + +interface Ethernet1/37 + +interface Ethernet1/38 + +interface Ethernet1/39 + +interface Ethernet1/40 + +interface Ethernet1/41 + +interface Ethernet1/42 + +interface Ethernet1/43 + +interface Ethernet1/44 + +interface Ethernet1/45 + +interface Ethernet1/46 + +interface Ethernet1/47 + +interface Ethernet1/48 + +interface Ethernet1/49 + +interface Ethernet1/50 + +interface Ethernet1/51 + +interface Ethernet1/52 + +interface Ethernet1/53 + +interface Ethernet1/54 + +interface Ethernet1/55 + +interface Ethernet1/56 + +interface Ethernet1/57 + +interface Ethernet1/58 + +interface Ethernet1/59 + +interface Ethernet1/60 + +interface Ethernet1/61 + +interface Ethernet1/62 + +interface Ethernet1/63 + +interface Ethernet1/64 + +interface Ethernet1/65 + +interface Ethernet1/66 + +interface Ethernet1/67 + +interface Ethernet1/68 + +interface Ethernet1/69 + +interface Ethernet1/70 + +interface Ethernet1/71 + +interface Ethernet1/72 + +interface Ethernet1/73 + +interface Ethernet1/74 + +interface Ethernet1/75 + +interface Ethernet1/76 + +interface Ethernet1/77 + +interface Ethernet1/78 + +interface Ethernet1/79 + +interface Ethernet1/80 + +interface Ethernet1/81 + +interface Ethernet1/82 + +interface Ethernet1/83 + +interface Ethernet1/84 + +interface Ethernet1/85 + +interface Ethernet1/86 + +interface Ethernet1/87 + +interface Ethernet1/88 + +interface Ethernet1/89 + +interface Ethernet1/90 + +interface Ethernet1/91 + +interface Ethernet1/92 + +interface Ethernet1/93 + +interface Ethernet1/94 + +interface Ethernet1/95 + +interface Ethernet1/96 + +interface Ethernet1/97 + +interface Ethernet1/98 + +interface Ethernet1/99 + +interface Ethernet1/100 + +interface Ethernet1/101 + +interface Ethernet1/102 + +interface Ethernet1/103 + +interface Ethernet1/104 + +interface Ethernet1/105 + +interface Ethernet1/106 + +interface Ethernet1/107 + +interface Ethernet1/108 + +interface Ethernet1/109 + +interface Ethernet1/110 + +interface Ethernet1/111 + +interface Ethernet1/112 + +interface Ethernet1/113 + +interface Ethernet1/114 + +interface Ethernet1/115 + +interface Ethernet1/116 + +interface Ethernet1/117 + +interface Ethernet1/118 + +interface Ethernet1/119 + +interface Ethernet1/120 + +interface Ethernet1/121 + +interface Ethernet1/122 + +interface Ethernet1/123 + +interface Ethernet1/124 + +interface Ethernet1/125 + +interface Ethernet1/126 + +interface Ethernet1/127 + +interface Ethernet1/128 + +interface mgmt0 + vrf member management + ip address 10.0.0.15/24 +line console +line vty +boot nxos bootflash:/nxos.9.2.4.bin \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..18903b1e --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-asyncssh-no_strip_prompt] @@ -0,0 +1,127 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-asyncssh-strip_prompt] new file mode 100644 index 00000000..42db9276 --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-asyncssh-strip_prompt] @@ -0,0 +1,123 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..18903b1e --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-asynctelnet-no_strip_prompt] @@ -0,0 +1,127 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..42db9276 --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-asynctelnet-strip_prompt] @@ -0,0 +1,123 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..18903b1e --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-paramiko-no_strip_prompt] @@ -0,0 +1,127 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-paramiko-strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-paramiko-strip_prompt] new file mode 100644 index 00000000..42db9276 --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-paramiko-strip_prompt] @@ -0,0 +1,123 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..18903b1e --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-ssh2-no_strip_prompt] @@ -0,0 +1,127 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-ssh2-strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-ssh2-strip_prompt] new file mode 100644 index 00000000..42db9276 --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-ssh2-strip_prompt] @@ -0,0 +1,123 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-system-no_strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-system-no_strip_prompt] new file mode 100644 index 00000000..18903b1e --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-system-no_strip_prompt] @@ -0,0 +1,127 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-system-strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-system-strip_prompt] new file mode 100644 index 00000000..42db9276 --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-system-strip_prompt] @@ -0,0 +1,123 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-telnet-no_strip_prompt] new file mode 100644 index 00000000..18903b1e --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-telnet-no_strip_prompt] @@ -0,0 +1,127 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands[juniper_junos-telnet-strip_prompt] b/tests/functional/expected/test_send_commands[juniper_junos-telnet-strip_prompt] new file mode 100644 index 00000000..42db9276 --- /dev/null +++ b/tests/functional/expected/test_send_commands[juniper_junos-telnet-strip_prompt] @@ -0,0 +1,123 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration +TIME_STAMP_REPLACED +version 17.3R2.10; +system { + host-name vr-vqfx; + root-authentication { +CRYPTO_REPLACED + } + login { + user admin { + uid 2001; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + user boxen { + uid 2000; + class super-user; + authentication { +CRYPTO_REPLACED + } + } + } + services { + ssh; + telnet; + netconf { + ssh; + rfc-compliant; + } + web-management { + http { + interface fxp0.0; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + license { + autoupdate { + url https://ae1.juniper.net/junos/key_retrieval; + } + } +} +security { + screen { + ids-option untrust-screen { + icmp { + ping-death; + } + ip { + source-route-option; + tear-drop; + } + tcp { + syn-flood { + alarm-threshold 1024; + attack-threshold 200; + source-threshold 1024; + destination-threshold 2048; + queue-size 2000; ## Warning: 'queue-size' is deprecated + timeout 20; + } + land; + } + } + } + policies { + from-zone trust to-zone trust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + from-zone trust to-zone untrust { + policy default-permit { + match { + source-address any; + destination-address any; + application any; + } + then { + permit; + } + } + } + } + zones { + security-zone trust { + tcp-rst; + } + security-zone untrust { + screen untrust-screen; + } + } +} +interfaces { + fxp0 { + unit 0 { + family inet { + address 10.0.0.15/24; + } + } + } +} \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..36a8149e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-asyncssh-no_strip_prompt] @@ -0,0 +1,3 @@ +show run | i ZTP +ceos#show run | i ZTP +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-asyncssh-strip_prompt] new file mode 100644 index 00000000..c0e6270e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-asyncssh-strip_prompt] @@ -0,0 +1,2 @@ +show run | i ZTP +show run | i ZTP diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..36a8149e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-asynctelnet-no_strip_prompt] @@ -0,0 +1,3 @@ +show run | i ZTP +ceos#show run | i ZTP +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..c0e6270e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-asynctelnet-strip_prompt] @@ -0,0 +1,2 @@ +show run | i ZTP +show run | i ZTP diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..36a8149e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-paramiko-no_strip_prompt] @@ -0,0 +1,3 @@ +show run | i ZTP +ceos#show run | i ZTP +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-paramiko-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-paramiko-strip_prompt] new file mode 100644 index 00000000..c0e6270e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-paramiko-strip_prompt] @@ -0,0 +1,2 @@ +show run | i ZTP +show run | i ZTP diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..36a8149e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-ssh2-no_strip_prompt] @@ -0,0 +1,3 @@ +show run | i ZTP +ceos#show run | i ZTP +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-ssh2-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-ssh2-strip_prompt] new file mode 100644 index 00000000..c0e6270e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-ssh2-strip_prompt] @@ -0,0 +1,2 @@ +show run | i ZTP +show run | i ZTP diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-system-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-system-no_strip_prompt] new file mode 100644 index 00000000..36a8149e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-system-no_strip_prompt] @@ -0,0 +1,3 @@ +show run | i ZTP +ceos#show run | i ZTP +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-system-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-system-strip_prompt] new file mode 100644 index 00000000..c0e6270e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-system-strip_prompt] @@ -0,0 +1,2 @@ +show run | i ZTP +show run | i ZTP diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-telnet-no_strip_prompt] new file mode 100644 index 00000000..36a8149e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-telnet-no_strip_prompt] @@ -0,0 +1,3 @@ +show run | i ZTP +ceos#show run | i ZTP +ceos# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[arista_eos-telnet-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[arista_eos-telnet-strip_prompt] new file mode 100644 index 00000000..c0e6270e --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[arista_eos-telnet-strip_prompt] @@ -0,0 +1,2 @@ +show run | i ZTP +show run | i ZTP diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..390833c3 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asyncssh-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run | i hostname +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asyncssh-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asyncssh-strip_prompt] new file mode 100644 index 00000000..92c60db6 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asyncssh-strip_prompt] @@ -0,0 +1,3 @@ +show run | i hostname +hostname vr-csrshow run | i hostname +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..390833c3 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asynctelnet-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run | i hostname +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asynctelnet-strip_prompt] new file mode 100644 index 00000000..92c60db6 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-asynctelnet-strip_prompt] @@ -0,0 +1,3 @@ +show run | i hostname +hostname vr-csrshow run | i hostname +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-paramiko-no_strip_prompt] new file mode 100644 index 00000000..390833c3 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-paramiko-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run | i hostname +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-paramiko-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-paramiko-strip_prompt] new file mode 100644 index 00000000..92c60db6 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-paramiko-strip_prompt] @@ -0,0 +1,3 @@ +show run | i hostname +hostname vr-csrshow run | i hostname +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-ssh2-no_strip_prompt] new file mode 100644 index 00000000..390833c3 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-ssh2-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run | i hostname +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-ssh2-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-ssh2-strip_prompt] new file mode 100644 index 00000000..92c60db6 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-ssh2-strip_prompt] @@ -0,0 +1,3 @@ +show run | i hostname +hostname vr-csrshow run | i hostname +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-system-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-system-no_strip_prompt] new file mode 100644 index 00000000..390833c3 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-system-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run | i hostname +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-system-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-system-strip_prompt] new file mode 100644 index 00000000..92c60db6 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-system-strip_prompt] @@ -0,0 +1,3 @@ +show run | i hostname +hostname vr-csrshow run | i hostname +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-telnet-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-telnet-no_strip_prompt] new file mode 100644 index 00000000..390833c3 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-telnet-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i hostname +hostname vr-csr +vr-csr#show run | i hostname +hostname vr-csr +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-telnet-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-telnet-strip_prompt] new file mode 100644 index 00000000..92c60db6 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxe-telnet-strip_prompt] @@ -0,0 +1,3 @@ +show run | i hostname +hostname vr-csrshow run | i hostname +hostname vr-csr \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..a3f1baf0 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asyncssh-no_strip_prompt] @@ -0,0 +1,9 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asyncssh-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asyncssh-strip_prompt] new file mode 100644 index 00000000..8ab240a9 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asyncssh-strip_prompt] @@ -0,0 +1,7 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..a3f1baf0 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asynctelnet-no_strip_prompt] @@ -0,0 +1,9 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asynctelnet-strip_prompt] new file mode 100644 index 00000000..8ab240a9 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-asynctelnet-strip_prompt] @@ -0,0 +1,7 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-paramiko-no_strip_prompt] new file mode 100644 index 00000000..a3f1baf0 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-paramiko-no_strip_prompt] @@ -0,0 +1,9 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-paramiko-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-paramiko-strip_prompt] new file mode 100644 index 00000000..8ab240a9 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-paramiko-strip_prompt] @@ -0,0 +1,7 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-ssh2-no_strip_prompt] new file mode 100644 index 00000000..a3f1baf0 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-ssh2-no_strip_prompt] @@ -0,0 +1,9 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-ssh2-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-ssh2-strip_prompt] new file mode 100644 index 00000000..8ab240a9 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-ssh2-strip_prompt] @@ -0,0 +1,7 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-system-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-system-no_strip_prompt] new file mode 100644 index 00000000..a3f1baf0 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-system-no_strip_prompt] @@ -0,0 +1,9 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-system-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-system-strip_prompt] new file mode 100644 index 00000000..8ab240a9 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-system-strip_prompt] @@ -0,0 +1,7 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-telnet-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-telnet-no_strip_prompt] new file mode 100644 index 00000000..a3f1baf0 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-telnet-no_strip_prompt] @@ -0,0 +1,9 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k#show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 +RP/0/RP0/CPU0:vr-xrv9k# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-telnet-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-telnet-strip_prompt] new file mode 100644 index 00000000..8ab240a9 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_iosxr-telnet-strip_prompt] @@ -0,0 +1,7 @@ +show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0show run | i MgmtEth0 +TIME_STAMP_REPLACED +Building configuration... +interface MgmtEth0/RP0/CPU0/0 \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..6b51fa3d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asyncssh-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run | i scp-server +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asyncssh-strip_prompt] new file mode 100644 index 00000000..831ea43d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asyncssh-strip_prompt] @@ -0,0 +1,3 @@ +show run | i scp-server +feature scp-servershow run | i scp-server +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..6b51fa3d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asynctelnet-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run | i scp-server +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..831ea43d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-asynctelnet-strip_prompt] @@ -0,0 +1,3 @@ +show run | i scp-server +feature scp-servershow run | i scp-server +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..6b51fa3d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-paramiko-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run | i scp-server +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-paramiko-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-paramiko-strip_prompt] new file mode 100644 index 00000000..831ea43d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-paramiko-strip_prompt] @@ -0,0 +1,3 @@ +show run | i scp-server +feature scp-servershow run | i scp-server +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..6b51fa3d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-ssh2-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run | i scp-server +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-ssh2-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-ssh2-strip_prompt] new file mode 100644 index 00000000..831ea43d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-ssh2-strip_prompt] @@ -0,0 +1,3 @@ +show run | i scp-server +feature scp-servershow run | i scp-server +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-system-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-system-no_strip_prompt] new file mode 100644 index 00000000..6b51fa3d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-system-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run | i scp-server +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-system-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-system-strip_prompt] new file mode 100644 index 00000000..831ea43d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-system-strip_prompt] @@ -0,0 +1,3 @@ +show run | i scp-server +feature scp-servershow run | i scp-server +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-telnet-no_strip_prompt] new file mode 100644 index 00000000..6b51fa3d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-telnet-no_strip_prompt] @@ -0,0 +1,5 @@ +show run | i scp-server +feature scp-server +vr-n9kv#show run | i scp-server +feature scp-server +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[cisco_nxos-telnet-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-telnet-strip_prompt] new file mode 100644 index 00000000..831ea43d --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[cisco_nxos-telnet-strip_prompt] @@ -0,0 +1,3 @@ +show run | i scp-server +feature scp-servershow run | i scp-server +feature scp-server \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..ad289669 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-asyncssh-no_strip_prompt] @@ -0,0 +1,7 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-asyncssh-strip_prompt] new file mode 100644 index 00000000..598cc98b --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-asyncssh-strip_prompt] @@ -0,0 +1,3 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration | match 10.0.0.15 + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..ad289669 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-asynctelnet-no_strip_prompt] @@ -0,0 +1,7 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..598cc98b --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-asynctelnet-strip_prompt] @@ -0,0 +1,3 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration | match 10.0.0.15 + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..ad289669 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-paramiko-no_strip_prompt] @@ -0,0 +1,7 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-paramiko-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-paramiko-strip_prompt] new file mode 100644 index 00000000..598cc98b --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-paramiko-strip_prompt] @@ -0,0 +1,3 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration | match 10.0.0.15 + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..ad289669 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-ssh2-no_strip_prompt] @@ -0,0 +1,7 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-ssh2-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-ssh2-strip_prompt] new file mode 100644 index 00000000..598cc98b --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-ssh2-strip_prompt] @@ -0,0 +1,3 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration | match 10.0.0.15 + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-system-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-system-no_strip_prompt] new file mode 100644 index 00000000..ad289669 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-system-no_strip_prompt] @@ -0,0 +1,7 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-system-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-system-strip_prompt] new file mode 100644 index 00000000..598cc98b --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-system-strip_prompt] @@ -0,0 +1,3 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration | match 10.0.0.15 + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-telnet-no_strip_prompt] new file mode 100644 index 00000000..ad289669 --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-telnet-no_strip_prompt] @@ -0,0 +1,7 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx>show configuration | match 10.0.0.15 + address 10.0.0.15/24; + +admin@vr-vqfx> \ No newline at end of file diff --git a/tests/functional/expected/test_send_commands_from_file[juniper_junos-telnet-strip_prompt] b/tests/functional/expected/test_send_commands_from_file[juniper_junos-telnet-strip_prompt] new file mode 100644 index 00000000..598cc98b --- /dev/null +++ b/tests/functional/expected/test_send_commands_from_file[juniper_junos-telnet-strip_prompt] @@ -0,0 +1,3 @@ +show configuration | match 10.0.0.15 + address 10.0.0.15/24;show configuration | match 10.0.0.15 + address 10.0.0.15/24; \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[arista_eos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-asyncssh-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[arista_eos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-asyncssh-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-asyncssh-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[arista_eos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-asynctelnet-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[arista_eos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-asynctelnet-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[arista_eos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-paramiko-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[arista_eos-paramiko-strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-paramiko-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-paramiko-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[arista_eos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-ssh2-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[arista_eos-ssh2-strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-ssh2-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-ssh2-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[arista_eos-system-no_strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-system-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-system-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[arista_eos-system-strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-system-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-system-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[arista_eos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-telnet-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-telnet-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[arista_eos-telnet-strip_prompt] b/tests/functional/expected/test_send_config[arista_eos-telnet-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[arista_eos-telnet-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-asyncssh-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-asyncssh-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-asyncssh-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-asyncssh-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-asynctelnet-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-asynctelnet-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-asynctelnet-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-paramiko-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-paramiko-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-paramiko-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-paramiko-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-paramiko-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-ssh2-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-ssh2-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-ssh2-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-ssh2-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-ssh2-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-system-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-system-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-system-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-system-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-system-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-system-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-telnet-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-telnet-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-telnet-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxe-telnet-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxe-telnet-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxe-telnet-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-asyncssh-no_strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-asyncssh-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-asyncssh-strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-asyncssh-strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-asynctelnet-no_strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-asynctelnet-strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-asynctelnet-strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-paramiko-no_strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-paramiko-no_strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-paramiko-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-paramiko-strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-paramiko-strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-ssh2-no_strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-ssh2-no_strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-ssh2-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-ssh2-strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-ssh2-strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-system-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-system-no_strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-system-no_strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-system-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-system-strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-system-strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-telnet-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-telnet-no_strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-telnet-no_strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_iosxr-telnet-strip_prompt] b/tests/functional/expected/test_send_config[cisco_iosxr-telnet-strip_prompt] new file mode 100644 index 00000000..b83d5f43 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_iosxr-telnet-strip_prompt] @@ -0,0 +1,3 @@ + + +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[cisco_nxos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-asyncssh-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_nxos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-asyncssh-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-asyncssh-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_nxos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-asynctelnet-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_nxos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-asynctelnet-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_nxos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-paramiko-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_nxos-paramiko-strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-paramiko-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-paramiko-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_nxos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-ssh2-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_nxos-ssh2-strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-ssh2-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-ssh2-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_nxos-system-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-system-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-system-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_nxos-system-strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-system-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-system-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_nxos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-telnet-no_strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-telnet-no_strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[cisco_nxos-telnet-strip_prompt] b/tests/functional/expected/test_send_config[cisco_nxos-telnet-strip_prompt] new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/functional/expected/test_send_config[cisco_nxos-telnet-strip_prompt] @@ -0,0 +1 @@ + diff --git a/tests/functional/expected/test_send_config[juniper_junos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-asyncssh-no_strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[juniper_junos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-asyncssh-strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-asyncssh-strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[juniper_junos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-asynctelnet-no_strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[juniper_junos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-asynctelnet-strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[juniper_junos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-paramiko-no_strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[juniper_junos-paramiko-strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-paramiko-strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-paramiko-strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[juniper_junos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-ssh2-no_strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[juniper_junos-ssh2-strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-ssh2-strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-ssh2-strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[juniper_junos-system-no_strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-system-no_strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-system-no_strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[juniper_junos-system-strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-system-strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-system-strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[juniper_junos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-telnet-no_strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-telnet-no_strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_config[juniper_junos-telnet-strip_prompt] b/tests/functional/expected/test_send_config[juniper_junos-telnet-strip_prompt] new file mode 100644 index 00000000..a97d35b5 --- /dev/null +++ b/tests/functional/expected/test_send_config[juniper_junos-telnet-strip_prompt] @@ -0,0 +1,4 @@ +[edit] +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[arista_eos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-asyncssh-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[arista_eos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-asyncssh-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-asyncssh-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[arista_eos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-asynctelnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[arista_eos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-asynctelnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[arista_eos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-paramiko-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[arista_eos-paramiko-strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-paramiko-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-paramiko-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[arista_eos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-ssh2-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[arista_eos-ssh2-strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-ssh2-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-ssh2-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[arista_eos-system-no_strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-system-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-system-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[arista_eos-system-strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-system-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-system-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[arista_eos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-telnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-telnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[arista_eos-telnet-strip_prompt] b/tests/functional/expected/test_send_configs[arista_eos-telnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[arista_eos-telnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-asyncssh-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-asyncssh-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-asyncssh-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-asyncssh-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-asynctelnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-asynctelnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-asynctelnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-paramiko-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-paramiko-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-paramiko-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-paramiko-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-paramiko-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-ssh2-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-ssh2-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-ssh2-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-ssh2-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-ssh2-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-system-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-system-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-system-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-system-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-system-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-system-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-telnet-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-telnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-telnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxe-telnet-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxe-telnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxe-telnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-asyncssh-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-asyncssh-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-asyncssh-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-asyncssh-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-asynctelnet-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-asynctelnet-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-asynctelnet-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-paramiko-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-paramiko-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-paramiko-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-paramiko-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-paramiko-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-ssh2-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-ssh2-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-ssh2-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-ssh2-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-ssh2-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-system-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-system-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-system-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-system-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-system-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-system-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-telnet-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-telnet-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-telnet-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_iosxr-telnet-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_iosxr-telnet-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_iosxr-telnet-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-asyncssh-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-asyncssh-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-asyncssh-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-asynctelnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-asynctelnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-paramiko-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-paramiko-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-paramiko-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-paramiko-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-ssh2-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-ssh2-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-ssh2-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-ssh2-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-system-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-system-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-system-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-system-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-system-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-system-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-telnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-telnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[cisco_nxos-telnet-strip_prompt] b/tests/functional/expected/test_send_configs[cisco_nxos-telnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs[cisco_nxos-telnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs[juniper_junos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-asyncssh-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[juniper_junos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-asyncssh-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-asyncssh-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[juniper_junos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-asynctelnet-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[juniper_junos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-asynctelnet-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[juniper_junos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-paramiko-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[juniper_junos-paramiko-strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-paramiko-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-paramiko-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[juniper_junos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-ssh2-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[juniper_junos-ssh2-strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-ssh2-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-ssh2-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[juniper_junos-system-no_strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-system-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-system-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[juniper_junos-system-strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-system-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-system-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[juniper_junos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-telnet-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-telnet-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs[juniper_junos-telnet-strip_prompt] b/tests/functional/expected/test_send_configs[juniper_junos-telnet-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs[juniper_junos-telnet-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-asyncssh-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-asyncssh-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-asyncssh-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-asynctelnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-asynctelnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-paramiko-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-paramiko-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-paramiko-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-paramiko-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-ssh2-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-ssh2-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-ssh2-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-ssh2-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-system-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-system-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-system-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-system-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-system-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-system-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-telnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-telnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[arista_eos-telnet-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[arista_eos-telnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[arista_eos-telnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asyncssh-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asyncssh-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asyncssh-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asyncssh-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asynctelnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asynctelnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-asynctelnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-paramiko-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-paramiko-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-paramiko-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-paramiko-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-paramiko-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-ssh2-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-ssh2-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-ssh2-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-ssh2-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-ssh2-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-system-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-system-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-system-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-system-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-system-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-system-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-telnet-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-telnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-telnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-telnet-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-telnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxe-telnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asyncssh-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asyncssh-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asyncssh-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asyncssh-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asynctelnet-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asynctelnet-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-asynctelnet-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-paramiko-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-paramiko-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-paramiko-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-paramiko-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-paramiko-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-ssh2-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-ssh2-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-ssh2-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-ssh2-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-ssh2-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-system-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-system-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-system-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-system-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-system-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-system-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-telnet-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-telnet-no_strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-telnet-no_strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-telnet-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-telnet-strip_prompt] new file mode 100644 index 00000000..58d687de --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_iosxr-telnet-strip_prompt] @@ -0,0 +1,4 @@ +interface loopback123 +description scrapli was here +commit +TIME_STAMP_REPLACED \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asyncssh-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asyncssh-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asyncssh-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asynctelnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-asynctelnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-paramiko-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-paramiko-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-paramiko-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-paramiko-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-ssh2-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-ssh2-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-ssh2-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-ssh2-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-system-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-system-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-system-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-system-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-system-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-system-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-telnet-no_strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-telnet-no_strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[cisco_nxos-telnet-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-telnet-strip_prompt] new file mode 100644 index 00000000..64795db1 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[cisco_nxos-telnet-strip_prompt] @@ -0,0 +1,2 @@ +interface loopback123 +description scrapli was here diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-asyncssh-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-asyncssh-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-asyncssh-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-asyncssh-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-asyncssh-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-asyncssh-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-asynctelnet-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-asynctelnet-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-asynctelnet-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-asynctelnet-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-asynctelnet-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-asynctelnet-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-paramiko-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-paramiko-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-paramiko-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-paramiko-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-paramiko-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-paramiko-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-ssh2-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-ssh2-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-ssh2-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-ssh2-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-ssh2-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-ssh2-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-system-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-system-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-system-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-system-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-system-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-system-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-telnet-no_strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-telnet-no_strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-telnet-no_strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_configs_from_file[juniper_junos-telnet-strip_prompt] b/tests/functional/expected/test_send_configs_from_file[juniper_junos-telnet-strip_prompt] new file mode 100644 index 00000000..44d4ee11 --- /dev/null +++ b/tests/functional/expected/test_send_configs_from_file[juniper_junos-telnet-strip_prompt] @@ -0,0 +1,5 @@ +set interfaces fxp0 unit 0 description "scrapli was here" +[edit]commit +commit complete + +[edit] \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-asyncssh] b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-asyncssh] new file mode 100644 index 00000000..a44a9733 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-asyncssh] @@ -0,0 +1,4 @@ +clear logg +Clear logging buffer [confirm] + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-asynctelnet] b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-asynctelnet] new file mode 100644 index 00000000..a44a9733 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-asynctelnet] @@ -0,0 +1,4 @@ +clear logg +Clear logging buffer [confirm] + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-paramiko] b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-paramiko] new file mode 100644 index 00000000..a44a9733 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-paramiko] @@ -0,0 +1,4 @@ +clear logg +Clear logging buffer [confirm] + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-ssh2] b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-ssh2] new file mode 100644 index 00000000..a44a9733 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-ssh2] @@ -0,0 +1,4 @@ +clear logg +Clear logging buffer [confirm] + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-system] b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-system] new file mode 100644 index 00000000..a44a9733 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-system] @@ -0,0 +1,4 @@ +clear logg +Clear logging buffer [confirm] + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-telnet] b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-telnet] new file mode 100644 index 00000000..a44a9733 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_iosxe-telnet] @@ -0,0 +1,4 @@ +clear logg +Clear logging buffer [confirm] + +vr-csr# \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-asyncssh] b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-asyncssh] new file mode 100644 index 00000000..45ca4fe4 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-asyncssh] @@ -0,0 +1,3 @@ +delete bootflash:virtual-instance.conf +Do you want to delete "/virtual-instance.conf" ? (yes/no/abort) [y] n +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-asynctelnet] b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-asynctelnet] new file mode 100644 index 00000000..45ca4fe4 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-asynctelnet] @@ -0,0 +1,3 @@ +delete bootflash:virtual-instance.conf +Do you want to delete "/virtual-instance.conf" ? (yes/no/abort) [y] n +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-paramiko] b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-paramiko] new file mode 100644 index 00000000..45ca4fe4 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-paramiko] @@ -0,0 +1,3 @@ +delete bootflash:virtual-instance.conf +Do you want to delete "/virtual-instance.conf" ? (yes/no/abort) [y] n +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-ssh2] b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-ssh2] new file mode 100644 index 00000000..45ca4fe4 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-ssh2] @@ -0,0 +1,3 @@ +delete bootflash:virtual-instance.conf +Do you want to delete "/virtual-instance.conf" ? (yes/no/abort) [y] n +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-system] b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-system] new file mode 100644 index 00000000..45ca4fe4 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-system] @@ -0,0 +1,3 @@ +delete bootflash:virtual-instance.conf +Do you want to delete "/virtual-instance.conf" ? (yes/no/abort) [y] n +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-telnet] b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-telnet] new file mode 100644 index 00000000..45ca4fe4 --- /dev/null +++ b/tests/functional/expected/test_send_interactive_normal_response[cisco_nxos-telnet] @@ -0,0 +1,3 @@ +delete bootflash:virtual-instance.conf +Do you want to delete "/virtual-instance.conf" ? (yes/no/abort) [y] n +vr-n9kv# \ No newline at end of file diff --git a/tests/functional/test_arista_eos.py b/tests/functional/test_arista_eos.py index 2854c101..47e081dd 100644 --- a/tests/functional/test_arista_eos.py +++ b/tests/functional/test_arista_eos.py @@ -24,4 +24,4 @@ def test_configuration_session_abort(eos_conn): # assert config session was aborted at first sign of failed config assert len(result) == 1 # assert that session aborted and we are back at priv exec - assert current_prompt == "localhost#" + assert current_prompt == "ceos#" diff --git a/tests/functional/test_cisco_iosxe.py b/tests/functional/test_cisco_iosxe.py index d006959f..c725cb21 100644 --- a/tests/functional/test_cisco_iosxe.py +++ b/tests/functional/test_cisco_iosxe.py @@ -6,5 +6,5 @@ def test_non_standard_default_desired_privilege_level(iosxe_conn): iosxe_conn.default_desired_privilege_level = "configuration" iosxe_conn.open() current_prompt = iosxe_conn.get_prompt() - assert current_prompt == "csr1000v(config)#" + assert current_prompt.endswith("vr-csr(config)#") iosxe_conn.close() diff --git a/tests/functional/test_cisco_nxos.py b/tests/functional/test_cisco_nxos.py index 3e87e89d..4ee9bb08 100644 --- a/tests/functional/test_cisco_nxos.py +++ b/tests/functional/test_cisco_nxos.py @@ -24,4 +24,4 @@ def test_configuration_session_abort(nxos_conn): # assert config session was aborted at first sign of failed config assert len(result) == 1 # assert that session aborted and we are back at priv exec - assert current_prompt == "switch#" + assert current_prompt == "vr-n9kv#" diff --git a/tests/functional/test_drivers_functional.py b/tests/functional/test_drivers_functional.py deleted file mode 100644 index 921fa97e..00000000 --- a/tests/functional/test_drivers_functional.py +++ /dev/null @@ -1,628 +0,0 @@ -import time - -import pytest - -from scrapli.exceptions import ScrapliAuthenticationFailed - - -class TestDevice: - @pytest.fixture(autouse=True) - def __setup(self, test_cases): - self.test_cases = test_cases - - def test_get_prompt(self, nix_conn, transport): - prompt = nix_conn.channel.get_prompt() - assert prompt == self.test_cases["linux"]["get_prompt"] - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_command_short(self, nix_conn, transport, strip_prompt): - command = self.test_cases["linux"]["send_command_short"]["command"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_response = self.test_cases["linux"]["send_command_short"][expected_type] - _, response = nix_conn.channel.send_input(channel_input=command, strip_prompt=strip_prompt) - assert response.decode() == expected_response - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_command_long(self, nix_conn, transport, strip_prompt): - command = self.test_cases["linux"]["send_command_long"]["command"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_response = self.test_cases["linux"]["send_command_long"][expected_type] - _, response = nix_conn.channel.send_input(channel_input=command, strip_prompt=strip_prompt) - assert response.decode() == expected_response - - def test_isalive_and_close(self, nix_conn, transport): - assert nix_conn.isalive() is True - nix_conn.close() - # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt - # close in time for the next assert - time.sleep(0.1) - assert nix_conn.isalive() is False - - -class TestGenericDevice: - @pytest.fixture(autouse=True) - def __setup(self, test_cases): - self.test_cases = test_cases - - def test_get_prompt(self, nix_conn_generic, transport): - prompt = nix_conn_generic.channel.get_prompt() - assert prompt == self.test_cases["linux"]["get_prompt"] - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_command_short(self, nix_conn_generic, transport, strip_prompt): - command = self.test_cases["linux"]["send_command_short"]["command"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_response = self.test_cases["linux"]["send_command_short"][expected_type] - response = nix_conn_generic.send_command(command=command, strip_prompt=strip_prompt) - assert response.result == expected_response - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_command_long(self, nix_conn_generic, transport, strip_prompt): - command = self.test_cases["linux"]["send_command_long"]["command"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_response = self.test_cases["linux"]["send_command_long"][expected_type] - response = nix_conn_generic.send_command(command=command, strip_prompt=strip_prompt) - assert response.result == expected_response - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_commands(self, nix_conn_generic, transport, strip_prompt): - commands = [] - expected_responses = [] - commands.append(self.test_cases["linux"]["send_command_short"]["command"]) - commands.append(self.test_cases["linux"]["send_command_long"]["command"]) - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_responses.append(self.test_cases["linux"]["send_command_short"][expected_type]) - expected_responses.append(self.test_cases["linux"]["send_command_long"][expected_type]) - responses = nix_conn_generic.send_commands(commands=commands, strip_prompt=strip_prompt) - for expected_response, response in zip(expected_responses, responses): - assert response.result == expected_response - - def test_isalive_and_close(self, nix_conn_generic, transport): - assert nix_conn_generic.isalive() is True - nix_conn_generic.close() - # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt - # close in time for the next assert - time.sleep(0.1) - assert nix_conn_generic.isalive() is False - - -class TestNetworkDevice: - @pytest.fixture(autouse=True) - def __setup(self, test_cases): - self.test_cases = test_cases - - @pytest.mark.parametrize( - "priv_level", - ["exec", "privilege_exec", "configuration"], - ids=["exec", "privilege_exec", "configuration"], - ) - def test_get_prompt_and_acquire_priv(self, conn, priv_level, device_type, transport): - if self.test_cases[device_type]["get_prompt"][priv_level] is None: - pytest.skip(f"Priv level {priv_level} for device type {device_type} not tested") - conn.acquire_priv(priv_level) - prompt = conn.get_prompt() - assert prompt == self.test_cases[device_type]["get_prompt"][priv_level] - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_command_short(self, conn, device_type, transport, strip_prompt): - command = self.test_cases[device_type]["send_command_short"]["command"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_response = self.test_cases[device_type]["send_command_short"][expected_type] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - response = conn.send_command(command=command, strip_prompt=strip_prompt) - assert sanitize_response(response.result) == expected_response - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_command_long(self, conn, device_type, transport, strip_prompt): - command = self.test_cases[device_type]["send_command_long"]["command"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_response = self.test_cases[device_type]["send_command_long"][expected_type] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - response = conn.send_command(command=command, strip_prompt=strip_prompt) - assert sanitize_response(response.result) == expected_response - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_commands(self, conn, device_type, transport, strip_prompt): - commands = [] - expected_responses = [] - commands.append(self.test_cases[device_type]["send_command_short"]["command"]) - commands.append(self.test_cases[device_type]["send_command_long"]["command"]) - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_responses.append(self.test_cases[device_type]["send_command_short"][expected_type]) - expected_responses.append(self.test_cases[device_type]["send_command_long"][expected_type]) - sanitize_response = self.test_cases[device_type]["sanitize_response"] - responses = conn.send_commands(commands=commands, strip_prompt=strip_prompt) - for expected_response, response in zip(expected_responses, responses): - assert sanitize_response(response.result) == expected_response - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_commands_from_file(self, conn, device_type, transport, strip_prompt): - file = self.test_cases[device_type]["send_commands_from_file"]["file"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_responses = self.test_cases[device_type]["send_commands_from_file"][expected_type] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - responses = conn.send_commands_from_file(file=file, strip_prompt=strip_prompt) - for expected_response, response in zip(expected_responses, responses): - assert sanitize_response(response.result) == expected_response - - def test_send_commands_stop_on_failed(self, conn, device_type, transport): - commands = self.test_cases[device_type]["send_commands_error"]["commands"] - responses = conn.send_commands(commands=commands, stop_on_failed=True) - assert len(responses) == 2 - assert responses[0].failed is False - assert responses[1].failed is True - - def test_send_interactive_normal_response(self, conn, device_type, transport): - if self.test_cases[device_type]["send_interactive_normal_response"] is None: - pytest.skip( - f"send_interactive_normal_response for device type {device_type} not tested" - ) - interact = self.test_cases[device_type]["send_interactive_normal_response"]["command"] - expected_response = self.test_cases[device_type]["send_interactive_normal_response"][ - "expected" - ] - response = conn.send_interactive(interact_events=interact) - assert response.result == expected_response - - def test_send_interactive_hidden_response(self, conn, device_type, transport): - if self.test_cases[device_type]["send_interactive_hidden_response"] is None: - pytest.skip( - f"send_interactive_hidden_response for device type {device_type} not tested" - ) - interact = self.test_cases[device_type]["send_interactive_hidden_response"]["command"] - expected_response = self.test_cases[device_type]["send_interactive_hidden_response"][ - "expected" - ] - response = conn.send_interactive(interact_events=interact) - assert response.result == expected_response - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_config(self, conn, device_type, transport, strip_prompt): - config = self.test_cases[device_type]["send_config"]["configs"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_response = self.test_cases[device_type]["send_config"][expected_type] - verification = self.test_cases[device_type]["send_config"]["verification"] - expected_verification = self.test_cases[device_type]["send_config"][ - f"verification_{expected_type}" - ] - teardown_configs = self.test_cases[device_type]["send_config"]["teardown_configs"] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - response = conn.send_config(config=config, strip_prompt=strip_prompt) - assert sanitize_response(response.result) == expected_response - verification_response = conn.send_command(command=verification, strip_prompt=strip_prompt) - assert sanitize_response(verification_response.result) == expected_verification - if isinstance(teardown_configs, list): - conn.send_configs(configs=teardown_configs) - else: - conn.send_config(config=teardown_configs) - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_configs(self, conn, device_type, transport, strip_prompt): - configs = self.test_cases[device_type]["send_configs"]["configs"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_responses = self.test_cases[device_type]["send_configs"][expected_type] - verification = self.test_cases[device_type]["send_configs"]["verification"] - expected_verification = self.test_cases[device_type]["send_configs"][ - f"verification_{expected_type}" - ] - teardown_configs = self.test_cases[device_type]["send_configs"]["teardown_configs"] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - responses = conn.send_configs(configs=configs, strip_prompt=strip_prompt) - for expected_response, response in zip(expected_responses, responses): - assert response.result == expected_response - verification_response = conn.send_command(command=verification, strip_prompt=strip_prompt) - assert sanitize_response(verification_response.result) == expected_verification - if isinstance(teardown_configs, list): - conn.send_configs(configs=teardown_configs) - else: - conn.send_config(config=teardown_configs) - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - def test_send_configs_from_file(self, conn, device_type, transport, strip_prompt): - file = self.test_cases[device_type]["send_configs_from_file"]["file"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_responses = self.test_cases[device_type]["send_configs"][expected_type] - verification = self.test_cases[device_type]["send_configs"]["verification"] - expected_verification = self.test_cases[device_type]["send_configs"][ - f"verification_{expected_type}" - ] - teardown_configs = self.test_cases[device_type]["send_configs"]["teardown_configs"] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - responses = conn.send_configs_from_file(file=file, strip_prompt=strip_prompt) - for expected_response, response in zip(expected_responses, responses): - assert response.result == expected_response - verification_response = conn.send_command(command=verification, strip_prompt=strip_prompt) - assert sanitize_response(verification_response.result) == expected_verification - if isinstance(teardown_configs, list): - conn.send_configs(configs=teardown_configs) - else: - conn.send_config(config=teardown_configs) - - def test_send_configs_stop_on_failed(self, conn, device_type, transport): - if self.test_cases[device_type]["send_configs_error"] is None: - pytest.skip( - f"test_send_configs_stop_on_failed for device type {device_type} not tested yet, need to overhaul privilege levels..." - ) - configs = self.test_cases[device_type]["send_configs_error"]["configs"] - teardown_configs = self.test_cases[device_type]["send_configs_error"]["teardown_configs"] - responses = conn.send_configs(configs=configs, stop_on_failed=True) - assert len(responses) == 2 - assert responses[0].failed is False - assert responses[1].failed is True - if isinstance(teardown_configs, list): - conn.send_configs(configs=teardown_configs) - else: - conn.send_config(config=teardown_configs) - - def test_isalive_and_close(self, conn, device_type, transport): - assert conn.isalive() is True - conn.close() - # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt - # close in time for the next assert - time.sleep(0.5) - assert conn.isalive() is False - - -class TestAsyncNetworkDevice: - @pytest.fixture(autouse=True) - def __setup(self, test_cases): - self.test_cases = test_cases - - @pytest.mark.parametrize( - "priv_level", - ["exec", "privilege_exec", "configuration"], - ids=["exec", "privilege_exec", "configuration"], - ) - async def test_get_prompt_and_acquire_priv(self, async_conn, priv_level, device_type): - if self.test_cases[device_type]["get_prompt"][priv_level] is None: - pytest.skip(f"Priv level {priv_level} for device type {device_type} not tested") - await async_conn.acquire_priv(priv_level) - prompt = await async_conn.get_prompt() - assert prompt == self.test_cases[device_type]["get_prompt"][priv_level] - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - async def test_send_command_short(self, async_conn, device_type, strip_prompt): - command = self.test_cases[device_type]["send_command_short"]["command"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_response = self.test_cases[device_type]["send_command_short"][expected_type] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - response = await async_conn.send_command(command=command, strip_prompt=strip_prompt) - assert sanitize_response(response.result) == expected_response - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - async def test_send_command_long(self, async_conn, device_type, strip_prompt): - command = self.test_cases[device_type]["send_command_long"]["command"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_response = self.test_cases[device_type]["send_command_long"][expected_type] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - response = await async_conn.send_command(command=command, strip_prompt=strip_prompt) - assert sanitize_response(response.result) == expected_response - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - async def test_send_commands(self, async_conn, device_type, strip_prompt): - commands = [] - expected_responses = [] - commands.append(self.test_cases[device_type]["send_command_short"]["command"]) - commands.append(self.test_cases[device_type]["send_command_long"]["command"]) - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_responses.append(self.test_cases[device_type]["send_command_short"][expected_type]) - expected_responses.append(self.test_cases[device_type]["send_command_long"][expected_type]) - sanitize_response = self.test_cases[device_type]["sanitize_response"] - responses = await async_conn.send_commands(commands=commands, strip_prompt=strip_prompt) - for expected_response, response in zip(expected_responses, responses): - assert sanitize_response(response.result) == expected_response - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - async def test_send_commands_from_file(self, async_conn, device_type, strip_prompt): - file = self.test_cases[device_type]["send_commands_from_file"]["file"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_responses = self.test_cases[device_type]["send_commands_from_file"][expected_type] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - responses = await async_conn.send_commands_from_file(file=file, strip_prompt=strip_prompt) - for expected_response, response in zip(expected_responses, responses): - assert sanitize_response(response.result) == expected_response - - async def test_send_commands_stop_on_failed(self, async_conn, device_type): - commands = self.test_cases[device_type]["send_commands_error"]["commands"] - responses = await async_conn.send_commands(commands=commands, stop_on_failed=True) - assert len(responses) == 2 - assert responses[0].failed is False - assert responses[1].failed is True - - async def test_send_interactive_normal_response(self, async_conn, device_type): - if self.test_cases[device_type]["send_interactive_normal_response"] is None: - pytest.skip( - f"send_interactive_normal_response for device type {device_type} not tested" - ) - interact = self.test_cases[device_type]["send_interactive_normal_response"]["command"] - expected_response = self.test_cases[device_type]["send_interactive_normal_response"][ - "expected" - ] - response = await async_conn.send_interactive(interact_events=interact) - assert response.result == expected_response - - async def test_send_interactive_hidden_response(self, async_conn, device_type): - if self.test_cases[device_type]["send_interactive_hidden_response"] is None: - pytest.skip( - f"send_interactive_hidden_response for device type {device_type} not tested" - ) - interact = self.test_cases[device_type]["send_interactive_hidden_response"]["command"] - expected_response = self.test_cases[device_type]["send_interactive_hidden_response"][ - "expected" - ] - response = await async_conn.send_interactive(interact_events=interact) - assert response.result == expected_response - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - async def test_send_config(self, async_conn, device_type, strip_prompt): - config = self.test_cases[device_type]["send_config"]["configs"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_response = self.test_cases[device_type]["send_config"][expected_type] - verification = self.test_cases[device_type]["send_config"]["verification"] - expected_verification = self.test_cases[device_type]["send_config"][ - f"verification_{expected_type}" - ] - teardown_configs = self.test_cases[device_type]["send_config"]["teardown_configs"] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - response = await async_conn.send_config(config=config, strip_prompt=strip_prompt) - assert sanitize_response(response.result) == expected_response - verification_response = await async_conn.send_command( - command=verification, strip_prompt=strip_prompt - ) - assert sanitize_response(verification_response.result) == expected_verification - if isinstance(teardown_configs, list): - await async_conn.send_configs(configs=teardown_configs) - else: - await async_conn.send_config(config=teardown_configs) - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - async def test_send_configs(self, async_conn, device_type, strip_prompt): - configs = self.test_cases[device_type]["send_configs"]["configs"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_responses = self.test_cases[device_type]["send_configs"][expected_type] - verification = self.test_cases[device_type]["send_configs"]["verification"] - expected_verification = self.test_cases[device_type]["send_configs"][ - f"verification_{expected_type}" - ] - teardown_configs = self.test_cases[device_type]["send_configs"]["teardown_configs"] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - responses = await async_conn.send_configs(configs=configs, strip_prompt=strip_prompt) - for expected_response, response in zip(expected_responses, responses): - assert response.result == expected_response - verification_response = await async_conn.send_command( - command=verification, strip_prompt=strip_prompt - ) - assert sanitize_response(verification_response.result) == expected_verification - if isinstance(teardown_configs, list): - await async_conn.send_configs(configs=teardown_configs) - else: - await async_conn.send_config(config=teardown_configs) - - @pytest.mark.parametrize( - "strip_prompt", - [True, False], - ids=["strip_prompt", "no_strip_prompt"], - ) - async def test_send_configs_from_file(self, async_conn, device_type, strip_prompt): - file = self.test_cases[device_type]["send_configs_from_file"]["file"] - expected_type = "expected_no_strip" if not strip_prompt else "expected_strip" - expected_responses = self.test_cases[device_type]["send_configs"][expected_type] - verification = self.test_cases[device_type]["send_configs"]["verification"] - expected_verification = self.test_cases[device_type]["send_configs"][ - f"verification_{expected_type}" - ] - teardown_configs = self.test_cases[device_type]["send_configs"]["teardown_configs"] - sanitize_response = self.test_cases[device_type]["sanitize_response"] - responses = await async_conn.send_configs_from_file(file=file, strip_prompt=strip_prompt) - for expected_response, response in zip(expected_responses, responses): - assert response.result == expected_response - verification_response = await async_conn.send_command( - command=verification, strip_prompt=strip_prompt - ) - assert sanitize_response(verification_response.result) == expected_verification - if isinstance(teardown_configs, list): - await async_conn.send_configs(configs=teardown_configs) - else: - await async_conn.send_config(config=teardown_configs) - - async def test_send_configs_stop_on_failed(self, async_conn, device_type): - if self.test_cases[device_type]["send_configs_error"] is None: - pytest.skip( - f"test_send_configs_stop_on_failed for device type {device_type} not tested yet, need to overhaul privilege levels..." - ) - configs = self.test_cases[device_type]["send_configs_error"]["configs"] - teardown_configs = self.test_cases[device_type]["send_configs_error"]["teardown_configs"] - responses = await async_conn.send_configs(configs=configs, stop_on_failed=True) - assert len(responses) == 2 - assert responses[0].failed is False - assert responses[1].failed is True - if isinstance(teardown_configs, list): - await async_conn.send_configs(configs=teardown_configs) - else: - await async_conn.send_config(config=teardown_configs) - - async def test_isalive_and_close(self, async_conn, device_type): - assert async_conn.isalive() is True - await async_conn.close() - # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt - # close in time for the next assert - time.sleep(0.5) - assert async_conn.isalive() is False - - -def test_context_manager(test_devices_dict, device_type, transport): - device = test_devices_dict[device_type].copy() - driver = device.pop("driver") - device.pop("base_config") - device.pop("async_driver") - - port = device.pop("port", 22) - if transport == "telnet": - port = port + 1 - - device["port"] = port - device["transport"] = transport - # nxos running on macos is crazy slow.... - device["timeout_socket"] = 30 - device["timeout_transport"] = 30 - device["timeout_ops"] = 30 - - with driver(**device) as conn: - assert conn.isalive() is True - # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt - # close in time for the next assert - time.sleep(0.5) - assert conn.isalive() is False - - -def test_public_key_auth(test_devices_dict, real_valid_ssh_key_path, device_type, transport): - if device_type != "cisco_iosxe" or transport == "telnet": - pytest.skip("public key auth only tested against iosxe at the moment, and never on telnet!") - - device = test_devices_dict[device_type].copy() - driver = device.pop("driver") - device.pop("base_config") - device.pop("async_driver") - - device["transport"] = transport - device["timeout_socket"] = 5 - device["timeout_transport"] = 5 - device["timeout_ops"] = 5 - device["auth_private_key"] = real_valid_ssh_key_path - - with driver(**device) as conn: - assert conn.isalive() is True - # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt - # close in time for the next assert - time.sleep(0.2) - assert conn.isalive() is False - - -def test_public_key_auth_failure( - test_devices_dict, real_invalid_ssh_key_path, device_type, transport -): - if device_type != "cisco_iosxe" or transport == "telnet": - pytest.skip("public key auth only tested against iosxe at the moment, and never on telnet!") - - if device_type != "cisco_iosxe" or transport == "system": - pytest.skip( - "systemssh raises a different exception as it cant distinguish between auth types as well as the other transports!" - ) - - device = test_devices_dict[device_type].copy() - driver = device.pop("driver") - device.pop("base_config") - device.pop("async_driver") - - device["transport"] = transport - device["timeout_socket"] = 5 - device["timeout_transport"] = 5 - device["timeout_ops"] = 5 - device["auth_private_key"] = real_invalid_ssh_key_path - device.pop("auth_password") - conn = driver(**device) - - with pytest.raises(ScrapliAuthenticationFailed) as exc: - conn.open() - assert str(exc.value) == ( - f"Failed to authenticate to host {device['host']} with private key `{real_invalid_ssh_key_path}`." - " Unable to continue authentication, missing username, password, or both." - ) - - -def test_public_key_auth_failure_systemssh( - test_devices_dict, real_invalid_ssh_key_path, device_type, transport -): - if device_type != "cisco_iosxe" or transport != "system": - pytest.skip( - "systemssh raises a different exception as it cant distinguish between auth types as well as the other transports!" - ) - - device = test_devices_dict[device_type].copy() - driver = device.pop("driver") - device.pop("base_config") - device.pop("async_driver") - - device["transport"] = transport - device["timeout_socket"] = 5 - device["timeout_transport"] = 5 - device["timeout_ops"] = 5 - device["auth_private_key"] = real_invalid_ssh_key_path - device.pop("auth_password") - conn = driver(**device) - - with pytest.raises(ScrapliAuthenticationFailed) as exc: - conn.open() - assert "auth failed" in str(exc.value) diff --git a/tests/functional/test_drivers_network.py b/tests/functional/test_drivers_network.py new file mode 100644 index 00000000..b5816937 --- /dev/null +++ b/tests/functional/test_drivers_network.py @@ -0,0 +1,332 @@ +import time + +import pytest +from expected import get_expected, write_expected + +from scrapli.exceptions import ScrapliAuthenticationFailed + + +class TestNetworkDevice: + @pytest.fixture(autouse=True) + def __setup(self, test_cases): + self.test_cases = test_cases + + @pytest.mark.parametrize( + "priv_level", + ["exec", "privilege_exec", "configuration"], + ids=["exec", "privilege_exec", "configuration"], + ) + def test_get_prompt_and_acquire_priv(self, conn, priv_level, device_type, transport, update): + if (device_type in ("cisco_nxos", "cisco_iosxr") and priv_level == "exec") or ( + device_type == "juniper_junos" and priv_level == "privilege_exec" + ): + pytest.skip(f"Priv level {priv_level} for device type {device_type} not tested") + + conn.acquire_priv(priv_level) + actual = conn.get_prompt() + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + def test_send_command_short(self, conn, device_type, transport, strip_prompt, update): + command = self.test_cases[device_type]["send_command_short"]["command"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = conn.send_command(command=command, strip_prompt=strip_prompt) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + def test_send_command_long(self, conn, device_type, transport, strip_prompt, update): + command = self.test_cases[device_type]["send_command_long"]["command"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = conn.send_command(command=command, strip_prompt=strip_prompt) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + def test_send_commands(self, conn, device_type, transport, strip_prompt, update): + commands = [ + self.test_cases[device_type]["send_command_short"]["command"], + self.test_cases[device_type]["send_command_long"]["command"], + ] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = conn.send_commands(commands=commands, strip_prompt=strip_prompt) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + def test_send_commands_from_file(self, conn, device_type, transport, strip_prompt, update): + file = self.test_cases[device_type]["send_commands_from_file"]["file"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = conn.send_commands_from_file(file=file, strip_prompt=strip_prompt) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + def test_send_commands_stop_on_failed(self, conn, device_type, transport): + commands = self.test_cases[device_type]["send_commands_error"]["commands"] + + responses = conn.send_commands(commands=commands, stop_on_failed=True) + + assert len(responses) == 2 + assert responses[0].failed is False + assert responses[1].failed is True + + def test_send_interactive_normal_response(self, conn, device_type, transport, update): + if self.test_cases[device_type]["send_interactive_normal_response"] is None: + pytest.skip( + f"send_interactive_normal_response for device type {device_type} not tested" + ) + interact = self.test_cases[device_type]["send_interactive_normal_response"]["command"] + + response = conn.send_interactive(interact_events=interact) + + actual = response.result + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + def test_send_config(self, conn, device_type, transport, strip_prompt, update): + config = self.test_cases[device_type]["send_config"]["configs"] + teardown_configs = self.test_cases[device_type]["send_config"]["teardown_configs"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = conn.send_config(config=config) + if isinstance(teardown_configs, list): + conn.send_configs(configs=teardown_configs) + else: + conn.send_config(config=teardown_configs) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + def test_send_configs(self, conn, device_type, transport, strip_prompt, update): + configs = self.test_cases[device_type]["send_configs"]["configs"] + teardown_configs = self.test_cases[device_type]["send_config"]["teardown_configs"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = conn.send_configs(configs=configs) + if isinstance(teardown_configs, list): + conn.send_configs(configs=teardown_configs) + else: + conn.send_config(config=teardown_configs) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + def test_send_configs_from_file(self, conn, device_type, transport, strip_prompt, update): + file = self.test_cases[device_type]["send_configs_from_file"]["file"] + teardown_configs = self.test_cases[device_type]["send_config"]["teardown_configs"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = conn.send_configs_from_file(file=file) + if isinstance(teardown_configs, list): + conn.send_configs(configs=teardown_configs) + else: + conn.send_config(config=teardown_configs) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + def test_send_configs_stop_on_failed(self, conn, device_type, transport): + if self.test_cases[device_type]["send_configs_error"] is None: + pytest.skip( + f"test_send_configs_stop_on_failed for device type {device_type} not tested yet, need to overhaul privilege levels..." + ) + + configs = self.test_cases[device_type]["send_configs_error"]["configs"] + teardown_configs = self.test_cases[device_type]["send_configs_error"]["teardown_configs"] + responses = conn.send_configs(configs=configs, stop_on_failed=True) + + assert len(responses) == 2 + assert responses[0].failed is False + assert responses[1].failed is True + if isinstance(teardown_configs, list): + conn.send_configs(configs=teardown_configs) + else: + conn.send_config(config=teardown_configs) + + def test_isalive_and_close(self, conn, device_type, transport): + assert conn.isalive() is True + conn.close() + # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt + # close in time for the next assert + time.sleep(0.5) + assert conn.isalive() is False + + +def test_context_manager(test_devices_dict, device_type, transport): + device = test_devices_dict[device_type].copy() + driver = device.pop("driver") + device.pop("base_config") + device.pop("async_driver") + + port = device.pop("port", 22) + if transport == "telnet": + port = port + 1 + + device["port"] = port + device["transport"] = transport + # nxos running on macos is crazy slow.... + device["timeout_socket"] = 30 + device["timeout_transport"] = 30 + device["timeout_ops"] = 30 + + with driver(**device) as conn: + assert conn.isalive() is True + # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt + # close in time for the next assert + time.sleep(0.5) + assert conn.isalive() is False + + +def test_public_key_auth(test_devices_dict, real_valid_ssh_key_path, device_type, transport): + if device_type != "cisco_iosxe" or transport == "telnet": + pytest.skip("public key auth only tested against iosxe at the moment, and never on telnet!") + + device = test_devices_dict[device_type].copy() + driver = device.pop("driver") + device.pop("base_config") + device.pop("async_driver") + + device["transport"] = transport + device["timeout_socket"] = 5 + device["timeout_transport"] = 5 + device["timeout_ops"] = 5 + device["auth_private_key"] = real_valid_ssh_key_path + + with driver(**device) as conn: + assert conn.isalive() is True + # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt + # close in time for the next assert + time.sleep(0.2) + assert conn.isalive() is False + + +def test_public_key_auth_failure( + test_devices_dict, real_invalid_ssh_key_path, device_type, transport +): + if device_type != "cisco_iosxe" or transport == "telnet": + pytest.skip("public key auth only tested against iosxe at the moment, and never on telnet!") + + if device_type != "cisco_iosxe" or transport == "system": + pytest.skip( + "systemssh raises a different exception as it cant distinguish between auth types as well as the other transports!" + ) + + device = test_devices_dict[device_type].copy() + driver = device.pop("driver") + device.pop("base_config") + device.pop("async_driver") + + device["transport"] = transport + device["timeout_socket"] = 5 + device["timeout_transport"] = 5 + device["timeout_ops"] = 5 + device["auth_private_key"] = real_invalid_ssh_key_path + device.pop("auth_password") + conn = driver(**device) + + with pytest.raises(ScrapliAuthenticationFailed) as exc: + conn.open() + assert str(exc.value) == ( + f"Failed to authenticate to host {device['host']} with private key `{real_invalid_ssh_key_path}`." + " Unable to continue authentication, missing username, password, or both." + ) + + +def test_public_key_auth_failure_systemssh( + test_devices_dict, real_invalid_ssh_key_path, device_type, transport +): + if device_type != "cisco_iosxe" or transport != "system": + pytest.skip( + "systemssh raises a different exception as it cant distinguish between auth types as well as the other transports!" + ) + + device = test_devices_dict[device_type].copy() + driver = device.pop("driver") + device.pop("base_config") + device.pop("async_driver") + + device["transport"] = transport + device["timeout_socket"] = 5 + device["timeout_transport"] = 5 + device["timeout_ops"] = 5 + device["auth_private_key"] = real_invalid_ssh_key_path + device.pop("auth_password") + conn = driver(**device) + + with pytest.raises(ScrapliAuthenticationFailed) as exc: + conn.open() + assert "auth failed" in str(exc.value) diff --git a/tests/functional/test_drivers_network_async.py b/tests/functional/test_drivers_network_async.py new file mode 100644 index 00000000..f67eca0c --- /dev/null +++ b/tests/functional/test_drivers_network_async.py @@ -0,0 +1,224 @@ +import time + +import pytest +from expected import get_expected, write_expected + + +class TestAsyncNetworkDevice: + @pytest.fixture(autouse=True) + def __setup(self, test_cases): + self.test_cases = test_cases + + @pytest.mark.parametrize( + "priv_level", + ["exec", "privilege_exec", "configuration"], + ids=["exec", "privilege_exec", "configuration"], + ) + async def test_get_prompt_and_acquire_priv(self, async_conn, priv_level, device_type, update): + if (device_type in ("cisco_nxos", "cisco_iosxr") and priv_level == "exec") or ( + device_type == "juniper_junos" and priv_level == "privilege_exec" + ): + pytest.skip(f"Priv level {priv_level} for device type {device_type} not tested") + + await async_conn.acquire_priv(priv_level) + actual = await async_conn.get_prompt() + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + async def test_send_command_short(self, async_conn, device_type, strip_prompt, update): + command = self.test_cases[device_type]["send_command_short"]["command"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = await async_conn.send_command(command=command, strip_prompt=strip_prompt) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + async def test_send_command_long(self, async_conn, device_type, strip_prompt, update): + command = self.test_cases[device_type]["send_command_long"]["command"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = await async_conn.send_command(command=command, strip_prompt=strip_prompt) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + async def test_send_commands(self, async_conn, device_type, strip_prompt, update): + commands = [ + self.test_cases[device_type]["send_command_short"]["command"], + self.test_cases[device_type]["send_command_long"]["command"], + ] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = await async_conn.send_commands(commands=commands, strip_prompt=strip_prompt) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + async def test_send_commands_from_file(self, async_conn, device_type, strip_prompt, update): + file = self.test_cases[device_type]["send_commands_from_file"]["file"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = await async_conn.send_commands_from_file(file=file, strip_prompt=strip_prompt) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + async def test_send_commands_stop_on_failed(self, async_conn, device_type): + commands = self.test_cases[device_type]["send_commands_error"]["commands"] + + responses = await async_conn.send_commands(commands=commands, stop_on_failed=True) + + assert len(responses) == 2 + assert responses[0].failed is False + assert responses[1].failed is True + + async def test_send_interactive_normal_response(self, async_conn, device_type, update): + if self.test_cases[device_type]["send_interactive_normal_response"] is None: + pytest.skip( + f"send_interactive_normal_response for device type {device_type} not tested" + ) + interact = self.test_cases[device_type]["send_interactive_normal_response"]["command"] + + response = await async_conn.send_interactive(interact_events=interact) + + actual = response.result + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + async def test_send_config(self, async_conn, device_type, strip_prompt, update): + config = self.test_cases[device_type]["send_config"]["configs"] + teardown_configs = self.test_cases[device_type]["send_config"]["teardown_configs"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = await async_conn.send_config(config=config) + if isinstance(teardown_configs, list): + await async_conn.send_configs(configs=teardown_configs) + else: + await async_conn.send_config(config=teardown_configs) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + async def test_send_configs(self, async_conn, device_type, strip_prompt, update): + configs = self.test_cases[device_type]["send_configs"]["configs"] + teardown_configs = self.test_cases[device_type]["send_config"]["teardown_configs"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = await async_conn.send_configs(configs=configs) + if isinstance(teardown_configs, list): + await async_conn.send_configs(configs=teardown_configs) + else: + await async_conn.send_config(config=teardown_configs) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + @pytest.mark.parametrize( + "strip_prompt", + [True, False], + ids=["strip_prompt", "no_strip_prompt"], + ) + async def test_send_configs_from_file(self, async_conn, device_type, strip_prompt, update): + file = self.test_cases[device_type]["send_configs_from_file"]["file"] + teardown_configs = self.test_cases[device_type]["send_config"]["teardown_configs"] + sanitize_response = self.test_cases[device_type]["sanitize_response"] + + response = await async_conn.send_configs_from_file(file=file) + if isinstance(teardown_configs, list): + await async_conn.send_configs(configs=teardown_configs) + else: + await async_conn.send_config(config=teardown_configs) + + actual = sanitize_response(response.result) + + if update: + write_expected(f=__file__, result=actual) + + assert actual == get_expected(f=__file__) + + async def test_send_configs_stop_on_failed(self, async_conn, device_type): + if self.test_cases[device_type]["send_configs_error"] is None: + pytest.skip( + f"test_send_configs_stop_on_failed for device type {device_type} not tested yet, need to overhaul privilege levels..." + ) + + configs = self.test_cases[device_type]["send_configs_error"]["configs"] + teardown_configs = self.test_cases[device_type]["send_configs_error"]["teardown_configs"] + responses = await async_conn.send_configs(configs=configs, stop_on_failed=True) + + assert len(responses) == 2 + assert responses[0].failed is False + assert responses[1].failed is True + if isinstance(teardown_configs, list): + await async_conn.send_configs(configs=teardown_configs) + else: + await async_conn.send_config(config=teardown_configs) + + async def test_isalive_and_close(self, async_conn, device_type): + assert async_conn.isalive() is True + await async_conn.close() + # unsure why but w/out a tiny sleep pytest just plows ahead and the connection doesnt + # close in time for the next assert + time.sleep(0.5) + assert async_conn.isalive() is False diff --git a/tests/prepare_devices.py b/tests/prepare_devices.py index b34fc710..a270f68a 100644 --- a/tests/prepare_devices.py +++ b/tests/prepare_devices.py @@ -28,13 +28,6 @@ def prepare_device(test_devices): "platform": device, # nxos on macos w/out acceleration is... slooooooooooow "timeout_ops": 120, - # for xe, but won't hurt anything else anyway - "transport_options": { - "open_cmd": [ - "-o", - "KexAlgorithms=+diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1", - ] - }, } with Scrapli(**conn_dict) as conn: diff --git a/tests/test_data/base_configs/arista_eos b/tests/test_data/base_configs/arista_eos index e0522362..1dfc06e9 100644 --- a/tests/test_data/base_configs/arista_eos +++ b/tests/test_data/base_configs/arista_eos @@ -1,284 +1,39 @@ ! Command: show running-config -! device: localhost (vEOS, EOS-4.22.1F) +! device: ceos (cEOSLab, EOS-4.28.0F-26924507.4280F (engineering build)) ! -! boot system flash:/vEOS-lab.swi +no aaa root ! -switchport default mode routed +username admin privilege 15 role network-admin secret sha512 $6$hB2JUt/ViRqix1FE$LeMDLUUvYUB9RcfqIWNYTZcvQX8lBHHeC5FjEkk/Uj3HJKw4fOTXMHNBU6/x3yS2hUrrM7m/xVTYzrQV5YLkD/ ! transceiver qsfp default-mode 4x10G ! -logging console informational +service routing protocols model multi-agent ! -logging level AAA errors -logging level ACCOUNTING errors -logging level ACL errors -logging level AGENT errors -logging level ALE errors -logging level ARP errors -logging level BFD errors -logging level BGP errors -logging level BMP errors -logging level CAPACITY errors -logging level CAPI errors -logging level CLEAR errors -logging level CVX errors -logging level DATAPLANE errors -logging level DHCP errors -logging level DOT1X errors -logging level DSCP errors -logging level ENVMON errors -logging level ETH errors -logging level EVENTMON errors -logging level EXTENSION errors -logging level FHRP errors -logging level FLOW errors -logging level FORWARDING errors -logging level FRU errors -logging level FWK errors -logging level GMP errors -logging level HARDWARE errors -logging level HEALTH errors -logging level HTTPSERVICE errors -logging level IGMP errors -logging level IGMPSNOOPING errors -logging level INT errors -logging level INTF errors -logging level IP6ROUTING errors -logging level IPRIB errors -logging level IRA errors -logging level ISIS errors -logging level KERNELFIB errors -logging level LACP errors -logging level LAG errors -logging level LAUNCHER errors -logging level LDP errors -logging level LICENSE errors -logging level LINEPROTO errors -logging level LLDP errors -logging level LOGMGR errors -logging level LOOPBACK errors -logging level LOOPPROTECT errors -logging level MAPREDUCEMONITOR errors -logging level MIRRORING errors -logging level MKA errors -logging level MLAG errors -logging level MMODE errors -logging level MROUTE errors -logging level MRP errors -logging level MSDP errors -logging level MSRP errors -logging level MSSPOLICYMONITOR errors -logging level MVRP errors -logging level NAT errors -logging level OPENCONFIG errors -logging level OPENFLOW errors -logging level OSPF errors -logging level OSPF3 errors -logging level PACKAGE errors -logging level PFC errors -logging level PIMBSR errors -logging level PORTSECURITY errors -logging level PTP errors -logging level PWRMGMT errors -logging level QOS errors -logging level QUEUEMONITOR errors -logging level REDUNDANCY errors -logging level RIB errors -logging level ROUTING errors -logging level SECURITY errors -logging level SERVERMONITOR errors -logging level SPANTREE errors -logging level SSO errors -logging level STAGEMGR errors -logging level SYS errors -logging level SYSDB errors -logging level TAPAGG errors -logging level TCP errors -logging level TRANSCEIVER errors -logging level TUNNEL errors -logging level TUNNELINTF errors -logging level VMTRACERSESS errors -logging level VMWAREVI errors -logging level VMWAREVS errors -logging level VRF errors -logging level VRRP errors -logging level VXLAN errors -logging level XMPP errors -logging level ZTP informational +hostname ceos ! spanning-tree mode mstp ! -enable secret sha512 $6$TVJ6KgdC0qsGkKfb$LjGGPd6W3S1iJQVQ.Vvo3Bca4Yt1R3y4nOjWAaaTCsk1NuIoqB/gOMseoigt/HQVFDTvDAJ3IPmsF9sWfxi1V/ -no aaa root +management api http-commands + no shutdown ! -username boxen role network-admin secret sha512 $6$1ex07TzYfKx23A9z$c02oeDxnr4J7HMgj0PcabYvACZfjdiu3zp4IAgjJQ51IBtkstpvOjm0FYbxSSBhsl.mytIr9Y4PaERp4MDXJM/ +management api gnmi + transport grpc default +! +management api netconf + transport ssh default ! interface Ethernet1 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route + description tacocat ! interface Ethernet2 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet3 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet4 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet5 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet6 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet7 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet8 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet9 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet10 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet11 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route ! -interface Ethernet12 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route +interface Management0 + ip address 172.20.20.14/24 + ipv6 address 2001:172:20:20::14/64 ! -interface Ethernet13 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route +ip routing ! -interface Ethernet14 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet15 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet16 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet17 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet18 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet19 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet20 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Management1 - ip address 10.0.0.15/24 - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -no ip routing -! -control-plane - no service-policy input copp-system-policy -! -banner login -No startup-config was found. -The device is in Zero Touch Provisioning mode and is attempting to -download the startup-config from a remote system. The device will not -be fully functional until either a valid startup-config is downloaded -from a remote system or Zero Touch Provisioning is cancelled. -To cancel Zero Touch Provisioning, login as admin and type -'zerotouch cancel' at the CLI. Alternatively, to disable Zero Touch -Provisioning permanently, type 'zerotouch disable' at the CLI. -Note: The device will reload when these commands are issued. -EOF -! -management api http-commands - protocol unix-socket - no shutdown +ip route 0.0.0.0/0 172.20.20.1 ! management telnet no shutdown diff --git a/tests/test_data/base_configs/cisco_iosxe.j2 b/tests/test_data/base_configs/cisco_iosxe.j2 index 604651f4..6e85ff05 100644 --- a/tests/test_data/base_configs/cisco_iosxe.j2 +++ b/tests/test_data/base_configs/cisco_iosxe.j2 @@ -7,13 +7,13 @@ platform qfp utilization monitor load 80 platform punt-keepalive disable-kernel-core platform console serial ! -hostname csr1000v +hostname vr-csr ! boot-start-marker boot-end-marker ! ! -enable secret 9 $9$xvWnx8Fe35f8xE$E9ijp7GM/V48P5y1Uz3IEPtotXgwkJKYJmN0q3q2E92 +enable secret 9 $9$iYHNnk9hB4ElFk$3JjDfWOwfPRJK5SJKUo8YGs7whG5fra4jK9i1UWeVPc ! no aaa new-model call-home @@ -31,7 +31,7 @@ call-home ! ! ! -ip domain name example.com +ip domain name boxen.box ! ! ! @@ -69,17 +69,13 @@ multilink bundle-name authenticated {{ crypto_pki }} ! diagnostic bootup level minimal -archive - log config - logging enable - path bootflash: memory free low-watermark processor 72329 -file prompt quiet ! ! spanning-tree extend system-id ! -username boxen priv 15 pass 0 b0x3N-b0x3N +username boxen privilege 15 password 0 b0x3N-b0x3N +username admin privilege 15 password 0 admin ! redundancy ! @@ -105,10 +101,6 @@ redundancy ! ! ! -! -! -! -! interface GigabitEthernet1 ip address 10.0.0.15 255.255.255.0 negotiation auto @@ -178,12 +170,9 @@ interface GigabitEthernet10 no mop enabled no mop sysid ! -! -virtual-service csr_mgmt -! ip forward-protocol nd no ip http server -no ip http secure-server +ip http secure-server ! ip scp server enable ! @@ -193,7 +182,7 @@ ip scp server enable ! ! ip ssh pubkey-chain - username boxen + username admin key-hash ssh-rsa 5CC74A68B18B026A1709FB09D1F44E2F control-plane ! @@ -206,21 +195,31 @@ control-plane ! ! ! +control-plane +! +! +! +! +! +! line con 0 stopbits 1 -line vty 0 4 +line vty 0 + login local + transport input all +line vty 1 login local - no length 0 + length 0 transport input all -line vty 5 15 +line vty 2 4 login local transport input all ! -netconf ssh ! ! ! ! ! netconf-yang +restconf end \ No newline at end of file diff --git a/tests/test_data/base_configs/cisco_iosxr b/tests/test_data/base_configs/cisco_iosxr index bd72bd5b..4893fe08 100644 --- a/tests/test_data/base_configs/cisco_iosxr +++ b/tests/test_data/base_configs/cisco_iosxr @@ -1,8 +1,14 @@ telnet vrf default ipv4 server max-servers 10 +hostname vr-xrv9k username boxen group root-lr group cisco-support - secret 5 $1$ERrP$IwIygdqbJGkqrXZDtaWVI0 + secret 5 $1$Eqd9$r77Xc5HHjEiT.ushQEHMu1 +! +username clab + group root-lr + group cisco-support + password 7 1511070D060A7A767B ! call-home service active @@ -63,347 +69,14 @@ interface GigabitEthernet0/0/0/14 interface GigabitEthernet0/0/0/15 shutdown ! -interface GigabitEthernet0/0/0/16 - shutdown -! -interface GigabitEthernet0/0/0/17 - shutdown -! -interface GigabitEthernet0/0/0/18 - shutdown -! -interface GigabitEthernet0/0/0/19 - shutdown -! -interface GigabitEthernet0/0/0/20 - shutdown -! -interface GigabitEthernet0/0/0/21 - shutdown -! -interface GigabitEthernet0/0/0/22 - shutdown -! -interface GigabitEthernet0/0/0/23 - shutdown -! -interface GigabitEthernet0/0/0/24 - shutdown -! -interface GigabitEthernet0/0/0/25 - shutdown -! -interface GigabitEthernet0/0/0/26 - shutdown -! -interface GigabitEthernet0/0/0/27 - shutdown -! -interface GigabitEthernet0/0/0/28 - shutdown -! -interface GigabitEthernet0/0/0/29 - shutdown -! -interface GigabitEthernet0/0/0/30 - shutdown -! -interface GigabitEthernet0/0/0/31 - shutdown -! -interface GigabitEthernet0/0/0/32 - shutdown -! -interface GigabitEthernet0/0/0/33 - shutdown -! -interface GigabitEthernet0/0/0/34 - shutdown -! -interface GigabitEthernet0/0/0/35 - shutdown -! -interface GigabitEthernet0/0/0/36 - shutdown -! -interface GigabitEthernet0/0/0/37 - shutdown -! -interface GigabitEthernet0/0/0/38 - shutdown -! -interface GigabitEthernet0/0/0/39 - shutdown -! -interface GigabitEthernet0/0/0/40 - shutdown -! -interface GigabitEthernet0/0/0/41 - shutdown -! -interface GigabitEthernet0/0/0/42 - shutdown -! -interface GigabitEthernet0/0/0/43 - shutdown -! -interface GigabitEthernet0/0/0/44 - shutdown -! -interface GigabitEthernet0/0/0/45 - shutdown -! -interface GigabitEthernet0/0/0/46 - shutdown -! -interface GigabitEthernet0/0/0/47 - shutdown -! -interface GigabitEthernet0/0/0/48 - shutdown -! -interface GigabitEthernet0/0/0/49 - shutdown -! -interface GigabitEthernet0/0/0/50 - shutdown -! -interface GigabitEthernet0/0/0/51 - shutdown -! -interface GigabitEthernet0/0/0/52 - shutdown -! -interface GigabitEthernet0/0/0/53 - shutdown -! -interface GigabitEthernet0/0/0/54 - shutdown -! -interface GigabitEthernet0/0/0/55 - shutdown -! -interface GigabitEthernet0/0/0/56 - shutdown -! -interface GigabitEthernet0/0/0/57 - shutdown -! -interface GigabitEthernet0/0/0/58 - shutdown -! -interface GigabitEthernet0/0/0/59 - shutdown -! -interface GigabitEthernet0/0/0/60 - shutdown -! -interface GigabitEthernet0/0/0/61 - shutdown -! -interface GigabitEthernet0/0/0/62 - shutdown -! -interface GigabitEthernet0/0/0/63 - shutdown -! -interface GigabitEthernet0/0/0/64 - shutdown -! -interface GigabitEthernet0/0/0/65 - shutdown -! -interface GigabitEthernet0/0/0/66 - shutdown -! -interface GigabitEthernet0/0/0/67 - shutdown -! -interface GigabitEthernet0/0/0/68 - shutdown -! -interface GigabitEthernet0/0/0/69 - shutdown -! -interface GigabitEthernet0/0/0/70 - shutdown -! -interface GigabitEthernet0/0/0/71 - shutdown -! -interface GigabitEthernet0/0/0/72 - shutdown -! -interface GigabitEthernet0/0/0/73 - shutdown -! -interface GigabitEthernet0/0/0/74 - shutdown -! -interface GigabitEthernet0/0/0/75 - shutdown -! -interface GigabitEthernet0/0/0/76 - shutdown -! -interface GigabitEthernet0/0/0/77 - shutdown -! -interface GigabitEthernet0/0/0/78 - shutdown -! -interface GigabitEthernet0/0/0/79 - shutdown -! -interface GigabitEthernet0/0/0/80 - shutdown -! -interface GigabitEthernet0/0/0/81 - shutdown -! -interface GigabitEthernet0/0/0/82 - shutdown -! -interface GigabitEthernet0/0/0/83 - shutdown -! -interface GigabitEthernet0/0/0/84 - shutdown -! -interface GigabitEthernet0/0/0/85 - shutdown -! -interface GigabitEthernet0/0/0/86 - shutdown -! -interface GigabitEthernet0/0/0/87 - shutdown -! -interface GigabitEthernet0/0/0/88 - shutdown -! -interface GigabitEthernet0/0/0/89 - shutdown -! -interface GigabitEthernet0/0/0/90 - shutdown -! -interface GigabitEthernet0/0/0/91 - shutdown -! -interface GigabitEthernet0/0/0/92 - shutdown -! -interface GigabitEthernet0/0/0/93 - shutdown -! -interface GigabitEthernet0/0/0/94 - shutdown -! -interface GigabitEthernet0/0/0/95 - shutdown -! -interface GigabitEthernet0/0/0/96 - shutdown -! -interface GigabitEthernet0/0/0/97 - shutdown -! -interface GigabitEthernet0/0/0/98 - shutdown -! -interface GigabitEthernet0/0/0/99 - shutdown -! -interface GigabitEthernet0/0/0/100 - shutdown -! -interface GigabitEthernet0/0/0/101 - shutdown -! -interface GigabitEthernet0/0/0/102 - shutdown -! -interface GigabitEthernet0/0/0/103 - shutdown -! -interface GigabitEthernet0/0/0/104 - shutdown -! -interface GigabitEthernet0/0/0/105 - shutdown -! -interface GigabitEthernet0/0/0/106 - shutdown -! -interface GigabitEthernet0/0/0/107 - shutdown -! -interface GigabitEthernet0/0/0/108 - shutdown -! -interface GigabitEthernet0/0/0/109 - shutdown -! -interface GigabitEthernet0/0/0/110 - shutdown -! -interface GigabitEthernet0/0/0/111 - shutdown -! -interface GigabitEthernet0/0/0/112 - shutdown -! -interface GigabitEthernet0/0/0/113 - shutdown -! -interface GigabitEthernet0/0/0/114 - shutdown -! -interface GigabitEthernet0/0/0/115 - shutdown -! -interface GigabitEthernet0/0/0/116 - shutdown -! -interface GigabitEthernet0/0/0/117 - shutdown -! -interface GigabitEthernet0/0/0/118 - shutdown -! -interface GigabitEthernet0/0/0/119 - shutdown -! -interface GigabitEthernet0/0/0/120 - shutdown -! -interface GigabitEthernet0/0/0/121 - shutdown -! -interface GigabitEthernet0/0/0/122 - shutdown -! -interface GigabitEthernet0/0/0/123 - shutdown -! -interface GigabitEthernet0/0/0/124 - shutdown -! -interface GigabitEthernet0/0/0/125 - shutdown -! -interface GigabitEthernet0/0/0/126 - shutdown -! -interface GigabitEthernet0/0/0/127 - shutdown -! -xml agent tty +grpc + port 57400 + no-tls ! netconf-yang agent ssh ! +ssh server rate-limit 600 ssh server v2 ssh server netconf vrf default end \ No newline at end of file diff --git a/tests/test_data/base_configs/cisco_nxos b/tests/test_data/base_configs/cisco_nxos index a4291e72..73c8abf4 100644 --- a/tests/test_data/base_configs/cisco_nxos +++ b/tests/test_data/base_configs/cisco_nxos @@ -1,8 +1,8 @@ - !Command: Checkpoint cmd vdc 1 -!Time: Thu Mar 19 23:32:32 2020 +!Time: Mon Jul 18 17:41:48 2022 -version 9.2(4) Bios:version +version 9.2(4) Bios:version +hostname vr-n9kv class-map type network-qos c-nq1 description Default class on qos-group 1 match qos-group 1 @@ -65,27 +65,27 @@ policy-map type network-qos default-8q-nq-policy mtu 1500 class type network-qos c-8q-nq-default mtu 1500 -vdc switch id 1 +vdc vr-n9kv id 1 limit-resource vlan minimum 16 maximum 4094 limit-resource vrf minimum 2 maximum 4096 limit-resource port-channel minimum 0 maximum 511 - limit-resource u4route-mem minimum 128 maximum 128 + limit-resource u4route-mem minimum 248 maximum 248 limit-resource u6route-mem minimum 96 maximum 96 limit-resource m4route-mem minimum 58 maximum 58 limit-resource m6route-mem minimum 8 maximum 8 -!#feature ssh -!#ssh key rsa 1024 feature telnet feature nxapi feature scp-server +feature netconf +feature grpc role name priv-15 description This is a system defined privilege role. - rule 1 permit read-write + rule 1 permit read-write role name priv-14 description This is a system defined privilege role. - rule 1 permit read-write + rule 1 permit read-write role name priv-13 description This is a system defined privilege role. role name priv-12 @@ -123,53 +123,12 @@ role name priv-0 rule 4 permit command ssh6 * rule 3 permit command ssh * rule 2 permit command enable * - rule 1 permit read + rule 1 permit read no password strength-check -username admin password 5 $5$LOIMHI$hIaO64VM40/x.MTQoeWg8/IAn2iBY5jv4WZyzQbb5q9 role network-admin -username boxen password 5 $5$rFrywOjz$buvWY6uEPf79GVyfGNO6SGOi5gbxV2VAcsbBtyXDZyB role network-admin +username admin password 5 $5$NOBDCN$nRLYI94Rsr2aFyNFJZkMC9tsO3eHEZXcDOt5uvRuN10 role network-admin +username boxen password 5 $5$ipZx5veq$a7WoQ5.Cnki64vgXPPjcUvQwgKsur3OKpOtGGILPlF/ role network-admin username boxen passphrase lifetime 99999 warntime 14 gracetime 3 ip domain-lookup -!# qos statistics -!# class-map type queuing match-any c-out-q3 - !# match qos-group 3 -!# class-map type queuing match-any c-out-q2 - !# match qos-group 2 -!# class-map type queuing match-any c-out-q1 - !# match qos-group 1 -!# class-map type queuing match-any c-out-q-default - !# match qos-group 0 -!# class-map type queuing match-any c-out-8q-q7 - !# match qos-group 7 -!# class-map type queuing match-any c-out-8q-q6 - !# match qos-group 6 -!# class-map type queuing match-any c-out-8q-q5 - !# match qos-group 5 -!# class-map type queuing match-any c-out-8q-q4 - !# match qos-group 4 -!# class-map type queuing match-any c-out-8q-q3 - !# match qos-group 3 -!# class-map type queuing match-any c-out-8q-q2 - !# match qos-group 2 -!# class-map type queuing match-any c-out-8q-q1 - !# match qos-group 1 -!# class-map type queuing match-any c-out-8q-q-default - !# match qos-group 0 -!# class-map type queuing match-any c-in-q7 - !# match qos-group 7 -!# class-map type queuing match-any c-in-q6 - !# match qos-group 6 -!# class-map type queuing match-any c-in-q5 - !# match qos-group 5 -!# class-map type queuing match-any c-in-q4 - !# match qos-group 4 -!# class-map type queuing match-any c-in-q3 - !# match qos-group 3 -!# class-map type queuing match-any c-in-q2 - !# match qos-group 2 -!# class-map type queuing match-any c-in-q1 - !# match qos-group 1 -!# class-map type queuing match-any c-in-q-default - !# match qos-group 0 policy-map type queuing default-out-policy class type queuing c-out-q3 priority level 1 @@ -198,22 +157,14 @@ policy-map type queuing default-8q-out-policy bandwidth remaining percent 100 copp profile strict no system mode maintenance -snmp-server user admin network-admin auth md5 0xd42fc9f6e153a348e1ab40f0f5b84589 priv 0xd42fc9f6e153a348e1ab40f0f5b84589 localizedkey -snmp-server user boxen network-admin auth md5 0xc168bfc2b500129bd35ee550b6d5d93d priv 0xc168bfc2b500129bd35ee550b6d5d93d localizedkey +snmp-server user admin network-admin auth md5 0xc2ddb65d774688cbe39ccc99407c3504 priv 0xc2ddb65d774688cbe39ccc99407c3504 localizedkey +snmp-server user boxen network-admin auth md5 0xbbde1f880043a9581715afb5bd97c938 priv 0xbbde1f880043a9581715afb5bd97c938 localizedkey rmon event 1 description FATAL(1) owner PMON@FATAL rmon event 2 description CRITICAL(2) owner PMON@CRITICAL rmon event 3 description ERROR(3) owner PMON@ERROR rmon event 4 description WARNING(4) owner PMON@WARNING rmon event 5 description INFORMATION(5) owner PMON@INFO callhome - !#destination-profile CiscoTAC-1 message-level 0 - !#destination-profile CiscoTAC-1 message-size 5000000 - !#destination-profile full_txt message-level 0 - !#destination-profile full_txt message-size 2500000 - !#destination-profile short_txt message-level 0 - !#destination-profile short_txt message-size 4000 - !#periodic-inventory notification interval 7 - !#periodic-inventory notification timeofday 08:00 vlan 1 vrf context management @@ -224,785 +175,395 @@ nxapi ssl protocols TLSv1.1 TLSv1.2 interface Ethernet1/1 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/2 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/3 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/4 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/5 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/6 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/7 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/8 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/9 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/10 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/11 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/12 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/13 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/14 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/15 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/16 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/17 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/18 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/19 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/20 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/21 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/22 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/23 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/24 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/25 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/26 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/27 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/28 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/29 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/30 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/31 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/32 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/33 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/34 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/35 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/36 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/37 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/38 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/39 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/40 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/41 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/42 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/43 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/44 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/45 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/46 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/47 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/48 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/49 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/50 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/51 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/52 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/53 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/54 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/55 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/56 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/57 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/58 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/59 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/60 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/61 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/62 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/63 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/64 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/65 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/66 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/67 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/68 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/69 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/70 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/71 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/72 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/73 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/74 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/75 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/76 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/77 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/78 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/79 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/80 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/81 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/82 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/83 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/84 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/85 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/86 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/87 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/88 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/89 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/90 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/91 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/92 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/93 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/94 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/95 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/96 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/97 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/98 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/99 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/100 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/101 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/102 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/103 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/104 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/105 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/106 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/107 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/108 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/109 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/110 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/111 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/112 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/113 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/114 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/115 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/116 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/117 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/118 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/119 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/120 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/121 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/122 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/123 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/124 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/125 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/126 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/127 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface Ethernet1/128 - !#switchport switchport mode access - !#switchport trunk allowed vlan 1-4094 - !#no shutdown interface mgmt0 vrf member management ip address 10.0.0.15/24 line console line vty -xml server timeout 1200 boot nxos bootflash:/nxos.9.2.4.bin -no priority-flow-control override-interface mode off - -!#logging logfile messages 5 size 4194304 -!#logging monitor -!#logging module -!#logging console - +xml server timeout 1200 +no priority-flow-control override-interface mode off diff --git a/tests/test_data/base_configs/juniper_junos b/tests/test_data/base_configs/juniper_junos index a01e7a01..012e9e98 100644 --- a/tests/test_data/base_configs/juniper_junos +++ b/tests/test_data/base_configs/juniper_junos @@ -1,25 +1,31 @@ -## Last commit: 2020-03-20 20:32:38 UTC by root version 17.3R2.10; system { + host-name vr-vqfx; root-authentication { - encrypted-password "$6$RhR81Jm4$DEXKIbZNGjv.agJvM.FlIZWtFqX/966PZk0r4/Ps3LlS.OQZn9fHoVGuYJ7Q.hj2OQLyPJO6Mq7aQ3xLQiNrx/"; ## SECRET-DATA + encrypted-password "$1$a$/nr2uXmtaTqW504hxM3Yw0"; ## SECRET-DATA } login { + user admin { + uid 2001; + class super-user; + authentication { + encrypted-password "$6$g7XN4vy8$S7d7Xl5RDgnFhzYgGNhvKDot4vEAiMo8ZFipF7WWGmSbih8xbnaSWmAnJn5/nSq3mA2gOs/ts6pBv2PPi3yYO."; ## SECRET-DATA + } + } user boxen { uid 2000; class super-user; authentication { - encrypted-password "$6$iYt26fU9$gkt6bgxPs.VqHgCoLuSD6Kxv1JUHJLQzXJgzAEUIxobvxWwRErtpaOFvBOjIHr3KMI7sEo.V/7xLXzr0Ok20h0"; ## SECRET-DATA + encrypted-password "$1$a$/nr2uXmtaTqW504hxM3Yw0"; ## SECRET-DATA } } } services { - ssh { - protocol-version v2; - } + ssh; telnet; netconf { ssh; + rfc-compliant; } web-management { http { diff --git a/tests/test_data/expected/arista_eos/send_command_long_no_strip b/tests/test_data/expected/arista_eos/send_command_long_no_strip deleted file mode 100644 index cb9bab72..00000000 --- a/tests/test_data/expected/arista_eos/send_command_long_no_strip +++ /dev/null @@ -1,287 +0,0 @@ -! Command: show running-config -! device: localhost (vEOS, EOS-4.22.1F) -! -! boot system flash:/vEOS-lab.swi -! -switchport default mode routed -! -transceiver qsfp default-mode 4x10G -! -logging console informational -! -logging level AAA errors -logging level ACCOUNTING errors -logging level ACL errors -logging level AGENT errors -logging level ALE errors -logging level ARP errors -logging level BFD errors -logging level BGP errors -logging level BMP errors -logging level CAPACITY errors -logging level CAPI errors -logging level CLEAR errors -logging level CVX errors -logging level DATAPLANE errors -logging level DHCP errors -logging level DOT1X errors -logging level DSCP errors -logging level ENVMON errors -logging level ETH errors -logging level EVENTMON errors -logging level EXTENSION errors -logging level FHRP errors -logging level FLOW errors -logging level FORWARDING errors -logging level FRU errors -logging level FWK errors -logging level GMP errors -logging level HARDWARE errors -logging level HEALTH errors -logging level HTTPSERVICE errors -logging level IGMP errors -logging level IGMPSNOOPING errors -logging level INT errors -logging level INTF errors -logging level IP6ROUTING errors -logging level IPRIB errors -logging level IRA errors -logging level ISIS errors -logging level KERNELFIB errors -logging level LACP errors -logging level LAG errors -logging level LAUNCHER errors -logging level LDP errors -logging level LICENSE errors -logging level LINEPROTO errors -logging level LLDP errors -logging level LOGMGR errors -logging level LOOPBACK errors -logging level LOOPPROTECT errors -logging level MAPREDUCEMONITOR errors -logging level MIRRORING errors -logging level MKA errors -logging level MLAG errors -logging level MMODE errors -logging level MROUTE errors -logging level MRP errors -logging level MSDP errors -logging level MSRP errors -logging level MSSPOLICYMONITOR errors -logging level MVRP errors -logging level NAT errors -logging level OPENCONFIG errors -logging level OPENFLOW errors -logging level OSPF errors -logging level OSPF3 errors -logging level PACKAGE errors -logging level PFC errors -logging level PIMBSR errors -logging level PORTSECURITY errors -logging level PTP errors -logging level PWRMGMT errors -logging level QOS errors -logging level QUEUEMONITOR errors -logging level REDUNDANCY errors -logging level RIB errors -logging level ROUTING errors -logging level SECURITY errors -logging level SERVERMONITOR errors -logging level SPANTREE errors -logging level SSO errors -logging level STAGEMGR errors -logging level SYS errors -logging level SYSDB errors -logging level TAPAGG errors -logging level TCP errors -logging level TRANSCEIVER errors -logging level TUNNEL errors -logging level TUNNELINTF errors -logging level VMTRACERSESS errors -logging level VMWAREVI errors -logging level VMWAREVS errors -logging level VRF errors -logging level VRRP errors -logging level VXLAN errors -logging level XMPP errors -logging level ZTP informational -! -spanning-tree mode mstp -! -enable CRYPTO_REPLACED -no aaa root -! -username boxen role network-admin CRYPTO_REPLACED -! -interface Ethernet1 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet2 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet3 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet4 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet5 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet6 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet7 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet8 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet9 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet10 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet11 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet12 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet13 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet14 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet15 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet16 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet17 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet18 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet19 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet20 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Management1 - ip address 10.0.0.15/24 - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -no ip routing -! -control-plane - no service-policy input copp-system-policy -! -banner login -No startup-config was found. -The device is in Zero Touch Provisioning mode and is attempting to -download the startup-config from a remote system. The device will not -be fully functional until either a valid startup-config is downloaded -from a remote system or Zero Touch Provisioning is cancelled. -To cancel Zero Touch Provisioning, login as admin and type -'zerotouch cancel' at the CLI. Alternatively, to disable Zero Touch -Provisioning permanently, type 'zerotouch disable' at the CLI. -Note: The device will reload when these commands are issued. -EOF -! -management api http-commands - protocol unix-socket - no shutdown -! -management telnet - no shutdown -! -end -localhost# \ No newline at end of file diff --git a/tests/test_data/expected/arista_eos/send_command_long_strip b/tests/test_data/expected/arista_eos/send_command_long_strip deleted file mode 100644 index 628f0569..00000000 --- a/tests/test_data/expected/arista_eos/send_command_long_strip +++ /dev/null @@ -1,286 +0,0 @@ -! Command: show running-config -! device: localhost (vEOS, EOS-4.22.1F) -! -! boot system flash:/vEOS-lab.swi -! -switchport default mode routed -! -transceiver qsfp default-mode 4x10G -! -logging console informational -! -logging level AAA errors -logging level ACCOUNTING errors -logging level ACL errors -logging level AGENT errors -logging level ALE errors -logging level ARP errors -logging level BFD errors -logging level BGP errors -logging level BMP errors -logging level CAPACITY errors -logging level CAPI errors -logging level CLEAR errors -logging level CVX errors -logging level DATAPLANE errors -logging level DHCP errors -logging level DOT1X errors -logging level DSCP errors -logging level ENVMON errors -logging level ETH errors -logging level EVENTMON errors -logging level EXTENSION errors -logging level FHRP errors -logging level FLOW errors -logging level FORWARDING errors -logging level FRU errors -logging level FWK errors -logging level GMP errors -logging level HARDWARE errors -logging level HEALTH errors -logging level HTTPSERVICE errors -logging level IGMP errors -logging level IGMPSNOOPING errors -logging level INT errors -logging level INTF errors -logging level IP6ROUTING errors -logging level IPRIB errors -logging level IRA errors -logging level ISIS errors -logging level KERNELFIB errors -logging level LACP errors -logging level LAG errors -logging level LAUNCHER errors -logging level LDP errors -logging level LICENSE errors -logging level LINEPROTO errors -logging level LLDP errors -logging level LOGMGR errors -logging level LOOPBACK errors -logging level LOOPPROTECT errors -logging level MAPREDUCEMONITOR errors -logging level MIRRORING errors -logging level MKA errors -logging level MLAG errors -logging level MMODE errors -logging level MROUTE errors -logging level MRP errors -logging level MSDP errors -logging level MSRP errors -logging level MSSPOLICYMONITOR errors -logging level MVRP errors -logging level NAT errors -logging level OPENCONFIG errors -logging level OPENFLOW errors -logging level OSPF errors -logging level OSPF3 errors -logging level PACKAGE errors -logging level PFC errors -logging level PIMBSR errors -logging level PORTSECURITY errors -logging level PTP errors -logging level PWRMGMT errors -logging level QOS errors -logging level QUEUEMONITOR errors -logging level REDUNDANCY errors -logging level RIB errors -logging level ROUTING errors -logging level SECURITY errors -logging level SERVERMONITOR errors -logging level SPANTREE errors -logging level SSO errors -logging level STAGEMGR errors -logging level SYS errors -logging level SYSDB errors -logging level TAPAGG errors -logging level TCP errors -logging level TRANSCEIVER errors -logging level TUNNEL errors -logging level TUNNELINTF errors -logging level VMTRACERSESS errors -logging level VMWAREVI errors -logging level VMWAREVS errors -logging level VRF errors -logging level VRRP errors -logging level VXLAN errors -logging level XMPP errors -logging level ZTP informational -! -spanning-tree mode mstp -! -enable CRYPTO_REPLACED -no aaa root -! -username boxen role network-admin CRYPTO_REPLACED -! -interface Ethernet1 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet2 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet3 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet4 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet5 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet6 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet7 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet8 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet9 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet10 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet11 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet12 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet13 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet14 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet15 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet16 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet17 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet18 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet19 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Ethernet20 - speed forced 10000full - no switchport - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -interface Management1 - ip address 10.0.0.15/24 - ipv6 enable - ipv6 address auto-config - ipv6 nd ra rx accept default-route -! -no ip routing -! -control-plane - no service-policy input copp-system-policy -! -banner login -No startup-config was found. -The device is in Zero Touch Provisioning mode and is attempting to -download the startup-config from a remote system. The device will not -be fully functional until either a valid startup-config is downloaded -from a remote system or Zero Touch Provisioning is cancelled. -To cancel Zero Touch Provisioning, login as admin and type -'zerotouch cancel' at the CLI. Alternatively, to disable Zero Touch -Provisioning permanently, type 'zerotouch disable' at the CLI. -Note: The device will reload when these commands are issued. -EOF -! -management api http-commands - protocol unix-socket - no shutdown -! -management telnet - no shutdown -! -end \ No newline at end of file diff --git a/tests/test_data/expected/cisco_iosxr/send_command_long_no_strip b/tests/test_data/expected/cisco_iosxr/send_command_long_no_strip deleted file mode 100644 index 6ea78dd9..00000000 --- a/tests/test_data/expected/cisco_iosxr/send_command_long_no_strip +++ /dev/null @@ -1,416 +0,0 @@ -TIME_STAMP_REPLACED -Building configuration... -!! IOS XR Configuration version = 6.5.3 -!! Last configuration change at TIME_STAMP_REPLACED -! -telnet vrf default ipv4 server max-servers 10 -username boxen - group root-lr - group cisco-support -CRYPTO_REPLACED -! -call-home - service active - contact smart-licensing - profile CiscoTAC-1 - active - destination transport-method http - ! -! -interface MgmtEth0/RP0/CPU0/0 - ipv4 address 10.0.0.15 255.255.255.0 -! -interface GigabitEthernet0/0/0/0 - shutdown -! -interface GigabitEthernet0/0/0/1 - shutdown -! -interface GigabitEthernet0/0/0/2 - shutdown -! -interface GigabitEthernet0/0/0/3 - shutdown -! -interface GigabitEthernet0/0/0/4 - shutdown -! -interface GigabitEthernet0/0/0/5 - shutdown -! -interface GigabitEthernet0/0/0/6 - shutdown -! -interface GigabitEthernet0/0/0/7 - shutdown -! -interface GigabitEthernet0/0/0/8 - shutdown -! -interface GigabitEthernet0/0/0/9 - shutdown -! -interface GigabitEthernet0/0/0/10 - shutdown -! -interface GigabitEthernet0/0/0/11 - shutdown -! -interface GigabitEthernet0/0/0/12 - shutdown -! -interface GigabitEthernet0/0/0/13 - shutdown -! -interface GigabitEthernet0/0/0/14 - shutdown -! -interface GigabitEthernet0/0/0/15 - shutdown -! -interface GigabitEthernet0/0/0/16 - shutdown -! -interface GigabitEthernet0/0/0/17 - shutdown -! -interface GigabitEthernet0/0/0/18 - shutdown -! -interface GigabitEthernet0/0/0/19 - shutdown -! -interface GigabitEthernet0/0/0/20 - shutdown -! -interface GigabitEthernet0/0/0/21 - shutdown -! -interface GigabitEthernet0/0/0/22 - shutdown -! -interface GigabitEthernet0/0/0/23 - shutdown -! -interface GigabitEthernet0/0/0/24 - shutdown -! -interface GigabitEthernet0/0/0/25 - shutdown -! -interface GigabitEthernet0/0/0/26 - shutdown -! -interface GigabitEthernet0/0/0/27 - shutdown -! -interface GigabitEthernet0/0/0/28 - shutdown -! -interface GigabitEthernet0/0/0/29 - shutdown -! -interface GigabitEthernet0/0/0/30 - shutdown -! -interface GigabitEthernet0/0/0/31 - shutdown -! -interface GigabitEthernet0/0/0/32 - shutdown -! -interface GigabitEthernet0/0/0/33 - shutdown -! -interface GigabitEthernet0/0/0/34 - shutdown -! -interface GigabitEthernet0/0/0/35 - shutdown -! -interface GigabitEthernet0/0/0/36 - shutdown -! -interface GigabitEthernet0/0/0/37 - shutdown -! -interface GigabitEthernet0/0/0/38 - shutdown -! -interface GigabitEthernet0/0/0/39 - shutdown -! -interface GigabitEthernet0/0/0/40 - shutdown -! -interface GigabitEthernet0/0/0/41 - shutdown -! -interface GigabitEthernet0/0/0/42 - shutdown -! -interface GigabitEthernet0/0/0/43 - shutdown -! -interface GigabitEthernet0/0/0/44 - shutdown -! -interface GigabitEthernet0/0/0/45 - shutdown -! -interface GigabitEthernet0/0/0/46 - shutdown -! -interface GigabitEthernet0/0/0/47 - shutdown -! -interface GigabitEthernet0/0/0/48 - shutdown -! -interface GigabitEthernet0/0/0/49 - shutdown -! -interface GigabitEthernet0/0/0/50 - shutdown -! -interface GigabitEthernet0/0/0/51 - shutdown -! -interface GigabitEthernet0/0/0/52 - shutdown -! -interface GigabitEthernet0/0/0/53 - shutdown -! -interface GigabitEthernet0/0/0/54 - shutdown -! -interface GigabitEthernet0/0/0/55 - shutdown -! -interface GigabitEthernet0/0/0/56 - shutdown -! -interface GigabitEthernet0/0/0/57 - shutdown -! -interface GigabitEthernet0/0/0/58 - shutdown -! -interface GigabitEthernet0/0/0/59 - shutdown -! -interface GigabitEthernet0/0/0/60 - shutdown -! -interface GigabitEthernet0/0/0/61 - shutdown -! -interface GigabitEthernet0/0/0/62 - shutdown -! -interface GigabitEthernet0/0/0/63 - shutdown -! -interface GigabitEthernet0/0/0/64 - shutdown -! -interface GigabitEthernet0/0/0/65 - shutdown -! -interface GigabitEthernet0/0/0/66 - shutdown -! -interface GigabitEthernet0/0/0/67 - shutdown -! -interface GigabitEthernet0/0/0/68 - shutdown -! -interface GigabitEthernet0/0/0/69 - shutdown -! -interface GigabitEthernet0/0/0/70 - shutdown -! -interface GigabitEthernet0/0/0/71 - shutdown -! -interface GigabitEthernet0/0/0/72 - shutdown -! -interface GigabitEthernet0/0/0/73 - shutdown -! -interface GigabitEthernet0/0/0/74 - shutdown -! -interface GigabitEthernet0/0/0/75 - shutdown -! -interface GigabitEthernet0/0/0/76 - shutdown -! -interface GigabitEthernet0/0/0/77 - shutdown -! -interface GigabitEthernet0/0/0/78 - shutdown -! -interface GigabitEthernet0/0/0/79 - shutdown -! -interface GigabitEthernet0/0/0/80 - shutdown -! -interface GigabitEthernet0/0/0/81 - shutdown -! -interface GigabitEthernet0/0/0/82 - shutdown -! -interface GigabitEthernet0/0/0/83 - shutdown -! -interface GigabitEthernet0/0/0/84 - shutdown -! -interface GigabitEthernet0/0/0/85 - shutdown -! -interface GigabitEthernet0/0/0/86 - shutdown -! -interface GigabitEthernet0/0/0/87 - shutdown -! -interface GigabitEthernet0/0/0/88 - shutdown -! -interface GigabitEthernet0/0/0/89 - shutdown -! -interface GigabitEthernet0/0/0/90 - shutdown -! -interface GigabitEthernet0/0/0/91 - shutdown -! -interface GigabitEthernet0/0/0/92 - shutdown -! -interface GigabitEthernet0/0/0/93 - shutdown -! -interface GigabitEthernet0/0/0/94 - shutdown -! -interface GigabitEthernet0/0/0/95 - shutdown -! -interface GigabitEthernet0/0/0/96 - shutdown -! -interface GigabitEthernet0/0/0/97 - shutdown -! -interface GigabitEthernet0/0/0/98 - shutdown -! -interface GigabitEthernet0/0/0/99 - shutdown -! -interface GigabitEthernet0/0/0/100 - shutdown -! -interface GigabitEthernet0/0/0/101 - shutdown -! -interface GigabitEthernet0/0/0/102 - shutdown -! -interface GigabitEthernet0/0/0/103 - shutdown -! -interface GigabitEthernet0/0/0/104 - shutdown -! -interface GigabitEthernet0/0/0/105 - shutdown -! -interface GigabitEthernet0/0/0/106 - shutdown -! -interface GigabitEthernet0/0/0/107 - shutdown -! -interface GigabitEthernet0/0/0/108 - shutdown -! -interface GigabitEthernet0/0/0/109 - shutdown -! -interface GigabitEthernet0/0/0/110 - shutdown -! -interface GigabitEthernet0/0/0/111 - shutdown -! -interface GigabitEthernet0/0/0/112 - shutdown -! -interface GigabitEthernet0/0/0/113 - shutdown -! -interface GigabitEthernet0/0/0/114 - shutdown -! -interface GigabitEthernet0/0/0/115 - shutdown -! -interface GigabitEthernet0/0/0/116 - shutdown -! -interface GigabitEthernet0/0/0/117 - shutdown -! -interface GigabitEthernet0/0/0/118 - shutdown -! -interface GigabitEthernet0/0/0/119 - shutdown -! -interface GigabitEthernet0/0/0/120 - shutdown -! -interface GigabitEthernet0/0/0/121 - shutdown -! -interface GigabitEthernet0/0/0/122 - shutdown -! -interface GigabitEthernet0/0/0/123 - shutdown -! -interface GigabitEthernet0/0/0/124 - shutdown -! -interface GigabitEthernet0/0/0/125 - shutdown -! -interface GigabitEthernet0/0/0/126 - shutdown -! -interface GigabitEthernet0/0/0/127 - shutdown -! -xml agent tty -! -netconf-yang agent - ssh -! -ssh server v2 -ssh server netconf vrf default -end - -RP/0/RP0/CPU0:ios# \ No newline at end of file diff --git a/tests/test_data/expected/cisco_iosxr/send_command_long_strip b/tests/test_data/expected/cisco_iosxr/send_command_long_strip deleted file mode 100644 index 35c593b7..00000000 --- a/tests/test_data/expected/cisco_iosxr/send_command_long_strip +++ /dev/null @@ -1,414 +0,0 @@ -TIME_STAMP_REPLACED -Building configuration... -!! IOS XR Configuration version = 6.5.3 -!! Last configuration change at TIME_STAMP_REPLACED -! -telnet vrf default ipv4 server max-servers 10 -username boxen - group root-lr - group cisco-support -CRYPTO_REPLACED -! -call-home - service active - contact smart-licensing - profile CiscoTAC-1 - active - destination transport-method http - ! -! -interface MgmtEth0/RP0/CPU0/0 - ipv4 address 10.0.0.15 255.255.255.0 -! -interface GigabitEthernet0/0/0/0 - shutdown -! -interface GigabitEthernet0/0/0/1 - shutdown -! -interface GigabitEthernet0/0/0/2 - shutdown -! -interface GigabitEthernet0/0/0/3 - shutdown -! -interface GigabitEthernet0/0/0/4 - shutdown -! -interface GigabitEthernet0/0/0/5 - shutdown -! -interface GigabitEthernet0/0/0/6 - shutdown -! -interface GigabitEthernet0/0/0/7 - shutdown -! -interface GigabitEthernet0/0/0/8 - shutdown -! -interface GigabitEthernet0/0/0/9 - shutdown -! -interface GigabitEthernet0/0/0/10 - shutdown -! -interface GigabitEthernet0/0/0/11 - shutdown -! -interface GigabitEthernet0/0/0/12 - shutdown -! -interface GigabitEthernet0/0/0/13 - shutdown -! -interface GigabitEthernet0/0/0/14 - shutdown -! -interface GigabitEthernet0/0/0/15 - shutdown -! -interface GigabitEthernet0/0/0/16 - shutdown -! -interface GigabitEthernet0/0/0/17 - shutdown -! -interface GigabitEthernet0/0/0/18 - shutdown -! -interface GigabitEthernet0/0/0/19 - shutdown -! -interface GigabitEthernet0/0/0/20 - shutdown -! -interface GigabitEthernet0/0/0/21 - shutdown -! -interface GigabitEthernet0/0/0/22 - shutdown -! -interface GigabitEthernet0/0/0/23 - shutdown -! -interface GigabitEthernet0/0/0/24 - shutdown -! -interface GigabitEthernet0/0/0/25 - shutdown -! -interface GigabitEthernet0/0/0/26 - shutdown -! -interface GigabitEthernet0/0/0/27 - shutdown -! -interface GigabitEthernet0/0/0/28 - shutdown -! -interface GigabitEthernet0/0/0/29 - shutdown -! -interface GigabitEthernet0/0/0/30 - shutdown -! -interface GigabitEthernet0/0/0/31 - shutdown -! -interface GigabitEthernet0/0/0/32 - shutdown -! -interface GigabitEthernet0/0/0/33 - shutdown -! -interface GigabitEthernet0/0/0/34 - shutdown -! -interface GigabitEthernet0/0/0/35 - shutdown -! -interface GigabitEthernet0/0/0/36 - shutdown -! -interface GigabitEthernet0/0/0/37 - shutdown -! -interface GigabitEthernet0/0/0/38 - shutdown -! -interface GigabitEthernet0/0/0/39 - shutdown -! -interface GigabitEthernet0/0/0/40 - shutdown -! -interface GigabitEthernet0/0/0/41 - shutdown -! -interface GigabitEthernet0/0/0/42 - shutdown -! -interface GigabitEthernet0/0/0/43 - shutdown -! -interface GigabitEthernet0/0/0/44 - shutdown -! -interface GigabitEthernet0/0/0/45 - shutdown -! -interface GigabitEthernet0/0/0/46 - shutdown -! -interface GigabitEthernet0/0/0/47 - shutdown -! -interface GigabitEthernet0/0/0/48 - shutdown -! -interface GigabitEthernet0/0/0/49 - shutdown -! -interface GigabitEthernet0/0/0/50 - shutdown -! -interface GigabitEthernet0/0/0/51 - shutdown -! -interface GigabitEthernet0/0/0/52 - shutdown -! -interface GigabitEthernet0/0/0/53 - shutdown -! -interface GigabitEthernet0/0/0/54 - shutdown -! -interface GigabitEthernet0/0/0/55 - shutdown -! -interface GigabitEthernet0/0/0/56 - shutdown -! -interface GigabitEthernet0/0/0/57 - shutdown -! -interface GigabitEthernet0/0/0/58 - shutdown -! -interface GigabitEthernet0/0/0/59 - shutdown -! -interface GigabitEthernet0/0/0/60 - shutdown -! -interface GigabitEthernet0/0/0/61 - shutdown -! -interface GigabitEthernet0/0/0/62 - shutdown -! -interface GigabitEthernet0/0/0/63 - shutdown -! -interface GigabitEthernet0/0/0/64 - shutdown -! -interface GigabitEthernet0/0/0/65 - shutdown -! -interface GigabitEthernet0/0/0/66 - shutdown -! -interface GigabitEthernet0/0/0/67 - shutdown -! -interface GigabitEthernet0/0/0/68 - shutdown -! -interface GigabitEthernet0/0/0/69 - shutdown -! -interface GigabitEthernet0/0/0/70 - shutdown -! -interface GigabitEthernet0/0/0/71 - shutdown -! -interface GigabitEthernet0/0/0/72 - shutdown -! -interface GigabitEthernet0/0/0/73 - shutdown -! -interface GigabitEthernet0/0/0/74 - shutdown -! -interface GigabitEthernet0/0/0/75 - shutdown -! -interface GigabitEthernet0/0/0/76 - shutdown -! -interface GigabitEthernet0/0/0/77 - shutdown -! -interface GigabitEthernet0/0/0/78 - shutdown -! -interface GigabitEthernet0/0/0/79 - shutdown -! -interface GigabitEthernet0/0/0/80 - shutdown -! -interface GigabitEthernet0/0/0/81 - shutdown -! -interface GigabitEthernet0/0/0/82 - shutdown -! -interface GigabitEthernet0/0/0/83 - shutdown -! -interface GigabitEthernet0/0/0/84 - shutdown -! -interface GigabitEthernet0/0/0/85 - shutdown -! -interface GigabitEthernet0/0/0/86 - shutdown -! -interface GigabitEthernet0/0/0/87 - shutdown -! -interface GigabitEthernet0/0/0/88 - shutdown -! -interface GigabitEthernet0/0/0/89 - shutdown -! -interface GigabitEthernet0/0/0/90 - shutdown -! -interface GigabitEthernet0/0/0/91 - shutdown -! -interface GigabitEthernet0/0/0/92 - shutdown -! -interface GigabitEthernet0/0/0/93 - shutdown -! -interface GigabitEthernet0/0/0/94 - shutdown -! -interface GigabitEthernet0/0/0/95 - shutdown -! -interface GigabitEthernet0/0/0/96 - shutdown -! -interface GigabitEthernet0/0/0/97 - shutdown -! -interface GigabitEthernet0/0/0/98 - shutdown -! -interface GigabitEthernet0/0/0/99 - shutdown -! -interface GigabitEthernet0/0/0/100 - shutdown -! -interface GigabitEthernet0/0/0/101 - shutdown -! -interface GigabitEthernet0/0/0/102 - shutdown -! -interface GigabitEthernet0/0/0/103 - shutdown -! -interface GigabitEthernet0/0/0/104 - shutdown -! -interface GigabitEthernet0/0/0/105 - shutdown -! -interface GigabitEthernet0/0/0/106 - shutdown -! -interface GigabitEthernet0/0/0/107 - shutdown -! -interface GigabitEthernet0/0/0/108 - shutdown -! -interface GigabitEthernet0/0/0/109 - shutdown -! -interface GigabitEthernet0/0/0/110 - shutdown -! -interface GigabitEthernet0/0/0/111 - shutdown -! -interface GigabitEthernet0/0/0/112 - shutdown -! -interface GigabitEthernet0/0/0/113 - shutdown -! -interface GigabitEthernet0/0/0/114 - shutdown -! -interface GigabitEthernet0/0/0/115 - shutdown -! -interface GigabitEthernet0/0/0/116 - shutdown -! -interface GigabitEthernet0/0/0/117 - shutdown -! -interface GigabitEthernet0/0/0/118 - shutdown -! -interface GigabitEthernet0/0/0/119 - shutdown -! -interface GigabitEthernet0/0/0/120 - shutdown -! -interface GigabitEthernet0/0/0/121 - shutdown -! -interface GigabitEthernet0/0/0/122 - shutdown -! -interface GigabitEthernet0/0/0/123 - shutdown -! -interface GigabitEthernet0/0/0/124 - shutdown -! -interface GigabitEthernet0/0/0/125 - shutdown -! -interface GigabitEthernet0/0/0/126 - shutdown -! -interface GigabitEthernet0/0/0/127 - shutdown -! -xml agent tty -! -netconf-yang agent - ssh -! -ssh server v2 -ssh server netconf vrf default -end \ No newline at end of file diff --git a/tests/test_data/expected/linux/send_command_long_no_strip b/tests/test_data/expected/linux/send_command_long_no_strip deleted file mode 100644 index 71bec427..00000000 --- a/tests/test_data/expected/linux/send_command_long_no_strip +++ /dev/null @@ -1,101 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6.4,v 1.5 2015/05/04 02:56:25 vapier Exp $ - -description="OpenBSD Secure Shell server" -description_checkconfig="Verify configuration file" -description_reload="Reload configuration" - -extra_commands="checkconfig" -extra_started_commands="reload" - -: ${SSHD_CONFDIR:=/etc/ssh} -: ${SSHD_CONFIG:=${SSHD_CONFDIR}/sshd_config} -: ${SSHD_PIDFILE:=/run/${SVCNAME}.pid} -: ${SSHD_BINARY:=/usr/sbin/sshd} - -depend() { - use logger dns - if [ "${rc_need+set}" = "set" ] ; then - : # Do nothing, the user has explicitly set rc_need - else - local x warn_addr - for x in $(awk '/^ListenAddress/{ print $2 }' "$SSHD_CONFIG" 2>/dev/null) ; do - case "${x}" in - 0.0.0.0|0.0.0.0:*) ;; - ::|\[::\]*) ;; - *) warn_addr="${warn_addr} ${x}" ;; - esac - done - if [ -n "${warn_addr}" ] ; then - need net - ewarn "You are binding an interface in ListenAddress statement in your sshd_config!" - ewarn "You must add rc_need=\"net.FOO\" to your /etc/conf.d/sshd" - ewarn "where FOO is the interface(s) providing the following address(es):" - ewarn "${warn_addr}" - fi - fi -} - -checkconfig() { - if [ ! -d /var/empty ] ; then - mkdir -p /var/empty || return 1 - fi - - if [ ! -e "${SSHD_CONFIG}" ] ; then - eerror "You need an ${SSHD_CONFIG} file to run sshd" - eerror "There is a sample file in /usr/share/doc/openssh" - return 1 - fi - - if ! yesno "${SSHD_DISABLE_KEYGEN}"; then - ssh-keygen -A || return 1 - fi - - [ "${SSHD_PIDFILE}" != "/run/sshd.pid" ] \ - && SSHD_OPTS="${SSHD_OPTS} -o PidFile=${SSHD_PIDFILE}" - [ "${SSHD_CONFIG}" != "/etc/ssh/sshd_config" ] \ - && SSHD_OPTS="${SSHD_OPTS} -f ${SSHD_CONFIG}" - - "${SSHD_BINARY}" -t ${SSHD_OPTS} || return 1 -} - -start() { - checkconfig || return 1 - - ebegin "Starting ${SVCNAME}" - start-stop-daemon --start --exec "${SSHD_BINARY}" \ - --pidfile "${SSHD_PIDFILE}" \ - -- ${SSHD_OPTS} - eend $? -} - -stop() { - if [ "${RC_CMD}" = "restart" ] ; then - checkconfig || return 1 - fi - - ebegin "Stopping ${SVCNAME}" - start-stop-daemon --stop --exec "${SSHD_BINARY}" \ - --pidfile "${SSHD_PIDFILE}" --quiet - eend $? - - if [ "$RC_RUNLEVEL" = "shutdown" ]; then - _sshd_pids=$(pgrep "${SSHD_BINARY##*/}") - if [ -n "$_sshd_pids" ]; then - ebegin "Shutting down ssh connections" - kill -TERM $_sshd_pids >/dev/null 2>&1 - eend 0 - fi - fi -} - -reload() { - checkconfig || return 1 - ebegin "Reloading ${SVCNAME}" - start-stop-daemon --signal HUP \ - --exec "${SSHD_BINARY}" --pidfile "${SSHD_PIDFILE}" - eend $? -} -linux:~# \ No newline at end of file diff --git a/tests/test_data/expected/linux/send_command_long_strip b/tests/test_data/expected/linux/send_command_long_strip deleted file mode 100644 index 0b644614..00000000 --- a/tests/test_data/expected/linux/send_command_long_strip +++ /dev/null @@ -1,100 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6.4,v 1.5 2015/05/04 02:56:25 vapier Exp $ - -description="OpenBSD Secure Shell server" -description_checkconfig="Verify configuration file" -description_reload="Reload configuration" - -extra_commands="checkconfig" -extra_started_commands="reload" - -: ${SSHD_CONFDIR:=/etc/ssh} -: ${SSHD_CONFIG:=${SSHD_CONFDIR}/sshd_config} -: ${SSHD_PIDFILE:=/run/${SVCNAME}.pid} -: ${SSHD_BINARY:=/usr/sbin/sshd} - -depend() { - use logger dns - if [ "${rc_need+set}" = "set" ] ; then - : # Do nothing, the user has explicitly set rc_need - else - local x warn_addr - for x in $(awk '/^ListenAddress/{ print $2 }' "$SSHD_CONFIG" 2>/dev/null) ; do - case "${x}" in - 0.0.0.0|0.0.0.0:*) ;; - ::|\[::\]*) ;; - *) warn_addr="${warn_addr} ${x}" ;; - esac - done - if [ -n "${warn_addr}" ] ; then - need net - ewarn "You are binding an interface in ListenAddress statement in your sshd_config!" - ewarn "You must add rc_need=\"net.FOO\" to your /etc/conf.d/sshd" - ewarn "where FOO is the interface(s) providing the following address(es):" - ewarn "${warn_addr}" - fi - fi -} - -checkconfig() { - if [ ! -d /var/empty ] ; then - mkdir -p /var/empty || return 1 - fi - - if [ ! -e "${SSHD_CONFIG}" ] ; then - eerror "You need an ${SSHD_CONFIG} file to run sshd" - eerror "There is a sample file in /usr/share/doc/openssh" - return 1 - fi - - if ! yesno "${SSHD_DISABLE_KEYGEN}"; then - ssh-keygen -A || return 1 - fi - - [ "${SSHD_PIDFILE}" != "/run/sshd.pid" ] \ - && SSHD_OPTS="${SSHD_OPTS} -o PidFile=${SSHD_PIDFILE}" - [ "${SSHD_CONFIG}" != "/etc/ssh/sshd_config" ] \ - && SSHD_OPTS="${SSHD_OPTS} -f ${SSHD_CONFIG}" - - "${SSHD_BINARY}" -t ${SSHD_OPTS} || return 1 -} - -start() { - checkconfig || return 1 - - ebegin "Starting ${SVCNAME}" - start-stop-daemon --start --exec "${SSHD_BINARY}" \ - --pidfile "${SSHD_PIDFILE}" \ - -- ${SSHD_OPTS} - eend $? -} - -stop() { - if [ "${RC_CMD}" = "restart" ] ; then - checkconfig || return 1 - fi - - ebegin "Stopping ${SVCNAME}" - start-stop-daemon --stop --exec "${SSHD_BINARY}" \ - --pidfile "${SSHD_PIDFILE}" --quiet - eend $? - - if [ "$RC_RUNLEVEL" = "shutdown" ]; then - _sshd_pids=$(pgrep "${SSHD_BINARY##*/}") - if [ -n "$_sshd_pids" ]; then - ebegin "Shutting down ssh connections" - kill -TERM $_sshd_pids >/dev/null 2>&1 - eend 0 - fi - fi -} - -reload() { - checkconfig || return 1 - ebegin "Reloading ${SVCNAME}" - start-stop-daemon --signal HUP \ - --exec "${SSHD_BINARY}" --pidfile "${SSHD_PIDFILE}" - eend $? -} \ No newline at end of file diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index 09046d22..af8b2aea 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -1,4 +1,3 @@ -import sys from copy import deepcopy import pytest From 1d0e0a396d0956285aa45a1e6739be1a04c71248 Mon Sep 17 00:00:00 2001 From: "v.garkaviy" Date: Wed, 20 Jul 2022 07:23:08 +0300 Subject: [PATCH 44/49] Generic context method --- scrapli/driver/base/async_driver.py | 7 +++++-- scrapli/driver/base/sync_driver.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scrapli/driver/base/async_driver.py b/scrapli/driver/base/async_driver.py index ec7139b6..81a408f0 100644 --- a/scrapli/driver/base/async_driver.py +++ b/scrapli/driver/base/async_driver.py @@ -1,6 +1,6 @@ """scrapli.driver.base.async_driver""" from types import TracebackType -from typing import Any, Optional, Type +from typing import Any, Optional, Type, TypeVar from scrapli.channel import AsyncChannel from scrapli.driver.base.base_driver import BaseDriver @@ -8,6 +8,9 @@ from scrapli.transport import ASYNCIO_TRANSPORTS +_T = TypeVar("_T") + + class AsyncDriver(BaseDriver): def __init__(self, **kwargs: Any): super().__init__(**kwargs) @@ -23,7 +26,7 @@ def __init__(self, **kwargs: Any): base_channel_args=self._base_channel_args, ) - async def __aenter__(self): + async def __aenter__(self: _T) -> _T: """ Enter method for context manager diff --git a/scrapli/driver/base/sync_driver.py b/scrapli/driver/base/sync_driver.py index 09c898ee..bc8848c2 100644 --- a/scrapli/driver/base/sync_driver.py +++ b/scrapli/driver/base/sync_driver.py @@ -1,6 +1,6 @@ """scrapli.driver.base.sync_driver""" from types import TracebackType -from typing import Any, Optional, Type +from typing import Any, Optional, Type, TypeVar from scrapli.channel import Channel from scrapli.driver.base.base_driver import BaseDriver @@ -8,6 +8,9 @@ from scrapli.transport import ASYNCIO_TRANSPORTS +_T = TypeVar("_T") + + class Driver(BaseDriver): def __init__(self, **kwargs: Any): super().__init__(**kwargs) @@ -23,7 +26,7 @@ def __init__(self, **kwargs: Any): base_channel_args=self._base_channel_args, ) - def __enter__(self): + def __enter__(self: _T) -> _T: """ Enter method for context manager From 0b65ce2c8d69afe6c7040ee0ae50a167042a02e7 Mon Sep 17 00:00:00 2001 From: "v.garkaviy" Date: Thu, 21 Jul 2022 08:01:50 +0300 Subject: [PATCH 45/49] bind generic var to an actual type. --- scrapli/driver/base/async_driver.py | 3 +-- scrapli/driver/base/sync_driver.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scrapli/driver/base/async_driver.py b/scrapli/driver/base/async_driver.py index 81a408f0..bcf28bcb 100644 --- a/scrapli/driver/base/async_driver.py +++ b/scrapli/driver/base/async_driver.py @@ -7,8 +7,7 @@ from scrapli.exceptions import ScrapliValueError from scrapli.transport import ASYNCIO_TRANSPORTS - -_T = TypeVar("_T") +_T = TypeVar("_T", bound="AsyncDriver") class AsyncDriver(BaseDriver): diff --git a/scrapli/driver/base/sync_driver.py b/scrapli/driver/base/sync_driver.py index bc8848c2..f6717dfd 100644 --- a/scrapli/driver/base/sync_driver.py +++ b/scrapli/driver/base/sync_driver.py @@ -7,8 +7,7 @@ from scrapli.exceptions import ScrapliValueError from scrapli.transport import ASYNCIO_TRANSPORTS - -_T = TypeVar("_T") +_T = TypeVar("_T", bound="Driver") class Driver(BaseDriver): From e57b253f5cc9df0472f4ad1804a296c450f320d4 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Thu, 21 Jul 2022 09:27:40 -0700 Subject: [PATCH 46/49] update enter/aenter return type --- scrapli/driver/base/async_driver.py | 2 +- scrapli/driver/base/sync_driver.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scrapli/driver/base/async_driver.py b/scrapli/driver/base/async_driver.py index bcf28bcb..78a0ef61 100644 --- a/scrapli/driver/base/async_driver.py +++ b/scrapli/driver/base/async_driver.py @@ -33,7 +33,7 @@ async def __aenter__(self: _T) -> _T: N/A Returns: - AsyncDriver: a concrete implementation of the opened AsyncDriver object + _T: a concrete implementation of the opened AsyncDriver object Raises: N/A diff --git a/scrapli/driver/base/sync_driver.py b/scrapli/driver/base/sync_driver.py index f6717dfd..c8087d2d 100644 --- a/scrapli/driver/base/sync_driver.py +++ b/scrapli/driver/base/sync_driver.py @@ -33,7 +33,7 @@ def __enter__(self: _T) -> _T: N/A Returns: - Driver: a concrete implementation of the opened Driver object + _T: a concrete implementation of the opened Driver object Raises: N/A From db47819e9bc30a374dd43af96d6797ab59652305 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Tue, 26 Jul 2022 10:11:29 -0700 Subject: [PATCH 47/49] test genie on 3.10, better pyfakefs workaround for pyats issue --- requirements-genie.txt | 4 ++-- tests/conftest.py | 9 +++++++++ tests/unit/channel/test_async_channel.py | 3 +-- tests/unit/channel/test_base_channel.py | 10 ++++------ tests/unit/channel/test_sync_channel.py | 3 +-- tests/unit/driver/base/test_base_base_driver.py | 16 +++++++--------- .../driver/generic/test_generic_async_driver.py | 4 ++-- .../driver/generic/test_generic_base_driver.py | 4 ++-- .../driver/generic/test_generic_sync_driver.py | 6 ++++-- .../driver/network/test_network_async_driver.py | 8 ++++---- .../driver/network/test_network_sync_driver.py | 10 ++++++---- tests/unit/test_helper.py | 16 ++++++---------- tests/unit/test_logging.py | 4 ++-- tests/unit/test_response.py | 4 ++-- tests/unit/test_ssh_config.py | 4 ++-- .../plugins/system/test_system_transport.py | 16 ++++++++-------- 16 files changed, 62 insertions(+), 59 deletions(-) diff --git a/requirements-genie.txt b/requirements-genie.txt index a4fda06c..c00e8230 100644 --- a/requirements-genie.txt +++ b/requirements-genie.txt @@ -1,2 +1,2 @@ -genie>=20.2 ; sys_platform != "win32" and python_version < "3.10" -pyats>=20.2 ; sys_platform != "win32" and python_version < "3.10" \ No newline at end of file +genie>=20.2 ; sys_platform != "win32" and python_version < "3.11" +pyats>=20.2 ; sys_platform != "win32" and python_version < "3.11" \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py index ae0c35f9..9f5d9577 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -9,12 +9,21 @@ cisco_nxos_clean_response, juniper_junos_clean_response, ) +from pyfakefs.fake_filesystem_unittest import Patcher import scrapli TEST_DATA_PATH = f"{Path(scrapli.__file__).parents[1]}/tests/test_data" +@pytest.fixture +def fs_(): + # replaces "fs" (pyfakefs) with patched one that does *not* use cache -- this is because + # pyats does something fucky with modules that breaks pyfakefs. + with Patcher(use_cache=False) as patcher: + yield patcher.fs + + @pytest.fixture(scope="session") def test_data_path(): """Fixture to provide path to test data files""" diff --git a/tests/unit/channel/test_async_channel.py b/tests/unit/channel/test_async_channel.py index 052bdeff..fc3264b7 100644 --- a/tests/unit/channel/test_async_channel.py +++ b/tests/unit/channel/test_async_channel.py @@ -38,9 +38,8 @@ async def test_channel_lock_context_manager_no_channel_lock(async_transport_no_a assert True -async def test_channel_read(fs, caplog, monkeypatch, async_transport_no_abc): +async def test_channel_read(fs_, caplog, monkeypatch, async_transport_no_abc): # fs needed to mock filesystem for asserting log location - _ = fs caplog.set_level(logging.DEBUG, logger="scrapli.channel") channel_read_called = False diff --git a/tests/unit/channel/test_base_channel.py b/tests/unit/channel/test_base_channel.py index 190a4fb2..22fe0921 100644 --- a/tests/unit/channel/test_base_channel.py +++ b/tests/unit/channel/test_base_channel.py @@ -47,8 +47,8 @@ def test_channel_auth_properties(test_data, base_channel): assert getattr(base_channel, property_name) == compiled_new_value -def test_channel_log_append(fs, base_transport_no_abc): - fs.create_file( +def test_channel_log_append(fs_, base_transport_no_abc): + fs_.create_file( "scrapli_channel.log", contents="APPEND TO ME PLEASE!", ) @@ -67,18 +67,16 @@ def test_channel_log_invalid_mode(base_transport_no_abc): BaseChannelArgs(channel_log=True, channel_log_mode="not valid") -def test_channel_log(fs, base_transport_no_abc): +def test_channel_log(fs_, base_transport_no_abc): # fs needed to mock filesystem for asserting log location - _ = fs base_channel_args = BaseChannelArgs(channel_log=True) chan = BaseChannel(transport=base_transport_no_abc, base_channel_args=base_channel_args) chan.open() assert Path("/scrapli_channel.log").is_file() -def test_channel_log_user_defined(fs, base_transport_no_abc): +def test_channel_log_user_defined(fs_, base_transport_no_abc): # fs needed to mock filesystem for asserting log location - _ = fs base_channel_args = BaseChannelArgs(channel_log="/log.log") chan = BaseChannel(transport=base_transport_no_abc, base_channel_args=base_channel_args) chan.open() diff --git a/tests/unit/channel/test_sync_channel.py b/tests/unit/channel/test_sync_channel.py index 2ab1f002..8c373f49 100644 --- a/tests/unit/channel/test_sync_channel.py +++ b/tests/unit/channel/test_sync_channel.py @@ -32,9 +32,8 @@ def test_channel_lock_context_manager_no_channel_lock(base_transport_no_abc): assert True -def test_channel_read(fs, caplog, monkeypatch, sync_transport_no_abc): +def test_channel_read(fs_, caplog, monkeypatch, sync_transport_no_abc): # fs needed to mock filesystem for asserting log location - _ = fs caplog.set_level(logging.DEBUG, logger="scrapli.channel") channel_read_called = False diff --git a/tests/unit/driver/base/test_base_base_driver.py b/tests/unit/driver/base/test_base_base_driver.py index d44d017e..7ea75979 100644 --- a/tests/unit/driver/base/test_base_base_driver.py +++ b/tests/unit/driver/base/test_base_base_driver.py @@ -90,8 +90,8 @@ def test_setup_ssh_file_args_telnet_transport(caplog, base_driver, test_data): assert logging.DEBUG == log_record.levelno -def test_update_ssh_args_from_ssh_config(fs, real_ssh_config_file_path, base_driver): - fs.add_real_file(source_path=real_ssh_config_file_path, target_path="ssh_config") +def test_update_ssh_args_from_ssh_config(fs_, real_ssh_config_file_path, base_driver): + fs_.add_real_file(source_path=real_ssh_config_file_path, target_path="ssh_config") base_driver.ssh_config_file = "ssh_config" base_driver.host = "1.2.3.4" base_driver.port = 0 @@ -119,7 +119,7 @@ def test_update_ssh_args_from_ssh_config(fs, real_ssh_config_file_path, base_dri ), ids=("true", "unresolvable_path"), ) -def test_setup_ssh_file_args_resolved(fs, base_driver, test_data): +def test_setup_ssh_file_args_resolved(fs_, base_driver, test_data): """ Assert we handle ssh config/known hosts inputs properly @@ -127,8 +127,6 @@ def test_setup_ssh_file_args_resolved(fs, base_driver, test_data): that if given a non False bool or a string we properly try to resolve the ssh files """ # using fakefs to ensure we dont resolve user/system config files - _ = fs - ssh_config_file_input, ssh_known_hosts_file_input = test_data resolved_ssh_config_file, resolved_ssh_known_hosts_file = base_driver._setup_ssh_file_args( @@ -240,11 +238,11 @@ def _import_module(_): ], ids=("auto_etc", "auto_user", "manual_location", "no_config"), ) -def test_resolve_ssh_config(fs, real_ssh_config_file_path, base_driver, test_data): +def test_resolve_ssh_config(fs_, real_ssh_config_file_path, base_driver, test_data): input_data, expected_output, mount_real_file, fake_fs_destination = test_data if mount_real_file: - fs.add_real_file(source_path=real_ssh_config_file_path, target_path=fake_fs_destination) + fs_.add_real_file(source_path=real_ssh_config_file_path, target_path=fake_fs_destination) actual_output = base_driver._resolve_ssh_config(ssh_config_file=input_data) assert actual_output == expected_output @@ -269,11 +267,11 @@ def test_resolve_ssh_config(fs, real_ssh_config_file_path, base_driver, test_dat ], ids=("auto_etc", "auto_user", "manual_location", "no_config"), ) -def test_resolve_ssh_known_hosts(fs, real_ssh_known_hosts_file_path, base_driver, test_data): +def test_resolve_ssh_known_hosts(fs_, real_ssh_known_hosts_file_path, base_driver, test_data): input_data, expected_output, mount_real_file, fake_fs_destination = test_data if mount_real_file: - fs.add_real_file( + fs_.add_real_file( source_path=real_ssh_known_hosts_file_path, target_path=fake_fs_destination ) actual_output = base_driver._resolve_ssh_known_hosts(ssh_known_hosts=input_data) diff --git a/tests/unit/driver/generic/test_generic_async_driver.py b/tests/unit/driver/generic/test_generic_async_driver.py index 2e906b5d..b279fea8 100644 --- a/tests/unit/driver/generic/test_generic_async_driver.py +++ b/tests/unit/driver/generic/test_generic_async_driver.py @@ -56,9 +56,9 @@ async def _send_input(cls, **kwargs): async def test_send_commands_from_file( - fs, monkeypatch, real_ssh_commands_file_path, async_generic_driver + fs_, monkeypatch, real_ssh_commands_file_path, async_generic_driver ): - fs.add_real_file(source_path=real_ssh_commands_file_path, target_path="/commands") + fs_.add_real_file(source_path=real_ssh_commands_file_path, target_path="/commands") async def _send_input(cls, **kwargs): return b"raw", b"processed" diff --git a/tests/unit/driver/generic/test_generic_base_driver.py b/tests/unit/driver/generic/test_generic_base_driver.py index 52382f9c..3fd92443 100644 --- a/tests/unit/driver/generic/test_generic_base_driver.py +++ b/tests/unit/driver/generic/test_generic_base_driver.py @@ -148,8 +148,8 @@ def test_pre_send_commands(base_generic_driver): assert isinstance(actual_responses, MultiResponse) -def test_pre_send_from_file(fs, real_ssh_config_file_path, base_generic_driver): - fs.add_real_file(source_path=real_ssh_config_file_path, target_path="/scrapli/mycommands") +def test_pre_send_from_file(fs_, real_ssh_config_file_path, base_generic_driver): + fs_.add_real_file(source_path=real_ssh_config_file_path, target_path="/scrapli/mycommands") commands = base_generic_driver._pre_send_from_file( file="/scrapli/mycommands", caller="commands" ) diff --git a/tests/unit/driver/generic/test_generic_sync_driver.py b/tests/unit/driver/generic/test_generic_sync_driver.py index f71be733..7bac0521 100644 --- a/tests/unit/driver/generic/test_generic_sync_driver.py +++ b/tests/unit/driver/generic/test_generic_sync_driver.py @@ -52,8 +52,10 @@ def test_send_commands(monkeypatch, sync_generic_driver): assert actual_response[0].raw_result == b"raw" -def test_send_commands_from_file(fs, monkeypatch, real_ssh_commands_file_path, sync_generic_driver): - fs.add_real_file(source_path=real_ssh_commands_file_path, target_path="/commands") +def test_send_commands_from_file( + fs_, monkeypatch, real_ssh_commands_file_path, sync_generic_driver +): + fs_.add_real_file(source_path=real_ssh_commands_file_path, target_path="/commands") monkeypatch.setattr( "scrapli.channel.sync_channel.Channel.send_input", lambda _, **kwargs: (b"raw", b"processed"), diff --git a/tests/unit/driver/network/test_network_async_driver.py b/tests/unit/driver/network/test_network_async_driver.py index 4c3cafb2..d2a3109f 100644 --- a/tests/unit/driver/network/test_network_async_driver.py +++ b/tests/unit/driver/network/test_network_async_driver.py @@ -323,9 +323,9 @@ async def _send_input(cls, channel_input, **kwargs): async def test_send_commands_from_file( - fs, monkeypatch, real_ssh_commands_file_path, async_network_driver + fs_, monkeypatch, real_ssh_commands_file_path, async_network_driver ): - fs.add_real_file(source_path=real_ssh_commands_file_path, target_path="/commands") + fs_.add_real_file(source_path=real_ssh_commands_file_path, target_path="/commands") async def _acquire_appropriate_privilege_level(cls, **kwargs): return @@ -449,9 +449,9 @@ async def _send_input(cls, channel_input, **kwargs): async def test_send_configs_from_file( - fs, monkeypatch, real_ssh_commands_file_path, async_network_driver + fs_, monkeypatch, real_ssh_commands_file_path, async_network_driver ): - fs.add_real_file(source_path=real_ssh_commands_file_path, target_path="/configs") + fs_.add_real_file(source_path=real_ssh_commands_file_path, target_path="/configs") async def _acquire_priv(cls, **kwargs): return diff --git a/tests/unit/driver/network/test_network_sync_driver.py b/tests/unit/driver/network/test_network_sync_driver.py index d1163622..cfd79335 100644 --- a/tests/unit/driver/network/test_network_sync_driver.py +++ b/tests/unit/driver/network/test_network_sync_driver.py @@ -305,8 +305,10 @@ def _send_input(cls, channel_input, **kwargs): assert actual_response[0].raw_result == b"raw" -def test_send_commands_from_file(fs, monkeypatch, real_ssh_commands_file_path, sync_network_driver): - fs.add_real_file(source_path=real_ssh_commands_file_path, target_path="/commands") +def test_send_commands_from_file( + fs_, monkeypatch, real_ssh_commands_file_path, sync_network_driver +): + fs_.add_real_file(source_path=real_ssh_commands_file_path, target_path="/commands") def _acquire_appropriate_privilege_level(cls, **kwargs): return @@ -419,8 +421,8 @@ def _send_input(cls, channel_input, **kwargs): assert actual_response.raw_result == b"" -def test_send_configs_from_file(fs, monkeypatch, real_ssh_commands_file_path, sync_network_driver): - fs.add_real_file(source_path=real_ssh_commands_file_path, target_path="/configs") +def test_send_configs_from_file(fs_, monkeypatch, real_ssh_commands_file_path, sync_network_driver): + fs_.add_real_file(source_path=real_ssh_commands_file_path, target_path="/configs") def _acquire_priv(cls, **kwargs): return diff --git a/tests/unit/test_helper.py b/tests/unit/test_helper.py index 922cefd9..cfd51981 100644 --- a/tests/unit/test_helper.py +++ b/tests/unit/test_helper.py @@ -142,7 +142,7 @@ def test_textfsm_parse_failed_to_parse(): @pytest.mark.skipif( - sys.version_info.minor > 9, reason="genie not currently available for python 3.10" + sys.version_info.minor > 10, reason="genie not currently available for python 3.11" ) def test_genie_parser(): result = genie_parse("iosxe", "show ip arp", IOS_ARP) @@ -153,13 +153,11 @@ def test_genie_parser(): @pytest.mark.skipif( - sys.version_info.minor > 9, reason="genie not currently available for python 3.10" + sys.version_info.minor > 10, reason="genie not currently available for python 3.11" ) def test_genie_parse_failure(): result = genie_parse("iosxe", "show ip arp", "not really arp data") assert result == [] - # w/out killing this module pyfakefs explodes. dont remember why/how i found that out... - del sys.modules["pyats.configuration"] def test_genie_no_genie_installed(monkeypatch): @@ -240,17 +238,15 @@ def _import_module(name): assert output == [] -def test_resolve_file(fs, real_ssh_config_file_path): +def test_resolve_file(fs_, real_ssh_config_file_path): # pyfakefs so this is not host dependent - _ = fs - fs.add_real_file(source_path=real_ssh_config_file_path, target_path="/some/neat/path/myfile") + fs_.add_real_file(source_path=real_ssh_config_file_path, target_path="/some/neat/path/myfile") assert resolve_file(file="/some/neat/path/myfile") == "/some/neat/path/myfile" -def test_resolve_file_expanduser(fs, real_ssh_config_file_path): +def test_resolve_file_expanduser(fs_, real_ssh_config_file_path): # pyfakefs so this is not host dependent - _ = fs - fs.add_real_file( + fs_.add_real_file( source_path=real_ssh_config_file_path, target_path=Path("~/myfile").expanduser() ) assert resolve_file(file="~/myfile") == str(Path("~/myfile").expanduser()) diff --git a/tests/unit/test_logging.py b/tests/unit/test_logging.py index 46b47f2c..25f28111 100644 --- a/tests/unit/test_logging.py +++ b/tests/unit/test_logging.py @@ -61,7 +61,7 @@ def test_scrapli_filehandler(): pass -def test_enable_basic_logging(fs): +def test_enable_basic_logging(fs_): assert Path("scrapli.log").is_file() is False enable_basic_logging(file=True, level="debug") scrapli_logger = logging.getLogger("scrapli") @@ -78,7 +78,7 @@ def test_enable_basic_logging(fs): del logger.handlers[1] -def test_enable_basic_logging_no_buffer(fs): +def test_enable_basic_logging_no_buffer(fs_): assert Path("mylog.log").is_file() is False enable_basic_logging(file="mylog.log", level="debug", buffer_log=False, caller_info=True) diff --git a/tests/unit/test_response.py b/tests/unit/test_response.py index ed0928cd..a57767e0 100644 --- a/tests/unit/test_response.py +++ b/tests/unit/test_response.py @@ -163,7 +163,7 @@ def test_response_parse_textfsm_no_template(): @pytest.mark.skipif( - sys.version_info.minor > 9, reason="genie not currently available for python 3.10" + sys.version_info.minor > 10, reason="genie not currently available for python 3.11" ) def test_response_parse_genie(): response = Response("localhost", channel_input="show ip arp", genie_platform="iosxe") @@ -179,7 +179,7 @@ def test_response_parse_genie(): @pytest.mark.skipif( - sys.version_info.minor > 9, reason="genie not currently available for python 3.10" + sys.version_info.minor > 10, reason="genie not currently available for python 3.11" ) def test_response_parse_genie_fail(): response = Response("localhost", channel_input="show ip arp", genie_platform="iosxe") diff --git a/tests/unit/test_ssh_config.py b/tests/unit/test_ssh_config.py index 5a58ff77..c9f3c94f 100644 --- a/tests/unit/test_ssh_config.py +++ b/tests/unit/test_ssh_config.py @@ -57,7 +57,7 @@ def test_init_ssh_config_file_explicit(real_ssh_config_file_path): assert ssh_conf.ssh_config == ssh_config_file -def test_init_ssh_config_file_no_config_file(fs): +def test_init_ssh_config_file_no_config_file(fs_): ssh_conf = SSHConfig("") # should only have a single splat host w/ all values set to None/empty assert ["*"] == list(ssh_conf.hosts.keys()) @@ -164,7 +164,7 @@ def test_init_ssh_known_hosts_file_explicit(real_ssh_known_hosts_file_path): assert known_hosts.ssh_known_hosts == ssh_known_hosts -def test_init_ssh_known_hosts_file_no_config_file(fs): +def test_init_ssh_known_hosts_file_no_config_file(fs_): known_hosts = SSHKnownHosts("") assert known_hosts.hosts == {} diff --git a/tests/unit/transport/plugins/system/test_system_transport.py b/tests/unit/transport/plugins/system/test_system_transport.py index 3b30d4f8..012f7362 100644 --- a/tests/unit/transport/plugins/system/test_system_transport.py +++ b/tests/unit/transport/plugins/system/test_system_transport.py @@ -84,7 +84,7 @@ def test_build_open_cmd_alternate_options(system_transport): ] -def test_close(fs, monkeypatch, system_transport): +def test_close(fs_, monkeypatch, system_transport): def _close(cls): pass @@ -95,7 +95,7 @@ def _close(cls): # giving ptyprocess a "real" (but not like... real real) fd seemed like a good idea... dunno # if its really necessary, but it *does* need a fd of some sort so whatever - fs.create_file("dummy") + fs_.create_file("dummy") dummy_file = open("dummy") system_transport.session = PtyProcess(pid=0, fd=dummy_file.fileno()) system_transport.close() @@ -107,7 +107,7 @@ def test_isalive_no_session(system_transport): assert system_transport.isalive() is False -def test_isalive(fs, system_transport): +def test_isalive(fs_, system_transport): # lie and pretend the session is already assigned # giving ptyprocess a "real" (but not like... real real) fd seemed like a good idea... dunno # if its really necessary, but it *does* need a fd of some sort so whatever; also give it a @@ -115,13 +115,13 @@ def test_isalive(fs, system_transport): # to work but we really only care that scrapli does the right thing... we have faith that # ptyprocess will be doing the right thing "below" scrapli dummy_pid, fd = pty.fork() - fs.create_file("dummy") + fs_.create_file("dummy") dummy_file = open("dummy") system_transport.session = PtyProcess(pid=dummy_pid, fd=dummy_file.fileno()) assert system_transport.isalive() is True -def test_read(fs, monkeypatch, system_transport): +def test_read(fs_, monkeypatch, system_transport): def _read(cls, _): return b"somebytes" @@ -134,7 +134,7 @@ def _read(cls, _): # giving ptyprocess a "real" (but not like... real real) fd seemed like a good idea... dunno # if its really necessary, but it *does* need a fd of some sort so whatever dummy_pid, fd = pty.fork() - fs.create_file("dummy") + fs_.create_file("dummy") dummy_file = open("dummy") system_transport.session = PtyProcess(pid=dummy_pid, fd=dummy_file.fileno()) @@ -146,7 +146,7 @@ def test_read_exception_not_open(system_transport): system_transport.read() -def test_read_exception_eof(fs, monkeypatch, system_transport): +def test_read_exception_eof(fs_, monkeypatch, system_transport): def _read(cls, _): raise EOFError @@ -158,7 +158,7 @@ def _read(cls, _): # lie and pretend the session is already assigned # giving ptyprocess a "real" (but not like... real real) fd seemed like a good idea... dunno # if its really necessary, but it *does* need a fd of some sort so whatever - fs.create_file("dummy") + fs_.create_file("dummy") dummy_file = open("dummy") system_transport.session = PtyProcess(pid=0, fd=dummy_file.fileno()) From 96422316bc93b445a1a0baec93ed9fcfadaa5b16 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Tue, 26 Jul 2022 10:11:47 -0700 Subject: [PATCH 48/49] changelog catch up --- docs/changelog.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 049344ae..9be8c864 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,6 +1,20 @@ Changelog ========= +## 2022.07.30 + +- Added MANIFEST.in to make sure requirements files are in source distribution see #216 +- Move weekly build to develop branch so weekly build doesn't fail for "stale" main branch reasons +- `textfsm_parse` now supports passing in a file *or* URL to load as the template file -- thank you to @haccht for + this one -- see #215 +- Fixed some mypy/typing challenges around the scrapli "factory" context manager -- thank you to @erwinkinn for + working on this +- With lots of help from @netixx tracked down some silliness with timeout decorators not behaving how they should -- + check out #233 for details on this +- Overhauled the functional testing to align more closely with scrapligo and to remove all the old unnecessary + dockerfile bits, replacing that completely with containerlab + + ## 2022.01.30.post1 - Remove newline anchor in in-channel auth password pattern. Felt like a good/smart idea but Cisco in their infinite From 4813711d6d5e74998f9cdee2c2fe5400fbc45702 Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Tue, 26 Jul 2022 10:12:18 -0700 Subject: [PATCH 49/49] prep for release, regen docs --- docs/api_docs/channel/async_channel.md | 36 +- docs/api_docs/channel/sync_channel.md | 26 +- docs/api_docs/decorators.md | 1097 ++++------------- docs/api_docs/driver/base/async_driver.md | 12 +- docs/api_docs/driver/base/sync_driver.md | 12 +- .../driver/core/juniper_junos/base_driver.md | 2 +- docs/api_docs/driver/generic/async_driver.md | 14 +- docs/api_docs/driver/generic/sync_driver.md | 14 +- docs/api_docs/driver/network/async_driver.md | 14 +- docs/api_docs/driver/network/base_driver.md | 6 +- docs/api_docs/driver/network/sync_driver.md | 14 +- docs/api_docs/transport/plugins/asyncssh.md | 6 +- .../api_docs/transport/plugins/asynctelnet.md | 26 +- docs/api_docs/transport/plugins/paramiko.md | 12 +- docs/api_docs/transport/plugins/system.md | 6 +- docs/api_docs/transport/plugins/telnet.md | 470 ++++--- setup.py | 2 +- 17 files changed, 690 insertions(+), 1079 deletions(-) diff --git a/docs/api_docs/channel/async_channel.md b/docs/api_docs/channel/async_channel.md index 8a04cc28..97c167fc 100644 --- a/docs/api_docs/channel/async_channel.md +++ b/docs/api_docs/channel/async_channel.md @@ -32,19 +32,13 @@ scrapli.channel.async_channel import asyncio import re import time -from io import BytesIO - -try: - from contextlib import asynccontextmanager -except ImportError: # pragma: nocover - # needed for 3.6 support, no asynccontextmanager until 3.7 - from async_generator import asynccontextmanager # type: ignore # pragma: nocover - +from contextlib import asynccontextmanager from datetime import datetime +from io import BytesIO from typing import AsyncIterator, List, Optional, Tuple from scrapli.channel.base_channel import BaseChannel, BaseChannelArgs -from scrapli.decorators import ChannelTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ScrapliAuthenticationFailed, ScrapliTimeout from scrapli.transport.base import AsyncTransport @@ -290,7 +284,7 @@ class AsyncChannel(BaseChannel): return read_buf.getvalue() - @ChannelTimeout(message="timed out during in channel ssh authentication") + @timeout_wrapper async def channel_authenticate_ssh( self, auth_password: str, auth_private_key_passphrase: str ) -> None: @@ -363,7 +357,7 @@ class AsyncChannel(BaseChannel): ): return - @ChannelTimeout(message="timed out during in channel telnet authentication") + @timeout_wrapper async def channel_authenticate_telnet( # noqa: C901 self, auth_username: str = "", auth_password: str = "" ) -> None: @@ -450,7 +444,7 @@ class AsyncChannel(BaseChannel): ): return - @ChannelTimeout(message="timed out getting prompt") + @timeout_wrapper async def get_prompt(self) -> str: """ Get current channel prompt @@ -486,7 +480,7 @@ class AsyncChannel(BaseChannel): current_prompt = channel_match.group(0) return current_prompt.decode().strip() - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper async def send_input( self, channel_input: str, @@ -534,7 +528,7 @@ class AsyncChannel(BaseChannel): ) return buf, processed_buf - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper async def send_input_and_read( self, channel_input: str, @@ -589,7 +583,7 @@ class AsyncChannel(BaseChannel): return buf, processed_buf - @ChannelTimeout(message="timed out sending interactive input to device") + @timeout_wrapper async def send_inputs_interact( self, interact_events: List[Tuple[str, str, Optional[bool]]], @@ -970,7 +964,7 @@ class AsyncChannel(BaseChannel): return read_buf.getvalue() - @ChannelTimeout(message="timed out during in channel ssh authentication") + @timeout_wrapper async def channel_authenticate_ssh( self, auth_password: str, auth_private_key_passphrase: str ) -> None: @@ -1043,7 +1037,7 @@ class AsyncChannel(BaseChannel): ): return - @ChannelTimeout(message="timed out during in channel telnet authentication") + @timeout_wrapper async def channel_authenticate_telnet( # noqa: C901 self, auth_username: str = "", auth_password: str = "" ) -> None: @@ -1130,7 +1124,7 @@ class AsyncChannel(BaseChannel): ): return - @ChannelTimeout(message="timed out getting prompt") + @timeout_wrapper async def get_prompt(self) -> str: """ Get current channel prompt @@ -1166,7 +1160,7 @@ class AsyncChannel(BaseChannel): current_prompt = channel_match.group(0) return current_prompt.decode().strip() - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper async def send_input( self, channel_input: str, @@ -1214,7 +1208,7 @@ class AsyncChannel(BaseChannel): ) return buf, processed_buf - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper async def send_input_and_read( self, channel_input: str, @@ -1269,7 +1263,7 @@ class AsyncChannel(BaseChannel): return buf, processed_buf - @ChannelTimeout(message="timed out sending interactive input to device") + @timeout_wrapper async def send_inputs_interact( self, interact_events: List[Tuple[str, str, Optional[bool]]], diff --git a/docs/api_docs/channel/sync_channel.md b/docs/api_docs/channel/sync_channel.md index 999cedab..d55df88f 100644 --- a/docs/api_docs/channel/sync_channel.md +++ b/docs/api_docs/channel/sync_channel.md @@ -38,7 +38,7 @@ from threading import Lock from typing import Iterator, List, Optional, Tuple from scrapli.channel.base_channel import BaseChannel, BaseChannelArgs -from scrapli.decorators import ChannelTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ScrapliAuthenticationFailed, ScrapliTimeout from scrapli.transport.base import Transport @@ -281,7 +281,7 @@ class Channel(BaseChannel): return read_buf.getvalue() - @ChannelTimeout(message="timed out during in channel ssh authentication") + @timeout_wrapper def channel_authenticate_ssh( self, auth_password: str, auth_private_key_passphrase: str ) -> None: @@ -353,7 +353,7 @@ class Channel(BaseChannel): ): return - @ChannelTimeout(message="timed out during in channel telnet authentication") + @timeout_wrapper def channel_authenticate_telnet(self, auth_username: str = "", auth_password: str = "") -> None: """ Handle Telnet Authentication @@ -434,7 +434,7 @@ class Channel(BaseChannel): ): return - @ChannelTimeout(message="timed out getting prompt") + @timeout_wrapper def get_prompt(self) -> str: """ Get current channel prompt @@ -470,7 +470,7 @@ class Channel(BaseChannel): current_prompt = channel_match.group(0) return current_prompt.decode().strip() - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper def send_input( self, channel_input: str, @@ -518,7 +518,7 @@ class Channel(BaseChannel): ) return buf, processed_buf - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper def send_input_and_read( self, channel_input: str, @@ -573,7 +573,7 @@ class Channel(BaseChannel): return buf, processed_buf - @ChannelTimeout(message="timed out sending interactive input to device") + @timeout_wrapper def send_inputs_interact( self, interact_events: List[Tuple[str, str, Optional[bool]]], @@ -951,7 +951,7 @@ class Channel(BaseChannel): return read_buf.getvalue() - @ChannelTimeout(message="timed out during in channel ssh authentication") + @timeout_wrapper def channel_authenticate_ssh( self, auth_password: str, auth_private_key_passphrase: str ) -> None: @@ -1023,7 +1023,7 @@ class Channel(BaseChannel): ): return - @ChannelTimeout(message="timed out during in channel telnet authentication") + @timeout_wrapper def channel_authenticate_telnet(self, auth_username: str = "", auth_password: str = "") -> None: """ Handle Telnet Authentication @@ -1104,7 +1104,7 @@ class Channel(BaseChannel): ): return - @ChannelTimeout(message="timed out getting prompt") + @timeout_wrapper def get_prompt(self) -> str: """ Get current channel prompt @@ -1140,7 +1140,7 @@ class Channel(BaseChannel): current_prompt = channel_match.group(0) return current_prompt.decode().strip() - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper def send_input( self, channel_input: str, @@ -1188,7 +1188,7 @@ class Channel(BaseChannel): ) return buf, processed_buf - @ChannelTimeout(message="timed out sending input to device") + @timeout_wrapper def send_input_and_read( self, channel_input: str, @@ -1243,7 +1243,7 @@ class Channel(BaseChannel): return buf, processed_buf - @ChannelTimeout(message="timed out sending interactive input to device") + @timeout_wrapper def send_inputs_interact( self, interact_events: List[Tuple[str, str, Optional[bool]]], diff --git a/docs/api_docs/decorators.md b/docs/api_docs/decorators.md index 12c28830..dc0387c4 100644 --- a/docs/api_docs/decorators.md +++ b/docs/api_docs/decorators.md @@ -34,908 +34,359 @@ import signal import sys import threading from concurrent.futures import ThreadPoolExecutor, wait -from functools import update_wrapper +from functools import partial, update_wrapper from logging import Logger, LoggerAdapter -from typing import TYPE_CHECKING, Any, Callable +from typing import TYPE_CHECKING, Any, Callable, Tuple from scrapli.exceptions import ScrapliTimeout if TYPE_CHECKING: - from scrapli.channel import Channel # pragma: no cover from scrapli.driver import AsyncGenericDriver, GenericDriver # pragma: no cover from scrapli.transport.base.base_transport import BaseTransport # pragma: no cover if TYPE_CHECKING: - LoggerAdapterT = LoggerAdapter[Logger] # pylint:disable=E1136 + LoggerAdapterT = LoggerAdapter[Logger] # pragma: no cover # pylint:disable=E1136 else: LoggerAdapterT = LoggerAdapter _IS_WINDOWS = sys.platform.startswith("win") -class TransportTimeout: - def __init__(self, message: str = "") -> None: - """ - Transport timeout decorator +FUNC_TIMEOUT_MESSAGE_MAP = { + "channel_authenticate_ssh": "timed out during in channel ssh authentication", + "channel_authenticate_telnet": "timed out during in channel telnet authentication", + "get_prompt": "timed out getting prompt", + "send_input": "timed out sending input to device", + "send_input_and_read": "timed out sending input to device", + "send_inputs_interact": "timed out sending interactive input to device", + "read": "timed out reading from transport", +} + + +def _get_timeout_message(func_name: str) -> str: + """ + Return appropriate timeout message for the given function name + + Args: + func_name: name of function to fetch timeout message for + + Returns: + str: timeout message + + Raises: + N/A + + """ + return FUNC_TIMEOUT_MESSAGE_MAP.get(func_name, "unspecified timeout occurred") + + +def _signal_raise_exception( + signum: Any, frame: Any, transport: "BaseTransport", logger: LoggerAdapterT, message: str +) -> None: + """ + Signal method exception handler + + Args: + signum: singum from the singal handler, unused here + frame: frame from the signal handler, unused here + transport: transport to close + logger: logger to write closing messages to + message: exception message + + Returns: + None + + Raises: + N/A + + """ + _, _ = signum, frame + + return _handle_timeout(transport=transport, logger=logger, message=message) + + +def _multiprocessing_timeout( + transport: "BaseTransport", + logger: LoggerAdapterT, + timeout: float, + wrapped_func: Callable[..., Any], + args: Any, + kwargs: Any, +) -> Any: + """ + Return appropriate timeout message for the given function name + + Args: + transport: transport to close (if timeout occurs) + logger: logger to write closing message to + timeout: timeout in seconds + wrapped_func: function being decorated + args: function args + kwargs: function kwargs + + Returns: + Any: result of the wrapped function + + Raises: + N/A + + """ + with ThreadPoolExecutor(max_workers=1) as pool: + future = pool.submit(wrapped_func, *args, **kwargs) + wait([future], timeout=timeout) + if not future.done(): + return _handle_timeout( + transport=transport, + logger=logger, + message=_get_timeout_message(func_name=wrapped_func.__name__), + ) + return future.result() - Args: - message: accepts message from decorated function to add context to any timeout - (if a timeout happens!) - Returns: - None +def _handle_timeout(transport: "BaseTransport", logger: LoggerAdapterT, message: str) -> None: + """ + Timeout handler method to close connections and raise ScrapliTimeout - Raises: - N/A + Args: + transport: transport to close + logger: logger to write closing message to + message: message to pass to ScrapliTimeout exception - """ - self.message = message - self.transport_instance: "BaseTransport" - self.transport_timeout_transport = 0.0 + Returns: + None - def __call__(self, wrapped_func: Callable[..., Any]) -> Callable[..., Any]: - """ - Decorate an "operation" to modify the timeout_transport value for duration of that operation + Raises: + ScrapliTimeout: always, if we hit this method we have already timed out! - This decorator wraps a transport read operation and is used to allow users to control the - transport timeout via the `timeout_transport` attribute. This decorator should be applied to - any transport "read" operations. + """ + logger.critical("operation timed out, closing connection") + transport.close() + raise ScrapliTimeout(message) - Args: - wrapped_func: function being decorated - Returns: - decorate: decorated func +def _get_transport_logger_timeout( + cls: Any, +) -> Tuple["BaseTransport", LoggerAdapterT, float]: + """ + Fetch the transport, logger and timeout from the channel or transport object - Raises: - N/A + Args: + cls: Channel or Transport object (self from wrapped function) to grab transport/logger and + timeout values from - """ + Returns: + Tuple: transport, logger, and timeout value - if asyncio.iscoroutinefunction(wrapped_func): + Raises: + N/A - async def decorate(*args: Any, **kwargs: Any) -> Any: - self.transport_instance = args[0] - self.transport_timeout_transport = self._get_timeout_transport() + """ + if hasattr(cls, "transport"): + return ( + cls.transport, + cls.logger, + cls._base_channel_args.timeout_ops, # pylint: disable=W0212 + ) - if not self.transport_timeout_transport: - return await wrapped_func(*args, **kwargs) + return ( + cls, + cls.logger, + cls._base_transport_args.timeout_transport, # pylint: disable=W0212 + ) - try: - return await asyncio.wait_for( - wrapped_func(*args, **kwargs), timeout=self.transport_timeout_transport - ) - except asyncio.TimeoutError: - self._handle_timeout() - - else: - # ignoring type error: - # "All conditional function variants must have identical signatures" - # one is sync one is async so never going to be identical here! - def decorate(*args: Any, **kwargs: Any) -> Any: # type: ignore - self.transport_instance = args[0] - self.transport_timeout_transport = self._get_timeout_transport() - - if not self.transport_timeout_transport: - return wrapped_func(*args, **kwargs) - - transport_instance_class_name = self.transport_instance.__class__.__name__ - - if ( - transport_instance_class_name in ("SystemTransport", "TelnetTransport") - or _IS_WINDOWS - or threading.current_thread() is not threading.main_thread() - ): - return self._multiprocessing_timeout( - wrapped_func=wrapped_func, - args=args, - kwargs=kwargs, - ) - - old = signal.signal(signal.SIGALRM, self._signal_raise_exception) - signal.setitimer(signal.ITIMER_REAL, self.transport_timeout_transport) - try: - return wrapped_func(*args, **kwargs) - finally: - if self.transport_timeout_transport: - signal.setitimer(signal.ITIMER_REAL, 0) - signal.signal(signal.SIGALRM, old) - - # ensures that the wrapped function is updated w/ the original functions docs/etc. -- - # necessary for introspection for the auto gen docs to work! - update_wrapper(wrapper=decorate, wrapped=wrapped_func) - return decorate - - def _get_timeout_transport(self) -> float: - """ - Fetch and return timeout transport from the transport object - - Args: - N/A - - Returns: - float: transport timeout value - - Raises: - N/A - - """ - transport_args = self.transport_instance._base_transport_args # pylint: disable=W0212 - return transport_args.timeout_transport - - def _handle_timeout(self) -> None: - """ - Timeout handler method to close connections and raise ScrapliTimeout - - Args: - N/A - - Returns: - None - - Raises: - ScrapliTimeout: always, if we hit this method we have already timed out! - - """ - self.transport_instance.logger.critical("transport operation timed out, closing transport") - self.transport_instance.close() - raise ScrapliTimeout(self.message) - - def _multiprocessing_timeout( - self, wrapped_func: Callable[..., Any], args: Any, kwargs: Any - ) -> Any: - """ - Multiprocessing method for timeouts; works in threads and on windows - - Args: - wrapped_func: function being decorated - args: function being decorated args - kwargs: function being decorated kwargs - - Returns: - Any: result of decorated function - - Raises: - N/A - - """ - with ThreadPoolExecutor(max_workers=1) as pool: - future = pool.submit(wrapped_func, *args, **kwargs) - wait([future], timeout=self.transport_timeout_transport) - if not future.done(): - self._handle_timeout() - return future.result() - def _signal_raise_exception(self, signum: Any, frame: Any) -> None: - """ - Signal method exception handler +def timeout_wrapper(wrapped_func: Callable[..., Any]) -> Callable[..., Any]: + """ + Timeout wrapper for transports - Args: - signum: singum from the singal handler, unused here - frame: frame from the signal handler, unused here + Args: + wrapped_func: function being wrapped -- must be a method of Channel or Transport - Returns: - None + Returns: + Any: result of wrapped function - Raises: - N/A + Raises: + N/A - """ - _, _ = signum, frame - self._handle_timeout() + """ + if asyncio.iscoroutinefunction(wrapped_func): + async def decorate(*args: Any, **kwargs: Any) -> Any: + transport, logger, timeout = _get_transport_logger_timeout(cls=args[0]) -class ChannelTimeout: - def __init__(self, message: str = "") -> None: - """ - Channel timeout decorator + if not timeout: + return await wrapped_func(*args, **kwargs) - Args: - message: accepts message from decorated function to add context to any timeout - (if a timeout happens!) + try: + return await asyncio.wait_for(wrapped_func(*args, **kwargs), timeout=timeout) + except asyncio.TimeoutError: + _handle_timeout( + transport=transport, + logger=logger, + message=_get_timeout_message(func_name=wrapped_func.__name__), + ) - Returns: - None + else: + # ignoring type error: + # "All conditional function variants must have identical signatures" + # one is sync one is async so never going to be identical here! + def decorate(*args: Any, **kwargs: Any) -> Any: # type: ignore + transport, logger, timeout = _get_transport_logger_timeout(cls=args[0]) + + if not timeout: + return wrapped_func(*args, **kwargs) + + cls_name = transport.__class__.__name__ + + if ( + cls_name in ("SystemTransport", "TelnetTransport") + or _IS_WINDOWS + or threading.current_thread() is not threading.main_thread() + ): + return _multiprocessing_timeout( + transport=transport, + logger=logger, + timeout=timeout, + wrapped_func=wrapped_func, + args=args, + kwargs=kwargs, + ) - Raises: - N/A + callback = partial( + _signal_raise_exception, + transport=transport, + logger=logger, + message=_get_timeout_message(wrapped_func.__name__), + ) - """ - self.message = message - self.channel_timeout_ops = 0.0 - self.channel_logger: LoggerAdapterT - self.transport_instance: "BaseTransport" + old = signal.signal(signal.SIGALRM, callback) + signal.setitimer(signal.ITIMER_REAL, timeout) + try: + return wrapped_func(*args, **kwargs) + finally: + if timeout: + signal.setitimer(signal.ITIMER_REAL, 0) + signal.signal(signal.SIGALRM, old) - def __call__(self, wrapped_func: Callable[..., Any]) -> Callable[..., Any]: - """ - Decorate an "operation" to modify the timeout_ops value for duration of that operation + # ensures that the wrapped function is updated w/ the original functions docs/etc. -- + # necessary for introspection for the auto gen docs to work! + update_wrapper(wrapper=decorate, wrapped=wrapped_func) + return decorate - This decorator wraps send command/config ops and is used to allow users to set a - `timeout_ops` value for the duration of a single method call -- this makes it so users don't - need to manually set/reset the value - Args: - wrapped_func: function being decorated +def timeout_modifier(wrapped_func: Callable[..., Any]) -> Callable[..., Any]: + """ + Decorate an "operation" to modify the timeout_ops value for duration of that operation - Returns: - decorate: decorated func + This decorator wraps send command/config ops and is used to allow users to set a + `timeout_ops` value for the duration of a single method call -- this makes it so users don't + need to manually set/reset the value - Raises: - N/A + Args: + wrapped_func: function being decorated - """ - if asyncio.iscoroutinefunction(wrapped_func): + Returns: + decorate: decorated func - async def decorate(*args: Any, **kwargs: Any) -> Any: - channel_instance: "Channel" = args[0] - self.channel_logger = channel_instance.logger - self.channel_timeout_ops = ( - channel_instance._base_channel_args.timeout_ops # pylint: disable=W0212 - ) + Raises: + N/A - if not self.channel_timeout_ops: - return await wrapped_func(*args, **kwargs) - - self.transport_instance = channel_instance.transport - - try: - return await asyncio.wait_for( - wrapped_func(*args, **kwargs), timeout=self.channel_timeout_ops - ) - except asyncio.TimeoutError: - self._handle_timeout() - - else: - # ignoring type error: - # "All conditional function variants must have identical signatures" - # one is sync one is async so never going to be identical here! - def decorate(*args: Any, **kwargs: Any) -> Any: # type: ignore - channel_instance: "Channel" = args[0] - self.channel_logger = channel_instance.logger - self.channel_timeout_ops = ( - channel_instance._base_channel_args.timeout_ops # pylint: disable=W0212 - ) + """ + if asyncio.iscoroutinefunction(wrapped_func): - if not self.channel_timeout_ops: - return wrapped_func(*args, **kwargs) - - self.transport_instance = channel_instance.transport - transport_instance_class_name = self.transport_instance.__class__.__name__ - - if ( - transport_instance_class_name in ("SystemTransport", "TelnetTransport") - or _IS_WINDOWS - or threading.current_thread() is not threading.main_thread() - ): - return self._multiprocessing_timeout( - wrapped_func=wrapped_func, - args=args, - kwargs=kwargs, - ) - - old = signal.signal(signal.SIGALRM, self._signal_raise_exception) - signal.setitimer(signal.ITIMER_REAL, self.channel_timeout_ops) - try: - return wrapped_func(*args, **kwargs) - finally: - if self.channel_timeout_ops: - signal.setitimer(signal.ITIMER_REAL, 0) - signal.signal(signal.SIGALRM, old) - - # ensures that the wrapped function is updated w/ the original functions docs/etc. -- - # necessary for introspection for the auto gen docs to work! - update_wrapper(wrapper=decorate, wrapped=wrapped_func) - return decorate - - def _handle_timeout(self) -> None: - """ - Timeout handler method to close connections and raise ScrapliTimeout - - Args: - N/A - - Returns: - None - - Raises: - ScrapliTimeout: always, if we hit this method we have already timed out! - - """ - self.channel_logger.critical("channel operation timed out, closing transport") - self.transport_instance.close() - raise ScrapliTimeout(self.message) - - def _multiprocessing_timeout( - self, wrapped_func: Callable[..., Any], args: Any, kwargs: Any - ) -> Any: - """ - Multiprocessing method for timeouts; works in threads and on windows - - Args: - wrapped_func: function being decorated - args: function being decorated args - kwargs: function being decorated kwargs - - Returns: - Any: result of decorated function - - Raises: - N/A - - """ - with ThreadPoolExecutor(max_workers=1) as pool: - future = pool.submit(wrapped_func, *args, **kwargs) - wait([future], timeout=self.channel_timeout_ops) - if not future.done(): - self._handle_timeout() - return future.result() + async def decorate(*args: Any, **kwargs: Any) -> Any: + driver_instance: "AsyncGenericDriver" = args[0] + driver_logger = driver_instance.logger + + timeout_ops_kwarg = kwargs.get("timeout_ops", None) - def _signal_raise_exception(self, signum: Any, frame: Any) -> None: - """ - Signal method exception handler - - Args: - signum: singum from the singal handler, unused here - frame: frame from the signal handler, unused here - - Returns: - None - - Raises: - N/A - - """ - _, _ = signum, frame - self._handle_timeout() - - -class TimeoutOpsModifier: - def __call__(self, wrapped_func: Callable[..., Any]) -> Callable[..., Any]: - """ - Decorate an "operation" to modify the timeout_ops value for duration of that operation - - This decorator wraps send command/config ops and is used to allow users to set a - `timeout_ops` value for the duration of a single method call -- this makes it so users don't - need to manually set/reset the value - - Args: - wrapped_func: function being decorated - - Returns: - decorate: decorated func - - Raises: - N/A - - """ - if asyncio.iscoroutinefunction(wrapped_func): - - async def decorate(*args: Any, **kwargs: Any) -> Any: - driver_instance: "AsyncGenericDriver" = args[0] - driver_logger = driver_instance.logger - - timeout_ops_kwarg = kwargs.get("timeout_ops", None) - - if timeout_ops_kwarg is None or timeout_ops_kwarg == driver_instance.timeout_ops: - result = await wrapped_func(*args, **kwargs) - else: - driver_logger.info( - "modifying driver timeout for current operation, temporary timeout_ops " - f"value: '{timeout_ops_kwarg}'" - ) - base_timeout_ops = driver_instance.timeout_ops - driver_instance.timeout_ops = kwargs["timeout_ops"] - result = await wrapped_func(*args, **kwargs) - driver_instance.timeout_ops = base_timeout_ops - return result - - else: - # ignoring type error: - # "All conditional function variants must have identical signatures" - # one is sync one is async so never going to be identical here! - def decorate(*args: Any, **kwargs: Any) -> Any: # type: ignore - driver_instance: "GenericDriver" = args[0] - driver_logger = driver_instance.logger - - timeout_ops_kwarg = kwargs.get("timeout_ops", None) - - if timeout_ops_kwarg is None or timeout_ops_kwarg == driver_instance.timeout_ops: - result = wrapped_func(*args, **kwargs) - else: - driver_logger.info( - "modifying driver timeout for current operation, temporary timeout_ops " - f"value: '{timeout_ops_kwarg}'" - ) - base_timeout_ops = driver_instance.timeout_ops - driver_instance.timeout_ops = kwargs["timeout_ops"] - result = wrapped_func(*args, **kwargs) - driver_instance.timeout_ops = base_timeout_ops - return result - - # ensures that the wrapped function is updated w/ the original functions docs/etc. -- - # necessary for introspection for the auto gen docs to work! - update_wrapper(wrapper=decorate, wrapped=wrapped_func) - return decorate + if timeout_ops_kwarg is None or timeout_ops_kwarg == driver_instance.timeout_ops: + result = await wrapped_func(*args, **kwargs) + else: + driver_logger.info( + "modifying driver timeout for current operation, temporary timeout_ops " + f"value: '{timeout_ops_kwarg}'" + ) + base_timeout_ops = driver_instance.timeout_ops + driver_instance.timeout_ops = kwargs["timeout_ops"] + result = await wrapped_func(*args, **kwargs) + driver_instance.timeout_ops = base_timeout_ops + return result + + else: + # ignoring type error: + # "All conditional function variants must have identical signatures" + # one is sync one is async so never going to be identical here! + def decorate(*args: Any, **kwargs: Any) -> Any: # type: ignore + driver_instance: "GenericDriver" = args[0] + driver_logger = driver_instance.logger + + timeout_ops_kwarg = kwargs.get("timeout_ops", None) + + if timeout_ops_kwarg is None or timeout_ops_kwarg == driver_instance.timeout_ops: + result = wrapped_func(*args, **kwargs) + else: + driver_logger.info( + "modifying driver timeout for current operation, temporary timeout_ops " + f"value: '{timeout_ops_kwarg}'" + ) + base_timeout_ops = driver_instance.timeout_ops + driver_instance.timeout_ops = kwargs["timeout_ops"] + result = wrapped_func(*args, **kwargs) + driver_instance.timeout_ops = base_timeout_ops + return result + + # ensures that the wrapped function is updated w/ the original functions docs/etc. -- + # necessary for introspection for the auto gen docs to work! + update_wrapper(wrapper=decorate, wrapped=wrapped_func) + return decorate +## Functions -## Classes - -### ChannelTimeout + +#### timeout_modifier +`timeout_modifier(wrapped_func: Callable[..., Any]) ‑> Callable[..., Any]` ```text -Channel timeout decorator +Decorate an "operation" to modify the timeout_ops value for duration of that operation + +This decorator wraps send command/config ops and is used to allow users to set a +`timeout_ops` value for the duration of a single method call -- this makes it so users don't +need to manually set/reset the value Args: - message: accepts message from decorated function to add context to any timeout - (if a timeout happens!) + wrapped_func: function being decorated Returns: - None + decorate: decorated func Raises: N/A ``` -
- - Expand source code - -
-        
-class ChannelTimeout:
-    def __init__(self, message: str = "") -> None:
-        """
-        Channel timeout decorator
-
-        Args:
-            message: accepts message from decorated function to add context to any timeout
-                (if a timeout happens!)
-
-        Returns:
-            None
 
-        Raises:
-            N/A
 
-        """
-        self.message = message
-        self.channel_timeout_ops = 0.0
-        self.channel_logger: LoggerAdapterT
-        self.transport_instance: "BaseTransport"
 
-    def __call__(self, wrapped_func: Callable[..., Any]) -> Callable[..., Any]:
-        """
-        Decorate an "operation" to modify the timeout_ops value for duration of that operation
-
-        This decorator wraps send command/config ops and is used to allow users to set a
-        `timeout_ops` value for the duration of a single method call -- this makes it so users don't
-        need to manually set/reset the value
-
-        Args:
-            wrapped_func: function being decorated
-
-        Returns:
-            decorate: decorated func
-
-        Raises:
-            N/A
-
-        """
-        if asyncio.iscoroutinefunction(wrapped_func):
-
-            async def decorate(*args: Any, **kwargs: Any) -> Any:
-                channel_instance: "Channel" = args[0]
-                self.channel_logger = channel_instance.logger
-                self.channel_timeout_ops = (
-                    channel_instance._base_channel_args.timeout_ops  # pylint: disable=W0212
-                )
-
-                if not self.channel_timeout_ops:
-                    return await wrapped_func(*args, **kwargs)
-
-                self.transport_instance = channel_instance.transport
-
-                try:
-                    return await asyncio.wait_for(
-                        wrapped_func(*args, **kwargs), timeout=self.channel_timeout_ops
-                    )
-                except asyncio.TimeoutError:
-                    self._handle_timeout()
-
-        else:
-            # ignoring type error:
-            # "All conditional function variants must have identical signatures"
-            # one is sync one is async so never going to be identical here!
-            def decorate(*args: Any, **kwargs: Any) -> Any:  # type: ignore
-                channel_instance: "Channel" = args[0]
-                self.channel_logger = channel_instance.logger
-                self.channel_timeout_ops = (
-                    channel_instance._base_channel_args.timeout_ops  # pylint: disable=W0212
-                )
-
-                if not self.channel_timeout_ops:
-                    return wrapped_func(*args, **kwargs)
-
-                self.transport_instance = channel_instance.transport
-                transport_instance_class_name = self.transport_instance.__class__.__name__
-
-                if (
-                    transport_instance_class_name in ("SystemTransport", "TelnetTransport")
-                    or _IS_WINDOWS
-                    or threading.current_thread() is not threading.main_thread()
-                ):
-                    return self._multiprocessing_timeout(
-                        wrapped_func=wrapped_func,
-                        args=args,
-                        kwargs=kwargs,
-                    )
-
-                old = signal.signal(signal.SIGALRM, self._signal_raise_exception)
-                signal.setitimer(signal.ITIMER_REAL, self.channel_timeout_ops)
-                try:
-                    return wrapped_func(*args, **kwargs)
-                finally:
-                    if self.channel_timeout_ops:
-                        signal.setitimer(signal.ITIMER_REAL, 0)
-                        signal.signal(signal.SIGALRM, old)
-
-        # ensures that the wrapped function is updated w/ the original functions docs/etc. --
-        # necessary for introspection for the auto gen docs to work!
-        update_wrapper(wrapper=decorate, wrapped=wrapped_func)
-        return decorate
-
-    def _handle_timeout(self) -> None:
-        """
-        Timeout handler method to close connections and raise ScrapliTimeout
-
-        Args:
-            N/A
-
-        Returns:
-            None
-
-        Raises:
-            ScrapliTimeout: always, if we hit this method we have already timed out!
-
-        """
-        self.channel_logger.critical("channel operation timed out, closing transport")
-        self.transport_instance.close()
-        raise ScrapliTimeout(self.message)
-
-    def _multiprocessing_timeout(
-        self, wrapped_func: Callable[..., Any], args: Any, kwargs: Any
-    ) -> Any:
-        """
-        Multiprocessing method for timeouts; works in threads and on windows
-
-        Args:
-            wrapped_func: function being decorated
-            args: function being decorated args
-            kwargs: function being decorated kwargs
-
-        Returns:
-            Any: result of decorated function
-
-        Raises:
-            N/A
-
-        """
-        with ThreadPoolExecutor(max_workers=1) as pool:
-            future = pool.submit(wrapped_func, *args, **kwargs)
-            wait([future], timeout=self.channel_timeout_ops)
-            if not future.done():
-                self._handle_timeout()
-        return future.result()
-
-    def _signal_raise_exception(self, signum: Any, frame: Any) -> None:
-        """
-        Signal method exception handler
-
-        Args:
-            signum: singum from the singal handler, unused here
-            frame: frame from the signal handler, unused here
-
-        Returns:
-            None
-
-        Raises:
-            N/A
-
-        """
-        _, _ = signum, frame
-        self._handle_timeout()
-        
-    
-
- - - - - -### TimeoutOpsModifier - - - -
- - Expand source code - -
-        
-class TimeoutOpsModifier:
-    def __call__(self, wrapped_func: Callable[..., Any]) -> Callable[..., Any]:
-        """
-        Decorate an "operation" to modify the timeout_ops value for duration of that operation
-
-        This decorator wraps send command/config ops and is used to allow users to set a
-        `timeout_ops` value for the duration of a single method call -- this makes it so users don't
-        need to manually set/reset the value
-
-        Args:
-            wrapped_func: function being decorated
-
-        Returns:
-            decorate: decorated func
-
-        Raises:
-            N/A
-
-        """
-        if asyncio.iscoroutinefunction(wrapped_func):
-
-            async def decorate(*args: Any, **kwargs: Any) -> Any:
-                driver_instance: "AsyncGenericDriver" = args[0]
-                driver_logger = driver_instance.logger
-
-                timeout_ops_kwarg = kwargs.get("timeout_ops", None)
-
-                if timeout_ops_kwarg is None or timeout_ops_kwarg == driver_instance.timeout_ops:
-                    result = await wrapped_func(*args, **kwargs)
-                else:
-                    driver_logger.info(
-                        "modifying driver timeout for current operation, temporary timeout_ops "
-                        f"value: '{timeout_ops_kwarg}'"
-                    )
-                    base_timeout_ops = driver_instance.timeout_ops
-                    driver_instance.timeout_ops = kwargs["timeout_ops"]
-                    result = await wrapped_func(*args, **kwargs)
-                    driver_instance.timeout_ops = base_timeout_ops
-                return result
-
-        else:
-            # ignoring type error:
-            # "All conditional function variants must have identical signatures"
-            # one is sync one is async so never going to be identical here!
-            def decorate(*args: Any, **kwargs: Any) -> Any:  # type: ignore
-                driver_instance: "GenericDriver" = args[0]
-                driver_logger = driver_instance.logger
-
-                timeout_ops_kwarg = kwargs.get("timeout_ops", None)
-
-                if timeout_ops_kwarg is None or timeout_ops_kwarg == driver_instance.timeout_ops:
-                    result = wrapped_func(*args, **kwargs)
-                else:
-                    driver_logger.info(
-                        "modifying driver timeout for current operation, temporary timeout_ops "
-                        f"value: '{timeout_ops_kwarg}'"
-                    )
-                    base_timeout_ops = driver_instance.timeout_ops
-                    driver_instance.timeout_ops = kwargs["timeout_ops"]
-                    result = wrapped_func(*args, **kwargs)
-                    driver_instance.timeout_ops = base_timeout_ops
-                return result
-
-        # ensures that the wrapped function is updated w/ the original functions docs/etc. --
-        # necessary for introspection for the auto gen docs to work!
-        update_wrapper(wrapper=decorate, wrapped=wrapped_func)
-        return decorate
-        
-    
-
- - - - - -### TransportTimeout + +#### timeout_wrapper +`timeout_wrapper(wrapped_func: Callable[..., Any]) ‑> Callable[..., Any]` ```text -Transport timeout decorator +Timeout wrapper for transports Args: - message: accepts message from decorated function to add context to any timeout - (if a timeout happens!) + wrapped_func: function being wrapped -- must be a method of Channel or Transport Returns: - None + Any: result of wrapped function Raises: N/A -``` - -
- - Expand source code - -
-        
-class TransportTimeout:
-    def __init__(self, message: str = "") -> None:
-        """
-        Transport timeout decorator
-
-        Args:
-            message: accepts message from decorated function to add context to any timeout
-                (if a timeout happens!)
-
-        Returns:
-            None
-
-        Raises:
-            N/A
-
-        """
-        self.message = message
-        self.transport_instance: "BaseTransport"
-        self.transport_timeout_transport = 0.0
-
-    def __call__(self, wrapped_func: Callable[..., Any]) -> Callable[..., Any]:
-        """
-        Decorate an "operation" to modify the timeout_transport value for duration of that operation
-
-        This decorator wraps a transport read operation and is used to allow users to control the
-        transport timeout via the `timeout_transport` attribute. This decorator should be applied to
-        any transport "read" operations.
-
-        Args:
-            wrapped_func: function being decorated
-
-        Returns:
-            decorate: decorated func
-
-        Raises:
-            N/A
-
-        """
-
-        if asyncio.iscoroutinefunction(wrapped_func):
-
-            async def decorate(*args: Any, **kwargs: Any) -> Any:
-                self.transport_instance = args[0]
-                self.transport_timeout_transport = self._get_timeout_transport()
-
-                if not self.transport_timeout_transport:
-                    return await wrapped_func(*args, **kwargs)
-
-                try:
-                    return await asyncio.wait_for(
-                        wrapped_func(*args, **kwargs), timeout=self.transport_timeout_transport
-                    )
-                except asyncio.TimeoutError:
-                    self._handle_timeout()
-
-        else:
-            # ignoring type error:
-            # "All conditional function variants must have identical signatures"
-            # one is sync one is async so never going to be identical here!
-            def decorate(*args: Any, **kwargs: Any) -> Any:  # type: ignore
-                self.transport_instance = args[0]
-                self.transport_timeout_transport = self._get_timeout_transport()
-
-                if not self.transport_timeout_transport:
-                    return wrapped_func(*args, **kwargs)
-
-                transport_instance_class_name = self.transport_instance.__class__.__name__
-
-                if (
-                    transport_instance_class_name in ("SystemTransport", "TelnetTransport")
-                    or _IS_WINDOWS
-                    or threading.current_thread() is not threading.main_thread()
-                ):
-                    return self._multiprocessing_timeout(
-                        wrapped_func=wrapped_func,
-                        args=args,
-                        kwargs=kwargs,
-                    )
-
-                old = signal.signal(signal.SIGALRM, self._signal_raise_exception)
-                signal.setitimer(signal.ITIMER_REAL, self.transport_timeout_transport)
-                try:
-                    return wrapped_func(*args, **kwargs)
-                finally:
-                    if self.transport_timeout_transport:
-                        signal.setitimer(signal.ITIMER_REAL, 0)
-                        signal.signal(signal.SIGALRM, old)
-
-        # ensures that the wrapped function is updated w/ the original functions docs/etc. --
-        # necessary for introspection for the auto gen docs to work!
-        update_wrapper(wrapper=decorate, wrapped=wrapped_func)
-        return decorate
-
-    def _get_timeout_transport(self) -> float:
-        """
-        Fetch and return timeout transport from the transport object
-
-        Args:
-            N/A
-
-        Returns:
-            float: transport timeout value
-
-        Raises:
-            N/A
-
-        """
-        transport_args = self.transport_instance._base_transport_args  # pylint: disable=W0212
-        return transport_args.timeout_transport
-
-    def _handle_timeout(self) -> None:
-        """
-        Timeout handler method to close connections and raise ScrapliTimeout
-
-        Args:
-            N/A
-
-        Returns:
-            None
-
-        Raises:
-            ScrapliTimeout: always, if we hit this method we have already timed out!
-
-        """
-        self.transport_instance.logger.critical("transport operation timed out, closing transport")
-        self.transport_instance.close()
-        raise ScrapliTimeout(self.message)
-
-    def _multiprocessing_timeout(
-        self, wrapped_func: Callable[..., Any], args: Any, kwargs: Any
-    ) -> Any:
-        """
-        Multiprocessing method for timeouts; works in threads and on windows
-
-        Args:
-            wrapped_func: function being decorated
-            args: function being decorated args
-            kwargs: function being decorated kwargs
-
-        Returns:
-            Any: result of decorated function
-
-        Raises:
-            N/A
-
-        """
-        with ThreadPoolExecutor(max_workers=1) as pool:
-            future = pool.submit(wrapped_func, *args, **kwargs)
-            wait([future], timeout=self.transport_timeout_transport)
-            if not future.done():
-                self._handle_timeout()
-        return future.result()
-
-    def _signal_raise_exception(self, signum: Any, frame: Any) -> None:
-        """
-        Signal method exception handler
-
-        Args:
-            signum: singum from the singal handler, unused here
-            frame: frame from the signal handler, unused here
-
-        Returns:
-            None
-
-        Raises:
-            N/A
-
-        """
-        _, _ = signum, frame
-        self._handle_timeout()
-        
-    
-
\ No newline at end of file +``` \ No newline at end of file diff --git a/docs/api_docs/driver/base/async_driver.md b/docs/api_docs/driver/base/async_driver.md index d233b9f1..4eedcb56 100644 --- a/docs/api_docs/driver/base/async_driver.md +++ b/docs/api_docs/driver/base/async_driver.md @@ -30,13 +30,15 @@ scrapli.driver.base.async_driver """scrapli.driver.base.async_driver""" from types import TracebackType -from typing import Any, Optional, Type +from typing import Any, Optional, Type, TypeVar from scrapli.channel import AsyncChannel from scrapli.driver.base.base_driver import BaseDriver from scrapli.exceptions import ScrapliValueError from scrapli.transport import ASYNCIO_TRANSPORTS +_T = TypeVar("_T", bound="AsyncDriver") + class AsyncDriver(BaseDriver): def __init__(self, **kwargs: Any): @@ -53,7 +55,7 @@ class AsyncDriver(BaseDriver): base_channel_args=self._base_channel_args, ) - async def __aenter__(self) -> "AsyncDriver": + async def __aenter__(self: _T) -> _T: """ Enter method for context manager @@ -61,7 +63,7 @@ class AsyncDriver(BaseDriver): N/A Returns: - AsyncDriver: opened AsyncDriver object + _T: a concrete implementation of the opened AsyncDriver object Raises: N/A @@ -371,7 +373,7 @@ class AsyncDriver(BaseDriver): base_channel_args=self._base_channel_args, ) - async def __aenter__(self) -> "AsyncDriver": + async def __aenter__(self: _T) -> _T: """ Enter method for context manager @@ -379,7 +381,7 @@ class AsyncDriver(BaseDriver): N/A Returns: - AsyncDriver: opened AsyncDriver object + _T: a concrete implementation of the opened AsyncDriver object Raises: N/A diff --git a/docs/api_docs/driver/base/sync_driver.md b/docs/api_docs/driver/base/sync_driver.md index f2a19063..8436fd20 100644 --- a/docs/api_docs/driver/base/sync_driver.md +++ b/docs/api_docs/driver/base/sync_driver.md @@ -30,13 +30,15 @@ scrapli.driver.base.sync_driver """scrapli.driver.base.sync_driver""" from types import TracebackType -from typing import Any, Optional, Type +from typing import Any, Optional, Type, TypeVar from scrapli.channel import Channel from scrapli.driver.base.base_driver import BaseDriver from scrapli.exceptions import ScrapliValueError from scrapli.transport import ASYNCIO_TRANSPORTS +_T = TypeVar("_T", bound="Driver") + class Driver(BaseDriver): def __init__(self, **kwargs: Any): @@ -53,7 +55,7 @@ class Driver(BaseDriver): base_channel_args=self._base_channel_args, ) - def __enter__(self) -> "Driver": + def __enter__(self: _T) -> _T: """ Enter method for context manager @@ -61,7 +63,7 @@ class Driver(BaseDriver): N/A Returns: - Driver: opened Driver object + _T: a concrete implementation of the opened Driver object Raises: N/A @@ -322,7 +324,7 @@ class Driver(BaseDriver): base_channel_args=self._base_channel_args, ) - def __enter__(self) -> "Driver": + def __enter__(self: _T) -> _T: """ Enter method for context manager @@ -330,7 +332,7 @@ class Driver(BaseDriver): N/A Returns: - Driver: opened Driver object + _T: a concrete implementation of the opened Driver object Raises: N/A diff --git a/docs/api_docs/driver/core/juniper_junos/base_driver.md b/docs/api_docs/driver/core/juniper_junos/base_driver.md index 50d71fcb..0e3bd9dc 100644 --- a/docs/api_docs/driver/core/juniper_junos/base_driver.md +++ b/docs/api_docs/driver/core/juniper_junos/base_driver.md @@ -90,7 +90,7 @@ PRIVS = { ), "root_shell": ( PrivilegeLevel( - pattern=r"^.*root@(?:\S*:\S*\s?)?[%\#]\s?$", + pattern=r"^.*root@(?:\S*:?\S*\s?)?[%\#]\s?$", name="root_shell", previous_priv="exec", deescalate="exit", diff --git a/docs/api_docs/driver/generic/async_driver.md b/docs/api_docs/driver/generic/async_driver.md index e5ab89f4..2f78fc15 100644 --- a/docs/api_docs/driver/generic/async_driver.md +++ b/docs/api_docs/driver/generic/async_driver.md @@ -33,7 +33,7 @@ import asyncio from io import BytesIO from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union -from scrapli.decorators import TimeoutOpsModifier +from scrapli.decorators import timeout_modifier from scrapli.driver import AsyncDriver from scrapli.driver.generic.base_driver import BaseGenericDriver from scrapli.exceptions import ScrapliTimeout, ScrapliValueError @@ -118,7 +118,7 @@ class AsyncGenericDriver(AsyncDriver, BaseGenericDriver): prompt: str = await self.channel.get_prompt() return prompt - @TimeoutOpsModifier() + @timeout_modifier async def _send_command( self, command: str, @@ -312,7 +312,7 @@ class AsyncGenericDriver(AsyncDriver, BaseGenericDriver): timeout_ops=timeout_ops, ) - @TimeoutOpsModifier() + @timeout_modifier async def send_and_read( self, channel_input: str, @@ -372,7 +372,7 @@ class AsyncGenericDriver(AsyncDriver, BaseGenericDriver): raw_response=raw_response, processed_response=processed_response, response=response ) - @TimeoutOpsModifier() + @timeout_modifier async def send_interactive( self, interact_events: Union[List[Tuple[str, str]], List[Tuple[str, str, bool]]], @@ -784,7 +784,7 @@ class AsyncGenericDriver(AsyncDriver, BaseGenericDriver): prompt: str = await self.channel.get_prompt() return prompt - @TimeoutOpsModifier() + @timeout_modifier async def _send_command( self, command: str, @@ -978,7 +978,7 @@ class AsyncGenericDriver(AsyncDriver, BaseGenericDriver): timeout_ops=timeout_ops, ) - @TimeoutOpsModifier() + @timeout_modifier async def send_and_read( self, channel_input: str, @@ -1038,7 +1038,7 @@ class AsyncGenericDriver(AsyncDriver, BaseGenericDriver): raw_response=raw_response, processed_response=processed_response, response=response ) - @TimeoutOpsModifier() + @timeout_modifier async def send_interactive( self, interact_events: Union[List[Tuple[str, str]], List[Tuple[str, str, bool]]], diff --git a/docs/api_docs/driver/generic/sync_driver.md b/docs/api_docs/driver/generic/sync_driver.md index 1e661c26..aa3ef0bd 100644 --- a/docs/api_docs/driver/generic/sync_driver.md +++ b/docs/api_docs/driver/generic/sync_driver.md @@ -33,7 +33,7 @@ import time from io import BytesIO from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union -from scrapli.decorators import TimeoutOpsModifier +from scrapli.decorators import timeout_modifier from scrapli.driver import Driver from scrapli.driver.generic.base_driver import BaseGenericDriver from scrapli.exceptions import ScrapliTimeout, ScrapliValueError @@ -119,7 +119,7 @@ class GenericDriver(Driver, BaseGenericDriver): prompt: str = self.channel.get_prompt() return prompt - @TimeoutOpsModifier() + @timeout_modifier def _send_command( self, command: str, @@ -313,7 +313,7 @@ class GenericDriver(Driver, BaseGenericDriver): timeout_ops=timeout_ops, ) - @TimeoutOpsModifier() + @timeout_modifier def send_and_read( self, channel_input: str, @@ -373,7 +373,7 @@ class GenericDriver(Driver, BaseGenericDriver): raw_response=raw_response, processed_response=processed_response, response=response ) - @TimeoutOpsModifier() + @timeout_modifier def send_interactive( self, interact_events: Union[List[Tuple[str, str]], List[Tuple[str, str, bool]]], @@ -783,7 +783,7 @@ class GenericDriver(Driver, BaseGenericDriver): prompt: str = self.channel.get_prompt() return prompt - @TimeoutOpsModifier() + @timeout_modifier def _send_command( self, command: str, @@ -977,7 +977,7 @@ class GenericDriver(Driver, BaseGenericDriver): timeout_ops=timeout_ops, ) - @TimeoutOpsModifier() + @timeout_modifier def send_and_read( self, channel_input: str, @@ -1037,7 +1037,7 @@ class GenericDriver(Driver, BaseGenericDriver): raw_response=raw_response, processed_response=processed_response, response=response ) - @TimeoutOpsModifier() + @timeout_modifier def send_interactive( self, interact_events: Union[List[Tuple[str, str]], List[Tuple[str, str, bool]]], diff --git a/docs/api_docs/driver/network/async_driver.md b/docs/api_docs/driver/network/async_driver.md index 4fc72d19..3c5f2a93 100644 --- a/docs/api_docs/driver/network/async_driver.md +++ b/docs/api_docs/driver/network/async_driver.md @@ -136,7 +136,10 @@ class AsyncNetworkDriver(AsyncGenericDriver, BaseNetworkDriver): (escalate_priv.escalate, escalate_priv.escalate_prompt, False), (self.auth_secondary, escalate_priv.pattern, True), ], - interaction_complete_patterns=[escalate_priv.pattern], + interaction_complete_patterns=[ + self.privilege_levels[escalate_priv.previous_priv].pattern, + escalate_priv.pattern, + ], ) except ScrapliTimeout as exc: raise ScrapliAuthenticationFailed( @@ -462,7 +465,7 @@ class AsyncNetworkDriver(AsyncGenericDriver, BaseNetworkDriver): if failed_when_contains is None: failed_when_contains = self.failed_when_contains - # type hint is due to the TimeoutModifier wrapper returning `Any` so that we dont anger the + # type hint is due to the timeout_modifier wrapper returning `Any` so that we dont anger the # asyncio parts (which will get an awaitable not a Response returned) response: Response = await super().send_interactive( interact_events=interact_events, @@ -860,7 +863,10 @@ class AsyncNetworkDriver(AsyncGenericDriver, BaseNetworkDriver): (escalate_priv.escalate, escalate_priv.escalate_prompt, False), (self.auth_secondary, escalate_priv.pattern, True), ], - interaction_complete_patterns=[escalate_priv.pattern], + interaction_complete_patterns=[ + self.privilege_levels[escalate_priv.previous_priv].pattern, + escalate_priv.pattern, + ], ) except ScrapliTimeout as exc: raise ScrapliAuthenticationFailed( @@ -1186,7 +1192,7 @@ class AsyncNetworkDriver(AsyncGenericDriver, BaseNetworkDriver): if failed_when_contains is None: failed_when_contains = self.failed_when_contains - # type hint is due to the TimeoutModifier wrapper returning `Any` so that we dont anger the + # type hint is due to the timeout_modifier wrapper returning `Any` so that we dont anger the # asyncio parts (which will get an awaitable not a Response returned) response: Response = await super().send_interactive( interact_events=interact_events, diff --git a/docs/api_docs/driver/network/base_driver.md b/docs/api_docs/driver/network/base_driver.md index f5ba00dd..fdfca7fd 100644 --- a/docs/api_docs/driver/network/base_driver.md +++ b/docs/api_docs/driver/network/base_driver.md @@ -42,7 +42,7 @@ from scrapli.helper import user_warning from scrapli.response import MultiResponse, Response if TYPE_CHECKING: - LoggerAdapterT = LoggerAdapter[Logger] # pylint:disable=E1136 + LoggerAdapterT = LoggerAdapter[Logger] # pragma: no cover # pylint:disable=E1136 else: LoggerAdapterT = LoggerAdapter @@ -142,7 +142,7 @@ class BaseNetworkDriver: rf"({priv_level_data.pattern})" for priv_level_data in self.privilege_levels.values() ) - @lru_cache() + @lru_cache(maxsize=64) def _determine_current_priv(self, current_prompt: str) -> List[str]: """ Determine current privilege level from prompt string @@ -664,7 +664,7 @@ class BaseNetworkDriver: rf"({priv_level_data.pattern})" for priv_level_data in self.privilege_levels.values() ) - @lru_cache() + @lru_cache(maxsize=64) def _determine_current_priv(self, current_prompt: str) -> List[str]: """ Determine current privilege level from prompt string diff --git a/docs/api_docs/driver/network/sync_driver.md b/docs/api_docs/driver/network/sync_driver.md index 7e4ced0d..cf8fd253 100644 --- a/docs/api_docs/driver/network/sync_driver.md +++ b/docs/api_docs/driver/network/sync_driver.md @@ -136,7 +136,10 @@ class NetworkDriver(GenericDriver, BaseNetworkDriver): (escalate_priv.escalate, escalate_priv.escalate_prompt, False), (self.auth_secondary, escalate_priv.pattern, True), ], - interaction_complete_patterns=[escalate_priv.pattern], + interaction_complete_patterns=[ + self.privilege_levels[escalate_priv.previous_priv].pattern, + escalate_priv.pattern, + ], ) except ScrapliTimeout as exc: raise ScrapliAuthenticationFailed( @@ -462,7 +465,7 @@ class NetworkDriver(GenericDriver, BaseNetworkDriver): if failed_when_contains is None: failed_when_contains = self.failed_when_contains - # type hint is due to the TimeoutModifier wrapper returning `Any` so that we dont anger the + # type hint is due to the timeout_modifier wrapper returning `Any` so that we dont anger the # asyncio parts (which will get an awaitable not a Response returned) response: Response = super().send_interactive( interact_events=interact_events, @@ -860,7 +863,10 @@ class NetworkDriver(GenericDriver, BaseNetworkDriver): (escalate_priv.escalate, escalate_priv.escalate_prompt, False), (self.auth_secondary, escalate_priv.pattern, True), ], - interaction_complete_patterns=[escalate_priv.pattern], + interaction_complete_patterns=[ + self.privilege_levels[escalate_priv.previous_priv].pattern, + escalate_priv.pattern, + ], ) except ScrapliTimeout as exc: raise ScrapliAuthenticationFailed( @@ -1186,7 +1192,7 @@ class NetworkDriver(GenericDriver, BaseNetworkDriver): if failed_when_contains is None: failed_when_contains = self.failed_when_contains - # type hint is due to the TimeoutModifier wrapper returning `Any` so that we dont anger the + # type hint is due to the timeout_modifier wrapper returning `Any` so that we dont anger the # asyncio parts (which will get an awaitable not a Response returned) response: Response = super().send_interactive( interact_events=interact_events, diff --git a/docs/api_docs/transport/plugins/asyncssh.md b/docs/api_docs/transport/plugins/asyncssh.md index 861d5c59..ecfba1d4 100644 --- a/docs/api_docs/transport/plugins/asyncssh.md +++ b/docs/api_docs/transport/plugins/asyncssh.md @@ -37,7 +37,7 @@ from asyncssh.connection import SSHClientConnection, connect from asyncssh.misc import ConnectionLost, PermissionDenied from asyncssh.stream import SSHReader, SSHWriter -from scrapli.decorators import TransportTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ( ScrapliAuthenticationFailed, ScrapliConnectionError, @@ -275,7 +275,7 @@ class AsyncsshTransport(AsyncTransport): pass return False - @TransportTimeout("timed out reading from transport") + @timeout_wrapper async def read(self) -> bytes: if not self.stdout: raise ScrapliConnectionNotOpened @@ -583,7 +583,7 @@ class AsyncsshTransport(AsyncTransport): pass return False - @TransportTimeout("timed out reading from transport") + @timeout_wrapper async def read(self) -> bytes: if not self.stdout: raise ScrapliConnectionNotOpened diff --git a/docs/api_docs/transport/plugins/asynctelnet.md b/docs/api_docs/transport/plugins/asynctelnet.md index 4e8d0584..540ac108 100644 --- a/docs/api_docs/transport/plugins/asynctelnet.md +++ b/docs/api_docs/transport/plugins/asynctelnet.md @@ -34,22 +34,14 @@ import socket from dataclasses import dataclass from typing import Optional -from scrapli.decorators import TransportTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ( ScrapliAuthenticationFailed, ScrapliConnectionError, ScrapliConnectionNotOpened, ) from scrapli.transport.base import AsyncTransport, BasePluginTransportArgs, BaseTransportArgs - -# telnet control characters we care about -IAC = bytes([255]) -DONT = bytes([254]) -DO = bytes([253]) -WONT = bytes([252]) -WILL = bytes([251]) -TERM_TYPE = bytes([24]) -SUPPRESS_GO_AHEAD = bytes([3]) +from scrapli.transport.base.telnet_common import DO, DONT, IAC, SUPPRESS_GO_AHEAD, WILL, WONT @dataclass() @@ -68,10 +60,9 @@ class AsynctelnetTransport(AsyncTransport): self.stdin: Optional[asyncio.StreamWriter] = None self._initial_buf = b"" - self._stdout_binary_transmission = False def _handle_control_chars_response(self, control_buf: bytes, c: bytes) -> bytes: - """ " + """ Handle the actual response to control characters Broken up to be easier to test as well as to appease mr. mccabe @@ -128,7 +119,7 @@ class AsynctelnetTransport(AsyncTransport): return control_buf async def _handle_control_chars(self) -> None: - """ " + """ Handle control characters -- nearly identical to CPython telnetlib Basically we want to read and "decline" any and all control options that the server proposes @@ -227,7 +218,7 @@ class AsynctelnetTransport(AsyncTransport): return False return not self.stdout.at_eof() - @TransportTimeout("timed out reading from transport") + @timeout_wrapper async def read(self) -> bytes: if not self.stdout: raise ScrapliConnectionNotOpened @@ -301,10 +292,9 @@ class AsynctelnetTransport(AsyncTransport): self.stdin: Optional[asyncio.StreamWriter] = None self._initial_buf = b"" - self._stdout_binary_transmission = False def _handle_control_chars_response(self, control_buf: bytes, c: bytes) -> bytes: - """ " + """ Handle the actual response to control characters Broken up to be easier to test as well as to appease mr. mccabe @@ -361,7 +351,7 @@ class AsynctelnetTransport(AsyncTransport): return control_buf async def _handle_control_chars(self) -> None: - """ " + """ Handle control characters -- nearly identical to CPython telnetlib Basically we want to read and "decline" any and all control options that the server proposes @@ -460,7 +450,7 @@ class AsynctelnetTransport(AsyncTransport): return False return not self.stdout.at_eof() - @TransportTimeout("timed out reading from transport") + @timeout_wrapper async def read(self) -> bytes: if not self.stdout: raise ScrapliConnectionNotOpened diff --git a/docs/api_docs/transport/plugins/paramiko.md b/docs/api_docs/transport/plugins/paramiko.md index 6509cd30..3ccf0670 100644 --- a/docs/api_docs/transport/plugins/paramiko.md +++ b/docs/api_docs/transport/plugins/paramiko.md @@ -216,7 +216,11 @@ class ParamikoTransport(Transport): raise ScrapliConnectionNotOpened if self._base_transport_args.transport_options.get("enable_rsa2", False) is False: - self.session.disabled_algorithms = {"keys": ["rsa-sha2-256", "rsa-sha2-512"]} + # do this for "keys" and "pubkeys": https://github.com/paramiko/paramiko/issues/1984 + self.session.disabled_algorithms = { + "keys": ["rsa-sha2-256", "rsa-sha2-512"], + "pubkeys": ["rsa-sha2-256", "rsa-sha2-512"], + } try: paramiko_key = RSAKey(filename=self.plugin_transport_args.auth_private_key) @@ -537,7 +541,11 @@ class ParamikoTransport(Transport): raise ScrapliConnectionNotOpened if self._base_transport_args.transport_options.get("enable_rsa2", False) is False: - self.session.disabled_algorithms = {"keys": ["rsa-sha2-256", "rsa-sha2-512"]} + # do this for "keys" and "pubkeys": https://github.com/paramiko/paramiko/issues/1984 + self.session.disabled_algorithms = { + "keys": ["rsa-sha2-256", "rsa-sha2-512"], + "pubkeys": ["rsa-sha2-256", "rsa-sha2-512"], + } try: paramiko_key = RSAKey(filename=self.plugin_transport_args.auth_private_key) diff --git a/docs/api_docs/transport/plugins/system.md b/docs/api_docs/transport/plugins/system.md index 5d0c65c8..eb21223c 100644 --- a/docs/api_docs/transport/plugins/system.md +++ b/docs/api_docs/transport/plugins/system.md @@ -33,7 +33,7 @@ import sys from dataclasses import dataclass from typing import List, Optional -from scrapli.decorators import TransportTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ( ScrapliConnectionError, ScrapliConnectionNotOpened, @@ -180,7 +180,7 @@ class SystemTransport(Transport): return True return False - @TransportTimeout("timed out reading from transport") + @timeout_wrapper def read(self) -> bytes: if not self.session: raise ScrapliConnectionNotOpened @@ -437,7 +437,7 @@ class SystemTransport(Transport): return True return False - @TransportTimeout("timed out reading from transport") + @timeout_wrapper def read(self) -> bytes: if not self.session: raise ScrapliConnectionNotOpened diff --git a/docs/api_docs/transport/plugins/telnet.md b/docs/api_docs/transport/plugins/telnet.md index 298f3339..14f2c972 100644 --- a/docs/api_docs/transport/plugins/telnet.md +++ b/docs/api_docs/transport/plugins/telnet.md @@ -30,12 +30,13 @@ scrapli.transport.plugins.telnet.transport """scrapli.transport.plugins.telnet.transport""" from dataclasses import dataclass -from telnetlib import Telnet from typing import Optional -from scrapli.decorators import TransportTimeout +from scrapli.decorators import timeout_wrapper from scrapli.exceptions import ScrapliConnectionError, ScrapliConnectionNotOpened from scrapli.transport.base import BasePluginTransportArgs, BaseTransportArgs, Transport +from scrapli.transport.base.base_socket import Socket +from scrapli.transport.base.telnet_common import DO, DONT, IAC, SUPPRESS_GO_AHEAD, WILL, WONT @dataclass() @@ -43,81 +44,196 @@ class PluginTransportArgs(BasePluginTransportArgs): pass -class ScrapliTelnet(Telnet): - def __init__(self, host: str, port: int, timeout: float) -> None: +class TelnetTransport(Transport): + def __init__( + self, base_transport_args: BaseTransportArgs, plugin_transport_args: PluginTransportArgs + ) -> None: + super().__init__(base_transport_args=base_transport_args) + self.plugin_transport_args = plugin_transport_args + + self.socket: Optional[Socket] = None + self._initial_buf = b"" + + def _set_socket_timeout(self, timeout: float) -> None: """ - ScrapliTelnet class for typing purposes + Set underlying socket timeout + + Mostly this exists just to assert that socket and socket.sock are not None to appease mypy! Args: - host: string of host - port: integer port to connect to - timeout: timeout value in seconds + timeout: float value to set as the timeout Returns: - None + N/A Raises: + ScrapliConnectionNotOpened: if either socket or socket.sock are None + """ + if self.socket is None: + raise ScrapliConnectionNotOpened + if self.socket.sock is None: + raise ScrapliConnectionNotOpened + self.socket.sock.settimeout(timeout) + + def _handle_control_chars_response(self, control_buf: bytes, c: bytes) -> bytes: + """ + Handle the actual response to control characters + + Broken up to be easier to test as well as to appease mr. mccabe + + NOTE: see the asynctelnet transport for additional comments inline about what is going on + here. + + Args: + control_buf: current control_buf to work with + c: currently read control char to process + + Returns: + bytes: updated control_buf + + Raises: + ScrapliConnectionNotOpened: if connection is not opened for some reason + + """ + if not self.socket: + raise ScrapliConnectionNotOpened + + if not control_buf: + if c != IAC: + self._initial_buf += c + else: + control_buf += c + + elif len(control_buf) == 1 and c in (DO, DONT, WILL, WONT): + control_buf += c + + elif len(control_buf) == 2: + cmd = control_buf[1:2] + control_buf = b"" + + if (cmd == DO) and (c == SUPPRESS_GO_AHEAD): + self.write(IAC + WILL + c) + elif cmd in (DO, DONT): + self.write(IAC + WONT + c) + elif cmd == WILL: + self.write(IAC + DO + c) + elif cmd == WONT: + self.write(IAC + DONT + c) + + return control_buf + + def _handle_control_chars(self) -> None: + """ + Handle control characters -- nearly identical to CPython (removed in 3.11) telnetlib + + Basically we want to read and "decline" any and all control options that the server proposes + to us -- so if they say "DO" XYZ directive, we say "DONT", if they say "WILL" we say "WONT". + + NOTE: see the asynctelnet transport for additional comments inline about what is going on + here. + + Args: N/A + Returns: + None + + Raises: + ScrapliConnectionNotOpened: if connection is not opened for some reason + ScrapliConnectionNotOpened: if we read an empty byte string from the reader -- this + indicates the server sent an EOF -- see #142 + """ - self.eof: bool - self.timeout: float + if not self.socket: + raise ScrapliConnectionNotOpened - super().__init__(host, port, int(timeout)) + control_buf = b"" + original_socket_timeout = self._base_transport_args.timeout_socket + self._set_socket_timeout(self._base_transport_args.timeout_socket / 4) -class TelnetTransport(Transport): - def __init__( - self, base_transport_args: BaseTransportArgs, plugin_transport_args: PluginTransportArgs - ) -> None: - super().__init__(base_transport_args=base_transport_args) - self.plugin_transport_args = plugin_transport_args + while True: + try: + c = self._read(1) + if not c: + raise ScrapliConnectionNotOpened("server returned EOF, connection not opened") + except TimeoutError: + # shouldn't really matter/need to be reset back to "normal", but don't really want + # to leave it modified as that would be confusing! + self._base_transport_args.timeout_socket = original_socket_timeout + return - self.session: Optional[ScrapliTelnet] = None + self._set_socket_timeout(self._base_transport_args.timeout_socket / 10) + control_buf = self._handle_control_chars_response(control_buf=control_buf, c=c) def open(self) -> None: self._pre_open_closing_log(closing=False) - # establish session with "socket" timeout, then reset timeout to "transport" timeout - try: - self.session = ScrapliTelnet( + if not self.socket: + self.socket = Socket( host=self._base_transport_args.host, port=self._base_transport_args.port, timeout=self._base_transport_args.timeout_socket, ) - self.session.timeout = self._base_transport_args.timeout_transport - except ConnectionError as exc: - msg = f"Failed to open telnet session to host {self._base_transport_args.host}" - if "connection refused" in str(exc).lower(): - msg = ( - f"Failed to open telnet session to host {self._base_transport_args.host}, " - "connection refused" - ) - raise ScrapliConnectionError(msg) from exc + + if not self.socket.isalive(): + self.socket.open() + + self._handle_control_chars() self._post_open_closing_log(closing=False) def close(self) -> None: self._pre_open_closing_log(closing=True) - if self.session: - self.session.close() + if self.socket: + self.socket.close() - self.session = None + self.socket = None self._post_open_closing_log(closing=True) def isalive(self) -> bool: - if not self.session: + if not self.socket: + return False + if not self.socket.isalive(): return False - return not self.session.eof + return True - @TransportTimeout("timed out reading from transport") + def _read(self, n: int = 65535) -> bytes: + """ + Read n bytes from the socket + + Mostly this exists just to assert that socket and socket.sock are not None to appease mypy! + + Args: + n: optional amount of bytes to try to recv from the underlying socket + + Returns: + N/A + + Raises: + ScrapliConnectionNotOpened: if either socket or socket.sock are None + """ + if self.socket is None: + raise ScrapliConnectionNotOpened + if self.socket.sock is None: + raise ScrapliConnectionNotOpened + return self.socket.sock.recv(n) + + @timeout_wrapper def read(self) -> bytes: - if not self.session: + if not self.socket: raise ScrapliConnectionNotOpened + + if self._initial_buf: + buf = self._initial_buf + self._initial_buf = b"" + return buf + try: - buf = self.session.read_eager() + buf = self._read() + buf = buf.replace(b"\x00", b"") except Exception as exc: raise ScrapliConnectionError( "encountered EOF reading from transport; typically means the device closed the " @@ -126,9 +242,11 @@ class TelnetTransport(Transport): return buf def write(self, channel_input: bytes) -> None: - if not self.session: + if self.socket is None: + raise ScrapliConnectionNotOpened + if self.socket.sock is None: raise ScrapliConnectionNotOpened - self.session.write(channel_input) + self.socket.sock.send(channel_input) @@ -164,67 +282,17 @@ class PluginTransportArgs(BasePluginTransportArgs): -### ScrapliTelnet +### TelnetTransport ```text -Telnet interface class. - -An instance of this class represents a connection to a telnet -server. The instance is initially not connected; the open() -method must be used to establish a connection. Alternatively, the -host name and optional port number can be passed to the -constructor, too. - -Don't try to reopen an already connected instance. - -This class has many read_*() methods. Note that some of them -raise EOFError when the end of the connection is read, because -they can return an empty string for other reasons. See the -individual doc strings. - -read_until(expected, [timeout]) - Read until the expected string has been seen, or a timeout is - hit (default is no timeout); may block. - -read_all() - Read all data until EOF; may block. - -read_some() - Read at least one byte or EOF; may block. - -read_very_eager() - Read all data available already queued or on the socket, - without blocking. - -read_eager() - Read either data already queued or some data available on the - socket, without blocking. - -read_lazy() - Read all data in the raw queue (processing it first), without - doing any socket I/O. - -read_very_lazy() - Reads all data in the cooked queue, without doing any socket - I/O. - -read_sb_data() - Reads available data between SB ... SE sequence. Don't block. - -set_option_negotiation_callback(callback) - Each time a telnet option is read on the input flow, this callback - (if set) is called with the following parameters : - callback(telnet socket, command, option) - option will be chr(0) when there is no option. - No other action is done afterwards by telnetlib. +Helper class that provides a standard way to create an ABC using +inheritance. -ScrapliTelnet class for typing purposes +Scrapli's transport base class Args: - host: string of host - port: integer port to connect to - timeout: timeout value in seconds + base_transport_args: base transport args dataclass Returns: None @@ -239,114 +307,196 @@ Raises:
         
-class ScrapliTelnet(Telnet):
-    def __init__(self, host: str, port: int, timeout: float) -> None:
+class TelnetTransport(Transport):
+    def __init__(
+        self, base_transport_args: BaseTransportArgs, plugin_transport_args: PluginTransportArgs
+    ) -> None:
+        super().__init__(base_transport_args=base_transport_args)
+        self.plugin_transport_args = plugin_transport_args
+
+        self.socket: Optional[Socket] = None
+        self._initial_buf = b""
+
+    def _set_socket_timeout(self, timeout: float) -> None:
         """
-        ScrapliTelnet class for typing purposes
+        Set underlying socket timeout
+
+        Mostly this exists just to assert that socket and socket.sock are not None to appease mypy!
 
         Args:
-            host: string of host
-            port: integer port to connect to
-            timeout: timeout value in seconds
+            timeout: float value to set as the timeout
 
         Returns:
-            None
+            N/A
 
         Raises:
-            N/A
+            ScrapliConnectionNotOpened: if either socket or socket.sock are None
+        """
+        if self.socket is None:
+            raise ScrapliConnectionNotOpened
+        if self.socket.sock is None:
+            raise ScrapliConnectionNotOpened
+        self.socket.sock.settimeout(timeout)
 
+    def _handle_control_chars_response(self, control_buf: bytes, c: bytes) -> bytes:
         """
-        self.eof: bool
-        self.timeout: float
+        Handle the actual response to control characters
 
-        super().__init__(host, port, int(timeout))
-        
-    
- + Broken up to be easier to test as well as to appease mr. mccabe + NOTE: see the asynctelnet transport for additional comments inline about what is going on + here. -#### Ancestors (in MRO) -- telnetlib.Telnet + Args: + control_buf: current control_buf to work with + c: currently read control char to process + Returns: + bytes: updated control_buf + Raises: + ScrapliConnectionNotOpened: if connection is not opened for some reason -### TelnetTransport + """ + if not self.socket: + raise ScrapliConnectionNotOpened + if not control_buf: + if c != IAC: + self._initial_buf += c + else: + control_buf += c -```text -Helper class that provides a standard way to create an ABC using -inheritance. + elif len(control_buf) == 1 and c in (DO, DONT, WILL, WONT): + control_buf += c -Scrapli's transport base class + elif len(control_buf) == 2: + cmd = control_buf[1:2] + control_buf = b"" -Args: - base_transport_args: base transport args dataclass + if (cmd == DO) and (c == SUPPRESS_GO_AHEAD): + self.write(IAC + WILL + c) + elif cmd in (DO, DONT): + self.write(IAC + WONT + c) + elif cmd == WILL: + self.write(IAC + DO + c) + elif cmd == WONT: + self.write(IAC + DONT + c) -Returns: - None + return control_buf -Raises: - N/A -``` + def _handle_control_chars(self) -> None: + """ + Handle control characters -- nearly identical to CPython (removed in 3.11) telnetlib -
- - Expand source code - -
-        
-class TelnetTransport(Transport):
-    def __init__(
-        self, base_transport_args: BaseTransportArgs, plugin_transport_args: PluginTransportArgs
-    ) -> None:
-        super().__init__(base_transport_args=base_transport_args)
-        self.plugin_transport_args = plugin_transport_args
+        Basically we want to read and "decline" any and all control options that the server proposes
+        to us -- so if they say "DO" XYZ directive, we say "DONT", if they say "WILL" we say "WONT".
+
+        NOTE: see the asynctelnet transport for additional comments inline about what is going on
+        here.
+
+        Args:
+            N/A
+
+        Returns:
+            None
+
+        Raises:
+            ScrapliConnectionNotOpened: if connection is not opened for some reason
+            ScrapliConnectionNotOpened: if we read an empty byte string from the reader -- this
+                indicates the server sent an EOF -- see #142
+
+        """
+        if not self.socket:
+            raise ScrapliConnectionNotOpened
+
+        control_buf = b""
+
+        original_socket_timeout = self._base_transport_args.timeout_socket
+        self._set_socket_timeout(self._base_transport_args.timeout_socket / 4)
 
-        self.session: Optional[ScrapliTelnet] = None
+        while True:
+            try:
+                c = self._read(1)
+                if not c:
+                    raise ScrapliConnectionNotOpened("server returned EOF, connection not opened")
+            except TimeoutError:
+                # shouldn't really matter/need to be reset back to "normal", but don't really want
+                # to leave it modified as that would be confusing!
+                self._base_transport_args.timeout_socket = original_socket_timeout
+                return
+
+            self._set_socket_timeout(self._base_transport_args.timeout_socket / 10)
+            control_buf = self._handle_control_chars_response(control_buf=control_buf, c=c)
 
     def open(self) -> None:
         self._pre_open_closing_log(closing=False)
 
-        # establish session with "socket" timeout, then reset timeout to "transport" timeout
-        try:
-            self.session = ScrapliTelnet(
+        if not self.socket:
+            self.socket = Socket(
                 host=self._base_transport_args.host,
                 port=self._base_transport_args.port,
                 timeout=self._base_transport_args.timeout_socket,
             )
-            self.session.timeout = self._base_transport_args.timeout_transport
-        except ConnectionError as exc:
-            msg = f"Failed to open telnet session to host {self._base_transport_args.host}"
-            if "connection refused" in str(exc).lower():
-                msg = (
-                    f"Failed to open telnet session to host {self._base_transport_args.host}, "
-                    "connection refused"
-                )
-            raise ScrapliConnectionError(msg) from exc
+
+        if not self.socket.isalive():
+            self.socket.open()
+
+        self._handle_control_chars()
 
         self._post_open_closing_log(closing=False)
 
     def close(self) -> None:
         self._pre_open_closing_log(closing=True)
 
-        if self.session:
-            self.session.close()
+        if self.socket:
+            self.socket.close()
 
-        self.session = None
+        self.socket = None
 
         self._post_open_closing_log(closing=True)
 
     def isalive(self) -> bool:
-        if not self.session:
+        if not self.socket:
+            return False
+        if not self.socket.isalive():
             return False
-        return not self.session.eof
+        return True
 
-    @TransportTimeout("timed out reading from transport")
+    def _read(self, n: int = 65535) -> bytes:
+        """
+        Read n bytes from the socket
+
+        Mostly this exists just to assert that socket and socket.sock are not None to appease mypy!
+
+        Args:
+            n: optional amount of bytes to try to recv from the underlying socket
+
+        Returns:
+            N/A
+
+        Raises:
+            ScrapliConnectionNotOpened: if either socket or socket.sock are None
+        """
+        if self.socket is None:
+            raise ScrapliConnectionNotOpened
+        if self.socket.sock is None:
+            raise ScrapliConnectionNotOpened
+        return self.socket.sock.recv(n)
+
+    @timeout_wrapper
     def read(self) -> bytes:
-        if not self.session:
+        if not self.socket:
             raise ScrapliConnectionNotOpened
+
+        if self._initial_buf:
+            buf = self._initial_buf
+            self._initial_buf = b""
+            return buf
+
         try:
-            buf = self.session.read_eager()
+            buf = self._read()
+            buf = buf.replace(b"\x00", b"")
         except Exception as exc:
             raise ScrapliConnectionError(
                 "encountered EOF reading from transport; typically means the device closed the "
@@ -355,9 +505,11 @@ class TelnetTransport(Transport):
         return buf
 
     def write(self, channel_input: bytes) -> None:
-        if not self.session:
+        if self.socket is None:
+            raise ScrapliConnectionNotOpened
+        if self.socket.sock is None:
             raise ScrapliConnectionNotOpened
-        self.session.write(channel_input)
+        self.socket.sock.send(channel_input)
         
     
diff --git a/setup.py b/setup.py index b81183f0..ae38ea88 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import setuptools -__version__ = "2022.01.30.post1" +__version__ = "2022.07.30" __author__ = "Carl Montanari" with open("README.md", "r", encoding="utf-8") as f: