├── .github └── workflows │ ├── acceptence_tests.yml │ └── clean_code.yml ├── .gitignore ├── BUILD.rst ├── COPYRIGHT.txt ├── LICENSE.txt ├── MANIFEST.in ├── README.rst ├── atest ├── README.rst ├── Tunnels.py ├── __init__.robot ├── connections.robot ├── docker │ ├── Dockerfile │ └── docker-compose.yml ├── execute_command.robot ├── file_and_dir_exists.robot ├── get_connection.robot ├── get_directory.robot ├── get_file.robot ├── importing_with_args.robot ├── list_directories_in_directory.robot ├── list_directory.robot ├── list_files_in_directory.robot ├── logging.robot ├── login.robot ├── put_directory.robot ├── put_file.robot ├── regexp_prompt.robot ├── resources │ ├── common.robot │ ├── sftp.robot │ ├── shell.robot │ └── write_and_read_resource.robot ├── run.py ├── start_command.robot ├── testdata │ ├── keyfiles │ │ ├── id_rsa_inaccessible │ │ └── id_rsa_invalid │ ├── scripts │ │ ├── test.sh │ │ ├── test_interactive.sh │ │ └── test_repeat.sh │ ├── textfiles │ │ ├── Test_newlines.txt │ │ ├── aaääöö │ │ │ └── aaääöö.txt │ │ ├── corrupted.txt │ │ ├── special%2Fchars.txt │ │ ├── test[1].txt │ │ └── test_file.txt │ └── to_put │ │ ├── ExampleText3.txt │ │ ├── Folder1 │ │ └── Folder2 │ │ │ └── ExampleFile1.txt │ │ └── Folder3 │ │ └── ExampleFile2.txt ├── tunnels.robot └── write_and_read │ ├── other_writes_and_reads.robot │ └── write_and_read.robot ├── docs ├── SSHLibrary-3.0.0.rst ├── SSHLibrary-3.0.0a1.rst ├── SSHLibrary-3.0.0rc1.rst ├── SSHLibrary-3.0.1a1.rst ├── SSHLibrary-3.1.0.rst ├── SSHLibrary-3.1.0rc1.rst ├── SSHLibrary-3.1.1.rst ├── SSHLibrary-3.2.0.rst ├── SSHLibrary-3.2.0a1.rst ├── SSHLibrary-3.2.0rc1.rst ├── SSHLibrary-3.2.1.rst ├── SSHLibrary-3.3.0.rst ├── SSHLibrary-3.3.0a1.rst ├── SSHLibrary-3.3.0rc1.rst ├── SSHLibrary-3.4.0.rst ├── SSHLibrary-3.4.0rc1.rst ├── SSHLibrary-3.4.0rc2.rst ├── SSHLibrary-3.4.0rc3.rst ├── SSHLibrary-3.4.0rc4.rst ├── SSHLibrary-3.5.0.rst ├── SSHLibrary-3.5.0rc1.rst ├── SSHLibrary-3.5.1.rst ├── SSHLibrary-3.6.0.rst ├── SSHLibrary-3.6.0rc1.rst ├── SSHLibrary-3.7.0.rst ├── SSHLibrary-3.7.0rc1.rst ├── SSHLibrary-3.7.0rc2.rst ├── SSHLibrary-3.7.0rc3.rst ├── SSHLibrary-3.8.0.rst ├── SSHLibrary-3.8.0rc1.rst ├── SSHLibrary-3.8.1rc1.rst ├── SSHLibrary.html ├── extra.css ├── index.html └── style.css ├── requirements-build.txt ├── requirements-dev.txt ├── setup.py ├── src └── SSHLibrary │ ├── __init__.py │ ├── client.py │ ├── config.py │ ├── library.py │ ├── logger.py │ ├── pythonforward.py │ ├── sshconnectioncache.py │ └── version.py └── tasks.py /.github/workflows/acceptence_tests.yml: -------------------------------------------------------------------------------- 1 | name: Acceptance Tests 2 | 3 | on: [pull_request, workflow_dispatch] 4 | concurrency: 5 | group: ${{ github.workflow }}-${{ github.ref }} 6 | cancel-in-progress: true 7 | 8 | jobs: 9 | build: 10 | name: Acceptance tests Python ${{ matrix.python-version }} 11 | runs-on: ${{ matrix.os }} 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | os: ["ubuntu-latest"] 16 | python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] 17 | 18 | steps: 19 | - uses: actions/checkout@v4 20 | - name: Set up Python ${{ matrix.python-version }} 21 | uses: actions/setup-python@v5 22 | with: 23 | python-version: ${{ matrix.python-version }} 24 | - name: Install dependencies 25 | run: | 26 | python -m pip install --upgrade pip 27 | pip install . 28 | - name: Configure test environment for Linux 29 | run: | 30 | sudo useradd test -m -s /bin/bash 31 | (echo 'test'; echo 'test') | sudo passwd test 32 | sudo -E su test -c "echo $'export PS1=\'\u@$HOSTNAME \W \$ \'' >> /home/test/.bashrc" 33 | sudo sh -c "echo 'test ALL=(ALL:ALL) PASSWD:ALL' > /etc/sudoers.d/passworded" 34 | sudo useradd -m testkey -s /bin/bash 35 | sudo -E su testkey -c "echo $'export PS1=\'\u@$HOSTNAME \W \$ \'' >> /home/testkey/.bashrc" 36 | sudo -E su testkey -c "mkdir -p /home/testkey/.ssh" 37 | sudo -E su testkey -c "ssh-keygen -f /home/testkey/.ssh/id_rsa -t rsa -N ''" 38 | sudo -E su testkey -c "cp /home/testkey/.ssh/id_rsa.pub /home/testkey/.ssh/authorized_keys" 39 | sudo -E su testkey -c "chmod 644 /home/testkey/.ssh/id_rsa" 40 | sudo -E su testkey -c "chmod 600 /home/testkey/.ssh/authorized_keys" 41 | cp /home/testkey/.ssh/id_rsa atest/testdata/keyfiles/ 42 | sudo -E su testkey -c "chmod 700 /home/testkey/.ssh" 43 | sudo -E su testkey -c "chmod 600 /home/testkey/.ssh/id_rsa" 44 | sudo chmod 600 atest/testdata/keyfiles/id_rsa 45 | sudo bash -c "echo 'Testing pre-login banner' > /etc/ssh/sshd-banner" 46 | sudo bash -c "echo 'Banner /etc/ssh/sshd-banner' >> /etc/ssh/sshd_config" 47 | sudo bash -c "echo 'Subsystem subsys echo \"Subsystem invoked.\"' >> /etc/ssh/sshd_config" 48 | mkdir ~/.ssh 49 | echo $'Host test_hostname\n Hostname localhost\n User test\n Port 22\n' >> ~/.ssh/config 50 | echo $'Host testkey_hostname\n Hostname localhost\n User testkey\n Port 22\n IdentityFile atest/testdata/keyfiles/id_rsa\n' >> ~/.ssh/config 51 | echo $'Host test_proxy_hostname\n Hostname localhost\n User test\n Port 22\n ProxyCommand ssh -W %h:%p testkey_hostname\n' >> ~/.ssh/config 52 | sudo useradd test-nopasswd -m -s /bin/bash 53 | sudo passwd --delete test-nopasswd 54 | sudo bash -c "echo 'PermitEmptyPasswords yes' >> /etc/ssh/sshd_config" 55 | sudo service ssh restart 56 | eval "$(ssh-agent -s)" 57 | ssh-add atest/testdata/keyfiles/id_rsa 58 | - name: Run tests 59 | run: | 60 | robot -d results-${{ matrix.python-version }} -e no-gh-actions -b console.log -x xunit.xml -L TRACE:INFO atest 61 | - uses: actions/upload-artifact@v4 62 | if: success() || failure() 63 | with: 64 | name: Test Results - Python ${{ matrix.python-version }} 65 | path: "results-${{ matrix.python-version }}" 66 | retention-days: 180 67 | - name: Publish Unit Test Results 68 | uses: EnricoMi/publish-unit-test-result-action@v2 69 | if: success() || failure() 70 | with: 71 | files: results-${{ matrix.python-version }}/xunit.xml 72 | -------------------------------------------------------------------------------- /.github/workflows/clean_code.yml: -------------------------------------------------------------------------------- 1 | name: Clean Code Verification 2 | 3 | on: [pull_request] 4 | concurrency: 5 | group: ${{ github.workflow }}-${{ github.ref }} 6 | cancel-in-progress: true 7 | 8 | jobs: 9 | tidy: 10 | name: Robotidy - Check Formatting 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v4 14 | - name: Set up Python 15 | uses: actions/setup-python@v5 16 | with: 17 | python-version: "3.11" 18 | - name: Install robotidy 19 | run: | 20 | pip install robotframework-tidy 21 | - name: Check Test Formatting 22 | run: | 23 | robotidy --check --diff atest 24 | validate-syntax: 25 | name: Validate Test Syntax 26 | runs-on: ubuntu-latest 27 | steps: 28 | - uses: actions/checkout@v4 29 | - name: Set up Python 30 | uses: actions/setup-python@v5 31 | with: 32 | python-version: "3.11" 33 | - name: Install SSHLibrary 34 | run: | 35 | python -m pip install --upgrade pip 36 | pip install . 37 | - name: Run tests 38 | run: | 39 | robot --dryrun -d results -e no-gh-actions -b console.log atest 40 | - uses: actions/upload-artifact@v4 41 | if: success() || failure() 42 | with: 43 | name: Syntax Validation 44 | path: "results" 45 | retention-days: 7 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | dist/ 3 | .DS_Store 4 | .idea/ 5 | .vscode/ 6 | __pycache__/ 7 | 8 | *.pyc 9 | *.class 10 | *.egg-info 11 | *.swp 12 | results/ 13 | atest/testdata/keyfiles/id_rsa 14 | atest/docker/results 15 | examples/output.xml 16 | examples/log.html 17 | examples/report.html 18 | 19 | log.html 20 | report.html 21 | output.xml -------------------------------------------------------------------------------- /COPYRIGHT.txt: -------------------------------------------------------------------------------- 1 | Copyright 2008-2015 Nokia Networks 2 | Copyright 2016-2024 Robot Framework Foundation 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | exclude MANIFEST.in 2 | include README.rst COPYRIGHT.txt LICENSE.txt 3 | include doc/SSHLibrary.html 4 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | .. list-table:: 2 | :header-rows: 0 3 | 4 | * - Statistic: 5 | - |_github_created_at| 6 | - |_pypi_python_version| 7 | - |_pypi_downloads| 8 | * - Quality: 9 | - |_github_main_status| 10 | - Next Release: 11 | - |_github_milestone_4| 12 | * - Pulse: 13 | - |_github_latest_release| 14 | - |_github_commits_since_release| 15 | - |_github_last_commit| 16 | 17 | SSHLibrary 18 | =============== 19 | 20 | .. contents:: 21 | 22 | Introduction 23 | ------------ 24 | 25 | SSHLibrary_ is a `Robot Framework`_ test 26 | library for SSH and SFTP. The project is hosted on GitHub_ 27 | and downloads can be found from PyPI_. 28 | 29 | SSHLibrary is operating system independent and supports Python 3.6 or newer. 30 | 31 | The library has the following main usages: 32 | 33 | - Executing commands on the remote machine, either with blocking or 34 | non-blocking behavior. 35 | - Writing and reading in an interactive shell. 36 | - Transferring files and directories over SFTP. 37 | - Ensuring that files and directories exist on the remote machine. 38 | 39 | .. image:: https://img.shields.io/pypi/l/robotframework-sshlibrary.svg 40 | :target: http://www.apache.org/licenses/LICENSE-2.0 41 | 42 | Documentation 43 | ------------- 44 | 45 | See `keyword documentation`_ for available keywords and more information 46 | about the library in general. 47 | 48 | For general information about using test libraries with Robot Framework, see 49 | `Robot Framework User Guide`_. 50 | 51 | Installation 52 | ------------ 53 | 54 | The recommended installation method is using pip_:: 55 | 56 | pip install --upgrade robotframework-sshlibrary 57 | 58 | Running this command installs also the latest Robot Framework, paramiko_ 59 | and scp_ versions. The minimum supported paramiko version is ``1.15.3`` and 60 | minimum supported scp version is ``0.13.0``. 61 | The ``--upgrade`` option can be omitted when installing the library for the 62 | first time. 63 | 64 | With recent versions of ``pip`` it is possible to install directly from the 65 | GitHub_ repository. To install latest source from the master branch, use 66 | this command:: 67 | 68 | pip install git+https://github.com/MarketSquare/SSHLibrary.git 69 | 70 | Alternatively you can download the source distribution from PyPI_, extract 71 | it, and install it using one the command:: 72 | 73 | python setup.py install 74 | 75 | A benefit of using pip is that it automatically installs scp, paramiko 76 | and Cryptography_ modules (or PyCrypto_ if paramiko version < 2.0) 77 | that SSHLibrary requires. 78 | 79 | For creating SSH tunnels robotbackgroundlogger_ > 1.2 is also a requirement. 80 | 81 | Docker 82 | ~~~~~~ 83 | 84 | When installing SSHLibrary in a container (eg. Alpine Linux) there are more dependencies 85 | that must be installed: gcc_, make_, openssl-dev_, musl-dev_ and libffi-dev_. These 86 | packages can be installed using:: 87 | 88 | apk add gcc make openssl-dev musl-dev libffi-dev 89 | 90 | Usage 91 | ----- 92 | 93 | To use SSHLibrary in Robot Framework tests, the library needs to first be 94 | imported using the Library setting as any other library. 95 | 96 | When using Robot Framework, it is generally recommended to write as 97 | easy-to-understand tests as possible. The keywords provided by 98 | SSHLibrary are pretty low level and it is typically a good idea to 99 | write tests using Robot Framework's higher level keywords that utilize 100 | SSHLibrary keywords internally. This is illustrated by the following example 101 | where SSHLibrary keywords like ``Open Connection`` and ``Login`` are grouped 102 | together in a higher level keyword like ``Open Connection And Log In``. 103 | 104 | .. code:: robotframework 105 | 106 | *** Settings *** 107 | Documentation This example demonstrates executing a command on a remote machine 108 | ... and getting its output. 109 | ... 110 | ... Notice how connections are handled as part of the suite setup and 111 | ... teardown. This saves some time when executing several test cases. 112 | 113 | Library SSHLibrary 114 | Suite Setup Open Connection And Log In 115 | Suite Teardown Close All Connections 116 | 117 | *** Variables *** 118 | ${HOST} localhost 119 | ${USERNAME} test 120 | ${PASSWORD} test 121 | 122 | *** Test Cases *** 123 | Execute Command And Verify Output 124 | [Documentation] Execute Command can be used to run commands on the remote machine. 125 | ... The keyword returns the standard output by default. 126 | ${output}= Execute Command echo Hello SSHLibrary! 127 | Should Be Equal ${output} Hello SSHLibrary! 128 | 129 | *** Keywords *** 130 | Open Connection And Log In 131 | Open Connection ${HOST} 132 | Login ${USERNAME} ${PASSWORD} 133 | 134 | Support 135 | ------- 136 | 137 | If the provided documentation is not enough, there are various support forums 138 | available: 139 | 140 | - `robotframework-users`_ mailing list 141 | - ``#sshlibrary`` and ``#sshlibrary-dev`` channels in 142 | Robot Framework `Slack community`_ 143 | - SSHLibrary `issue tracker`_ for bug reports and concrete enhancement 144 | requests 145 | - `Other support forums`_ including paid support 146 | 147 | .. _Robot Framework: http://robotframework.org 148 | .. _Robot Framework User Guide: http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#using-test-libraries 149 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 150 | .. _GitHub: https://github.com/MarketSquare/SSHLibrary 151 | .. _Python: http://python.org 152 | .. _pip: http://pip-installer.org 153 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 154 | .. _Keyword Documentation: https://marketsquare.github.io/SSHLibrary/SSHLibrary.html 155 | .. _Jython 2.7: http://jython.org 156 | .. _paramiko: http://www.paramiko.org 157 | .. _scp: https://github.com/jbardin/scp.py 158 | .. _Cryptography: https://cryptography.io 159 | .. _PyCrypto: http://www.pycrypto.org 160 | .. _robotbackgroundlogger: https://github.com/robotframework/robotbackgroundlogger 161 | .. _gcc: https://pkgs.alpinelinux.org/packages?name=gcc&branch=edge 162 | .. _make: https://pkgs.alpinelinux.org/packages?name=make&branch=edge 163 | .. _openssl-dev: https://pkgs.alpinelinux.org/packages?name=openssl-dev&branch=edge 164 | .. _musl-dev: https://pkgs.alpinelinux.org/packages?name=musl-dev&branch=edge 165 | .. _libffi-dev: https://pkgs.alpinelinux.org/packages?name=libffi-dev&branch=edge 166 | .. _robotframework-users: http://groups.google.com/group/robotframework-users 167 | .. _Slack community: https://robotframework-slack-invite.herokuapp.com 168 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues 169 | .. _Other support forums: http://robotframework.org/#support 170 | 171 | .. |_github_created_at| image:: https://img.shields.io/github/created-at/MarketSquare/SSHLibrary?logo=robotframework 172 | :alt: GitHub Created At 173 | 174 | .. |_pypi_downloads| image:: https://img.shields.io/pypi/dm/robotframework-sshlibrary 175 | :alt: PyPI - Downloads 176 | 177 | .. |_github_milestone_4| image:: https://img.shields.io/github/milestones/progress-percent/MarketSquare/SSHLibrary/25 178 | :alt: GitHub milestone details 179 | 180 | .. |_pypi_python_version| image:: https://img.shields.io/pypi/pyversions/robotframework-sshlibrary 181 | :alt: PyPI - Python Version 182 | 183 | .. |_github_main_status| image:: https://img.shields.io/github/check-runs/MarketSquare/SSHLibrary/master 184 | :alt: GitHub branch check runs 185 | 186 | .. |_github_commits_since_release| image:: https://img.shields.io/github/commits-since/MarketSquare/SSHLibrary/latest 187 | :alt: GitHub commits since latest release 188 | 189 | .. |_github_latest_release| image:: https://img.shields.io/github/release-date/MarketSquare/SSHLibrary 190 | :alt: GitHub Release Date 191 | 192 | .. |_github_last_commit| image:: https://img.shields.io/github/last-commit/MarketSquare/SSHLibrary 193 | :alt: GitHub last commit 194 | -------------------------------------------------------------------------------- /atest/README.rst: -------------------------------------------------------------------------------- 1 | ================================================ 2 | How to run SSHLibrary's own acceptance tests 3 | ================================================ 4 | 5 | This guide tells how to run the acceptance tests of SSHLibrary. Acceptance tests basically require an SSH server (`OpenSSH `__ recommended) installed and running and two user accounts to be created for the tests. 6 | 7 | Because SSHLibrary is primary used on Linux, tests should be ran at least on it. If developing on OS X or Windows, setting up a virtual machine with Linux and SSHLibrary installed is the recommended approach. 8 | 9 | Setup IDE 10 | ========= 11 | 12 | Use ``robotframework-tidy`` to format the test files. It can be installed with pip: ``pip install robotframework-tidy``. If you do not format test cases according to robotidy, the PR check will fail automatically. 13 | 14 | Setup on Linux 15 | ============== 16 | 17 | - Install OpenSSH server (using apt-get on Debian variants): 18 | 19 | :: 20 | 21 | sudo apt-get install openssh-server 22 | 23 | - Create a new user ``test``: 24 | 25 | :: 26 | 27 | sudo useradd test -m -s /bin/bash 28 | 29 | - With password ``test``: 30 | 31 | :: 32 | 33 | sudo passwd test 34 | (input `test` as the new password) 35 | 36 | - Add ``test`` user to the sudoers list:: 37 | 38 | sudo adduser test sudo 39 | (input `test` as UNIX password) 40 | 41 | - Log in as ``test`` 42 | 43 | :: 44 | 45 | sudo su test 46 | 47 | - Set prompt in ``.bashrc`` 48 | 49 | :: 50 | 51 | export PS1='\u@\h \W \$ ' 52 | 53 | - exit 54 | 55 | - Create a new user ``test-nopasswd``: 56 | 57 | :: 58 | 59 | sudo useradd --create-home --shell /bin/bash test-nopasswd 60 | 61 | - Delete it's password 62 | 63 | :: 64 | 65 | sudo passwd --delete test-nopasswd 66 | 67 | - Create a new user ``testkey``: 68 | 69 | :: 70 | 71 | sudo useradd -m testkey -s /bin/bash 72 | 73 | - Log in as ``testkey``: 74 | 75 | :: 76 | 77 | sudo su testkey 78 | 79 | - Set prompt in `.bashrc` 80 | 81 | :: 82 | 83 | export PS1='\u@\h \W \$ ' 84 | 85 | - Generate a new SSH key pair: 86 | 87 | :: 88 | 89 | ssh-keygen -t rsa 90 | (input empty password) 91 | 92 | - Add the public key to user's authorized keys: 93 | 94 | :: 95 | 96 | cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys 97 | 98 | - Make the key known to the ssh agent: 99 | 100 | :: 101 | 102 | ssh-add ~/.ssh/id_rsa 103 | 104 | - Log out, back to your normal user account: 105 | 106 | :: 107 | 108 | exit 109 | 110 | - Finally, copy ``id_rsa`` of user ``testkey`` into directory ``atest/testdata/keyfiles``: 111 | 112 | :: 113 | 114 | sudo cp ~testkey/.ssh/id_rsa /atest/testdata/keyfiles/ 115 | 116 | - Change the rights for that file so that you can read it. 117 | 118 | Additional OpenSSH configuration 119 | ################################ 120 | 121 | - Open sshd configuration file ``/etc/ssh/sshd_config`` using a text editor 122 | 123 | - Add/edit the following lines: 124 | 125 | :: 126 | PermitEmptyPasswords yes 127 | Banner /etc/ssh/sshd-banner # for testing pre-login banner 128 | Subsystem subsys echo "Subsystem invoked." # for testing invoke_subsystem 129 | 130 | - Save file and restart the ssh server: 131 | 132 | :: 133 | 134 | sudo /etc/init.d/ssh restart 135 | 136 | - Create a new file ``/etc/ssh/sshd-banner`` containing: 137 | 138 | :: 139 | 140 | Testing pre-login banner 141 | 142 | 143 | - Add test_hostname, testkey_hostname and test_proxy_hostname in ``~/.ssh/config`` 144 | 145 | :: 146 | 147 | echo $'Host test_hostname\n Hostname localhost\n User test\n Port 22\n' >> ~/.ssh/config 148 | 149 | :: 150 | 151 | echo $'Host testkey_hostname\n Hostname localhost\n User testkey\n Port 22\n IdentityFile /atest/testdata/keyfiles/id_rsa\n' >> ~/.ssh/config 152 | 153 | :: 154 | 155 | echo $'Host test_proxy_hostname\n Hostname localhost\n User test\n Port 22\n ProxyCommand ssh -W %h:%p testkey_hostname\n' >> ~/.ssh/config 156 | 157 | 158 | Setup for Docker 159 | ================ 160 | First go into the ``docker`` folder and build a SSHLibrary image that will be based on your repository: 161 | 162 | :: 163 | 164 | sudo docker build -t sshlibrary --build-arg repository= . 165 | 166 | 167 | Go to the ``docker-compose.yml`` file and change the branch name so that the chosen git branch will be selected: 168 | 169 | :: 170 | 171 | command: /bin/bash -c "service ssh start && && eval $$(ssh-agent -s) && ssh-add /home/testkey/.ssh/id_rsa && 172 | cd SSHLibrary && git checkout && git pull origin && python3 atest/run.py ." 173 | 174 | Save the changes and create a folder ``results`` in the ``docker`` folder, that will be used by 175 | ``docker-compose`` to get from the container the test reports: 176 | 177 | :: 178 | 179 | mkdir results 180 | 181 | 182 | Run the docker-compose file: 183 | 184 | :: 185 | 186 | sudo docker-compose up -d 187 | 188 | 189 | After running the latest command some time will be required for the acceptance tests to be executed. The results 190 | files can be found in the ``/docker/results/python`` folder. 191 | 192 | To follow the test execution in real time use the command: 193 | 194 | :: 195 | 196 | sudo docker logs --follow 197 | 198 | Setup in Windows 199 | ================ 200 | The acceptance tests can also be run on Windows. The recommended way is to use the WSL (Windows Subsystem for Linux) available in Windows 10. 201 | 202 | Running the acceptance tests 203 | ============================ 204 | 205 | Tests also require ``robotstatuschecker``: 206 | 207 | :: 208 | 209 | pip install robotstatuschecker 210 | 211 | Tests are ran using Bash script ``python atest/run.py``. The script prints help when ran without parameters. 212 | 213 | In order to run the tests with IPv6, the ``::1`` must be used as host variable when running ``atest/run.py`` script:: 214 | 215 | python atest/run.py --variable=HOST:::1 atest 216 | 217 | 218 | -------------------------------------------------------------------------------- /atest/Tunnels.py: -------------------------------------------------------------------------------- 1 | import socket 2 | from robot.api.deco import library, keyword 3 | 4 | 5 | @library 6 | class Tunnels: 7 | 8 | @keyword 9 | def dummy_connect(self, local_port): 10 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 11 | s.connect(("127.0.0.1", int(local_port))) 12 | s.close() 13 | -------------------------------------------------------------------------------- /atest/__init__.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Force Tags regression 3 | -------------------------------------------------------------------------------- /atest/connections.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/common.robot 3 | 4 | Test Teardown Close All Connections 5 | 6 | 7 | *** Test Cases *** 8 | Open Connection 9 | Open Connection ${HOST} 10 | 11 | Close Connection 12 | [Setup] Login As Valid User 13 | Close Connection 14 | Connection Should Be Closed 15 | 16 | Close Connection Fails If No Connection 17 | Run Keyword And Expect Error No open connection. Close Connection 18 | 19 | Switch Connection 20 | ${conn1_id} = Open Connection ${HOST} alias=one prompt=${PROMPT} 21 | Login ${USERNAME} ${PASSWORD} 22 | Write cd /tmp 23 | Read Until Prompt 24 | ${conn_id2} = Open Connection ${HOST} alias=second prompt=${PROMPT} 25 | Login ${USERNAME} ${PASSWORD} 26 | ${prev id} = Switch Connection ${conn1_id} 27 | Should Be Equal ${prev id} ${conn_id2} 28 | Write pwd 29 | ${output} = Read Until Prompt 30 | Should Contain ${output} /tmp 31 | ${prev id} = Switch Connection second 32 | Write pwd 33 | ${result} = Read Until Prompt 34 | Should Contain ${result} ~ 35 | 36 | Switch Connection To None 37 | [Setup] Login As Valid User 38 | Switch Connection ${NONE} 39 | Connection Should Be Closed 40 | 41 | Switch to closed connection 42 | Open Connection ${HOST} alias=SUT 43 | Login ${USERNAME} ${PASSWORD} 44 | Execute command ls 45 | close connection 46 | Run keyword and expect error Non-existing index or alias 'SUT'. switch connection SUT 47 | 48 | Get pre-login banner without open connection 49 | [Tags] no-gh-actions 50 | ${banner} = Get Pre Login Banner ${HOST} 51 | Should Be Equal ${banner} Testing pre-login banner\n 52 | 53 | Get pre-login banner from current connection 54 | Open Connection ${HOST} prompt=${PROMPT} 55 | Login ${USERNAME} ${PASSWORD} 56 | ${banner} = Get Pre Login Banner 57 | Should Be Equal ${banner} Testing pre-login banner\n 58 | 59 | Switch Connection When Previous Connection Was Closed 60 | Open Connection ${HOST} alias=alias1 61 | Open Connection ${HOST} alias=alias2 62 | Switch Connection alias1 63 | Close Connection 64 | Connection Should Be Closed 65 | ${old_index} = Switch Connection alias2 66 | Should Be Equal As Strings ${old_index} None 67 | Run Keyword And Expect Error Non-existing index or alias 'alias1'. Switch Connection alias1 68 | ${conn} = Get Connection 69 | Should Be Equal As Strings ${conn.index} 2 70 | Should Be Equal As Strings ${conn.alias} alias2 71 | 72 | Switch Connection Using Index When Previous Connection Was Closed 73 | Open Connection ${HOST} 74 | Open Connection ${HOST} 75 | Switch Connection 1 76 | Close Connection 77 | Connection Should Be Closed 78 | Switch Connection 2 79 | Run Keyword And Expect Error Non-existing index or alias '1'. Switch Connection 1 80 | ${conn} = Get Connection 81 | Should Be Equal As Strings ${conn.index} 2 82 | 83 | Open Connection When Previous Connection Was Closed 84 | Open Connection ${HOST} alias=alias1 85 | Close Connection 86 | Connection Should Be Closed 87 | ${idx} = Open Connection ${HOST} alias=alias2 88 | Should Be Equal ${idx} ${2} 89 | ${conn} = Get Connection 2 90 | Should Be Equal ${conn.index} ${2} 91 | Should Be Equal ${conn.alias} alias2 92 | ${conn} = Get Connection alias2 93 | Should Be Equal ${conn.index} ${2} 94 | Should Be Equal ${conn.alias} alias2 95 | 96 | Reuse Closed Connection Alias 97 | Open Connection ${HOST} alias=alias1 98 | Close Connection 99 | Connection Should Be Closed 100 | Open Connection ${HOST} alias=alias1 101 | ${conn} = Get Connection 2 102 | Should Be Equal ${conn.index} ${2} 103 | Should Be Equal ${conn.alias} alias1 104 | ${conn} = Get Connection alias1 105 | Should Be Equal ${conn.index} ${2} 106 | Should Be Equal ${conn.alias} alias1 107 | 108 | Connection To Host Read From SSH Config File 109 | Open Connection ${TEST_HOSTNAME} 110 | Login ${USERNAME} ${PASSWORD} read_config=True 111 | 112 | Connection To Host Ignoring SSH Config File 113 | Open Connection ${TEST_HOSTNAME} 114 | Run Keyword And Expect Error *Err* Login ${USERNAME} ${PASSWORD} read_config=False 115 | Run Keyword And Expect Error *Err* Login With Public Key ${KEY USERNAME} ${KEY} read_config=False 116 | 117 | Write In Teardown Should Not Hang If Auth Failed 118 | Open Connection ${HOST} 119 | Run Keyword And Expect Error Authentication failed* Login ${USERNAME} invalid 120 | [Teardown] Run Keyword And Expect Error *Cannot open session, you need to establish a connection first. Write ls 121 | 122 | Write Bare In Teardown Should Not Hang If Auth Failed 123 | Open Connection ${HOST} 124 | Run Keyword And Expect Error 125 | ... Login with public key failed* 126 | ... Login With Public Key 127 | ... ${USERNAME} 128 | ... ${KEY}_invalid 129 | [Teardown] Run Keyword And Expect Error *Cannot open session, you need to establish a connection first. Write Bare ls 130 | 131 | Login With Agent 132 | [Tags] no-gh-actions 133 | Open Connection ${HOST} 134 | Login ${KEY USERNAME} allow_agent=True 135 | 136 | 137 | *** Keywords *** 138 | Connection Should Be Closed 139 | Run Keyword And Expect Error No open connection. Write pwd 140 | -------------------------------------------------------------------------------- /atest/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | RUN apt-get update -y 3 | RUN apt-get update -y 4 | RUN apt-get install -y software-properties-common 5 | RUN add-apt-repository -y ppa:deadsnakes/ppa 6 | RUN apt update 7 | RUN apt-get install -y python3.7 python3-pip gcc make musl-dev libffi-dev net-tools language-pack-en locales 8 | RUN python3.7 -m pip install --upgrade pip 9 | RUN python3.7 -m pip install --upgrade robotframework-sshlibrary robotbackgroundlogger robotstatuschecker 10 | ARG repository 11 | RUN apt-get install -y openssh-server sudo git 12 | RUN useradd --create-home --shell /bin/bash test-nopasswd 13 | RUN passwd --delete test-nopasswd 14 | RUN echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config 15 | RUN systemctl restart sshd 16 | RUN useradd test --create-home --shell /bin/bash test 17 | RUN (echo 'test'; echo 'test') | passwd test 18 | RUN echo -e "test\n test" | adduser test sudo 19 | RUN sh -c "echo 'test ALL=(ALL:ALL) PASSWD:ALL' > /etc/sudoers.d/passworded" 20 | RUN useradd -m testkey -s /bin/bash 21 | RUN sudo -E su test -c echo "$'export PS1='\u@\h \W \$ '' >> /home/test/.bashrc" 22 | RUN sudo -E su testkey -c echo "$'export PS1='\u@\h \W \$ '' >> /home/testkey/.bashrc" 23 | RUN sudo -E su testkey -c "mkdir -p /home/testkey/.ssh" 24 | RUN sudo -E su testkey -c "ssh-keygen -f /home/testkey/.ssh/id_rsa -t rsa -N ''" 25 | RUN sudo -E su testkey -c "cp /home/testkey/.ssh/id_rsa.pub /home/testkey/.ssh/authorized_keys" 26 | RUN sudo -E su testkey -c "chmod 644 /home/testkey/.ssh/id_rsa" 27 | RUN git clone $repository 28 | RUN cp /home/testkey/.ssh/id_rsa /SSHLibrary/atest/testdata/keyfiles/ 29 | RUN echo 'Testing pre-login banner' >> /etc/ssh/sshd-banner 30 | RUN echo 'Banner /etc/ssh/sshd-banner' >> /etc/ssh/sshd_config 31 | RUN echo 'Subsystem subsys echo "Subsystem invoked."' >> /etc/ssh/sshd_config 32 | RUN sudo mkdir -p ~/.ssh 33 | RUN echo 'Host test_hostname\n Hostname localhost\n' >> ~/.ssh/config 34 | RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen 35 | ENV LANG en_US.UTF-8 36 | ENV LANGUAGE en_US:en 37 | ENV LC_ALL en_US.UTF-8 38 | -------------------------------------------------------------------------------- /atest/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | services: 3 | cont: 4 | image: sshlibrary:latest 5 | volumes: 6 | - type: bind 7 | source: ./results 8 | target: /SSHLibrary/atest/results 9 | command: /bin/bash -c "service ssh start && eval $$(ssh-agent -s) && ssh-add /home/testkey/.ssh/id_rsa && cd SSHLibrary && git checkout master && git pull origin master && python3.7 atest/run.py ." 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /atest/execute_command.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/shell.robot 3 | Library OperatingSystem WITH NAME OS 4 | Library DateTime 5 | 6 | Suite Setup Login And Upload Test Scripts 7 | Suite Teardown Remove Test Files And Close Connections 8 | 9 | Test Tags shell execute_command 10 | 11 | 12 | *** Test Cases *** 13 | Execute Timeout 14 | [Documentation] FAIL SSHClientException: Timed out in 3 seconds 15 | ... LOG 1:2 INFO GLOB: *Command no. 1*Command no. 2*Command no. 3* 16 | TRY 17 | Execute Command 18 | ... for i in {1..5}; do echo "Command no. $i"; sleep 1; done 19 | ... timeout=3s 20 | ... output_if_timeout=True 21 | EXCEPT SSHClientException: Timed out in 3 seconds 22 | Pass Execution Test passed: Command successfully timed out after 3 seconds. 23 | EXCEPT AS ${exception} 24 | Fail Unexpected exception: ${exception} 25 | END 26 | Fail Expected timeout did not occur. 27 | 28 | Execute Command With Defaults 29 | ${stdout} = Execute Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 30 | Should Be Equal ${stdout} This is stdout 31 | 32 | Execute Command And Return Stderr 33 | ${stderr} = Execute Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 34 | ... return_stdout=false return_stderr=yes 35 | Should Be Equal ${stderr} This is stderr 36 | 37 | Execute Command And Return Rc 38 | ${rc} = Execute Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 39 | ... return_stdout=False return_rc=${true} 40 | Should Be Equal As Integers ${rc} 0 41 | 42 | Execute Command And Return All Values 43 | ${stdout} ${stderr} ${rc} = Execute Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 44 | ... foo bar baz 45 | Should Be Equal ${stdout} This is stdout 46 | Should Be Equal ${stderr} This is stderr 47 | Should Be Equal As Integers ${rc} 0 48 | 49 | Execute Command With Output Containing Newlines 50 | ${result} = Execute Command echo -e "\n\nfoo" 51 | Should Be Equal ${result} \n\nfoo 52 | 53 | Execute Command With Multiple Statements 54 | ${result} = Execute Command echo "foo\n"; echo RC=$? 55 | Should Be Equal ${result} foo\n\nRC=0 56 | 57 | Executing Command With Non-ASCII characters 58 | ${result} = Execute Command echo 'aaääöö' 59 | Should Contain ${result} aaääöö 60 | 61 | Execute Command With Legacy Stdout Config 62 | ${stdout} = Execute Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 63 | ... STDout 64 | Should Be Equal ${stdout} This is stdout 65 | 66 | Execute Command With Legacy Stderr Config 67 | ${stderr} = Execute Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 68 | ... stderr 69 | Should Be Equal ${stderr} This is stderr 70 | 71 | Execute Command With Timeout Argument 72 | Run Keyword And Expect Error SSHClientException: Timed out in * seconds 73 | ... Execute Command cat timeout=1s 74 | Run Keyword And Expect Error SSHClientException: Timed out in * seconds 75 | ... Execute Command sleep 5 timeout=2s 76 | 77 | Execute Command With Legacy Stdout And Stderr Config 78 | ${stdout} ${stderr} = Execute Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 79 | ... Both 80 | Should Be Equal ${stdout} This is stdout 81 | Should Be Equal ${stderr} This is stderr 82 | 83 | Execute Command With Huge Output 84 | [Timeout] 5 seconds 85 | Execute Command echo 'foo\\nbar\\n' > file.txt 86 | Execute Command for i in {1..20}; do cat file.txt file.txt > file2.txt && mv file2.txt file.txt; done 87 | Execute Command cat file.txt 88 | [Teardown] Execute Command rm file.txt 89 | 90 | Execute Sudo Command With Correct Password 91 | ${stdout} = Execute Command -k pwd sudo=True sudo_password=test 92 | Should Be Equal ${stdout} ${REMOTE HOME TEST} 93 | 94 | Execute Sudo Command With Incorrect Password 95 | ${stdout} = Execute Command -k pwd sudo=True sudo_password=test123 96 | Should Not Contain ${stdout} ${REMOTE HOME TEST} 97 | 98 | Execute Time Consuming Sudo Command 99 | ${stdout} = Execute Command -k sleep 5; echo cat sudo=True sudo_password=test 100 | Should Contain ${stdout} cat 101 | 102 | Execute Command With Invoke Subsystem 103 | ${stdout} = Execute Command subsys invoke_subsystem=yes 104 | Should Be Equal ${stdout} Subsystem invoked. 105 | 106 | Execute Command With Timeout 107 | Run Keyword and Expect Error *Timed out in 5 seconds Execute Command sleep 10 timeout=5s 108 | 109 | Execute Command In Certain Amount Of Time 110 | ${start_time} = Get Current Date result_format=epoch exclude_millis=True 111 | Execute Command for i in {1..3}; do echo "Command no. $i"; sleep 1; done timeout=5s 112 | ${end_time} = Get Current Date result_format=epoch exclude_millis=True 113 | ${execution_time} = Subtract Time From Time ${end_time} ${start_time} 114 | Should Be True ${execution_time} < 5 115 | -------------------------------------------------------------------------------- /atest/file_and_dir_exists.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/sftp.robot 3 | 4 | Suite Setup Login And Upload Test Files 5 | Suite Teardown Remove Test Files and Close Connections 6 | 7 | 8 | *** Test Cases *** 9 | Directory Should Exist Using Absolute Path 10 | ${target} = Set Variable ${REMOTE TEST ROOT} 11 | SSH.Directory Should Exist ${target} 12 | Run Keyword And Expect Error Directory '${target}' exists. 13 | ... SSH.Directory Should Not Exist ${target} 14 | 15 | Directory Should Not Exist Using Absolute Path 16 | ${target} = Set Variable ${REMOTE TEST ROOT}/not_exists 17 | SSH.Directory Should Not Exist ${target} 18 | Run Keyword And Expect Error Directory '${target}' does not exist. 19 | ... SSH.Directory Should Exist ${target} 20 | 21 | Directory Should Exist Using Relative Path 22 | ${target} = Set Variable ${REMOTE TEST ROOT NAME}/${SUBDIRECTORY NAME} 23 | SSH.Directory Should Exist ${target} 24 | Run Keyword And Expect Error Directory '${target}' exists. 25 | ... SSH.Directory Should Not Exist ${target} 26 | 27 | Directory Should Not Exist Using Relative Path 28 | ${target} = Set Variable ${REMOTE TEST ROOT NAME}/not_exists 29 | SSH.Directory Should Not Exist ${target} 30 | Run Keyword And Expect Error Directory '${target}' does not exist. 31 | ... SSH.Directory Should Exist ${target} 32 | 33 | Directory Should Exist Using Current Path 34 | ${target} = Set Variable . 35 | SSH.Directory Should Exist ${target} 36 | Run Keyword And Expect Error Directory '${target}' exists. 37 | ... SSH.Directory Should Not Exist ${target} 38 | 39 | File Should Exist Using Absolute Path 40 | ${target} = Set Variable ${REMOTE TEST ROOT NAME}/${SUBDIRECTORY NAME}/${FILE WITH NON-ASCII NAME} 41 | SSH.File Should Exist ${target} 42 | Run Keyword And Expect Error File '${target}' exists. 43 | ... SSH.File Should Not Exist ${target} 44 | 45 | File Should Not Exist Using Absolute Path 46 | ${target} = Set Variable ${REMOTE TEST ROOT}/not_exists 47 | SSH.File Should Not Exist ${target} 48 | Run Keyword And Expect Error File '${target}' does not exist. 49 | ... SSH.File Should Exist ${target} 50 | 51 | File Should Exist Using Relative Path 52 | ${target} = Set Variable ${REMOTE TEST ROOT NAME}/${SUBDIRECTORY NAME}/${FILE WITH NON-ASCII NAME} 53 | SSH.File Should Exist ${target} 54 | Run Keyword And Expect Error File '${target}' exists. 55 | ... SSH.File Should Not Exist ${target} 56 | 57 | File Should Not Exist Using Relative Path 58 | ${target} = Set Variable ${REMOTE TEST ROOT NAME}/not_exists 59 | SSH.File Should Not Exist ${target} 60 | Run Keyword And Expect Error File '${target}' does not exist. 61 | ... SSH.File Should Exist ${target} 62 | 63 | File Should Exist Using GLOB Patterns 64 | ${target} = Set Variable ${REMOTE TEST ROOT NAME}/${SUBDIRECTORY NAME}/?[a][!b]*.txt 65 | SSH.File Should Exist ${target} 66 | 67 | File Should Not Exist Using GLOB Patterns 68 | ${target} = Set Variable ${REMOTE TEST ROOT NAME}/${SUBDIRECTORY NAME}/?[a]z[!b]*.txt 69 | SSH.File Should Not Exist ${target} 70 | 71 | Directory Should Exist Using GLOB Patterns 72 | ${target} = Set Variable ${REMOTE TEST ROOT}/[abcDAWF][!b]?* 73 | SSH.Directory Should Exist ${target} 74 | 75 | Directory Should Not Exist Using GLOB Patterns 76 | ${target} = Set Variable ${REMOTE TEST ROOT}/z* 77 | SSH.Directory Should Not Exist ${target} 78 | -------------------------------------------------------------------------------- /atest/get_connection.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/common.robot 3 | Library OperatingSystem 4 | 5 | Test Teardown Close All Connections 6 | 7 | 8 | *** Test Cases *** 9 | Get Connection 10 | ${conn1_index} = Open Connection ${HOST} alias=one 11 | ${conn2_index} = Open Connection ${HOST} 12 | ${conn} = Get Connection 13 | Should Be Equal ${conn.index} ${conn2_index} 14 | ${conn} = Get Connection one 15 | Should Be Equal ${conn.index} ${conn1_index} 16 | ${conn} = Get Connection 2 17 | Should Be Equal ${conn.index} ${conn2_index} 18 | 19 | Get Connection When No Connection Is Open 20 | ${conn} = Get Connection 1 21 | Should Be Equal ${conn.host} ${None} 22 | Should Be Equal ${conn.index} ${None} 23 | Should Be Equal ${conn.alias} ${None} 24 | Should Be Equal ${conn.prompt} ${None} 25 | Should Be Equal As Integers ${conn.port} 22 26 | Should Be Equal As Strings ${conn.newline} \n 27 | Should Be Equal ${conn.encoding} utf8 28 | Should Be Equal ${conn.term_type} vt100 29 | Should Be Equal As Integers ${conn.width} 80 30 | Should Be Equal As Integers ${conn.height} 24 31 | 32 | Get Connection Closed 33 | Open Connection ${HOST} alias=alias1 34 | Close Connection 35 | ${conn} = Get Connection 1 36 | Should Be Equal ${conn.host} ${None} 37 | Should Be Equal ${conn.index} ${None} 38 | Should Be Equal ${conn.alias} ${None} 39 | Should Be Equal ${conn.prompt} ${None} 40 | Should Be Equal As Integers ${conn.port} 22 41 | Should Be Equal As Strings ${conn.newline} \n 42 | Should Be Equal ${conn.encoding} utf8 43 | Should Be Equal ${conn.term_type} vt100 44 | Should Be Equal As Integers ${conn.width} 80 45 | Should Be Equal As Integers ${conn.height} 24 46 | 47 | Get Connection Index Only 48 | Open Connection ${HOST} 49 | ${index} = Get Connection index=True 50 | Should Be Equal As Integers ${index} 1 51 | 52 | Get Connection Host And Timeout Only 53 | Open Connection ${HOST} timeout=3 seconds 54 | ${rhost} ${timeout} = Get Connection host=Yes timeout=True port=false 55 | Should Be Equal ${rhost} ${HOST} 56 | Should Be Equal As Integers ${timeout} 3 57 | 58 | Get Connections 59 | Open Connection ${HOST} prompt=>> escape_ansi=True 60 | Open Connection ${HOST} alias=another 61 | ${conns} = Get Connections 62 | Length Should Be ${conns} 2 63 | Should Be Equal As Integers ${conns[0].index} 1 64 | Should Be Equal As Integers ${conns[1].index} 2 65 | Should Be Equal ${conns[0].host} ${HOST} 66 | Should Be Equal ${conns[1].host} ${HOST} 67 | Should Be Equal ${conns[0].prompt} >> 68 | Should Be Equal ${conns[1].alias} another 69 | Should Be Equal ${conns[0].term_type} vt100 70 | Should Be Equal ${conns[0].escape_ansi} True 71 | Should Be Equal ${conns[1].escape_ansi} False 72 | 73 | Get Connections Returns Only Open Connections 74 | Open Connection ${HOST} prompt=>> 75 | Open Connection ${HOST} alias=to_be_closed 76 | Open Connection ${HOST} alias=another 77 | Switch Connection to_be_closed 78 | Close Connection 79 | ${conns} = Get Connections 80 | Length Should Be ${conns} 2 81 | Should Be Equal As Integers ${conns[0].index} 1 82 | Should Be Equal As Integers ${conns[1].index} 3 83 | Should Be Equal ${conns[0].host} ${HOST} 84 | Should Be Equal ${conns[1].host} ${HOST} 85 | Should Be Equal ${conns[0].prompt} >> 86 | Should Be Equal ${conns[1].alias} another 87 | Should Be Equal ${conns[0].term_type} vt100 88 | 89 | Get Connections Returns Empty List When No Connections 90 | ${conns} = Get Connections 91 | ${empty_list} = Create List 92 | Should Be Equal ${conns} ${empty_list} 93 | 94 | Get Connections Returns Empty List When All Connections Are Closed 95 | Open Connection ${HOST} 96 | Close Connection 97 | Open Connection ${HOST} 98 | Close Connection 99 | ${conns} = Get Connections 100 | ${empty_list} = Create List 101 | Should Be Equal ${conns} ${empty_list} 102 | -------------------------------------------------------------------------------- /atest/get_file.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/sftp.robot 3 | Library OperatingSystem WITH NAME OS 4 | Library DateTime 5 | 6 | Suite Setup Login and Upload Test Files 7 | Suite Teardown Remove Test Files And Close Connections 8 | Test Teardown Remove Directory ${LOCAL TMPDIR} yes 9 | 10 | 11 | *** Test Cases *** 12 | Get File Using Absolute Source 13 | SSH.Get File ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME}/${FILE WITH NON-ASCII NAME} ${LOCAL TMPDIR}${/} 14 | OS.File Should Exist ${LOCAL TMPDIR}${/}${FILE WITH NON-ASCII NAME} 15 | [Teardown] OS.Remove File ${LOCAL TMPDIR}${/}${FILE WITH NON-ASCII NAME} 16 | 17 | Get File Using Relative Source 18 | SSH.Get File ${REMOTE TEST ROOT NAME}/${SUBDIRECTORY NAME}/${FILE WITH NON-ASCII NAME} ${TEST FILE NAME} 19 | OS.File Should Exist ${TEST FILE NAME} 20 | [Teardown] OS.Remove File ${TEST FILE NAME} 21 | 22 | Get File Using Pattern As Source 23 | @{expected} = Create List ${TEST FILE NAME} 24 | ... ${FILE WITH NEWLINES NAME} 25 | ${destination} = Set Variable ${LOCAL TMPDIR}${/} 26 | SSH.Get File ${REMOTE TEST ROOT}/*est*.txt ${destination} 27 | FOR ${filename} IN @{expected} 28 | OS.File Should Exist ${destination}${/}${filename} 29 | END 30 | 31 | Get File From Path Not Under Remote Home 32 | [Setup] Create Tmp Dir And Move File 33 | SSH.Get File /tmp/test_file.txt ${LOCAL TMPDIR}${/} 34 | OS.File Should Exist ${LOCAL TMPDIR}${/}test_file.txt 35 | [Teardown] Remove Tmp Dir And Remote File 36 | 37 | Get File From Path Not Under Remote Home With SCP (transfer) 38 | [Setup] Create Tmp Dir And Move File 39 | SSH.Get File /tmp/test_file.txt ${LOCAL TMPDIR}${/} scp=TRANSFER 40 | OS.File Should Exist ${LOCAL TMPDIR}${/}test_file.txt 41 | [Teardown] Remove Tmp Dir And Remote File 42 | 43 | Get File From Path Not Under Remote Home With SCP (all) 44 | [Setup] Create Tmp Dir And Move File 45 | SSH.Get File /tmp/test_file.txt ${LOCAL TMPDIR}${/} scp=ALL 46 | OS.File Should Exist ${LOCAL TMPDIR}${/}test_file.txt 47 | [Teardown] Remove Tmp Dir And Remote File 48 | 49 | Get File With SCP And Pattern Matching 50 | [Setup] Create Tmp Dir And Move File 51 | SSH.Get File ${REMOTE TEST ROOT}/*est*.txt ${LOCAL TMPDIR}${/} scp=ALL 52 | OS.File Should Exist ${LOCAL TMPDIR}${/}test_file.txt 53 | OS.File Should Exist ${LOCAL TMPDIR}${/}Test_newlines.txt 54 | 55 | Get File With Multiple Sources To Single File Fails 56 | Run Keyword And Expect Error 57 | ... Cannot copy multiple source files to one destination file. 58 | ... SSH.Get File ${REMOTE TEST ROOT}/*.txt ${LOCAL TMPDIR}${/}foo 59 | 60 | Get File To Different Name 61 | ${new name} = Set Variable foo.txt 62 | SSH.Get File ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME}/${FILE WITH NON-ASCII NAME} ${new name} 63 | OS.File Should Exist ${new name} 64 | [Teardown] OS.Remove File ${new name} 65 | 66 | Get File To Current Working Directory 67 | SSH.Get File ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME}/${FILE WITH NON-ASCII NAME} . 68 | OS.File Should Exist ${FILE WITH NON-ASCII NAME} 69 | [Teardown] OS.Remove File ${FILE WITH NON-ASCII NAME} 70 | 71 | Get File With Square Brackets In Name 72 | SSH.Get File ${REMOTE TEST ROOT}/${FILE WITH SQUARE BRACKETS NAME} ${LOCAL TMPDIR}${/} 73 | OS.File Should Exist ${LOCAL TMPDIR}${/}${FILE WITH SQUARE BRACKETS NAME} 74 | 75 | Get File When Destination Path Does Not Exist 76 | ${target} = Set Variable ${LOCAL TMPDIR}/new/none.txt 77 | SSH.Get File ${REMOTE TEST ROOT}/${TEST FILE NAME} ${target} 78 | OS.File Should Exist ${target} 79 | [Teardown] OS.Remove File ${target} 80 | 81 | Get File Should Fail When There Are No Source Files 82 | Run Keyword And Expect Error 83 | ... There were no source files matching 'non-existing'. 84 | ... SSH.Get File non-existing 85 | 86 | Get Symlink File 87 | Execute Command cd ${REMOTE TEST ROOT}; ln -s ${TEST FILE NAME} ${SYMLINK TO TEST FILE} 88 | SSH.Get File ${REMOTE TEST ROOT}/${SYMLINK TO TEST FILE} . 89 | OS.File Should Exist ${SYMLINK TO TEST FILE} 90 | [Teardown] OS.Remove File ${SYMLINK TO TEST FILE} 91 | 92 | Get File That Is A Symlink Directory 93 | Execute Command mkdir -p ${REMOTE TEST ROOT}/dir/subdir 94 | Execute Command touch ${REMOTE TEST ROOT}/dir/${TEST FILE NAME} 95 | Execute Command cd ${REMOTE TEST ROOT};ln -s dir/subdir symlink_dir 96 | SSH.Get File ${REMOTE TEST ROOT}/dir/* 97 | OS.File Should Not Exist symlink_dir 98 | [Teardown] OS.Remove File ${TEST FILE NAME} 99 | 100 | Get File With SCP (transfer) And Preserve Time 101 | [Setup] Create Tmp Dir And Move File 102 | Sleep 15s 103 | ${current_time} = Get Current Date result_format=epoch exclude_millis=False 104 | SSH.Get File /tmp/test_file.txt ${LOCAL TMPDIR}${/} scp=TRANSFER scp_preserve_times=True 105 | OS.File Should Exist ${LOCAL TMPDIR}${/}test_file.txt 106 | ${last_access_time} = Run stat -c %X ${LOCAL TMPDIR}${/}test_file.txt 107 | ${last_modify_time} = Run stat -c %X ${LOCAL TMPDIR}${/}test_file.txt 108 | Should Be True ${current_time} > ${last_access_time} 109 | Should Be True ${current_time} > ${last_modify_time} 110 | [Teardown] Remove Tmp Dir And Remote File 111 | 112 | Get File With SCP (all) And Preserve Time 113 | [Setup] Create Tmp Dir And Move File 114 | Sleep 15s 115 | ${current_time} = Get Current Date result_format=epoch exclude_millis=False 116 | SSH.Get File /tmp/test_file.txt ${LOCAL TMPDIR}${/} scp=ALL scp_preserve_times=True 117 | OS.File Should Exist ${LOCAL TMPDIR}${/}test_file.txt 118 | ${last_access_time} = Run stat -c %X ${LOCAL TMPDIR}${/}test_file.txt 119 | ${last_modify_time} = Run stat -c %X ${LOCAL TMPDIR}${/}test_file.txt 120 | Should Be True ${current_time} > ${last_access_time} 121 | Should Be True ${current_time} > ${last_modify_time} 122 | [Teardown] Remove Tmp Dir And Remote File 123 | 124 | 125 | *** Keywords *** 126 | Create Tmp Dir And Move File 127 | Put File ${TEST FILE} /tmp/ 128 | Create Directory ${LOCAL TMPDIR} 129 | 130 | Remove Tmp Dir And Remote File 131 | Execute Command rm -f /tmp/test_file.txt 132 | Remove Directory ${LOCAL TMPDIR} yes 133 | -------------------------------------------------------------------------------- /atest/importing_with_args.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library SSHLibrary 3 minutes 30 seconds ${NONE} >> INFO ${NONE} 3 | ... ${NONE} ${NONE} \\ 4 | 5 | 6 | *** Test Cases *** 7 | Importing Library With Arguments 8 | [Setup] Open Connections 9 | ${conn}= Get Connections 10 | Should Be Equal As Integers ${conn[0].timeout} 210 11 | Should Be Equal ${conn[0].prompt} >> 12 | Should Be Equal ${conn[1].path_separator} \\ 13 | Should Be Equal As Integers ${conn[1].timeout} 60 14 | Should Be Equal ${conn[1].prompt} >> 15 | Should Be Equal ${conn[1].path_separator} \\ 16 | [Teardown] Close All Connections 17 | 18 | 19 | *** Keywords *** 20 | Open Connections 21 | Open Connection localhost 22 | Set Default Configuration timeout=1 minute 23 | Open Connection localhost 24 | -------------------------------------------------------------------------------- /atest/list_directories_in_directory.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/sftp.robot 3 | Library Collections 4 | 5 | Suite Setup Login And Upload Test Files 6 | Suite Teardown Remove Test Files and Close Connections 7 | 8 | 9 | *** Test Cases *** 10 | List Directories Using Absolute Path 11 | ${expected} = Create List ${SUBDIRECTORY NAME} 12 | ${listing} = List Directories In Directory ${REMOTE TEST ROOT} 13 | Lists Should Be Equal ${listing} ${expected} 14 | 15 | List Directories Using Relative Path 16 | ${expected} = Create List ${SUBDIRECTORY NAME} 17 | ${listing} = List Directories In Directory ${REMOTE TEST ROOT NAME} 18 | Lists Should Be Equal ${listing} ${expected} 19 | 20 | List Directories Using Pattern 21 | ${expected} = Create List ${SUBDIRECTORY NAME} 22 | ${listing} = List Directories In Directory ${REMOTE TEST ROOT} pattern=aaä* 23 | Lists Should Be Equal ${listing} ${expected} 24 | 25 | List Directories Using Current Working Directory 26 | ${listing} = List Directories In Directory . 27 | Should Contain ${listing} ${REMOTE TEST ROOT NAME} 28 | 29 | List Directories Using Symlink As Path 30 | [Setup] Execute Command ln -s ${REMOTE TEST ROOT} symlink 31 | ${expected} = Create List ${SUBDIRECTORY NAME} 32 | ${listing} = List Directories In Directory symlink 33 | Lists Should Be Equal ${listing} ${expected} 34 | [Teardown] Execute Command rm -f symlink 35 | 36 | List Directories Using Non-ASCII Characters In Path 37 | ${expected} = Create List ${DIRECTORY WITH EMPTY SUBDIRECTORY} 38 | ${listing} = List Directories In Directory ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME} 39 | Lists Should Be Equal ${listing} ${expected} 40 | 41 | List Directories With Absolute Paths Using Absolute Path 42 | ${expected} = Create List ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME} 43 | ${listing} = List Directories In Directory ${REMOTE TEST ROOT} absolute=True 44 | Lists Should Be Equal ${listing} ${expected} 45 | 46 | List Directories With Absolute Paths Using Relative Path 47 | ${expected} = Create List ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME} 48 | ${target} = Set Variable ${REMOTE TEST ROOT NAME} 49 | ${listing} = List Directories In Directory ${target} absolute=True 50 | Lists Should Be Equal ${listing} ${expected} 51 | 52 | List Directories With Absolute Paths Using Current Working Directory 53 | ${listing} = List Directories In Directory . absolute=True 54 | Should Contain ${listing} ${REMOTE TEST ROOT} 55 | 56 | List Directories With Absolute Paths Using Pattern 57 | ${expected} = Create List ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME} 58 | ${listing} = List Directories In Directory ${REMOTE TEST ROOT} pattern=aaä* 59 | ... absolute=True 60 | Lists Should Be Equal ${listing} ${expected} 61 | 62 | List Directories With Absolute Paths Using Symlink As Path 63 | [Setup] Execute Command ln -s ${REMOTE TEST ROOT} symlink 64 | ${expected} = Create List ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME} 65 | ${listing} = List Directories In Directory symlink absolute=True 66 | Lists Should Be Equal ${listing} ${expected} 67 | [Teardown] Execute Command rm -f symlink 68 | 69 | List Directories Should Fail When Source Path Does Not Exists 70 | ${target} = Set Variable not_exists 71 | Run Keyword And Expect Error There was no directory matching '${target}'. 72 | ... List Directories In Directory ${target} 73 | -------------------------------------------------------------------------------- /atest/list_directory.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/sftp.robot 3 | Library Collections 4 | 5 | Suite Setup Login And Upload Test Files 6 | Suite Teardown Remove Test Files and Close Connections 7 | 8 | 9 | *** Test Cases *** 10 | List Content Using Absolute Path 11 | ${expected} = Create List 12 | ... ${FILE WITH NEWLINES NAME} 13 | ... ${SUBDIRECTORY NAME} 14 | ... ${CORRUPTED FILE NAME} 15 | ... ${FILE WITH SPECIAL CHARS NAME} 16 | ... ${FILE WITH SQUARE BRACKETS NAME} 17 | ... ${TEST FILE NAME} 18 | ${listing} = List Directory ${REMOTE TEST ROOT} 19 | Lists Should Be Equal ${listing} ${expected} 20 | 21 | List Content Using Relative Path 22 | ${expected} = Create List 23 | ... ${FILE WITH NEWLINES NAME} 24 | ... ${SUBDIRECTORY NAME} 25 | ... ${CORRUPTED FILE NAME} 26 | ... ${FILE WITH SPECIAL CHARS NAME} 27 | ... ${FILE WITH SQUARE BRACKETS NAME} 28 | ... ${TEST FILE NAME} 29 | ${listing} = List Directory ${REMOTE TEST ROOT NAME} 30 | Lists Should Be Equal ${listing} ${expected} 31 | 32 | List Content Using Pattern 33 | ${expected} = Create List ${FILE WITH SPECIAL CHARS NAME} 34 | ${listing} = List Directory ${REMOTE TEST ROOT} pattern=spec* 35 | Lists Should Be Equal ${listing} ${expected} 36 | 37 | List Content Using Current Working Directory 38 | ${listing} = List Directory . 39 | Should Contain ${listing} ${REMOTE TEST ROOT NAME} 40 | 41 | List Content Using Symlink As Path 42 | [Setup] Execute Command ln -s ${REMOTE TEST ROOT} symlink 43 | ${expected} = Create List 44 | ... ${FILE WITH NEWLINES NAME} 45 | ... ${SUBDIRECTORY NAME} 46 | ... ${CORRUPTED FILE NAME} 47 | ... ${FILE WITH SPECIAL CHARS NAME} 48 | ... ${FILE WITH SQUARE BRACKETS NAME} 49 | ... ${TEST FILE NAME} 50 | ${listing} = List Directory symlink 51 | Lists Should Be Equal ${listing} ${expected} 52 | [Teardown] Execute Command rm -f symlink 53 | 54 | List Content Using Non-ASCII Characters In Path 55 | ${expected} = Create List ${FILE WITH NON-ASCII NAME} 56 | ... ${DIRECTORY WITH EMPTY SUBDIRECTORY} 57 | ${listing} = List Directory ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME} 58 | Lists Should Be Equal ${listing} ${expected} 59 | 60 | List Content With Absolute Paths Using Absolute Path 61 | ${expected} = Create List 62 | ... ${REMOTE TEST ROOT}/${FILE WITH NEWLINES NAME} 63 | ... ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME} 64 | ... ${REMOTE TEST ROOT}/${CORRUPTED FILE NAME} 65 | ... ${REMOTE TEST ROOT}/${FILE WITH SPECIAL CHARS NAME} 66 | ... ${REMOTE TEST ROOT}/${FILE WITH SQUARE BRACKETS NAME} 67 | ... ${REMOTE TEST ROOT}/${TEST FILE NAME} 68 | ${listing} = List Directory ${REMOTE TEST ROOT} absolute=True 69 | Lists Should Be Equal ${listing} ${expected} 70 | 71 | List Content With Absolute Paths Using Relative Path 72 | ${expected} = Create List 73 | ... ${REMOTE TEST ROOT}/${FILE WITH NEWLINES NAME} 74 | ... ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME} 75 | ... ${REMOTE TEST ROOT}/${CORRUPTED FILE NAME} 76 | ... ${REMOTE TEST ROOT}/${FILE WITH SPECIAL CHARS NAME} 77 | ... ${REMOTE TEST ROOT}/${FILE WITH SQUARE BRACKETS NAME} 78 | ... ${REMOTE TEST ROOT}/${TEST FILE NAME} 79 | ${listing} = List Directory ${REMOTE TEST ROOT NAME} absolute=True 80 | Lists Should Be Equal ${listing} ${EXPECTED} 81 | 82 | List Content With Absolute Paths Using Pattern 83 | ${expected} = Create List 84 | ... ${REMOTE TEST ROOT}/${FILE WITH NEWLINES NAME} 85 | ... ${REMOTE TEST ROOT}/${FILE WITH SQUARE BRACKETS NAME} 86 | ... ${REMOTE TEST ROOT}/${TEST FILE NAME} 87 | ${listing} = List Directory ${REMOTE TEST ROOT} pattern=?est* absolute=True 88 | Lists Should Be Equal ${listing} ${expected} 89 | 90 | List Content With Absolute Paths Using Current Working Directory 91 | ${listing} = List Directory . absolute=True 92 | Should Contain ${listing} ${REMOTE TEST ROOT} 93 | 94 | List Content With Absolute Paths Using Symlink As Path 95 | [Setup] Execute Command ln -s ${REMOTE TEST ROOT} symlink 96 | ${expected} = Create List 97 | ... ${REMOTE TEST ROOT}/${FILE WITH NEWLINES NAME} 98 | ... ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME} 99 | ... ${REMOTE TEST ROOT}/${CORRUPTED FILE NAME} 100 | ... ${REMOTE TEST ROOT}/${FILE WITH SPECIAL CHARS NAME} 101 | ... ${REMOTE TEST ROOT}/${FILE WITH SQUARE BRACKETS NAME} 102 | ... ${REMOTE TEST ROOT}/${TEST FILE NAME} 103 | ${listing} = List Directory symlink absolute=True 104 | Lists Should Be Equal ${listing} ${expected} 105 | [Teardown] Execute Command rm -f symlink 106 | 107 | List Content Should Fail When Source Path Not Exists 108 | ${target} = Set Variable not_exists 109 | Run Keyword And Expect Error There was no directory matching '${target}'. 110 | ... List Directory ${target} 111 | -------------------------------------------------------------------------------- /atest/list_files_in_directory.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/sftp.robot 3 | Resource resources/sftp.robot 4 | Library Collections 5 | 6 | Suite Setup Login And Upload Test Files 7 | Suite Teardown Remove Test Files and Close Connections 8 | 9 | 10 | *** Test Cases *** 11 | List Files Using Absolute Path 12 | ${expected} = Create List 13 | ... ${FILE WITH NEWLINES NAME} 14 | ... ${CORRUPTED FILE NAME} 15 | ... ${FILE WITH SPECIAL CHARS NAME} 16 | ... ${FILE WITH SQUARE BRACKETS NAME} 17 | ... ${TEST FILE NAME} 18 | ${listing} = List Files In Directory ${REMOTE TEST ROOT} 19 | Lists Should Be Equal ${listing} ${expected} 20 | 21 | List Files Using Relative Path 22 | ${expected} = Create List 23 | ... ${FILE WITH NEWLINES NAME} 24 | ... ${CORRUPTED FILE NAME} 25 | ... ${FILE WITH SPECIAL CHARS NAME} 26 | ... ${FILE WITH SQUARE BRACKETS NAME} 27 | ... ${TEST FILE NAME} 28 | ${listing} = List Files In Directory ${REMOTE TEST ROOT NAME} 29 | Lists Should Be Equal ${listing} ${expected} 30 | 31 | List Files Using Pattern 32 | ${expected} = Create List ${FILE WITH NEWLINES NAME} 33 | ${listing} = List Files In Directory ${REMOTE TEST ROOT} pattern=*newlines.txt 34 | Lists Should Be Equal ${listing} ${expected} 35 | 36 | List Files Using Current Working Directory 37 | ${listing} = List Files In Directory . 38 | Should Not Contain ${listing} ${REMOTE TEST ROOT} 39 | 40 | List Files Using Symlink As Path 41 | [Setup] Execute Command ln -s ${REMOTE TEST ROOT} symlink 42 | ${expected} = Create List 43 | ... ${FILE WITH NEWLINES NAME} 44 | ... ${CORRUPTED FILE NAME} 45 | ... ${FILE WITH SPECIAL CHARS NAME} 46 | ... ${FILE WITH SQUARE BRACKETS NAME} 47 | ... ${TEST FILE NAME} 48 | ${listing} = List Files In Directory symlink 49 | Lists Should Be Equal ${listing} ${expected} 50 | [Teardown] Execute Command rm -f symlink 51 | 52 | List Files With Non-ASCII Characters In Path 53 | ${expected} = Create List ${FILE WITH NON-ASCII NAME} 54 | ${listing} = List Files In Directory ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME} 55 | Lists Should Be Equal ${listing} ${expected} 56 | 57 | List Files With Absolute Paths Using Absolute Path 58 | ${expected} = Create List 59 | ... ${REMOTE TEST ROOT}/${FILE WITH NEWLINES NAME} 60 | ... ${REMOTE TEST ROOT}/${CORRUPTED FILE NAME} 61 | ... ${REMOTE TEST ROOT}/${FILE WITH SPECIAL CHARS NAME} 62 | ... ${REMOTE TEST ROOT}/${FILE WITH SQUARE BRACKETS NAME} 63 | ... ${REMOTE TEST ROOT}/${TEST FILE NAME} 64 | ${listing} = List Files In Directory ${REMOTE TEST ROOT} absolute=True 65 | Lists Should Be Equal ${listing} ${expected} 66 | 67 | List Files With Absolute Paths Using Relative Path 68 | ${expected} = Create List 69 | ... ${REMOTE TEST ROOT}/${FILE WITH NEWLINES NAME} 70 | ... ${REMOTE TEST ROOT}/${CORRUPTED FILE NAME} 71 | ... ${REMOTE TEST ROOT}/${FILE WITH SPECIAL CHARS NAME} 72 | ... ${REMOTE TEST ROOT}/${FILE WITH SQUARE BRACKETS NAME} 73 | ... ${REMOTE TEST ROOT}/${TEST FILE NAME} 74 | ${listing} = List Files In Directory ${REMOTE TEST ROOT NAME} absolute=True 75 | Lists Should Be Equal ${listing} ${EXPECTED} 76 | 77 | List Files With Absolute Paths Using Pattern 78 | ${expected} = Create List 79 | ... ${REMOTE TEST ROOT}/${FILE WITH NEWLINES NAME} 80 | ... ${REMOTE TEST ROOT}/${FILE WITH SQUARE BRACKETS NAME} 81 | ... ${REMOTE TEST ROOT}/${TEST FILE NAME} 82 | ${listing} = List Files In Directory ${REMOTE TEST ROOT} pattern=?est* 83 | ... absolute=True 84 | Lists Should Be Equal ${listing} ${expected} 85 | 86 | List Files With Absolute Paths Using Current Working Directory 87 | ${listing} = List Files In Directory . absolute=True 88 | Should Not Contain ${listing} ${REMOTE TEST ROOT} 89 | 90 | List Files With Absolute Paths Using Symlink As Path 91 | [Setup] Execute Command ln -s ${REMOTE TEST ROOT} symlink 92 | ${expected} = Create List 93 | ... ${REMOTE TEST ROOT}/${FILE WITH NEWLINES NAME} 94 | ... ${REMOTE TEST ROOT}/${CORRUPTED FILE NAME} 95 | ... ${REMOTE TEST ROOT}/${FILE WITH SPECIAL CHARS NAME} 96 | ... ${REMOTE TEST ROOT}/${FILE WITH SQUARE BRACKETS NAME} 97 | ... ${REMOTE TEST ROOT}/${TEST FILE NAME} 98 | ${listing} = List Files In Directory symlink absolute=True 99 | Lists Should Be Equal ${listing} ${expected} 100 | [Teardown] Execute Command rm -f symlink 101 | 102 | List Files Should Fail When Source Path Not Exists 103 | ${target} = Set Variable not_exists 104 | Run Keyword And Expect Error There was no directory matching '${target}'. 105 | ... List Files In Directory ${target} 106 | -------------------------------------------------------------------------------- /atest/logging.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/common.robot 3 | Library OperatingSystem 4 | 5 | Test Teardown Close All Connections 6 | 7 | 8 | *** Test Cases *** 9 | Enable Logging 10 | [Setup] Remove File ${OUTPUTDIR}${/}sshlog.txt 11 | Enable SSH Logging ${OUTPUTDIR}${/}sshlog.txt 12 | Login As Valid User 13 | File Should Not Be Empty ${OUTPUTDIR}${/}sshlog.txt 14 | 15 | Log Level To None 16 | [Documentation] LOG 2.2:1 NONE 17 | ... LOG 2.2:2 NONE 18 | Set Default Configuration loglevel=NONE 19 | Login As Valid User 20 | [Teardown] Set Default Configuration loglevel=INFO 21 | 22 | Log Level To Info 23 | [Documentation] LOG 1.2:1 GLOB: Logging into * 24 | ... LOG 1.2:2 GLOB: *test@* 25 | Login As Valid User 26 | -------------------------------------------------------------------------------- /atest/login.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/common.robot 3 | 4 | Test Setup Open Connection ${HOST} 5 | Test Teardown Close All Connections 6 | 7 | Test Tags login 8 | 9 | 10 | *** Variables *** 11 | ${KEY DIR} ${LOCAL TESTDATA}${/}keyfiles 12 | ${KEY USERNAME} testkey 13 | ${KEY} ${KEY DIR}${/}id_rsa 14 | ${INVALID USERNAME} invalidusername 15 | ${INVALID PASSWORD} invalidpassword 16 | ${INVALID KEY} ${KEY DIR}${/}id_rsa_invalid 17 | 18 | 19 | *** Test Cases *** 20 | Login With Valid Username And Password 21 | Login As Valid User 22 | 23 | Login With Invalid Username Or Password 24 | [Setup] Open Connection ${HOST} 25 | Run Keyword And Expect Error Authentication failed for user '${INVALID USERNAME}'. 26 | ... Login ${INVALID USERNAME} ${PASSWORD} 27 | 28 | Login With Public Key When Valid Username And Key 29 | [Setup] Open Connection ${HOST} prompt=${PROMPT} 30 | Login With Public Key ${KEY USERNAME} ${KEY} 31 | 32 | Login With Public Key When Invalid Username 33 | [Documentation] A username that does not exist on the target machine leads to a rather misleading error message about key lengths. 34 | ... See: https://github.com/fabric/fabric/issues/2182#issuecomment-1362940149 35 | Run Keyword And Expect Error ValueError: q must be exactly 160, 224, or 256 bits long 36 | ... Login With Public Key ${INVALID USERNAME} ${KEY} 37 | 38 | Login With Public Key When Invalid Key 39 | Run Keyword And Expect Error Login with public key failed for user '${KEY USERNAME}'. 40 | ... Login With Public Key ${KEY USERNAME} ${INVALID KEY} 41 | 42 | Login With Public Key When Non-Existing Key 43 | Run Keyword And Expect Error Given key file 'not_existing_key' does not exist. 44 | ... Login With Public Key ${KEY USERNAME} not_existing_key 45 | 46 | Login With Public Key And Disabled Algorithms 47 | VAR @{pubkeys} diffie-hellman-group16-sha512 48 | VAR &{disabled_algorithms} pubkeys=${pubkeys} 49 | Login With Public Key ${KEY USERNAME} ${KEY} disabled_algorithms=${disabled_algorithms} 50 | 51 | Logging In Returns Server Output 52 | [Setup] Open Connection ${HOST} 53 | ${output}= Login ${USERNAME} ${PASSWORD} 54 | Should Contain ${output} Last login: 55 | ${output}= Read 56 | Should Be Equal ${output.strip()} ${EMPTY} 57 | 58 | Logging In Returns Server Output If Prompt Is Set 59 | [Setup] Open Connection ${HOST} prompt=${PROMPT} 60 | ${output}= Login With Public Key ${KEY USERNAME} ${KEY} 61 | Should Contain ${output} Last login: 62 | ${output}= Read 63 | Should Be Equal ${output.strip()} ${EMPTY} 64 | 65 | Login Using Config File 66 | [Setup] Open Connection ${TEST_HOSTNAME} prompt=${PROMPT} 67 | Login password=test read_config=True 68 | 69 | Login With Public Key Using Config File 70 | [Setup] Open Connection ${TESTKEY_HOSTNAME} prompt=${PROMPT} 71 | Login With Public Key read_config=True 72 | 73 | Login With No Password 74 | [Setup] Open Connection ${HOST} prompt=${PROMPT} 75 | Login ${USERNAME_NOPASSWD} 76 | 77 | Login With Explicit No Password 78 | [Setup] Open Connection ${HOST} prompt=${PROMPT} 79 | TRY 80 | Login ${USERNAME_NOPASSWD} ${EMPTY_STRING} 81 | EXCEPT Authentication failed for user '${USERNAME_NOPASSWD}'. AS ${ex} 82 | Pass Execution Authentication with empty password failed as expected: ${ex} 83 | END 84 | Fail Authentication with empty password should have failed 85 | 86 | Login With Empty Quotes No Password 87 | [Setup] Open Connection ${HOST} prompt=${PROMPT} 88 | Login ${USERNAME_NOPASSWD} "" 89 | 90 | Login Using Config File Proxy Command 91 | [Tags] no-gh-actions 92 | [Setup] Open Connection ${TEST_PROXY_HOSTNAME} prompt=${PROMPT} 93 | ${output}= Login password=test read_config=True 94 | Should Contain ${output} test@ 95 | 96 | Login With Disabled Algorithms 97 | [Setup] Open Connection ${HOST} prompt=${PROMPT} 98 | VAR @{pubkeys} rsa-sha2-512 rsa-sha2-256 99 | VAR &{disabled_algorithms} pubkeys=${pubkeys} 100 | Login ${USERNAME} ${PASSWORD} disabled_algorithms=${disabled_algorithms} 101 | 102 | -------------------------------------------------------------------------------- /atest/put_directory.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/sftp.robot 3 | Library OperatingSystem WITH NAME OS 4 | Library Collections 5 | Library DateTime 6 | 7 | Suite Setup Login As Valid User 8 | Suite Teardown Close All Connections 9 | 10 | 11 | *** Test Cases *** 12 | Put Directory To Existing Remote Path 13 | [Setup] SSH.Directory Should Not Exist textfiles 14 | Put Directory ${LOCAL TEXTFILES} . 15 | Remote Directory Should Exist With Content ./textfiles 16 | [Teardown] Execute Command rm -rf ./textfiles 17 | 18 | Put Directory To Non-Existing Remote Path 19 | [Setup] SSH.Directory Should Not Exist another_dir_name 20 | Put Directory ${LOCAL TEXTFILES} another_dir_name 21 | Remote Directory Should Exist With Content another_dir_name 22 | [Teardown] Execute Command rm -rf another_dir_name 23 | 24 | Put Directory Including Subdirectories To Existing Remote Path 25 | Put Directory ${LOCAL TEXTFILES} . recursive=True 26 | Remote Directory Should Exist With Subdirectories ./textfiles 27 | [Teardown] Execute Command rm -rf ./textfiles 28 | 29 | Put Directory Including Subdirectories To Existing Remote Path With SCP (transfer) 30 | Put Directory ${LOCAL TEXTFILES} . recursive=True scp=TRANSFER 31 | Remote Directory Should Exist With Subdirectories ./textfiles 32 | [Teardown] Execute Command rm -rf ./textfiles 33 | 34 | Put Directory Including Subdirectories To Existing Remote Path With SCP (all) 35 | Put Directory ${LOCAL TEXTFILES} . recursive=True scp=ALL 36 | Remote Directory Should Exist With Subdirectories ./textfiles 37 | [Teardown] Execute Command rm -rf ./textfiles 38 | 39 | Put Directory Including Subdirectories To Non-Existing Remote Path 40 | [Setup] SSH.Directory Should Not Exist another/dir/path 41 | Put Directory ${LOCAL TEXTFILES} another/dir/path recursive=True 42 | Remote Directory Should Exist With Subdirectories another/dir/path 43 | [Teardown] Execute Command rm -rf another 44 | 45 | Put Directory Including Empty Subdirectories 46 | [Setup] OS.Create Directory ${LOCAL TEXTFILES}${/}empty 47 | Put Directory ${LOCAL TEXTFILES} . recursive=True 48 | SSH.Directory Should Exist textfiles/empty 49 | Remote Directory Should Exist With Subdirectories textfiles 50 | [Teardown] Remove Local Empty Directory And Remote Files 51 | 52 | Put Directory With Square Brackets In Name 53 | [Setup] OS.Create Directory ${LOCAL TEXTFILES}${/}directory[1] 54 | Put Directory ${LOCAL TEXTFILES} . recursive=True 55 | SSH.Directory Should Exist textfiles/directory[1] 56 | [Teardown] Remove Local And Remote Directory With Square Brackets 57 | 58 | Put Directory Using Relative Source 59 | [Setup] SSH.Directory Should Not Exist ${REMOTE TEST ROOT} 60 | Put Directory ${CURDIR}${/}testdata${/}textfiles ${REMOTE TEST ROOT} 61 | Remote Directory Should Exist With Content ${REMOTE TEST ROOT} 62 | [Teardown] Execute Command rm -rf ${REMOTE TEST ROOT} 63 | 64 | Put Directory Should Fail When Source Does Not Exists 65 | Run Keyword And Expect Error There was no source path matching 'non-existing'. 66 | ... Put Directory non-existing 67 | 68 | Put Directory Containing A File With Colon In Its Name 69 | [Tags] linux 70 | [Setup] SSH.Directory Should Not Exist ${REMOTE TEST ROOT} 71 | Create File With Colon Char In Its Name 72 | Put Directory ${CURDIR}${/}testdata${/}textfiles ${REMOTE TEST ROOT} 73 | Check And Remove Local Added Directory ${REMOTE TEST ROOT} 74 | [Teardown] Execute Command rm -rf ${REMOTE TEST ROOT} 75 | 76 | Put Directory And Check For Proper Permissions 77 | [Tags] linux 78 | Put Directory ${CURDIR}${/}testdata${/}to_put recursive=True mode=0755 79 | ${output} = Execute Command ls 80 | Should Contain ${output} to_put 81 | Check File Permissions 0755 to_put${/}ExampleText3.txt 82 | Check Folder Permissions 0755 83 | [Teardown] Execute Command rm -rf ${CURDIR}${/}testdata${/}to_put 84 | 85 | Put Directory With SCP (transfer) And Preserve Time 86 | ${current_time} = Get Current Date result_format=epoch exclude_millis=False 87 | Put Directory ${LOCAL TEXTFILES} . recursive=True scp=TRANSFER scp_preserve_times=True 88 | Remote Directory Should Exist With Subdirectories ./textfiles 89 | ${last_access_time} = Execute Command stat -c %X ./textfiles/test_file.txt 90 | ${last_modify_time} = Execute Command stat -c %X ./textfiles/test_file.txt 91 | Should Be True ${current_time} > ${last_access_time} 92 | Should Be True ${current_time} > ${last_modify_time} 93 | [Teardown] Execute Command rm -rf ./textfiles 94 | 95 | Put Directory With SCP (all) And Preserve Time 96 | ${current_time} = Get Current Date result_format=epoch exclude_millis=False 97 | Put Directory ${LOCAL TEXTFILES} . recursive=True scp=ALL scp_preserve_times=True 98 | Remote Directory Should Exist With Subdirectories ./textfiles 99 | ${last_access_time} = Execute Command stat -c %X ./textfiles 100 | ${last_modify_time} = Execute Command stat -c %X ./textfiles 101 | Should Be True ${current_time} > ${last_access_time} 102 | Should Be True ${current_time} > ${last_modify_time} 103 | Remote Directory Should Exist With Subdirectories ./textfiles 104 | [Teardown] Execute Command rm -rf ./textfiles 105 | 106 | 107 | *** Keywords *** 108 | Remove Local Empty Directory And Remote Files 109 | OS.Remove Directory ${LOCAL TEXTFILES}${/}empty 110 | Execute Command rm -rf ./textfiles 111 | 112 | Remove Local And Remote Directory With Square Brackets 113 | OS.Remove Directory ${LOCAL TEXTFILES}${/}directory[1] 114 | Execute Command rm -rf ./textfiles 115 | 116 | Remote Directory Should Exist With Content 117 | [Arguments] ${destination} 118 | SSH.File Should Exist ${destination}/${TEST FILE NAME} 119 | SSH.File Should Exist ${destination}/${FILE WITH NEWLINES NAME} 120 | SSH.File Should Exist ${destination}/${FILE WITH SPECIAL CHARS NAME} 121 | SSH.File Should Not Exist ${destination}/${FILE WITH NON-ASCII NAME} 122 | SSH.Directory Should Not Exist ${destination}/${SUBDIRECTORY NAME} 123 | 124 | Remote Directory Should Exist With Subdirectories 125 | [Arguments] ${destination} 126 | SSH.File Should Exist ${destination}/${TEST FILE NAME} 127 | SSH.File Should Exist ${destination}/${FILE WITH NEWLINES NAME} 128 | SSH.File Should Exist ${destination}/${FILE WITH SPECIAL CHARS NAME} 129 | SSH.File Should Not Exist ${destination}/${FILE WITH NON-ASCII NAME} 130 | SSH.File Should Exist ${destination}/${SUBDIRECTORY NAME}/${FILE WITH NON-ASCII NAME} 131 | 132 | Create File With Colon Char In Its Name 133 | SSH.File Should Not Exist ${COLON CHAR FILE} 134 | OS.Create File ${COLON CHAR FILE} 135 | 136 | Check And Remove Local Added Directory 137 | [Arguments] ${destination} 138 | ${files_list} = SSH.List Files In Directory ${destination} 139 | List should contain value ${files_list} ${COLON CHAR FILE_NAME} 140 | [Teardown] OS.Remove File ${COLON CHAR FILE} 141 | 142 | Check Folder Permissions 143 | [Arguments] ${expected_permission} 144 | ${actual_permission} = Execute Command stat -c %a to_put${/}Folder3 145 | Should Be Equal As Integers 146 | ... ${actual_permission} 147 | ... ${expected_permission} 148 | ... Folder has not expected permission ${expected_permission}:\t${actual_permission} 149 | -------------------------------------------------------------------------------- /atest/regexp_prompt.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/common.robot 3 | 4 | Test Teardown Close All Connections 5 | 6 | 7 | *** Test Cases *** 8 | Read Until Prompt With Regexp Prompt 9 | Open Connection localhost prompt=REGEXP:[$#] 10 | Login test test 11 | Write pwd 12 | ${output}= Read Until Prompt 13 | Should Contain ${output} $ 14 | Write export PS1\='\\u\@\\h \\W # ' 15 | ${output1}= Read Until Prompt 16 | Should Contain ${output1} \# 17 | [Teardown] Close connection 18 | 19 | Set Client Configuration With Regexp Prompt 20 | Open Connection localhost prompt=$ 21 | Login test test 22 | Write pwd 23 | ${output}= Read Until Prompt 24 | Should Contain ${output} $ 25 | Set Client Configuration prompt=REGEXP:[$#] 26 | Write export PS1\='\\u\@\\h \\W # ' 27 | ${output1}= Read Until Prompt 28 | Should Contain ${output1} \# 29 | Write export PS1\='\\u\@\\h \\W $ ' 30 | ${output2}= Read Until Prompt 31 | Should Contain ${output2} $ 32 | -------------------------------------------------------------------------------- /atest/resources/common.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Library SSHLibrary WITH NAME SSH 3 | 4 | 5 | *** Variables *** 6 | ${USERNAME} test 7 | ${USERNAME_NOPASSWD} test-nopasswd 8 | ${PASSWORD} test 9 | ${HOST} localhost 10 | ${PROMPT} $ 11 | ${REMOTE TEST ROOT NAME} robot-testdir 12 | ${REMOTE HOME TEST} /home/test 13 | ${REMOTE TEST ROOT} ${REMOTE HOME TEST}/${REMOTE TEST ROOT NAME} 14 | ${LOCAL TESTDATA} ${CURDIR}${/}..${/}testdata 15 | ${KEY DIR} ${LOCAL TESTDATA}${/}keyfiles 16 | ${KEY USERNAME} testkey 17 | ${KEY} ${KEY DIR}${/}id_rsa 18 | ${TEST_HOSTNAME} test_hostname 19 | ${TESTKEY_HOSTNAME} testkey_hostname 20 | ${TEST_PROXY_HOSTNAME} test_proxy_hostname 21 | ${EMPTY_STRING} \ 22 | 23 | 24 | *** Keywords *** 25 | Login As Valid User 26 | Open Connection ${HOST} prompt=${PROMPT} 27 | Login ${USERNAME} ${PASSWORD} 28 | 29 | Remove Test Files And Close Connections 30 | Execute Command rm -rf ${REMOTE TEST ROOT} 31 | Close All Connections 32 | 33 | Check File Permissions 34 | [Arguments] ${expected_permission} ${remote_file}=to_put${/}ExampleText3.txt 35 | ${actual_permission}= Execute Command stat -c %a ${remote_file} 36 | Should Not Be Empty ${actual_permission} Failed to determine permissions for file:\t${remote_file} 37 | Should Be Equal As Integers 38 | ... ${actual_permission} 39 | ... ${expected_permission} 40 | ... File '${remote_file}' does not have expected permissions '${expected_permission}' set:\t${actual_permission} 41 | -------------------------------------------------------------------------------- /atest/resources/sftp.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource common.robot 3 | 4 | 5 | *** Variables *** 6 | ${LOCAL TMPDIR} ${TEMPDIR}${/}robot-sshlibrary-test-tmpdir 7 | ${LOCAL TEXTFILES} ${LOCAL TESTDATA}${/}textfiles 8 | ${FILE WITH NEWLINES NAME} Test_newlines.txt 9 | ${FILE WITH NEWLINES} ${LOCAL TEXTFILES}${/}${FILE WITH NEWLINES NAME} 10 | ${TEST FILE NAME} test_file.txt 11 | ${TEST FILE} ${LOCAL TEXTFILES}${/}${TEST FILE NAME} 12 | ${FILE WITH SPECIAL CHARS NAME} special%2Fchars.txt 13 | ${FILE WITH SPECIAL CHARS} ${LOCAL TEXTFILES}${/}${FILE WITH SPECIAL CHARS NAME} 14 | ${SUBDIRECTORY NAME} aaääöö 15 | ${FILE WITH NON-ASCII NAME} aaääöö.txt 16 | ${DIRECTORY WITH EMPTY SUBDIRECTORY} contains_only_empty_subdir 17 | ${EMPTY SUB DIR} empty 18 | ${FILE WITH NON-ASCII} ${LOCAL TEXTFILES}${/}${SUBDIRECTORY NAME}${/}${FILE WITH NON-ASCII NAME} 19 | ${COLON CHAR FILE NAME} special:char.txt 20 | ${COLON CHAR FILE} ${LOCAL TEXTFILES}${/}special:char.txt 21 | ${SYMLINK TO TEST FILE} symlink_to_text_file.txt 22 | ${FILE WITH SQUARE BRACKETS NAME} test[1].txt 23 | ${FILE WITH SQUARE BRACKETS} ${LOCAL TEXTFILES}${/}${FILE WITH SQUARE BRACKETS NAME} 24 | ${CORRUPTED FILE NAME} corrupted.txt 25 | ${CORRUPTED FILE} ${LOCAL TEXTFILES}${/}${CORRUPTED FILE NAME} 26 | 27 | 28 | *** Keywords *** 29 | Login And Upload Test Files 30 | Login As Valid User 31 | Put Directory ${LOCAL TEXTFILES} ${REMOTE TEST ROOT} recursive=True 32 | Execute command mkdir ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME}/${DIRECTORY WITH EMPTY SUBDIRECTORY} 33 | Execute command 34 | ... mkdir ${REMOTE TEST ROOT}/${SUBDIRECTORY NAME}/${DIRECTORY WITH EMPTY SUBDIRECTORY}/${EMPTY SUB DIR} 35 | -------------------------------------------------------------------------------- /atest/resources/shell.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource common.robot 3 | 4 | 5 | *** Variables *** 6 | ${LOCAL SCRIPTS} ${LOCAL TESTDATA}${/}scripts 7 | ${TEST SCRIPT NAME} test.sh 8 | ${TEST SCRIPT} ${LOCAL SCRIPTS}${/}${TEST SCRIPT NAME} 9 | 10 | 11 | *** Keywords *** 12 | Login And Upload Test Scripts 13 | Login As Valid User 14 | Put Directory ${LOCAL SCRIPTS} ${REMOTE TEST ROOT} recursive=True newline=LF 15 | -------------------------------------------------------------------------------- /atest/resources/write_and_read_resource.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource shell.robot 3 | 4 | 5 | *** Variables *** 6 | ${COUNTER NAME} counter.txt 7 | ${INTERACTIVE TEST SCRIPT NAME} test_interactive.sh 8 | ${INTERACTIVE TEST SCRIPT} ${LOCAL SCRIPTS}${/}${INTERACTIVE TEST SCRIPT NAME} 9 | ${REPEAT TEST SCRIPT NAME} test_repeat.sh 10 | ${REPEAT TEST SCRIPT} ${LOCAL SCRIPTS}${/}${REPEAT TEST SCRIPT NAME} 11 | ${CORRUPTED FILE NAME} corrupted.txt 12 | ${CORRUPTED FILE} ${LOCAL TESTDATA}${/}textfiles${/}${CORRUPTED FILE NAME} 13 | -------------------------------------------------------------------------------- /atest/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """usage: (python) atest/run.py " 4 | 5 | Examples: 6 | Running all the tests with Robot: 7 | python atest/run.py atest 8 | 9 | Robot results are found in path 'atest/results/' 10 | 11 | Running tests with IPv6: 12 | Example: 13 | python atest/run.py --variable=HOST:::1 atest 14 | """ 15 | import sys 16 | import os 17 | 18 | from os.path import abspath, dirname, join 19 | from robot import run_cli, rebot 20 | from robotstatuschecker import process_output 21 | 22 | CURDIR = dirname(abspath(__file__)) 23 | OUTPUT_ROOT = join(CURDIR, 'results') 24 | 25 | sys.path.append(join(CURDIR, '..', 'src')) 26 | 27 | COMMON_OPTS = ('--log', 'NONE', '--report', 'NONE') 28 | 29 | 30 | def atests(*opts): 31 | os_includes = get_os_includes(os.name) 32 | python(*(os_includes + opts)) 33 | process_output(join(OUTPUT_ROOT, 'output.xml')) 34 | return rebot(join(OUTPUT_ROOT, 'output.xml'), outputdir=OUTPUT_ROOT) 35 | 36 | 37 | def get_os_includes(operating_system): 38 | if operating_system == 'nt': 39 | return '--exclude', 'linux' 40 | return '--exclude', 'windows' 41 | 42 | 43 | def python(*opts): 44 | try: 45 | run_cli(['--outputdir', OUTPUT_ROOT] 46 | + list(COMMON_OPTS + opts)) 47 | except SystemExit: 48 | pass 49 | 50 | 51 | if __name__ == '__main__': 52 | if len(sys.argv) == 1 or '--help' in sys.argv: 53 | print(__doc__) 54 | rc = 251 55 | else: 56 | rc = atests(*sys.argv[1:]) 57 | print(f"\nAfter status check there were {rc} failures.") 58 | sys.exit(rc) 59 | -------------------------------------------------------------------------------- /atest/start_command.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/shell.robot 3 | 4 | Suite Setup Login And Upload Test Scripts 5 | Suite Teardown Remove Test Files And Close Connections 6 | 7 | 8 | *** Test Cases *** 9 | Start Command And Read Process Output With Defaults 10 | Start Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 11 | ${stdout} = Read Command Output 12 | Should Be Equal ${stdout} This is stdout 13 | 14 | Start Command And Read Only Return Code 15 | Start Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 16 | ${rc} = Read Command Output return_stdout=False return_rc=yes 17 | Should Be Equal As Integers ${rc} 0 18 | 19 | Start Command And Execute Command 20 | Start Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 21 | ${stdout} = Execute Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} Hello 22 | Should Be Equal ${stdout} Hello 23 | ${stdout} = Read Command Output 24 | Should Be Equal ${stdout} This is stdout 25 | 26 | Start Command And Read Process Output With Legacy Stdout 27 | Start Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 28 | ${stdout} = Read Command Output STDOUT 29 | Should Be Equal ${stdout} This is stdout 30 | 31 | Start Command And Read Process Output With Legacy Stderr 32 | Start Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 33 | ${stderr} = Read Command Output stderr 34 | Should Be Equal ${stderr} This is stderr 35 | 36 | Start Command And Read Process Output With Legacy Stdout And Stderr 37 | Start Command ${REMOTE TEST ROOT}/${TEST SCRIPT NAME} 38 | ${stdout} ${stderr} = Read Command Output both 39 | Should Be Equal ${stdout} This is stdout 40 | Should Be Equal ${stderr} This is stderr 41 | 42 | Reading Command Output Without Command Started 43 | Run Keyword And Expect Error 44 | ... No started commands to read output from. 45 | ... Read Command Output 46 | 47 | Start Sudo Command With Correct Password 48 | [Tags] linux 49 | Start Command -k pwd sudo=True sudo_password=test 50 | ${stdout} = Read Command Output 51 | Should Contain ${stdout} ${REMOTE HOME TEST} 52 | 53 | Start Sudo Command With Incorrect Password 54 | [Tags] linux 55 | Start Command -k pwd sudo=True sudo_password=test123 56 | ${stdout} = Read Command Output 57 | Should Not Contain ${stdout} ${REMOTE HOME TEST} 58 | 59 | Start Time Consuming Sudo Command 60 | [Tags] linux 61 | Start Command -k sleep 5; echo cat sudo=True sudo_password=test 62 | ${stdout} = Read Command Output 63 | Should Contain ${stdout} cat 64 | 65 | Start Command And Read Process Output With Invoke Subsystem 66 | Start Command subsys invoke_subsystem=yes 67 | ${stdout} = Read Command Output 68 | Should Be Equal ${stdout} Subsystem invoked. 69 | 70 | Read Command Output With Timeout 71 | Start Command sleep 15 72 | Run Keyword And Expect Error *Timed out in 5 seconds Read Command Output timeout=5s 73 | 74 | Start Commands In Different Connections 75 | [Documentation] PASS 76 | ... LOG 7:1 INFO Reading output of command 'pwd'. 77 | ... LOG 9:1 INFO Reading output of command 'hostname'. 78 | [Setup] Login As Valid User 79 | Switch Connection 1 80 | Start Command pwd 81 | Switch Connection 2 82 | Start Command hostname 83 | Switch Connection 1 84 | ${out} = Read Command Output return_stderr=True 85 | Switch Connection 2 86 | ${out} = Read Command Output return_stderr=True 87 | -------------------------------------------------------------------------------- /atest/testdata/keyfiles/id_rsa_inaccessible: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: DES-EDE3-CBC,128A0719BCB2B030 4 | 5 | cuDVjGr0qTI4UcuMhlQwEvKBGK5LmHB5PPsMF4ydMJ/esPVa+Itv/mwNlqGAdLkN 6 | I4xGvnoyTKQ3RnqkXcf7Tl8d5DJc1mBJkf6AcYrEDmXo/NZAr8A1eFjJTDUgV/ct 7 | c3wNRQCOkK9Q5WYqkSbPdrFf/+CnwepM+mFa4N8JB6Jkn30/SIR1jEz3HxpTt1bd 8 | avPADpBof1g+KkVZ8w0YgeH5LlaBGdoqQte8WOV14vu5lBZGG+O/VVHODjQ5/YvW 9 | qah7zC0pzaThRDA4Z/ZKqV+A43obju8ngzF48I2+omRPdO6+fWjpdMZb9Z+o15jq 10 | JuSr80xHxbmR6SYN+M25it9qgx55bXVdGRrxGft0crKmE/hiFfo1T3hJj/xcWcwc 11 | bPxEckkfcO2FIeZDlGgv4mGvUaXzzHLzr/JpwNjMa3vE2GeEfzrmuOL/gPe1FtMS 12 | Es9c+ZndOyYoZUi13eTXTtReEKPMc4sp0vr8tNNopSCOeOk8KUO7npwLGIfXpARY 13 | k/Au2ktpiIHORK6iyPgK8MNuKiabhOEGG8zv7G7qI+f9r5ZbGNnSI94b2VHAk7JR 14 | SC9SLcf0p/z2notJBi8LLy9r8x0y2zQWeQ/Xe41hnstfQzEqrxAGAr6Qd1I03OpH 15 | Y+pX4WMhSNakdueBEEvz154U5ERfP43Qu+QqwhnNmg6fJCJVjasmLpG/9qaOruFu 16 | R+cKQIZHBmFHfo3Qer235w9npd3I4O9fFbnbQv4sWylo4Kdq+a28xgKahOhA2+wl 17 | IynfX8GpFKZYul+vMkaqy4ZIVbyvXOf7U23PMAHUgUErDIZEEdBZEqUVWmTHsEfZ 18 | peAcYF84ksRxBgCTIv6SA2jV6C/+akkVwGQrR7ykzdQiJomupL5u988SJlFdZA73 19 | dBKm2Tc8C/AhmkeC4ztKAeX4nwQ04oQFB68FGHj+SrnFfkziU0lC2MaQf1T68tUN 20 | b6ioJxMJp3+tvNyJW92k+xz8H/E1f4n8TXjNir/+KeaXCoquWumVX9t+XCjM4R2d 21 | bu4hKwbPHhyzfluWdjPb/t0KFf7yELfhAjUaJIiQkHphNLC8+KjIGlIN0QRzDhWu 22 | U9iC4CzyT4Wdcgf33deAEvXzkbp7r4JxG+3ArK1A3rZ11ZFWnD1RZra3RDfhUIU4 23 | EL1qzJu0cSCJX3MNvKjLQnt1SKsyrC8st+zVVE35toMybJYEwCGf+eT8Q6imMAiY 24 | aI00Y/FuKvyxbGRy0emt/5/4y7lhaDBVyzwv5ltc5kn20ZA/ZqM+pNFYd5piFmWI 25 | qJQHLG9pFrW+QZNCnsJqhLKS4zqUT/YgMfmPP5BAVwnLNiqznNBUgcP0KiZshuqq 26 | sbbJ5UNR7WE7o6Kwyn0OBsFgjiY+5V89EuZiJYkrtY0qU2oVeiIJ5DitDaVvXZ2v 27 | XGaQCdsMYgkrjF+5UfwZVgzJt6UYEPoE79SxYm3cfDSHfRmaLRtpYoQ+KH/+RQce 28 | 5/nuQbKd0k1tx84NJSw/4BItczDuwbiMJdFHe3pqZFFQa54G7/8xpodaQ310vJa3 29 | RDwhrYfMdVK3zxeFRNyPkjlPBQ4Is47PMZg1aY/yA/KwJUP/2KbRYQ== 30 | -----END RSA PRIVATE KEY----- 31 | -------------------------------------------------------------------------------- /atest/testdata/keyfiles/id_rsa_invalid: -------------------------------------------------------------------------------- 1 | invalid private key file 2 | -------------------------------------------------------------------------------- /atest/testdata/scripts/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$1" != "" ]; then 4 | echo $1 5 | else 6 | echo This is stdout 7 | echo This is stderr 1>&2 8 | fi 9 | -------------------------------------------------------------------------------- /atest/testdata/scripts/test_interactive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo -n "Give your name?" 4 | read NAME 5 | if [ "$NAME" = "Error" ]; then 6 | echo This is Error 1>&2; 7 | fi 8 | echo Hello $NAME 9 | -------------------------------------------------------------------------------- /atest/testdata/scripts/test_repeat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -f counter.txt ] 4 | then 5 | count=$(cat counter.txt) 6 | echo Current count is $count 7 | echo $((1+$count)) > counter.txt 8 | else 9 | echo started counter; 10 | echo 1 > counter.txt; 11 | fi 12 | -------------------------------------------------------------------------------- /atest/testdata/textfiles/Test_newlines.txt: -------------------------------------------------------------------------------- 1 | 2 | This is yet another test file. 3 | 4 | And it contains newlines. 5 | -------------------------------------------------------------------------------- /atest/testdata/textfiles/aaääöö/aaääöö.txt: -------------------------------------------------------------------------------- 1 | This file contains characters like ä and ö. 2 | -------------------------------------------------------------------------------- /atest/testdata/textfiles/corrupted.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/SSHLibrary/f7afc581dc5f7eb2b59f499314c0406d8e17d7e5/atest/testdata/textfiles/corrupted.txt -------------------------------------------------------------------------------- /atest/testdata/textfiles/special%2Fchars.txt: -------------------------------------------------------------------------------- 1 | This file has URL encoded characters in its name. 2 | -------------------------------------------------------------------------------- /atest/testdata/textfiles/test[1].txt: -------------------------------------------------------------------------------- 1 | This file name contains square brackets in his name. -------------------------------------------------------------------------------- /atest/testdata/textfiles/test_file.txt: -------------------------------------------------------------------------------- 1 | This is a test file. 2 | -------------------------------------------------------------------------------- /atest/testdata/to_put/ExampleText3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MarketSquare/SSHLibrary/f7afc581dc5f7eb2b59f499314c0406d8e17d7e5/atest/testdata/to_put/ExampleText3.txt -------------------------------------------------------------------------------- /atest/testdata/to_put/Folder1/Folder2/ExampleFile1.txt: -------------------------------------------------------------------------------- 1 | Example -------------------------------------------------------------------------------- /atest/testdata/to_put/Folder3/ExampleFile2.txt: -------------------------------------------------------------------------------- 1 | Example2 -------------------------------------------------------------------------------- /atest/tunnels.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource resources/common.robot 3 | Library OperatingSystem 4 | Library Tunnels.py 5 | 6 | Test Setup Open Connection ${HOST} 7 | Test Teardown Close All Connections 8 | 9 | 10 | *** Variables *** 11 | ${LOCAL PORT} 9000 12 | ${REMOTE HOST} google.com 13 | ${REMOTE PORT} 80 14 | ${DEFAULT SSH PORT} 22 15 | ${LOCAL SSH PORT} 2222 16 | 17 | 18 | *** Test Cases *** 19 | Local Tunnel Should Be Closed 20 | [Documentation] LOG 3:1 GLOB: Now forwarding port ${LOCAL PORT} to ${REMOTE HOST}:${REMOTE PORT} ... 21 | ... LOG 6:2 GLOB: Connected! Tunnel open * 22 | ... LOG 6:3 GLOB: Tunnel closed from * 23 | Login ${USERNAME} ${PASSWORD} 24 | Create Local SSH Tunnel ${LOCAL PORT} ${REMOTE HOST} ${REMOTE PORT} 25 | Dummy Connect ${LOCAL PORT} 26 | Port Should Not Be Free ${LOCAL PORT} 27 | Close All Connections 28 | Wait For Port To Be Closed ${LOCAL PORT} 29 | Port Should Be Free ${LOCAL PORT} 30 | 31 | Local Tunnel With Public Key 32 | Login With Public Key ${KEY USERNAME} ${KEY} 33 | Create Local SSH Tunnel ${LOCAL PORT} ${REMOTE HOST} ${REMOTE PORT} 34 | Port Should Not Be Free ${LOCAL PORT} 35 | 36 | Local Tunnel SSH 37 | [Documentation] LOG 3:1 GLOB: Now forwarding port ${LOCAL SSH PORT} to ${HOST}:${DEFAULT SSH PORT} ... 38 | ... LOG 8:2 GLOB: Connected! Tunnel open * 39 | Login ${USERNAME} ${PASSWORD} 40 | Create Local SSH Tunnel ${LOCAL SSH PORT} ${HOST} ${DEFAULT SSH PORT} 41 | Port Should Not Be Free ${LOCAL SSH PORT} 42 | Open Connection ${HOST} port=${LOCAL SSH PORT} 43 | Login ${USERNAME} ${PASSWORD} 44 | Execute Command ls 45 | 46 | Local Tunnel With Default Remote Port 47 | Login With Public Key ${KEY USERNAME} ${KEY} 48 | Create Local SSH Tunnel ${LOCAL PORT} ${REMOTE HOST} 49 | Port Should Not Be Free ${LOCAL PORT} 50 | 51 | Local Tunnel With Bind Address 52 | Login ${USERNAME} ${PASSWORD} 53 | Create Local SSH Tunnel ${LOCAL PORT} ${REMOTE HOST} ${REMOTE PORT} bind_address=localhost 54 | Port Should Be Binded To Localhost ${LOCAL PORT} 55 | 56 | 57 | *** Keywords *** 58 | Port Should Not Be Free 59 | [Arguments] ${port} 60 | IF os.sep == '/' 61 | ${result} Run netstat -tulpn 62 | ELSE 63 | ${result} Run netstat -an 64 | END 65 | Should Contain ${result} :${port} 66 | 67 | Port Should Be Binded To Localhost 68 | [Arguments] ${port} 69 | IF os.sep == '/' 70 | ${result} Run netstat -tulpn 71 | ELSE 72 | ${result} Run netstat -an 73 | END 74 | ${ip} Set Variable If '${HOST}' == 'localhost' 127.0.0.1 [?::1]? 75 | Should Match Regexp ${result} ${ip}:${port} 76 | 77 | Port Should Be Free 78 | [Arguments] ${port} 79 | IF os.sep == '/' 80 | ${result} Run netstat -tulpn 81 | ELSE 82 | ${result} Run netstat -an 83 | END 84 | Should Not Contain ${result} :${port} 85 | 86 | Wait For Port To Be Closed 87 | [Arguments] ${port} 88 | Wait Until Keyword Succeeds 2 min 10s Port Should Be Free ${port} 89 | -------------------------------------------------------------------------------- /atest/write_and_read/other_writes_and_reads.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Resource ../resources/write_and_read_resource.robot 3 | 4 | Suite Setup Run Keywords Login And Upload Test Scripts AND Put File ${CORRUPTED FILE} ${REMOTE TEST ROOT} 5 | Suite Teardown Remove Test Files and Close Connections 6 | 7 | 8 | *** Test Cases *** 9 | Write And Read Until 10 | ${output} = Write ${REMOTE TEST ROOT}/${INTERACTIVE TEST SCRIPT NAME} 11 | Should Contain ${output} ${REMOTE TEST ROOT}/${INTERACTIVE TEST SCRIPT NAME} 12 | ${output} = Read Until Give your name? 13 | Should Contain ${output} Give your name? 14 | ${output} = Write Mr. Ääkkönen 15 | Should Contain ${output} Mr. Ääkkönen 16 | ${output} = Read Until Prompt 17 | Should Contain ${output} Hello Mr. Ääkkönen 18 | 19 | Write And Read Until Prompt 20 | Write Bare ${REMOTE TEST ROOT}/${INTERACTIVE TEST SCRIPT NAME} add_newline=True 21 | Write Bare Mr. Ääkkönen add_newline=True 22 | ${output} = Read Until Prompt 23 | Should Contain ${output} Hello Mr. Ääkkönen 24 | 25 | Write And Read Until Regexp 26 | Write ${REMOTE TEST ROOT}/${INTERACTIVE TEST SCRIPT NAME} 27 | ${output} = Read Until Regexp Give.*\\? 28 | Should Contain ${output} Give your name? 29 | Write Bare Mr. Ääkkönen add_newline=True 30 | Comment Prompt needs to be escaped because it might be $ 31 | ${output} = Read Until Regexp (?s).*\\${PROMPT} 32 | Should Contain ${output} Hello Mr. Ääkkönen 33 | Should End With ${output} ${PROMPT} 34 | 35 | Write Non-String 36 | Write ${1} 37 | ${output} = Read Until Prompt 38 | Should Contain ${output} 1 39 | 40 | Write Bare Non-String 41 | Write Bare ${False}\n 42 | ${output} = Read Until Prompt 43 | Should Contain ${output} False 44 | 45 | Write Bare Add New Line Non-String 46 | Write Bare ${False} add_newline=True 47 | ${output} = Read Until Prompt 48 | Should Contain ${output} False 49 | 50 | Write In Case Of Timeout 51 | Write Bare Foo Bar And Some Other add_newline=True 52 | Set Client Configuration timeout=1 53 | ${status} ${error} = Run Keyword And Ignore Error 54 | ... Read Until This is not found 55 | Should Start With ${error} No match found for 'This is not found' in 1 second 56 | 57 | Write Returning Stderr 58 | Write ${REMOTE TEST ROOT}/${INTERACTIVE TEST SCRIPT NAME} 59 | Read Until Give your name? 60 | Write Bare Error add_newline=True 61 | ${output} = Read Until ${PROMPT} 62 | Should Contain ${output} Hello Error 63 | Should Contain ${output} This is Error 64 | 65 | Write Bare And Read Until 66 | Write Bare ${REMOTE TEST ROOT}/${INTERACTIVE TEST SCRIPT NAME} add_newline=True 67 | ${output} = Read Until name? 68 | Write Bare Mr. Ääkkönen add_newline=True 69 | ${output2} = Read Until Prompt 70 | Should Contain ${output} Give your name? 71 | Should Contain ${output2} Hello Mr. Ääkkönen 72 | Should Contain ${output2} ${PROMPT} 73 | 74 | Write Until Expected Output 75 | Write Until Expected Output ${REMOTE TEST ROOT}/${REPEAT TEST SCRIPT NAME}\n 76 | ... 3 15 seconds 0.5 seconds 77 | [Teardown] Execute Command rm -f ${COUNTER NAME} 78 | 79 | Write Until Expected Output In Case Of Timeout 80 | Run Keyword And Expect Error No match found for '11' in 2 seconds. 81 | ... Write Until Expected Output ${REMOTE TEST ROOT}/${REPEAT TEST SCRIPT NAME}\n 82 | ... 11 2s 0.5s 83 | [Teardown] Execute Command rm -f ${COUNTER NAME} 84 | 85 | Read Until Prompt With Strip Prompt 86 | Write Bare echo This is a test add_newline=True 87 | ${output} = Read Until Prompt strip_prompt=True 88 | Should Contain ${output} This is a test 89 | Should Not Contain ${output} ${PROMPT} 90 | 91 | Read Until REGEXP Prompt With Strip Prompt 92 | Set Client Configuration prompt=REGEXP:[#$] 93 | Write Bare echo This is a test add_newline=True 94 | ${output} = Read Until Prompt strip_prompt=True 95 | Should Contain ${output} This is a test 96 | Should Not Match Regexp ${output} [#$] 97 | [Teardown] Set Client Configuration prompt=${PROMPT} 98 | 99 | Configure Session Width And Height 100 | Set Client Configuration prompt=${PROMPT} height=48 width=160 101 | ${conn} = Get Connection 1 102 | Should Be Equal As Integers ${conn.height} 48 103 | Should Be Equal As Integers ${conn.width} 160 104 | Write stty size 105 | ${output} = Read Until Prompt 106 | Should Contain ${output} 48 160 107 | [Teardown] Set Client Configuration height=24 width=80 108 | 109 | Read Until With Encoding Errors On Strict 110 | Write Bare cat ${REMOTE TEST ROOT}/${CORRUPTED FILE NAME} add_newline=True 111 | GROUP Read output from "cat" command 112 | TRY 113 | # "Hello" is at the end of the corrupted file 114 | Read Until Hello 115 | Fail READ UNTIL should have failed with expected error 116 | EXCEPT *codec can't decode byte* type=GLOB AS ${error_message} 117 | Log Write command failed with expected error: ${error_message} 118 | END 119 | END 120 | 121 | Read Until With Encoding Errors On Replace 122 | Set Client Configuration encoding_errors=replace 123 | Write Bare cat ${REMOTE TEST ROOT}/${CORRUPTED FILE NAME} add_newline=True 124 | ${output} = Read Until Hello 125 | Should Contain ${output} Hello 126 | 127 | Read Until With Encoding Errors On Ignore 128 | Set Client Configuration encoding_errors=ignore 129 | Write Bare cat ${REMOTE TEST ROOT}/${CORRUPTED FILE NAME} add_newline=True 130 | ${output} = Read Until Hello 131 | Should Contain ${output} Hello 132 | 133 | Read Until With Encoding Errors Set In Open Connection 134 | [Setup] Run Keywords Open Connection ${HOST} prompt=${PROMPT} encoding_errors=replace AND 135 | ... Login ${USERNAME} ${PASSWORD} 136 | Write Bare cat ${REMOTE TEST ROOT}/${CORRUPTED FILE NAME} add_newline=True 137 | ${output} = Read Until Hello 138 | Should Contain ${output} Hello 139 | -------------------------------------------------------------------------------- /atest/write_and_read/write_and_read.robot: -------------------------------------------------------------------------------- 1 | *** Settings *** 2 | Documentation This test case is isolated to its own suite because if `Read` fails 3 | ... because of timing issues, it will bleed to other test cases. Timing 4 | ... issues are related to the speed of computer. If the test case is 5 | ... failing, increase delay for `Read`. 6 | 7 | Resource ../resources/write_and_read_resource.robot 8 | 9 | Suite Setup Login And Upload Test Scripts 10 | Suite Teardown Remove Test Files and Close Connections 11 | 12 | 13 | *** Test Cases *** 14 | Write And Read 15 | Write ${REMOTE TEST ROOT}/${INTERACTIVE TEST SCRIPT NAME} 16 | Write Mr. Ääkkönen 17 | ${output} = Read delay=1s 18 | Should Contain ${output} Hello Mr. Ääkkönen 19 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.0.0.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.0.0 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.0.0 is a new release with Python 3 support and 11 | other fixes and enhancements. 12 | 13 | If you have pip_ installed, just run 14 | 15 | :: 16 | 17 | pip install --upgrade robotframework-sshlibrary 18 | 19 | to install the latest release or use 20 | 21 | :: 22 | 23 | pip install robotframework-sshlibrary==3.0.0 24 | 25 | to install exactly this version. Alternatively you can download the source 26 | distribution from PyPI_ and install it manually. 27 | 28 | SSHLibrary 3.0.0 was released on Friday April 27, 2018. 29 | 30 | .. _Robot Framework: http://robotframework.org 31 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 32 | .. _pip: http://pip-installer.org 33 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 34 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.0.0 35 | 36 | 37 | .. contents:: 38 | :depth: 2 39 | :local: 40 | 41 | Most important enhancements 42 | =========================== 43 | 44 | The main new feature in SSHLibrary 3.0.0 is the support for Python 3. The supported interpreters are Python 2.7, Python 3.4+ and Jython 2.7 (`#219`_). 45 | 46 | Another important feature is the possibility to use sudo to execute and start commands (`#189`_). 47 | 48 | The keyword documentation has been improved (`#223`_). 49 | 50 | Backwards incompatible changes 51 | ============================== 52 | 53 | New arguments were added to `Login with Public Key` keyword and `delay` must be provided as a named argument (`#146`_). 54 | 55 | Acknowledgements 56 | ================ 57 | 58 | Thanks to `@rainmanwy `_ for the Python 3 59 | pull request (`#207`_) and also others who provided earlier PRs related 60 | to it. 61 | 62 | Big thanks also to `Mihai Pârvu `_, 63 | `Oana Brinzan `_ and 64 | `Andreea Kovacs `_ for their work and 65 | especially for promising to work as SSHLibrary maintainers! 66 | 67 | .. _#207: https://github.com/MarketSquare/SSHLibrary/pull/207 68 | 69 | Full list of fixes and enhancements 70 | =================================== 71 | 72 | .. list-table:: 73 | :header-rows: 1 74 | 75 | * - ID 76 | - Type 77 | - Priority 78 | - Summary 79 | * - `#219`_ 80 | - enhancement 81 | - critical 82 | - Python 3 compatibility 83 | * - `#189`_ 84 | - enhancement 85 | - high 86 | - sudo for "Execute Command" and "Start Command" 87 | * - `#223`_ 88 | - enhancement 89 | - high 90 | - Enhance keyword documentation 91 | * - `#182`_ 92 | - bug 93 | - medium 94 | - 'Put Directory' command doesn't upload correctly the files with ':' in the name. 95 | * - `#146`_ 96 | - enhancement 97 | - medium 98 | - Login using agent forwarding 99 | * - `#199`_ 100 | - enhancement 101 | - medium 102 | - Support regexp for connection prompt 103 | * - `#201`_ 104 | - enhancement 105 | - medium 106 | - Add support for Travis CI 107 | * - `#132`_ 108 | - enhancement 109 | - low 110 | - Capture the pre login banner 111 | * - `#174`_ 112 | - enhancement 113 | - low 114 | - Enhance acceptance tests to cover IPv6 115 | 116 | Altogether 9 issues. View on the `issue tracker `__. 117 | 118 | .. _#219: https://github.com/MarketSquare/SSHLibrary/issues/219 119 | .. _#189: https://github.com/MarketSquare/SSHLibrary/issues/189 120 | .. _#223: https://github.com/MarketSquare/SSHLibrary/issues/223 121 | .. _#182: https://github.com/MarketSquare/SSHLibrary/issues/182 122 | .. _#146: https://github.com/MarketSquare/SSHLibrary/issues/146 123 | .. _#199: https://github.com/MarketSquare/SSHLibrary/issues/199 124 | .. _#201: https://github.com/MarketSquare/SSHLibrary/issues/201 125 | .. _#132: https://github.com/MarketSquare/SSHLibrary/issues/132 126 | .. _#174: https://github.com/MarketSquare/SSHLibrary/issues/174 127 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.0.0a1.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | SSHLibrary 3.0.0 alpha 1 3 | ======================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.0.0 alpha 1 is a new release with Python 3 support and 11 | few smaller fixes and enhancements. 12 | All issues targeted for SSHLibrary v3.0.0 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --pre --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.0.0a1 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.0.0a1 was released on Thursday March 22, 2018. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.0.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Most important enhancements 44 | =========================== 45 | 46 | The main new feature in SSHLibrary 3.0 is the support for Python 3 (`#219`_). 47 | 48 | Acknowledgements 49 | ================ 50 | 51 | Thanks to `@rainmanwy `_ for the Python 3 52 | pull request (`#207`_) and also others who provided earlier PRs related 53 | to it. 54 | 55 | Big thanks also to `Mihai Pârvu `_, 56 | `Oana Brinzan `_ and 57 | `@andreeakovacs `_ for their work and 58 | especially for promising to work as SSHLibrary maintainers! 59 | 60 | .. _#207: https://github.com/MarketSquare/SSHLibrary/pull/207 61 | 62 | Full list of fixes and enhancements 63 | =================================== 64 | 65 | .. list-table:: 66 | :header-rows: 1 67 | 68 | * - ID 69 | - Type 70 | - Priority 71 | - Summary 72 | - Added 73 | * - `#219`_ 74 | - enhancement 75 | - critical 76 | - Python 3 compatibility 77 | - alpha 1 78 | * - `#182`_ 79 | - bug 80 | - medium 81 | - 'Put Directory' command doesn't upload correctly the files with ':' in the name. 82 | - alpha 1 83 | * - `#199`_ 84 | - enhancement 85 | - medium 86 | - support regexp for connection prompt 87 | - alpha 1 88 | * - `#201`_ 89 | - enhancement 90 | - medium 91 | - Add support for Travis CI 92 | - alpha 1 93 | 94 | Altogether 4 issues. View on the `issue tracker `__. 95 | 96 | .. _#219: https://github.com/MarketSquare/SSHLibrary/issues/219 97 | .. _#182: https://github.com/MarketSquare/SSHLibrary/issues/182 98 | .. _#199: https://github.com/MarketSquare/SSHLibrary/issues/199 99 | .. _#201: https://github.com/MarketSquare/SSHLibrary/issues/201 100 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.0.0rc1.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.0.0 Release Candidate 1 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.0.0 release candidate 1 is a new release with Python 3 support and 11 | few smaller fixes and enhancements. 12 | All issues targeted for SSHLibrary v3.0.0 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --pre --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.0.0rc1 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.0.0rc1 was released on Tuesday April 24, 2018. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.0.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Most important enhancements 44 | =========================== 45 | 46 | The main new feature in SSHLibrary 3.0 is the support for Python 3 (`#219`_). 47 | 48 | Another important feature is the possibility to use sudo to execute and start commands (`#189`_). 49 | 50 | Backwards incompatible changes 51 | ============================== 52 | 53 | New arguments were added to `Login with Public Key` keyword and `delay` must be provided as a named argument (`#146`_). 54 | 55 | Acknowledgements 56 | ================ 57 | 58 | Thanks to `@rainmanwy `_ for the Python 3 59 | pull request (`#207`_) and also others who provided earlier PRs related 60 | to it. 61 | 62 | Big thanks also to `Mihai Pârvu `_, 63 | `Oana Brinzan `_ and 64 | `Andreea Kovacs `_ for their work and 65 | especially for promising to work as SSHLibrary maintainers! 66 | 67 | .. _#207: https://github.com/MarketSquare/SSHLibrary/pull/207 68 | 69 | 70 | Full list of fixes and enhancements 71 | =================================== 72 | 73 | .. list-table:: 74 | :header-rows: 1 75 | 76 | * - ID 77 | - Type 78 | - Priority 79 | - Summary 80 | - Added 81 | * - `#219`_ 82 | - enhancement 83 | - critical 84 | - Python 3 compatibility 85 | - alpha 1 86 | * - `#189`_ 87 | - enhancement 88 | - high 89 | - sudo for "Execute Command" and "Start Command" 90 | - rc 1 91 | * - `#182`_ 92 | - bug 93 | - medium 94 | - 'Put Directory' command doesn't upload correctly the files with ':' in the name. 95 | - alpha 1 96 | * - `#146`_ 97 | - enhancement 98 | - medium 99 | - Login using agent forwarding 100 | - rc 1 101 | * - `#199`_ 102 | - enhancement 103 | - medium 104 | - Support regexp for connection prompt 105 | - alpha 1 106 | * - `#201`_ 107 | - enhancement 108 | - medium 109 | - Add support for Travis CI 110 | - alpha 1 111 | * - `#132`_ 112 | - enhancement 113 | - low 114 | - Capture the pre login banner 115 | - rc 1 116 | 117 | Altogether 7 issues. View on the `issue tracker `__. 118 | 119 | .. _#219: https://github.com/MarketSquare/SSHLibrary/issues/219 120 | .. _#189: https://github.com/MarketSquare/SSHLibrary/issues/189 121 | .. _#182: https://github.com/MarketSquare/SSHLibrary/issues/182 122 | .. _#146: https://github.com/MarketSquare/SSHLibrary/issues/146 123 | .. _#199: https://github.com/MarketSquare/SSHLibrary/issues/199 124 | .. _#201: https://github.com/MarketSquare/SSHLibrary/issues/201 125 | .. _#132: https://github.com/MarketSquare/SSHLibrary/issues/132 126 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.0.1a1.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | SSHLibrary 3.0.1 alpha 1 3 | ======================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.0.1 alpha 1 is a new release with local ssh tunneling 11 | support and few smaller fixes. 12 | All issues targeted for SSHLibrary v3.0.1 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --pre --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.0.1a1 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.0.1a1 was released on Friday June 8, 2018. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.0.1 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Most important enhancements 44 | =========================== 45 | 46 | The most important feature in SSHLibrary 3.0.1 is the support for 47 | local port forwarding (SSH tunneling) (`#224`_). 48 | 49 | Full list of fixes and enhancements 50 | =================================== 51 | 52 | .. list-table:: 53 | :header-rows: 1 54 | 55 | * - ID 56 | - Type 57 | - Priority 58 | - Summary 59 | - Added 60 | * - `#230`_ 61 | - bug 62 | - high 63 | - Command is terminated after 0.1 seconds when sudo_password is used 64 | - alpha 1 65 | * - `#224`_ 66 | - enhancement 67 | - high 68 | - Implement creation of SSH tunnels with Paramiko 69 | - alpha 1 70 | * - `#206`_ 71 | - enhancement 72 | - medium 73 | - Command execution should take into account user configurable timeout 74 | - alpha 1 75 | 76 | Altogether 3 issues. View on the `issue tracker `__. 77 | 78 | .. _#230: https://github.com/MarketSquare/SSHLibrary/issues/230 79 | .. _#224: https://github.com/MarketSquare/SSHLibrary/issues/224 80 | .. _#206: https://github.com/MarketSquare/SSHLibrary/issues/206 81 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.1.0.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.1.0 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.1.0 is a new release with local SSH tunneling support 11 | and a few smaller fixes and enhancements. 12 | 13 | If you have pip_ installed, just run 14 | 15 | :: 16 | 17 | pip install --upgrade robotframework-sshlibrary 18 | 19 | to install the latest release or use 20 | 21 | :: 22 | 23 | pip install robotframework-sshlibrary==3.1.0 24 | 25 | to install exactly this version. Alternatively you can download the source 26 | distribution from PyPI_ and install it manually. 27 | 28 | SSHLibrary 3.1.0 was released on Friday June 29, 2018. 29 | 30 | .. _Robot Framework: http://robotframework.org 31 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 32 | .. _pip: http://pip-installer.org 33 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 34 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.1.0 35 | 36 | 37 | .. contents:: 38 | :depth: 2 39 | :local: 40 | 41 | Most important enhancements 42 | =========================== 43 | 44 | The most important feature in SSHLibrary 3.1.0 is the support for 45 | local port forwarding (SSH tunneling) (`#224`_). 46 | 47 | Backwards incompatible changes 48 | ============================== 49 | 50 | The minimum required Paramiko version is now 1.15.3, due to taking into account 51 | configurable timeout on command execution (`#206`_). 52 | 53 | Full list of fixes and enhancements 54 | =================================== 55 | 56 | .. list-table:: 57 | :header-rows: 1 58 | 59 | * - ID 60 | - Type 61 | - Priority 62 | - Summary 63 | * - `#230`_ 64 | - bug 65 | - high 66 | - Command is terminated after 0.1 seconds when sudo_password is used 67 | * - `#224`_ 68 | - enhancement 69 | - high 70 | - Implement creation of SSH tunnels with Paramiko 71 | * - `#228`_ 72 | - bug 73 | - medium 74 | - Inconsistent usage of Boolean arguments 75 | * - `#244`_ 76 | - bug 77 | - medium 78 | - SSH tunnel not is not closing properly during test execution 79 | * - `#206`_ 80 | - enhancement 81 | - medium 82 | - Command execution should take into account user configurable timeout 83 | * - `#225`_ 84 | - enhancement 85 | - medium 86 | - Possibility to turn off the logging generated by the ssh library 87 | * - `#229`_ 88 | - enhancement 89 | - low 90 | - Separate section for explaining the time syntax 91 | 92 | Altogether 7 issues. View on the `issue tracker `__. 93 | 94 | .. _#230: https://github.com/MarketSquare/SSHLibrary/issues/230 95 | .. _#224: https://github.com/MarketSquare/SSHLibrary/issues/224 96 | .. _#228: https://github.com/MarketSquare/SSHLibrary/issues/228 97 | .. _#244: https://github.com/MarketSquare/SSHLibrary/issues/244 98 | .. _#206: https://github.com/MarketSquare/SSHLibrary/issues/206 99 | .. _#225: https://github.com/MarketSquare/SSHLibrary/issues/225 100 | .. _#229: https://github.com/MarketSquare/SSHLibrary/issues/229 101 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.1.0rc1.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.1.0 Release Candidate 1 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.1.0 Release Candidate 1 is a new release with local ssh 11 | tunneling support and a few smaller fixes and enhancements. 12 | All issues targeted for SSHLibrary v3.1.0 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --pre --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.1.0rc1 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.1.0rc1 was released on Tuesday June 26, 2018. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.1.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Most important enhancements 44 | =========================== 45 | 46 | The most important feature in SSHLibrary 3.1.0 is the support for 47 | local port forwarding (SSH tunneling) (`#224`_). 48 | 49 | Full list of fixes and enhancements 50 | =================================== 51 | 52 | .. list-table:: 53 | :header-rows: 1 54 | 55 | * - ID 56 | - Type 57 | - Priority 58 | - Summary 59 | - Added 60 | * - `#230`_ 61 | - bug 62 | - high 63 | - Command is terminated after 0.1 seconds when sudo_password is used 64 | - alpha 1 65 | * - `#224`_ 66 | - enhancement 67 | - high 68 | - Implement creation of SSH tunnels with Paramiko 69 | - alpha 1 70 | * - `#228`_ 71 | - bug 72 | - medium 73 | - Inconsistent usage of Boolean arguments 74 | - rc 1 75 | * - `#244`_ 76 | - bug 77 | - medium 78 | - SSH tunnel not is not closing properly during test execution 79 | - rc 1 80 | * - `#206`_ 81 | - enhancement 82 | - medium 83 | - Command execution should take into account user configurable timeout 84 | - alpha 1 85 | * - `#225`_ 86 | - enhancement 87 | - medium 88 | - Possibility to turn off the logging generated by the ssh library 89 | - rc 1 90 | * - `#229`_ 91 | - enhancement 92 | - low 93 | - Separate section for explaining the time syntax 94 | - rc 1 95 | 96 | Altogether 7 issues. View on the `issue tracker `__. 97 | 98 | .. _#230: https://github.com/MarketSquare/SSHLibrary/issues/230 99 | .. _#224: https://github.com/MarketSquare/SSHLibrary/issues/224 100 | .. _#228: https://github.com/MarketSquare/SSHLibrary/issues/228 101 | .. _#244: https://github.com/MarketSquare/SSHLibrary/issues/244 102 | .. _#206: https://github.com/MarketSquare/SSHLibrary/issues/206 103 | .. _#225: https://github.com/MarketSquare/SSHLibrary/issues/225 104 | .. _#229: https://github.com/MarketSquare/SSHLibrary/issues/229 105 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.1.1.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.1.1 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.1.1 is a new minor release fixing a blocking issue 11 | related to copying symbolic links, and a couple of bug fixes. 12 | 13 | If you have pip_ installed, just run 14 | 15 | :: 16 | 17 | pip install --upgrade robotframework-sshlibrary 18 | 19 | to install the latest release or use 20 | 21 | :: 22 | 23 | pip install robotframework-sshlibrary==3.1.1 24 | 25 | to install exactly this version. Alternatively you can download the source 26 | distribution from PyPI_ and install it manually. 27 | 28 | SSHLibrary 3.1.1 was released on Tuesday August 14, 2018. 29 | 30 | .. _Robot Framework: http://robotframework.org 31 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 32 | .. _pip: http://pip-installer.org 33 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 34 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.1.1 35 | 36 | 37 | List of fixed issues 38 | ==================== 39 | 40 | .. list-table:: 41 | :header-rows: 1 42 | 43 | * - ID 44 | - Type 45 | - Priority 46 | - Summary 47 | * - `#131`_ 48 | - bug 49 | - medium 50 | - Get File does not resolve symlinks 51 | * - `#255`_ 52 | - bug 53 | - medium 54 | - Python tunneling issue with IPv6 55 | * - `#210`_ 56 | - bug 57 | - low 58 | - Permissions are not properly set when copying a directory 59 | 60 | Altogether 3 issues. View on the `issue tracker `__. 61 | 62 | .. _#131: https://github.com/MarketSquare/SSHLibrary/issues/131 63 | .. _#255: https://github.com/MarketSquare/SSHLibrary/issues/255 64 | .. _#210: https://github.com/MarketSquare/SSHLibrary/issues/210 65 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.2.0.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.2.0 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.2.0 is a new release with several enhancements and bug fixes. 11 | All issues targeted for SSHLibrary v3.2.0 can be found from 12 | the `issue tracker`_. 13 | 14 | If you have pip_ installed, just run 15 | 16 | :: 17 | 18 | pip install --upgrade robotframework-sshlibrary 19 | 20 | to install the latest release or use 21 | 22 | :: 23 | 24 | pip install robotframework-sshlibrary==3.2.0 25 | 26 | to install exactly this version. Alternatively you can download the source 27 | distribution from PyPI_ and install it manually. 28 | 29 | SSHLibrary 3.2.0 was released on Wednesday October 31, 2018. 30 | 31 | .. _Robot Framework: http://robotframework.org 32 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 33 | .. _pip: http://pip-installer.org 34 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 35 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.2.0 36 | 37 | 38 | .. contents:: 39 | :depth: 2 40 | :local: 41 | 42 | Most important enhancements 43 | =========================== 44 | 45 | The most important new features of SSHLibrary 3.2.0 are the new timeout 46 | argument for `Execute Command` (`#127`_) and adding the option to strip 47 | the prompt for `Read Until Prompt` keyword, similar with Telnet library 48 | (`#247`_). 49 | 50 | Backwards incompatible changes 51 | ============================== 52 | 53 | The `Close Connection` keyword removes the connection from the alias list and 54 | trying to switch to a closed connection will now result in keyword failure (`#233`_). 55 | 56 | Acknowledgements 57 | ================ 58 | 59 | Great contributions for the following issues from Claudiu Dragan: 60 | 61 | - Add *timeout* setting to `Execute Command` (`#127`_) 62 | - Add *strip_prompt* argument to the `Read Until Prompt` keyword (`#247`_) 63 | 64 | Full list of fixes and enhancements 65 | =================================== 66 | 67 | .. list-table:: 68 | :header-rows: 1 69 | 70 | * - ID 71 | - Type 72 | - Priority 73 | - Summary 74 | * - `#266`_ 75 | - bug 76 | - high 77 | - Get File keyword IOError when trying to copy symbolic link 78 | * - `#260`_ 79 | - bug 80 | - medium 81 | - Get/Put File keywords do not return folders containing square brackets 82 | * - `#127`_ 83 | - enhancement 84 | - medium 85 | - Add timeout setting to 'Execute Command' 86 | * - `#247`_ 87 | - enhancement 88 | - medium 89 | - Add strip_prompt argument to the Read Until Prompt keyword 90 | * - `#233`_ 91 | - bug 92 | - low 93 | - "Close Connection" keyword does not remove the connection from existing connections 94 | * - `#237`_ 95 | - bug 96 | - low 97 | - Permission Denied for Put File with correct permissions 98 | * - `#246`_ 99 | - enhancement 100 | - low 101 | - Create Local SSH Tunnel could use a default port number for the remote_port 102 | 103 | Altogether 7 issues. View on the `issue tracker `__. 104 | 105 | .. _#266: https://github.com/MarketSquare/SSHLibrary/issues/266 106 | .. _#260: https://github.com/MarketSquare/SSHLibrary/issues/260 107 | .. _#127: https://github.com/MarketSquare/SSHLibrary/issues/127 108 | .. _#247: https://github.com/MarketSquare/SSHLibrary/issues/247 109 | .. _#233: https://github.com/MarketSquare/SSHLibrary/issues/233 110 | .. _#237: https://github.com/MarketSquare/SSHLibrary/issues/237 111 | .. _#246: https://github.com/MarketSquare/SSHLibrary/issues/246 112 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.2.0a1.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | SSHLibrary 3.2.0 alpha 1 3 | ======================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.2.0a1 is a new release with several enhancements and bug fixes. 11 | All issues targeted for SSHLibrary v3.2.0 can be found from 12 | the `issue tracker`_. 13 | 14 | If you have pip_ installed, just run 15 | 16 | :: 17 | 18 | pip install --pre --upgrade robotframework-sshlibrary 19 | 20 | to install the latest release or use 21 | 22 | :: 23 | 24 | pip install robotframework-sshlibrary==3.2.0a1 25 | 26 | to install exactly this version. Alternatively you can download the source 27 | distribution from PyPI_ and install it manually. 28 | 29 | SSHLibrary 3.2.0a1 was released on Wednesday October 24, 2018. 30 | 31 | .. _Robot Framework: http://robotframework.org 32 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 33 | .. _pip: http://pip-installer.org 34 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 35 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.2.0 36 | 37 | 38 | .. contents:: 39 | :depth: 2 40 | :local: 41 | 42 | Most important enhancements 43 | =========================== 44 | 45 | The most important new features of SSHLibrary 3.2.0 are the new timeout 46 | argument for `Execute Command` (`#127`_) and adding the option to strip 47 | the prompt for `Read Until Prompt` keyword, similar with Telnet library 48 | (`#247`_). 49 | 50 | Backwards incompatible changes 51 | ============================== 52 | 53 | The `Close Connection` keyword removes the connection from the alias list and 54 | trying to switch to a closed connection will now result in keyword failure (`#233`_). 55 | 56 | Acknowledgements 57 | ================ 58 | 59 | Great contributions for the following issues from Claudiu Dragan: 60 | 61 | - Add *timeout* setting to `Execute Command` (`#127`_) 62 | - Add *strip_prompt* argument to the `Read Until Prompt` keyword (`#247`_) 63 | 64 | Full list of fixes and enhancements 65 | =================================== 66 | 67 | .. list-table:: 68 | :header-rows: 1 69 | 70 | * - ID 71 | - Type 72 | - Priority 73 | - Summary 74 | - Added 75 | * - `#266`_ 76 | - bug 77 | - high 78 | - Get File keyword IOError when trying to copy symbolic link 79 | - alpha 1 80 | * - `#260`_ 81 | - bug 82 | - medium 83 | - Get/Put File keywords do not return folders containing square brackets 84 | - alpha 1 85 | * - `#127`_ 86 | - enhancement 87 | - medium 88 | - Add timeout setting to 'Execute Command' 89 | - alpha 1 90 | * - `#247`_ 91 | - enhancement 92 | - medium 93 | - Add strip_prompt argument to the Read Until Prompt keyword 94 | - alpha 1 95 | * - `#233`_ 96 | - bug 97 | - low 98 | - "Close Connection" keyword does not remove the connection from existing connections 99 | - alpha 1 100 | 101 | Altogether 5 issues. View on the `issue tracker `__. 102 | 103 | .. _#266: https://github.com/MarketSquare/SSHLibrary/issues/266 104 | .. _#260: https://github.com/MarketSquare/SSHLibrary/issues/260 105 | .. _#127: https://github.com/MarketSquare/SSHLibrary/issues/127 106 | .. _#247: https://github.com/MarketSquare/SSHLibrary/issues/247 107 | .. _#233: https://github.com/MarketSquare/SSHLibrary/issues/233 108 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.2.0rc1.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.2.0 Release Candidate 1 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.2.0rc1 is a new release with several enhancements and bug fixes. 11 | All issues targeted for SSHLibrary v3.2.0 can be found from 12 | the `issue tracker`_. 13 | 14 | If you have pip_ installed, just run 15 | 16 | :: 17 | 18 | pip install --pre --upgrade robotframework-sshlibrary 19 | 20 | to install the latest release or use 21 | 22 | :: 23 | 24 | pip install robotframework-sshlibrary==3.2.0rc1 25 | 26 | to install exactly this version. Alternatively you can download the source 27 | distribution from PyPI_ and install it manually. 28 | 29 | SSHLibrary 3.2.0rc1 was released on Tuesday October 30, 2018. 30 | 31 | .. _Robot Framework: http://robotframework.org 32 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 33 | .. _pip: http://pip-installer.org 34 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 35 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.2.0 36 | 37 | 38 | .. contents:: 39 | :depth: 2 40 | :local: 41 | 42 | Most important enhancements 43 | =========================== 44 | 45 | The most important new features of SSHLibrary 3.2.0 are the new timeout 46 | argument for `Execute Command` (`#127`_, alpha 1) and adding the option to strip 47 | the prompt for `Read Until Prompt` keyword, similar with Telnet library 48 | (`#247`_, alpha 1). 49 | 50 | Backwards incompatible changes 51 | ============================== 52 | 53 | The `Close Connection` keyword removes the connection from the alias list and 54 | trying to switch to a closed connection will now result in keyword failure (`#233`_, alpha 1). 55 | 56 | Acknowledgements 57 | ================ 58 | 59 | Great contributions for the following issues from Claudiu Dragan: 60 | 61 | - Add *timeout* setting to `Execute Command` (`#127`_, alpha 1) 62 | - Add *strip_prompt* argument to the `Read Until Prompt` keyword (`#247`_, alpha 1) 63 | 64 | Full list of fixes and enhancements 65 | =================================== 66 | 67 | .. list-table:: 68 | :header-rows: 1 69 | 70 | * - ID 71 | - Type 72 | - Priority 73 | - Summary 74 | - Added 75 | * - `#266`_ 76 | - bug 77 | - high 78 | - Get File keyword IOError when trying to copy symbolic link 79 | - alpha 1 80 | * - `#260`_ 81 | - bug 82 | - medium 83 | - Get/Put File keywords do not return folders containing square brackets 84 | - alpha 1 85 | * - `#127`_ 86 | - enhancement 87 | - medium 88 | - Add timeout setting to 'Execute Command' 89 | - alpha 1 90 | * - `#247`_ 91 | - enhancement 92 | - medium 93 | - Add strip_prompt argument to the Read Until Prompt keyword 94 | - alpha 1 95 | * - `#233`_ 96 | - bug 97 | - low 98 | - "Close Connection" keyword does not remove the connection from existing connections 99 | - alpha 1 100 | * - `#237`_ 101 | - bug 102 | - low 103 | - Permission Denied for Put File with correct permissions 104 | - rc 1 105 | * - `#246`_ 106 | - enhancement 107 | - low 108 | - Create Local SSH Tunnel could use a default port number for the remote_port 109 | - rc 1 110 | 111 | Altogether 7 issues. View on the `issue tracker `__. 112 | 113 | .. _#266: https://github.com/MarketSquare/SSHLibrary/issues/266 114 | .. _#260: https://github.com/MarketSquare/SSHLibrary/issues/260 115 | .. _#127: https://github.com/MarketSquare/SSHLibrary/issues/127 116 | .. _#247: https://github.com/MarketSquare/SSHLibrary/issues/247 117 | .. _#233: https://github.com/MarketSquare/SSHLibrary/issues/233 118 | .. _#237: https://github.com/MarketSquare/SSHLibrary/issues/237 119 | .. _#246: https://github.com/MarketSquare/SSHLibrary/issues/246 120 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.2.1.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.2.1 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.2.1 is a bug-fix release. 11 | All issues targeted for SSHLibrary v3.2.1 can be found from 12 | the `issue tracker`_. 13 | 14 | If you have pip_ installed, just run 15 | 16 | :: 17 | 18 | pip install --upgrade robotframework-sshlibrary 19 | 20 | to install the latest release or use 21 | 22 | :: 23 | 24 | pip install robotframework-sshlibrary==3.2.1 25 | 26 | to install exactly this version. Alternatively you can download the source 27 | distribution from PyPI_ and install it manually. 28 | 29 | SSHLibrary 3.2.1 was released on Thursday November 8, 2018. 30 | 31 | .. _Robot Framework: http://robotframework.org 32 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 33 | .. _pip: http://pip-installer.org 34 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 35 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.2.1 36 | 37 | 38 | .. contents:: 39 | :depth: 2 40 | :local: 41 | 42 | Most important update 43 | ===================== 44 | 45 | - Removing connections from connection list breaks switch_connection when followed by a close_connection (`#279`_) 46 | 47 | Backwards incompatible changes 48 | ============================== 49 | 50 | - Get Directory now downloads also the folder not only its content (`#270`_) 51 | 52 | Acknowledgements 53 | ================ 54 | 55 | Thank you @jluhrsen for reporting the issue and providing a fix: 56 | 57 | - Removing connections from connection list breaks switch_connection when followed by a close_connection (`#279`_) 58 | 59 | Full list of fixes and enhancements 60 | =================================== 61 | 62 | .. list-table:: 63 | :header-rows: 1 64 | 65 | * - ID 66 | - Type 67 | - Priority 68 | - Summary 69 | * - `#279`_ 70 | - bug 71 | - high 72 | - Removing connections from connection list breaks switch_connection when followed by a close_connection 73 | * - `#270`_ 74 | - bug 75 | - medium 76 | - Get Directory downloads only the content of the folder 77 | * - `#248`_ 78 | - bug 79 | - low 80 | - SSHLibrary: not possible to change (width/height) of existing session 81 | 82 | Altogether 3 issues. View on the `issue tracker `__. 83 | 84 | .. _#279: https://github.com/MarketSquare/SSHLibrary/issues/279 85 | .. _#270: https://github.com/MarketSquare/SSHLibrary/issues/270 86 | .. _#248: https://github.com/MarketSquare/SSHLibrary/issues/248 87 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.3.0.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.3.0 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.3.0 is a new release with SCP support and a few smaller 11 | fixes and enhancements. 12 | All issues targeted for SSHLibrary v3.3.0 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.3.0 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.3.0 was released on Tuesday February 19, 2019. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.3.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Most important enhancements 44 | =========================== 45 | 46 | The most important feature is the support for SCP (`#137`_). It can be enabled by setting the 47 | `scp` argument to `TRANSFER` or `ALL` (if SFTP is disabled entirely). 48 | 49 | Acknowledgements 50 | ================ 51 | 52 | Thank you @p74 and @mtango for helping with testing and feedback for the pre-release versions! 53 | 54 | Full list of fixes and enhancements 55 | =================================== 56 | 57 | .. list-table:: 58 | :header-rows: 1 59 | 60 | * - ID 61 | - Type 62 | - Priority 63 | - Summary 64 | * - `#137`_ 65 | - enhancement 66 | - high 67 | - Support for SCP 68 | * - `#284`_ 69 | - bug 70 | - medium 71 | - Index handling issue for multiple connections 72 | * - `#299`_ 73 | - enhancement 74 | - medium 75 | - Add posibility to restrict binding to specific interface when using tunneling 76 | * - `#297`_ 77 | - bug 78 | - low 79 | - `Put Directory` issue with Windows path destination 80 | * - `#283`_ 81 | - enhancement 82 | - low 83 | - Read SSH hostnames from ~/.ssh/config 84 | 85 | Altogether 5 issues. View on the `issue tracker `__. 86 | 87 | .. _#137: https://github.com/MarketSquare/SSHLibrary/issues/137 88 | .. _#284: https://github.com/MarketSquare/SSHLibrary/issues/284 89 | .. _#299: https://github.com/MarketSquare/SSHLibrary/issues/299 90 | .. _#297: https://github.com/MarketSquare/SSHLibrary/issues/297 91 | .. _#283: https://github.com/MarketSquare/SSHLibrary/issues/283 92 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.3.0a1.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | SSHLibrary 3.3.0 alpha 1 3 | ======================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.3.0a1 is a new release with SCP support and bug fixes. 11 | All issues targeted for SSHLibrary v3.3.0 can be found from 12 | the `issue tracker`_. 13 | 14 | If you have pip_ installed, just run 15 | 16 | :: 17 | 18 | pip install --pre --upgrade robotframework-sshlibrary 19 | 20 | to install the latest release or use 21 | 22 | :: 23 | 24 | pip install robotframework-sshlibrary==3.3.0a1 25 | 26 | to install exactly this version. Alternatively you can download the source 27 | distribution from PyPI_ and install it manually. 28 | 29 | SSHLibrary 3.3.0a1 was released on Thursday January 31, 2019. 30 | 31 | .. _Robot Framework: http://robotframework.org 32 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 33 | .. _pip: http://pip-installer.org 34 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 35 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.3.0 36 | 37 | 38 | .. contents:: 39 | :depth: 2 40 | :local: 41 | 42 | Most important enhancements 43 | =========================== 44 | 45 | The target of this release is introducing support for SCP (`#137`_). 46 | 47 | Full list of fixes and enhancements 48 | =================================== 49 | 50 | .. list-table:: 51 | :header-rows: 1 52 | 53 | * - ID 54 | - Type 55 | - Priority 56 | - Summary 57 | - Added 58 | * - `#137`_ 59 | - enhancement 60 | - high 61 | - Support for SCP 62 | - alpha 1 63 | * - `#284`_ 64 | - bug 65 | - medium 66 | - Bug at SSHConnectionCache SSHLibrary version 3.2.1 67 | - alpha 1 68 | 69 | Altogether 2 issues. View on the `issue tracker `__. 70 | 71 | .. _#137: https://github.com/MarketSquare/SSHLibrary/issues/137 72 | .. _#284: https://github.com/MarketSquare/SSHLibrary/issues/284 73 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.3.0rc1.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.3.0 Release Candidate 1 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.3.0 Realease Candidate 1 is a new release with 11 | SCP support and a few smaller fixes and enhancements. 12 | All issues targeted for SSHLibrary v3.3.0 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --pre --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.3.0rc1 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.3.0rc1 was released on Wednesday February 13, 2019. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.3.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Most important enhancements 44 | =========================== 45 | 46 | The target of this release is introducing support for SCP (`#137`_). 47 | 48 | Full list of fixes and enhancements 49 | =================================== 50 | 51 | .. list-table:: 52 | :header-rows: 1 53 | 54 | * - ID 55 | - Type 56 | - Priority 57 | - Summary 58 | - Added 59 | * - `#137`_ 60 | - enhancement 61 | - high 62 | - Support for SCP 63 | - alpha 1 64 | * - `#284`_ 65 | - bug 66 | - medium 67 | - Index handling issue for multiple connections 68 | - alpha 1 69 | * - `#299`_ 70 | - enhancement 71 | - medium 72 | - Add posibility to restrict binding to specific interface when using tunneling 73 | - rc 1 74 | * - `#297`_ 75 | - bug 76 | - low 77 | - `Put Directory` issue with Windows path destination 78 | - rc 1 79 | * - `#283`_ 80 | - enhancement 81 | - low 82 | - SSHLibrary should understand ssh hostnames form .ssh/config 83 | - rc 1 84 | 85 | Altogether 5 issues. View on the `issue tracker `__. 86 | 87 | .. _#137: https://github.com/MarketSquare/SSHLibrary/issues/137 88 | .. _#284: https://github.com/MarketSquare/SSHLibrary/issues/284 89 | .. _#299: https://github.com/MarketSquare/SSHLibrary/issues/299 90 | .. _#297: https://github.com/MarketSquare/SSHLibrary/issues/297 91 | .. _#283: https://github.com/MarketSquare/SSHLibrary/issues/283 92 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.4.0.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.4.0 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.4.0 is a new release with 11 | several enhancements and bug fixes. 12 | All issues targeted for SSHLibrary v3.4.0 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.4.0 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.4.0 was released on Friday August 30, 2019. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.4.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Most important enhancements 44 | =========================== 45 | 46 | Some of the most important new features are: 47 | - Logging mechanism was added when creating tunnels using the `Create Local SSH Tunnel` keyword (`#243`_) 48 | - Support for SSH subsystem invocation (`#285`_) 49 | - Support for ANSI escape sequences (`#292`_) 50 | - Add SSH Agent Forwarding to command execution (`#334`_) 51 | - Add socket support with ProxyCommand (`#335`_) 52 | 53 | Acknowledgements 54 | ================ 55 | 56 | Thank you all for your great contributions: 57 | 58 | - @StefanMewa: It's possible to switch to already closed connection (`#304`_) 59 | - @Noordsestern: [SFTP] `create remote file` fails when server denies chmod command (`#312`_) 60 | - @mika-b: Get File attempts to open SFTP connection even when scp=ALL was requested. (`#329`_) 61 | - @bachng2017: Login with password fails even with correct credentials (confirmed by sshclient) (`#331`_) 62 | - @jsdobkin: Add SSH Agent Forwarding to command execution (`#334`_) 63 | - @bachng2017: Add socket support with ProxyCommand (`#335`_) 64 | 65 | Full list of fixes and enhancements 66 | =================================== 67 | 68 | .. list-table:: 69 | :header-rows: 1 70 | 71 | * - ID 72 | - Type 73 | - Priority 74 | - Summary 75 | * - `#304`_ 76 | - bug 77 | - medium 78 | - It's possible to switch to already closed connection 79 | * - `#318`_ 80 | - bug 81 | - medium 82 | - Read output command generates Type Error 83 | * - `#243`_ 84 | - enhancement 85 | - medium 86 | - Create Local Ssh Tunnel keyword gives no info about the success/failure of the Keyword 87 | * - `#285`_ 88 | - enhancement 89 | - medium 90 | - SSH subsystem invocation 91 | * - `#278`_ 92 | - bug 93 | - low 94 | - SSH Tunneling does not work on Python 2.7 Windows 95 | * - `#292`_ 96 | - bug 97 | - low 98 | - Support ANSI escape sequences 99 | * - `#312`_ 100 | - bug 101 | - low 102 | - [SFTP] `create remote file` fails when server denies chmod command 103 | * - `#329`_ 104 | - bug 105 | - low 106 | - Get File attempts to open SFTP connection even when scp=ALL was requested. 107 | * - `#310`_ 108 | - enhancement 109 | - low 110 | - Login using key agent 111 | * - `#331`_ 112 | - enhancement 113 | - low 114 | - Login with password fails even with correct credentials (confirmed by sshclient) 115 | * - `#333`_ 116 | - bug 117 | - high 118 | - `Write` keyword hangs in teardown if authentication failed 119 | * - `#334`_ 120 | - enhancement 121 | - low 122 | - Add SSH Agent Forwarding to command execution 123 | * - `#335`_ 124 | - enhancement 125 | - low 126 | - Add socket support with ProxyCommand 127 | 128 | Altogether 13 issues. View on the `issue tracker `__. 129 | 130 | .. _#304: https://github.com/MarketSquare/SSHLibrary/issues/304 131 | .. _#318: https://github.com/MarketSquare/SSHLibrary/issues/318 132 | .. _#243: https://github.com/MarketSquare/SSHLibrary/issues/243 133 | .. _#285: https://github.com/MarketSquare/SSHLibrary/issues/285 134 | .. _#278: https://github.com/MarketSquare/SSHLibrary/issues/278 135 | .. _#292: https://github.com/MarketSquare/SSHLibrary/issues/292 136 | .. _#312: https://github.com/MarketSquare/SSHLibrary/issues/312 137 | .. _#329: https://github.com/MarketSquare/SSHLibrary/issues/329 138 | .. _#310: https://github.com/MarketSquare/SSHLibrary/issues/310 139 | .. _#331: https://github.com/MarketSquare/SSHLibrary/issues/331 140 | .. _#333: https://github.com/MarketSquare/SSHLibrary/issues/333 141 | .. _#334: https://github.com/MarketSquare/SSHLibrary/issues/334 142 | .. _#335: https://github.com/MarketSquare/SSHLibrary/issues/335 143 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.4.0rc1.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.4.0 Release Candidate 1 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.4.0 Release Candidate 1 is a new release with 11 | several enhancements and bug fixes. 12 | All issues targeted for SSHLibrary v3.4.0 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --pre --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.4.0rc1 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.4.0rc1 was released on Tuesday July 30, 2019. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.4.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Acknowledgements 44 | ================ 45 | 46 | Thank you, @StefanMewa for your great contribution to: 47 | 48 | - It's possible to switch to already closed connection (`#304`_, rc 1) 49 | 50 | Full list of fixes and enhancements 51 | =================================== 52 | 53 | .. list-table:: 54 | :header-rows: 1 55 | 56 | * - ID 57 | - Type 58 | - Priority 59 | - Summary 60 | - Added 61 | * - `#304`_ 62 | - bug 63 | - medium 64 | - It's possible to switch to already closed connection 65 | - rc 1 66 | * - `#318`_ 67 | - bug 68 | - medium 69 | - Read output command generates Type Error 70 | - rc 1 71 | * - `#243`_ 72 | - enhancement 73 | - medium 74 | - Create Local Ssh Tunnel keyword gives no info about the success/failure of the Keyword 75 | - rc 1 76 | * - `#285`_ 77 | - enhancement 78 | - medium 79 | - SSH subsystem invocation 80 | - rc 1 81 | * - `#292`_ 82 | - bug 83 | - low 84 | - Strange chars are added at the end of a line 85 | - rc 1 86 | * - `#310`_ 87 | - enhancement 88 | - low 89 | - Login using key agent 90 | - rc 1 91 | 92 | Altogether 6 issues. View on the `issue tracker `__. 93 | 94 | .. _#304: https://github.com/MarketSquare/SSHLibrary/issues/304 95 | .. _#318: https://github.com/MarketSquare/SSHLibrary/issues/318 96 | .. _#243: https://github.com/MarketSquare/SSHLibrary/issues/243 97 | .. _#285: https://github.com/MarketSquare/SSHLibrary/issues/285 98 | .. _#292: https://github.com/MarketSquare/SSHLibrary/issues/292 99 | .. _#310: https://github.com/MarketSquare/SSHLibrary/issues/310 100 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.4.0rc2.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.4.0 Release Candidate 2 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.4.0rc2 is a new release with 11 | several enhancements and bug fixes. 12 | All issues targeted for SSHLibrary v3.4.0 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --pre --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.4.0rc2 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.4.0rc2 was released on Wednesday August 21, 2019. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.4.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Acknowledgements 44 | ================ 45 | 46 | Thank you all for your great contributions: 47 | 48 | - @StefanMewa: It's possible to switch to already closed connection (`#304`_, rc 1) 49 | - @Noordsestern: [SFTP] `create remote file` fails when server denies chmod command (`#312`_, rc 2) 50 | - @mika-b: Get File attempts to open SFTP connection even when scp=ALL was requested. (`#329`_, rc 2) 51 | - @bachng2017: Login with password fails even with correct credentials (confirmed by sshclient) (`#331`_, rc 2) 52 | - @jsdobkin: Add SSH Agent Forwarding to command execution (`#334`_, rc 2) 53 | 54 | Full list of fixes and enhancements 55 | =================================== 56 | 57 | .. list-table:: 58 | :header-rows: 1 59 | 60 | * - ID 61 | - Type 62 | - Priority 63 | - Summary 64 | - Added 65 | * - `#304`_ 66 | - bug 67 | - medium 68 | - It's possible to switch to already closed connection 69 | - rc 1 70 | * - `#318`_ 71 | - bug 72 | - medium 73 | - Read output command generates Type Error 74 | - rc 1 75 | * - `#243`_ 76 | - enhancement 77 | - medium 78 | - Create Local Ssh Tunnel keyword gives no info about the success/failure of the Keyword 79 | - rc 1 80 | * - `#285`_ 81 | - enhancement 82 | - medium 83 | - SSH subsystem invocation 84 | - rc 1 85 | * - `#278`_ 86 | - bug 87 | - low 88 | - SSH Tunneling does not work on Python 2.7 Windows 89 | - rc 2 90 | * - `#292`_ 91 | - bug 92 | - low 93 | - Support ANSI escape sequences 94 | - rc 2 95 | * - `#312`_ 96 | - bug 97 | - low 98 | - [SFTP] `create remote file` fails when server denies chmod command 99 | - rc 2 100 | * - `#329`_ 101 | - bug 102 | - low 103 | - Get File attempts to open SFTP connection even when scp=ALL was requested. 104 | - rc 2 105 | * - `#310`_ 106 | - enhancement 107 | - low 108 | - Login using key agent 109 | - rc 1 110 | * - `#331`_ 111 | - enhancement 112 | - low 113 | - Login with password fails even with correct credentials (confirmed by sshclient) 114 | - rc 2 115 | * - `#334`_ 116 | - enhancement 117 | - low 118 | - Add SSH Agent Forwarding to command execution 119 | - rc 2 120 | 121 | Altogether 11 issues. View on the `issue tracker `__. 122 | 123 | .. _#304: https://github.com/MarketSquare/SSHLibrary/issues/304 124 | .. _#318: https://github.com/MarketSquare/SSHLibrary/issues/318 125 | .. _#243: https://github.com/MarketSquare/SSHLibrary/issues/243 126 | .. _#285: https://github.com/MarketSquare/SSHLibrary/issues/285 127 | .. _#278: https://github.com/MarketSquare/SSHLibrary/issues/278 128 | .. _#292: https://github.com/MarketSquare/SSHLibrary/issues/292 129 | .. _#312: https://github.com/MarketSquare/SSHLibrary/issues/312 130 | .. _#329: https://github.com/MarketSquare/SSHLibrary/issues/329 131 | .. _#310: https://github.com/MarketSquare/SSHLibrary/issues/310 132 | .. _#331: https://github.com/MarketSquare/SSHLibrary/issues/331 133 | .. _#334: https://github.com/MarketSquare/SSHLibrary/issues/334 134 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.4.0rc3.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.4.0 Release Candidate 3 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.4.0rc3 is a new release with 11 | several enhancements and bug fixes. 12 | All issues targeted for SSHLibrary v3.4.0 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --pre --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.4.0rc3 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.4.0rc3 was released on Monday August 26, 2019. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.4.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Acknowledgements 44 | ================ 45 | 46 | Thank you all for your great contributions: 47 | 48 | - @StefanMewa: It's possible to switch to already closed connection (`#304`_, rc 1) 49 | - @Noordsestern: [SFTP] `create remote file` fails when server denies chmod command (`#312`_, rc 2) 50 | - @mika-b: Get File attempts to open SFTP connection even when scp=ALL was requested. (`#329`_, rc 2) 51 | - @bachng2017: Login with password fails even with correct credentials (confirmed by sshclient) (`#331`_, rc 2) 52 | - @jsdobkin: Add SSH Agent Forwarding to command execution (`#334`_, rc 2) 53 | - @bachng2017: Add socket support with ProxyCommand (`#335`_, rc 3) 54 | 55 | Full list of fixes and enhancements 56 | =================================== 57 | 58 | .. list-table:: 59 | :header-rows: 1 60 | 61 | * - ID 62 | - Type 63 | - Priority 64 | - Summary 65 | - Added 66 | * - `#304`_ 67 | - bug 68 | - medium 69 | - It's possible to switch to already closed connection 70 | - rc 1 71 | * - `#318`_ 72 | - bug 73 | - medium 74 | - Read output command generates Type Error 75 | - rc 1 76 | * - `#243`_ 77 | - enhancement 78 | - medium 79 | - Create Local Ssh Tunnel keyword gives no info about the success/failure of the Keyword 80 | - rc 1 81 | * - `#285`_ 82 | - enhancement 83 | - medium 84 | - SSH subsystem invocation 85 | - rc 1 86 | * - `#278`_ 87 | - bug 88 | - low 89 | - SSH Tunneling does not work on Python 2.7 Windows 90 | - rc 2 91 | * - `#292`_ 92 | - bug 93 | - low 94 | - Support ANSI escape sequences 95 | - rc 2 96 | * - `#312`_ 97 | - bug 98 | - low 99 | - [SFTP] `create remote file` fails when server denies chmod command 100 | - rc 2 101 | * - `#329`_ 102 | - bug 103 | - low 104 | - Get File attempts to open SFTP connection even when scp=ALL was requested. 105 | - rc 2 106 | * - `#310`_ 107 | - enhancement 108 | - low 109 | - Login using key agent 110 | - rc 1 111 | * - `#331`_ 112 | - enhancement 113 | - low 114 | - Login with password fails even with correct credentials (confirmed by sshclient) 115 | - rc 2 116 | * - `#334`_ 117 | - enhancement 118 | - low 119 | - Add SSH Agent Forwarding to command execution 120 | - rc 2 121 | * - `#335`_ 122 | - enhancement 123 | - low 124 | - Add socket support with ProxyCommand 125 | - rc 3 126 | 127 | Altogether 12 issues. View on the `issue tracker `__. 128 | 129 | .. _#304: https://github.com/MarketSquare/SSHLibrary/issues/304 130 | .. _#318: https://github.com/MarketSquare/SSHLibrary/issues/318 131 | .. _#243: https://github.com/MarketSquare/SSHLibrary/issues/243 132 | .. _#285: https://github.com/MarketSquare/SSHLibrary/issues/285 133 | .. _#278: https://github.com/MarketSquare/SSHLibrary/issues/278 134 | .. _#292: https://github.com/MarketSquare/SSHLibrary/issues/292 135 | .. _#312: https://github.com/MarketSquare/SSHLibrary/issues/312 136 | .. _#329: https://github.com/MarketSquare/SSHLibrary/issues/329 137 | .. _#310: https://github.com/MarketSquare/SSHLibrary/issues/310 138 | .. _#331: https://github.com/MarketSquare/SSHLibrary/issues/331 139 | .. _#334: https://github.com/MarketSquare/SSHLibrary/issues/334 140 | .. _#335: https://github.com/MarketSquare/SSHLibrary/issues/335 141 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.4.0rc4.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.4.0 Release Candidate 4 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.4.0rc4 is a new release with 11 | several enhancements and bug fixes. 12 | All issues targeted for SSHLibrary v3.4.0 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --pre --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.4.0rc4 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.4.0rc4 was released on Thursday August 29, 2019. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.4.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Acknowledgements 44 | ================ 45 | 46 | Thank you all for your great contributions: 47 | 48 | - @StefanMewa: It's possible to switch to already closed connection (`#304`_, rc 1) 49 | - @Noordsestern: [SFTP] `create remote file` fails when server denies chmod command (`#312`_, rc 2) 50 | - @mika-b: Get File attempts to open SFTP connection even when scp=ALL was requested. (`#329`_, rc 2) 51 | - @bachng2017: Login with password fails even with correct credentials (confirmed by sshclient) (`#331`_, rc 2) 52 | - @jsdobkin: Add SSH Agent Forwarding to command execution (`#334`_, rc 2) 53 | - @bachng2017: Add socket support with ProxyCommand (`#335`_, rc 3) 54 | 55 | Full list of fixes and enhancements 56 | =================================== 57 | 58 | .. list-table:: 59 | :header-rows: 1 60 | 61 | * - ID 62 | - Type 63 | - Priority 64 | - Summary 65 | - Added 66 | * - `#304`_ 67 | - bug 68 | - medium 69 | - It's possible to switch to already closed connection 70 | - rc 1 71 | * - `#318`_ 72 | - bug 73 | - medium 74 | - Read output command generates Type Error 75 | - rc 1 76 | * - `#243`_ 77 | - enhancement 78 | - medium 79 | - Create Local Ssh Tunnel keyword gives no info about the success/failure of the Keyword 80 | - rc 1 81 | * - `#285`_ 82 | - enhancement 83 | - medium 84 | - SSH subsystem invocation 85 | - rc 1 86 | * - `#278`_ 87 | - bug 88 | - low 89 | - SSH Tunneling does not work on Python 2.7 Windows 90 | - rc 2 91 | * - `#292`_ 92 | - bug 93 | - low 94 | - Support ANSI escape sequences 95 | - rc 2 96 | * - `#312`_ 97 | - bug 98 | - low 99 | - [SFTP] `create remote file` fails when server denies chmod command 100 | - rc 2 101 | * - `#329`_ 102 | - bug 103 | - low 104 | - Get File attempts to open SFTP connection even when scp=ALL was requested. 105 | - rc 2 106 | * - `#310`_ 107 | - enhancement 108 | - low 109 | - Login using key agent 110 | - rc 1 111 | * - `#331`_ 112 | - enhancement 113 | - low 114 | - Login with password fails even with correct credentials (confirmed by sshclient) 115 | - rc 2 116 | * - `#333`_ 117 | - bug 118 | - high 119 | - `Write` keyword hangs in teardown if authentication failed 120 | - rc 4 121 | * - `#334`_ 122 | - enhancement 123 | - low 124 | - Add SSH Agent Forwarding to command execution 125 | - rc 2 126 | * - `#335`_ 127 | - enhancement 128 | - low 129 | - Add socket support with ProxyCommand 130 | - rc 3 131 | 132 | Altogether 12 issues. View on the `issue tracker `__. 133 | 134 | .. _#304: https://github.com/MarketSquare/SSHLibrary/issues/304 135 | .. _#318: https://github.com/MarketSquare/SSHLibrary/issues/318 136 | .. _#243: https://github.com/MarketSquare/SSHLibrary/issues/243 137 | .. _#285: https://github.com/MarketSquare/SSHLibrary/issues/285 138 | .. _#278: https://github.com/MarketSquare/SSHLibrary/issues/278 139 | .. _#292: https://github.com/MarketSquare/SSHLibrary/issues/292 140 | .. _#312: https://github.com/MarketSquare/SSHLibrary/issues/312 141 | .. _#329: https://github.com/MarketSquare/SSHLibrary/issues/329 142 | .. _#310: https://github.com/MarketSquare/SSHLibrary/issues/310 143 | .. _#331: https://github.com/MarketSquare/SSHLibrary/issues/331 144 | .. _#333: https://github.com/MarketSquare/SSHLibrary/issues/333 145 | .. _#334: https://github.com/MarketSquare/SSHLibrary/issues/334 146 | .. _#335: https://github.com/MarketSquare/SSHLibrary/issues/335 147 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.5.0.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.5.0 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.5.0 is a new release with jump-host functionality and other enhancements and bug fixes. 11 | All issues targeted for SSHLibrary v3.5.0 can be found from 12 | the `issue tracker`_. 13 | 14 | If you have pip_ installed, just run 15 | 16 | :: 17 | 18 | pip install --upgrade robotframework-sshlibrary 19 | 20 | to install the latest release or use 21 | 22 | :: 23 | 24 | pip install robotframework-sshlibrary==3.5.0 25 | 26 | to install exactly this version. Alternatively you can download the source 27 | distribution from PyPI_ and install it manually. 28 | 29 | SSHLibrary 3.5.0 was released on Monday September 14, 2020. 30 | 31 | .. _Robot Framework: http://robotframework.org 32 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 33 | .. _pip: http://pip-installer.org 34 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 35 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.5.0 36 | 37 | 38 | .. contents:: 39 | :depth: 2 40 | :local: 41 | 42 | Acknowledgements 43 | ================ 44 | 45 | - @freddebacker for SSHLibrary.Read Until with command which produces long output (`#151`_) 46 | - @jsdobkin for Jump host functionality (`#356`_) 47 | - @tirkarthi for Deprecation warning due to invalid escape sequences in Python 3.7 (`#341`_) 48 | 49 | Full list of fixes and enhancements 50 | =================================== 51 | 52 | .. list-table:: 53 | :header-rows: 1 54 | 55 | * - ID 56 | - Type 57 | - Priority 58 | - Summary 59 | * - `#151`_ 60 | - enhancement 61 | - high 62 | - SSHLibrary.Read Until with command which produces long output 63 | * - `#349`_ 64 | - bug 65 | - medium 66 | - Incorrect Read Command Output INFO Message for Multiple Connections 67 | * - `#121`_ 68 | - enhancement 69 | - medium 70 | - "Open Connection" allows duplicate aliases 71 | * - `#323`_ 72 | - enhancement 73 | - medium 74 | - Add Login With Agent keyword 75 | * - `#340`_ 76 | - enhancement 77 | - medium 78 | - Get stdout/stderr after Execute Command was interrupted by timeout 79 | * - `#348`_ 80 | - enhancement 81 | - medium 82 | - Allow showing console output with Execute Command 83 | * - `#356`_ 84 | - enhancement 85 | - medium 86 | - Jump host functionality 87 | * - `#341`_ 88 | - enhancement 89 | - low 90 | - Deprecation warning due to invalid escape sequences in Python 3.7 91 | 92 | Altogether 8 issues. View on the `issue tracker `__. 93 | 94 | .. _#151: https://github.com/MarketSquare/SSHLibrary/issues/151 95 | .. _#349: https://github.com/MarketSquare/SSHLibrary/issues/349 96 | .. _#121: https://github.com/MarketSquare/SSHLibrary/issues/121 97 | .. _#323: https://github.com/MarketSquare/SSHLibrary/issues/323 98 | .. _#340: https://github.com/MarketSquare/SSHLibrary/issues/340 99 | .. _#348: https://github.com/MarketSquare/SSHLibrary/issues/348 100 | .. _#356: https://github.com/MarketSquare/SSHLibrary/issues/356 101 | .. _#341: https://github.com/MarketSquare/SSHLibrary/issues/341 102 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.5.0rc1.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.5.0 Release Candidate 1 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.5.0rc1 is a new release with 11 | jump-host functionality and other enhancements and bug fixes. 12 | All issues targeted for SSHLibrary v3.5.0 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --pre --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.5.0rc1 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.5.0rc1 was released on Thursday September 3, 2020. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.5.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Acknowledgements 44 | ================ 45 | 46 | Big thank you to the following contributors from the community: 47 | 48 | - @freddebacker for SSHLibrary.Read Until with command which produces long output (`#151`_, rc 1) 49 | - @jsdobkin for Jump host functionality (`#356`_, rc 1) 50 | - @tirkarthi for Deprecation warning due to invalid escape sequences in Python 3.7 (`#341`_, rc 1) 51 | 52 | Full list of fixes and enhancements 53 | =================================== 54 | 55 | .. list-table:: 56 | :header-rows: 1 57 | 58 | * - ID 59 | - Type 60 | - Priority 61 | - Summary 62 | - Added 63 | * - `#151`_ 64 | - enhancement 65 | - high 66 | - SSHLibrary.Read Until with command which produces long output 67 | - rc 1 68 | * - `#349`_ 69 | - bug 70 | - medium 71 | - Incorrect Read Command Output INFO Message for Multiple Connections 72 | - rc 1 73 | * - `#121`_ 74 | - enhancement 75 | - medium 76 | - "Open Connection" allows duplicate aliases 77 | - rc 1 78 | * - `#323`_ 79 | - enhancement 80 | - medium 81 | - Add Login With Agent keyword 82 | - rc 1 83 | * - `#340`_ 84 | - enhancement 85 | - medium 86 | - Get stdout/stderr after Execute Command was interrupted by timeout 87 | - rc 1 88 | * - `#348`_ 89 | - enhancement 90 | - medium 91 | - Allow showing console output with Execute Command 92 | - rc 1 93 | * - `#356`_ 94 | - enhancement 95 | - medium 96 | - Jump host functionality 97 | - rc 1 98 | * - `#341`_ 99 | - enhancement 100 | - low 101 | - Deprecation warning due to invalid escape sequences in Python 3.7 102 | - rc 1 103 | 104 | Altogether 8 issues. View on the `issue tracker `__. 105 | 106 | .. _#151: https://github.com/MarketSquare/SSHLibrary/issues/151 107 | .. _#349: https://github.com/MarketSquare/SSHLibrary/issues/349 108 | .. _#121: https://github.com/MarketSquare/SSHLibrary/issues/121 109 | .. _#323: https://github.com/MarketSquare/SSHLibrary/issues/323 110 | .. _#340: https://github.com/MarketSquare/SSHLibrary/issues/340 111 | .. _#348: https://github.com/MarketSquare/SSHLibrary/issues/348 112 | .. _#356: https://github.com/MarketSquare/SSHLibrary/issues/356 113 | .. _#341: https://github.com/MarketSquare/SSHLibrary/issues/341 114 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.5.1.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.5.1 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.5.1 is a hotfix release which solves timeout issue with 11 | `Execute Command` keyword. 12 | All issues targeted for SSHLibrary v3.5.1 can be found from 13 | the `issue tracker`_. 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.5.1 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.5.1 was released on Tuesday September 22, 2020. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.5.1 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Full list of fixes and enhancements 44 | =================================== 45 | 46 | .. list-table:: 47 | :header-rows: 1 48 | 49 | * - ID 50 | - Type 51 | - Priority 52 | - Summary 53 | * - `#359`_ 54 | - bug 55 | - critical 56 | - The execute command keyword executes for the duration of the timeout parameter and not the actual command. 57 | 58 | Altogether 1 issue. View on the `issue tracker `__. 59 | 60 | .. _#359: https://github.com/MarketSquare/SSHLibrary/issues/359 61 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.6.0.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.6.0 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.6.0 is a new release with several enhancements and bug fixes. 11 | All issues targeted for SSHLibrary v3.6.0 can be found from 12 | the `issue tracker`_. 13 | 14 | If you have pip_ installed, just run 15 | 16 | :: 17 | 18 | pip install --upgrade robotframework-sshlibrary 19 | 20 | to install the latest release or use 21 | 22 | :: 23 | 24 | pip install robotframework-sshlibrary==3.6.0 25 | 26 | to install exactly this version. Alternatively you can download the source 27 | distribution from PyPI_ and install it manually. 28 | 29 | SSHLibrary 3.6.0 was released on Friday December 18, 2020. 30 | 31 | .. _Robot Framework: http://robotframework.org 32 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 33 | .. _pip: http://pip-installer.org 34 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 35 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.5.0 36 | 37 | 38 | .. contents:: 39 | :depth: 2 40 | :local: 41 | 42 | Acknowledgements 43 | ================ 44 | 45 | Big thank you to the following contributors from the community: 46 | 47 | - @kallepokki for Support logins without authentication (`#370`_) 48 | - @mika-b for Extend jump host functionality to password logins (`#369`_) 49 | 50 | Full list of fixes and enhancements 51 | =================================== 52 | 53 | .. list-table:: 54 | :header-rows: 1 55 | 56 | * - ID 57 | - Type 58 | - Priority 59 | - Summary 60 | * - `#354`_ 61 | - enhancement 62 | - medium 63 | - Presence of SSH config file breaks plain host connections 64 | * - `#357`_ 65 | - bug 66 | - high 67 | - Execute command with sudo appends incorrect newline to output 68 | * - `#358`_ 69 | - enhancement 70 | - medium 71 | - add support to preserve original timestamps (scp -p) 72 | * - `#369`_ 73 | - enhancement 74 | - medium 75 | - Extend jump host functionality to password logins 76 | * - `#370`_ 77 | - enhancement 78 | - medium 79 | - Support logins without authentication 80 | 81 | Altogether 5 issues. View on the `issue tracker `__. 82 | 83 | .. _#354: https://github.com/MarketSquare/SSHLibrary/issues/354 84 | .. _#357: https://github.com/MarketSquare/SSHLibrary/issues/357 85 | .. _#358: https://github.com/MarketSquare/SSHLibrary/issues/358 86 | .. _#369: https://github.com/MarketSquare/SSHLibrary/issues/369 87 | .. _#370: https://github.com/MarketSquare/SSHLibrary/issues/370 88 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.6.0rc1.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.6.0 Release Candidate 1 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.6.0rc1 is a new release with several enhancements and bug fixes. 11 | All issues targeted for SSHLibrary v3.6.0 can be found from 12 | the `issue tracker`_. 13 | 14 | If you have pip_ installed, just run 15 | 16 | :: 17 | 18 | pip install --pre --upgrade robotframework-sshlibrary 19 | 20 | to install the latest release or use 21 | 22 | :: 23 | 24 | pip install robotframework-sshlibrary==3.6.0rc1 25 | 26 | to install exactly this version. Alternatively you can download the source 27 | distribution from PyPI_ and install it manually. 28 | 29 | SSHLibrary 3.6.0rc1 was released on Wednesday December 9, 2020. 30 | 31 | .. _Robot Framework: http://robotframework.org 32 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 33 | .. _pip: http://pip-installer.org 34 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 35 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.5.0 36 | 37 | 38 | .. contents:: 39 | :depth: 2 40 | :local: 41 | 42 | Acknowledgements 43 | ================ 44 | 45 | Big thank you to the following contributors from the community: 46 | 47 | - @kallepokki for Support logins without authentication (`#370`_, rc 1) 48 | - @mika-b for Extend jump host functionality to password logins (`#369`_, rc 1) 49 | 50 | Full list of fixes and enhancements 51 | =================================== 52 | 53 | .. list-table:: 54 | :header-rows: 1 55 | 56 | * - ID 57 | - Type 58 | - Priority 59 | - Summary 60 | - Added 61 | * - `#354`_ 62 | - enhancement 63 | - medium 64 | - Presence of SSH config file breaks plain host connections 65 | - rc 1 66 | * - `#357`_ 67 | - bug 68 | - high 69 | - Execute command with sudo appends incorrect newline to output 70 | - rc 1 71 | * - `#358`_ 72 | - enhancement 73 | - medium 74 | - add support to preserve original timestamps (scp -p) 75 | - rc 1 76 | * - `#369`_ 77 | - enhancement 78 | - medium 79 | - Extend jump host functionality to password logins 80 | - rc 1 81 | * - `#370`_ 82 | - enhancement 83 | - medium 84 | - Support logins without authentication 85 | - rc 1 86 | 87 | Altogether 5 issues. View on the `issue tracker `__. 88 | 89 | .. _#354: https://github.com/MarketSquare/SSHLibrary/issues/354 90 | .. _#357: https://github.com/MarketSquare/SSHLibrary/issues/357 91 | .. _#358: https://github.com/MarketSquare/SSHLibrary/issues/358 92 | .. _#369: https://github.com/MarketSquare/SSHLibrary/issues/369 93 | .. _#370: https://github.com/MarketSquare/SSHLibrary/issues/370 94 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.7.0.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.7.0 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.7.0 is a new release that improves performance when 11 | running Read Until keywords but also has several enhancements and 12 | bugfixes. 13 | All issues targeted for SSHLibrary v3.7.0 can be found from 14 | the `issue tracker`_. 15 | 16 | If you have pip_ installed, just run 17 | 18 | :: 19 | 20 | pip install --upgrade robotframework-sshlibrary 21 | 22 | to install the latest release or use 23 | 24 | :: 25 | 26 | pip install robotframework-sshlibrary==3.7.0 27 | 28 | to install exactly this version. Alternatively you can download the source 29 | distribution from PyPI_ and install it manually. 30 | 31 | SSHLibrary 3.7.0 was released on Monday July 5, 2021. 32 | 33 | .. _Robot Framework: http://robotframework.org 34 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 35 | .. _pip: http://pip-installer.org 36 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 37 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.7.0 38 | 39 | 40 | .. contents:: 41 | :depth: 2 42 | :local: 43 | 44 | Full list of fixes and enhancements 45 | =================================== 46 | 47 | .. list-table:: 48 | :header-rows: 1 49 | 50 | * - ID 51 | - Type 52 | - Priority 53 | - Summary 54 | * - `#129`_ 55 | - bug 56 | - medium 57 | - Read gets in endless loop after encountering invalid encoding 58 | * - `#376`_ 59 | - bug 60 | - medium 61 | - Unable to use 'Put File' with wildcard and scp=ALL 62 | * - `#368`_ 63 | - enhancement 64 | - medium 65 | - Support main options from SSH config file 66 | * - `#379`_ 67 | - enhancement 68 | - medium 69 | - Reconnect Keyword 70 | * - `#384`_ 71 | - bug 72 | - low 73 | - Get Directory failing when getting sub folders from Linux to local Windows 74 | 75 | Altogether 5 issues. View on the `issue tracker `__. 76 | 77 | .. _#129: https://github.com/MarketSquare/SSHLibrary/issues/129 78 | .. _#376: https://github.com/MarketSquare/SSHLibrary/issues/376 79 | .. _#368: https://github.com/MarketSquare/SSHLibrary/issues/368 80 | .. _#379: https://github.com/MarketSquare/SSHLibrary/issues/379 81 | .. _#384: https://github.com/MarketSquare/SSHLibrary/issues/384 82 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.7.0rc1.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.7.0 Release Candidate 1 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.7.0rc1 is a new release with several enhancements and bug fixes. 11 | All issues targeted for SSHLibrary v3.7.0 can be found from 12 | the `issue tracker`_. 13 | 14 | If you have pip_ installed, just run 15 | 16 | :: 17 | 18 | pip install --pre --upgrade robotframework-sshlibrary 19 | 20 | to install the latest release or use 21 | 22 | :: 23 | 24 | pip install robotframework-sshlibrary==3.7.0rc1 25 | 26 | to install exactly this version. Alternatively you can download the source 27 | distribution from PyPI_ and install it manually. 28 | 29 | SSHLibrary 3.7.0rc1 was released on Monday April 19, 2021. 30 | 31 | .. _Robot Framework: http://robotframework.org 32 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 33 | .. _pip: http://pip-installer.org 34 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 35 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.7.0 36 | 37 | 38 | .. contents:: 39 | :depth: 2 40 | :local: 41 | 42 | Full list of fixes and enhancements 43 | =================================== 44 | 45 | .. list-table:: 46 | :header-rows: 1 47 | 48 | * - ID 49 | - Type 50 | - Priority 51 | - Summary 52 | - Added 53 | * - `#129`_ 54 | - bug 55 | - medium 56 | - Read gets in endless loop after encountering invalid encoding 57 | - rc 1 58 | * - `#376`_ 59 | - bug 60 | - medium 61 | - Unable to use 'Put File' with wildcard and scp=ALL 62 | - rc 1 63 | * - `#368`_ 64 | - enhancement 65 | - medium 66 | - Support main options from SSH config file 67 | - rc 1 68 | * - `#379`_ 69 | - enhancement 70 | - medium 71 | - Reconnect Keyword 72 | - rc 1 73 | 74 | Altogether 4 issues. View on the `issue tracker `__. 75 | 76 | .. _#129: https://github.com/MarketSquare/SSHLibrary/issues/129 77 | .. _#376: https://github.com/MarketSquare/SSHLibrary/issues/376 78 | .. _#368: https://github.com/MarketSquare/SSHLibrary/issues/368 79 | .. _#379: https://github.com/MarketSquare/SSHLibrary/issues/379 80 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.7.0rc2.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.7.0 Release Candidate 2 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.7.0rc2 is a new release that fixes an encoding bug in `#129`_. 11 | All issues targeted for SSHLibrary v3.7.0 can be found from 12 | the `issue tracker`_. 13 | 14 | 15 | If you have pip_ installed, just run 16 | 17 | :: 18 | 19 | pip install --pre --upgrade robotframework-sshlibrary 20 | 21 | to install the latest release or use 22 | 23 | :: 24 | 25 | pip install robotframework-sshlibrary==3.7.0rc2 26 | 27 | to install exactly this version. Alternatively you can download the source 28 | distribution from PyPI_ and install it manually. 29 | 30 | SSHLibrary 3.7.0rc2 was released on Tuesday May 4, 2021. 31 | 32 | .. _Robot Framework: http://robotframework.org 33 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 34 | .. _pip: http://pip-installer.org 35 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 36 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.7.0 37 | 38 | 39 | .. contents:: 40 | :depth: 2 41 | :local: 42 | 43 | Full list of fixes and enhancements 44 | =================================== 45 | 46 | .. list-table:: 47 | :header-rows: 1 48 | 49 | * - ID 50 | - Type 51 | - Priority 52 | - Summary 53 | - Added 54 | * - `#129`_ 55 | - bug 56 | - medium 57 | - Read gets in endless loop after encountering invalid encoding 58 | - rc 1 59 | * - `#376`_ 60 | - bug 61 | - medium 62 | - Unable to use 'Put File' with wildcard and scp=ALL 63 | - rc 1 64 | * - `#368`_ 65 | - enhancement 66 | - medium 67 | - Support main options from SSH config file 68 | - rc 1 69 | * - `#379`_ 70 | - enhancement 71 | - medium 72 | - Reconnect Keyword 73 | - rc 1 74 | 75 | Altogether 4 issues. View on the `issue tracker `__. 76 | 77 | .. _#129: https://github.com/MarketSquare/SSHLibrary/issues/129 78 | .. _#376: https://github.com/MarketSquare/SSHLibrary/issues/376 79 | .. _#368: https://github.com/MarketSquare/SSHLibrary/issues/368 80 | .. _#379: https://github.com/MarketSquare/SSHLibrary/issues/379 81 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.7.0rc3.rst: -------------------------------------------------------------------------------- 1 | ==================================== 2 | SSHLibrary 3.7.0 Release Candidate 3 3 | ==================================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.7.0rc3 is a new release that fixes longpath filenames 11 | with Windows and improves performance when running Read Until 12 | keywords. 13 | All issues targeted for SSHLibrary v3.7.0 can be found from 14 | the `issue tracker`_. 15 | 16 | If you have pip_ installed, just run 17 | 18 | :: 19 | 20 | pip install --pre --upgrade robotframework-sshlibrary 21 | 22 | to install the latest release or use 23 | 24 | :: 25 | 26 | pip install robotframework-sshlibrary==3.7.0rc3 27 | 28 | to install exactly this version. Alternatively you can download the source 29 | distribution from PyPI_ and install it manually. 30 | 31 | SSHLibrary 3.7.0rc3 was released on Wednesday June 16, 2021. 32 | 33 | .. _Robot Framework: http://robotframework.org 34 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 35 | .. _pip: http://pip-installer.org 36 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 37 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.7.0 38 | 39 | 40 | .. contents:: 41 | :depth: 2 42 | :local: 43 | 44 | Full list of fixes and enhancements 45 | =================================== 46 | 47 | .. list-table:: 48 | :header-rows: 1 49 | 50 | * - ID 51 | - Type 52 | - Priority 53 | - Summary 54 | - Added 55 | * - `#129`_ 56 | - bug 57 | - medium 58 | - Read gets in endless loop after encountering invalid encoding 59 | - rc 1 60 | * - `#376`_ 61 | - bug 62 | - medium 63 | - Unable to use 'Put File' with wildcard and scp=ALL 64 | - rc 1 65 | * - `#368`_ 66 | - enhancement 67 | - medium 68 | - Support main options from SSH config file 69 | - rc 1 70 | * - `#379`_ 71 | - enhancement 72 | - medium 73 | - Reconnect Keyword 74 | - rc 1 75 | * - `#384`_ 76 | - bug 77 | - low 78 | - Get Directory failing when getting sub folders from Linux to local Windows 79 | - rc 3 80 | 81 | Altogether 5 issues. View on the `issue tracker `__. 82 | 83 | .. _#129: https://github.com/MarketSquare/SSHLibrary/issues/129 84 | .. _#376: https://github.com/MarketSquare/SSHLibrary/issues/376 85 | .. _#368: https://github.com/MarketSquare/SSHLibrary/issues/368 86 | .. _#379: https://github.com/MarketSquare/SSHLibrary/issues/379 87 | .. _#384: https://github.com/MarketSquare/SSHLibrary/issues/384 88 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.8.0.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | SSHLibrary 3.8.0 3 | ================ 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.8.0 is a new release with several enhancements and bug fixes. 11 | All issues targeted for SSHLibrary v3.8.0 can be found from 12 | the `issue tracker`_. 13 | 14 | If you have pip_ installed, just run 15 | 16 | :: 17 | 18 | pip install --upgrade robotframework-sshlibrary 19 | 20 | to install the latest release or use 21 | 22 | :: 23 | 24 | pip install robotframework-sshlibrary==3.8.0 25 | 26 | to install exactly this version. Alternatively you can download the source 27 | distribution from PyPI_ and install it manually. 28 | 29 | SSHLibrary 3.8.0 was released on Thursday November 18, 2021. 30 | 31 | .. _Robot Framework: http://robotframework.org 32 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 33 | .. _pip: http://pip-installer.org 34 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 35 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.8.0 36 | 37 | 38 | .. contents:: 39 | :depth: 2 40 | :local: 41 | 42 | Full list of fixes and enhancements 43 | =================================== 44 | 45 | .. list-table:: 46 | :header-rows: 1 47 | 48 | * - ID 49 | - Type 50 | - Priority 51 | - Summary 52 | * - `#388`_ 53 | - bug 54 | - medium 55 | - Get File scp=ALL depends on nonstandard utility 56 | * - `#104`_ 57 | - enhancement 58 | - medium 59 | - File Should Exist not allowing GLOB 60 | * - `#350`_ 61 | - enhancement 62 | - low 63 | - execute command with sudo has a potential password exposure 64 | 65 | Altogether 3 issues. View on the `issue tracker `__. 66 | 67 | .. _#388: https://github.com/MarketSquare/SSHLibrary/issues/388 68 | .. _#104: https://github.com/MarketSquare/SSHLibrary/issues/104 69 | .. _#350: https://github.com/MarketSquare/SSHLibrary/issues/350 70 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.8.0rc1.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | SSHLibrary 3.8.0rc1 3 | =================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.8.0rc1 is a new release with several enhancements and bug fixes. 11 | All issues targeted for SSHLibrary v3.8.0 can be found from 12 | the `issue tracker`_. 13 | 14 | If you have pip_ installed, just run 15 | 16 | :: 17 | 18 | pip install --pre --upgrade robotframework-sshlibrary 19 | 20 | to install the latest release or use 21 | 22 | :: 23 | 24 | pip install robotframework-sshlibrary==3.8.0rc1 25 | 26 | to install exactly this version. Alternatively you can download the source 27 | distribution from PyPI_ and install it manually. 28 | 29 | SSHLibrary 3.8.0rc1 was released on Friday November 5, 2021. 30 | 31 | .. _Robot Framework: http://robotframework.org 32 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 33 | .. _pip: http://pip-installer.org 34 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 35 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.8.0 36 | 37 | 38 | .. contents:: 39 | :depth: 2 40 | :local: 41 | 42 | Full list of fixes and enhancements 43 | =================================== 44 | 45 | .. list-table:: 46 | :header-rows: 1 47 | 48 | * - ID 49 | - Type 50 | - Priority 51 | - Summary 52 | - Added 53 | * - `#388`_ 54 | - bug 55 | - medium 56 | - Get File scp=ALL depends on nonstandard utility 57 | - rc 1 58 | * - `#104`_ 59 | - enhancement 60 | - medium 61 | - File Should Exist not allowing GLOB 62 | - rc 1 63 | * - `#350`_ 64 | - enhancement 65 | - low 66 | - execute command with sudo has a potential password exposure 67 | - rc 1 68 | 69 | Altogether 3 issues. View on the `issue tracker `__. 70 | 71 | .. _#388: https://github.com/MarketSquare/SSHLibrary/issues/388 72 | .. _#104: https://github.com/MarketSquare/SSHLibrary/issues/104 73 | .. _#350: https://github.com/MarketSquare/SSHLibrary/issues/350 74 | -------------------------------------------------------------------------------- /docs/SSHLibrary-3.8.1rc1.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | SSHLibrary 3.8.1rc1 3 | =================== 4 | 5 | 6 | .. default-role:: code 7 | 8 | 9 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 10 | SSHLibrary 3.8.1rc1 is a new release with 11 | **UPDATE** enhancements and bug fixes. 12 | All issues targeted for SSHLibrary v3.8.1 can be found from 13 | the `issue tracker`_. 14 | 15 | **REMOVE the previous note about all issues in the tracker with final 16 | releases or otherwise if release notes contain all issues.** 17 | 18 | **ADD more intro stuff if needed...** 19 | 20 | **REMOVE ``--pre`` from the next command with final releases.** 21 | 22 | If you have pip_ installed, just run 23 | 24 | :: 25 | 26 | pip install --pre --upgrade robotframework-sshlibrary 27 | 28 | to install the latest release or use 29 | 30 | :: 31 | 32 | pip install robotframework-sshlibrary==3.8.1rc1 33 | 34 | to install exactly this version. Alternatively you can download the source 35 | distribution from PyPI_ and install it manually. 36 | 37 | SSHLibrary 3.8.1rc1 was released on Thursday May 12, 2022. 38 | 39 | .. _Robot Framework: http://robotframework.org 40 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 41 | .. _pip: http://pip-installer.org 42 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 43 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3Av3.8.1 44 | 45 | 46 | .. contents:: 47 | :depth: 2 48 | :local: 49 | 50 | Most important enhancements 51 | =========================== 52 | 53 | **EXPLAIN** or remove these. 54 | 55 | - SSHLibrary not working with RF`#5`_.0a1 (`#401`_, rc 1) 56 | 57 | Full list of fixes and enhancements 58 | =================================== 59 | 60 | .. list-table:: 61 | :header-rows: 1 62 | 63 | * - ID 64 | - Type 65 | - Priority 66 | - Summary 67 | - Added 68 | * - `#401`_ 69 | - enhancement 70 | - high 71 | - SSHLibrary not working with RF`#5`_.0a1 72 | - rc 1 73 | * - `#374`_ 74 | - bug 75 | - medium 76 | - Library raises Authentication failure, but host accepted it 77 | - rc 1 78 | * - `#412`_ 79 | - bug 80 | - low 81 | - SSH.Execute Command Giving Warning while Inputting Password ${stderr} [sudo] password for supervisor: Sorry, try again 82 | - rc 1 83 | 84 | Altogether 3 issues. View on the `issue tracker `__. 85 | 86 | .. _#401: https://github.com/MarketSquare/SSHLibrary/issues/401 87 | .. _#374: https://github.com/MarketSquare/SSHLibrary/issues/374 88 | .. _#412: https://github.com/MarketSquare/SSHLibrary/issues/412 89 | -------------------------------------------------------------------------------- /docs/extra.css: -------------------------------------------------------------------------------- 1 | /* Additional styles to use with style.css. */ 2 | 3 | .contents li p, table p { 4 | margin: 0; 5 | } 6 | th, td { 7 | padding: 0.2em 0.4em; 8 | border-width: 1px; 9 | border-style: solid; 10 | vertical-align: top; 11 | } 12 | th { 13 | white-space: nowrap; 14 | vertical-align: middle; 15 | } 16 | -------------------------------------------------------------------------------- /requirements-build.txt: -------------------------------------------------------------------------------- 1 | # Requirements needed when generating releases. See BUILD.rst for details. 2 | invoke >= 0.20 3 | rellu >= 0.7 4 | twine 5 | wheel 6 | docutils >= 0.14 7 | pygments 8 | 9 | # Include other dev dependencies from requirements-dev.txt. 10 | -r requirements-dev.txt 11 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | robotframework >= 3.0 2 | robotstatuschecker == 1.5.1 3 | robotbackgroundlogger >= 1.2 4 | robotframework-tidy 5 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import re 4 | from os.path import abspath, dirname, join 5 | from setuptools import setup 6 | 7 | CURDIR = dirname(abspath(__file__)) 8 | REQUIREMENTS = ["robotframework >= 5.0", "paramiko >= 1.15.3", "scp >= 0.13.0"] 9 | with open(join(CURDIR, "src", "SSHLibrary", "version.py")) as f: 10 | VERSION = re.search("\nVERSION = '(.*)'", f.read()).group(1) 11 | with open(join(CURDIR, "README.rst")) as f: 12 | DESCRIPTION = f.read() 13 | CLASSIFIERS = """ 14 | Development Status :: 5 - Production/Stable 15 | License :: OSI Approved :: Apache Software License 16 | Operating System :: OS Independent 17 | Programming Language :: Python 18 | Programming Language :: Python :: 3.8 19 | Programming Language :: Python :: 3.9 20 | Programming Language :: Python :: 3.10 21 | Programming Language :: Python :: 3.11 22 | Programming Language :: Python :: 3.12 23 | Topic :: Software Development :: Testing 24 | Framework :: Robot Framework 25 | Framework :: Robot Framework :: Library 26 | """.strip().splitlines() 27 | 28 | setup( 29 | name="robotframework-sshlibrary", 30 | version=VERSION, 31 | description="Robot Framework test library for SSH and SFTP", 32 | long_description=DESCRIPTION, 33 | author="Markus Stahl", 34 | author_email="markus.i.sverige@gmail.com", 35 | url="https://github.com/MarketSquare/SSHLibrary", 36 | license="Apache License 2.0", 37 | keywords="robotframework testing testautomation ssh sftp", 38 | platforms="any", 39 | classifiers=CLASSIFIERS, 40 | install_requires=REQUIREMENTS, 41 | package_dir={"": "src"}, 42 | packages=["SSHLibrary"], 43 | ) 44 | -------------------------------------------------------------------------------- /src/SSHLibrary/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2008-2015 Nokia Networks 2 | # Copyright 2016- Robot Framework Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | from .client import SSHClient 17 | from .library import SSHLibrary 18 | from .version import VERSION 19 | 20 | 21 | __version__ = VERSION 22 | -------------------------------------------------------------------------------- /src/SSHLibrary/config.py: -------------------------------------------------------------------------------- 1 | # Copyright 2008-2015 Nokia Networks 2 | # Copyright 2016- Robot Framework Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | from robot.utils import is_bytes, secs_to_timestr, timestr_to_secs 17 | 18 | 19 | class ConfigurationException(Exception): 20 | """Raised when creating, updating or accessing a Configuration entry fails. 21 | """ 22 | pass 23 | 24 | 25 | class Configuration(object): 26 | """A simple configuration class. 27 | 28 | Configuration is defined with keyword arguments, in which the value must 29 | be an instance of :py:class:`Entry`. Different subclasses of `Entry` can 30 | be used to handle common types and conversions. 31 | 32 | Example:: 33 | 34 | cfg = Configuration(name=StringEntry('initial'), 35 | age=IntegerEntry('42')) 36 | assert cfg.name == initial 37 | assert cfg.age == 42 38 | cfg.update(name='John Doe') 39 | assert cfg.name == 'John Doe' 40 | """ 41 | def __init__(self, **entries): 42 | self._config = entries 43 | 44 | def __str__(self): 45 | return '\n'.join(f'{k}={v}' for k, v in self._config.items()) 46 | 47 | def update(self, **entries): 48 | """Update configuration entries. 49 | 50 | :param entries: entries to be updated, keyword argument names must 51 | match existing entry names. If any value in `**entries` is None, 52 | the corresponding entry is *not* updated. 53 | 54 | See `__init__` for an example. 55 | """ 56 | for name, value in entries.items(): 57 | if value is not None: 58 | self._config[name].set(value) 59 | 60 | def get(self, name): 61 | """Return entry corresponding to name.""" 62 | return self._config[name] 63 | 64 | def __getattr__(self, name): 65 | if name in self._config: 66 | return self._config[name].value 67 | msg = f"Configuration parameter '{name}' is not defined." 68 | raise ConfigurationException(msg) 69 | 70 | 71 | class Entry(object): 72 | """A base class for values stored in :py:class:`Configuration`. 73 | 74 | :param:`initial` the initial value of this entry. 75 | """ 76 | 77 | def __init__(self, initial=None): 78 | self._value = self._create_value(initial) 79 | 80 | def __str__(self): 81 | return str(self._value) 82 | 83 | @property 84 | def value(self): 85 | return self._value 86 | 87 | def set(self, value): 88 | self._value = self._parse_value(value) 89 | 90 | def _parse_value(self, value): 91 | raise NotImplementedError 92 | 93 | def _create_value(self, value): 94 | if value is None: 95 | return None 96 | return self._parse_value(value) 97 | 98 | 99 | class StringEntry(Entry): 100 | """String value to be stored in :py:class:`Configuration`.""" 101 | 102 | def _parse_value(self, value): 103 | return str(value) 104 | 105 | 106 | class IntegerEntry(Entry): 107 | """Integer value to be stored in stored in :py:class:`Configuration`. 108 | 109 | Given value is converted to string using `int()`. 110 | 111 | """ 112 | def _parse_value(self, value): 113 | return int(value) 114 | 115 | 116 | class TimeEntry(Entry): 117 | """Time string to be stored in :py:class:`Configuration`. 118 | 119 | Given time string will be converted to seconds using 120 | :py:func:`robot.utils.timestr_to_secs`. 121 | 122 | """ 123 | def _parse_value(self, value): 124 | value = str(value) 125 | return timestr_to_secs(value) if value else None 126 | 127 | def __str__(self): 128 | return secs_to_timestr(self._value) 129 | 130 | 131 | class LogLevelEntry(Entry): 132 | """Log level to be stored in :py:class:`Configuration`. 133 | 134 | Given string must be one of 'TRACE', 'DEBUG', 'INFO', 'WARN' or 'NONE' case 135 | insensitively. 136 | """ 137 | LEVELS = ('TRACE', 'DEBUG', 'INFO', 'WARN', 'NONE') 138 | 139 | def _parse_value(self, value): 140 | value = str(value).upper() 141 | if value not in self.LEVELS: 142 | raise ConfigurationException(f"Invalid log level '{value}'.") 143 | return value 144 | 145 | 146 | class NewlineEntry(Entry): 147 | """New line sequence to be stored in :py:class:`Configuration`. 148 | 149 | Following conversion are performed on the given string: 150 | * 'LF' -> '\n' 151 | * 'CR' -> '\r' 152 | """ 153 | 154 | def _parse_value(self, value): 155 | if is_bytes(value): 156 | value = value.decode('ASCII') 157 | value = value.upper() 158 | return value.replace('LF', '\n').replace('CR', '\r') 159 | 160 | -------------------------------------------------------------------------------- /src/SSHLibrary/logger.py: -------------------------------------------------------------------------------- 1 | # Copyright 2008-2015 Nokia Networks 2 | # Copyright 2016- Robot Framework Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | try: 17 | from robotbackgroundlogger import BackgroundLogger 18 | logger = BackgroundLogger() 19 | except ImportError: 20 | from robot.api import logger 21 | -------------------------------------------------------------------------------- /src/SSHLibrary/pythonforward.py: -------------------------------------------------------------------------------- 1 | import select 2 | import socket 3 | import threading 4 | from .logger import logger 5 | 6 | try: 7 | import SocketServer 8 | except ImportError: 9 | import socketserver as SocketServer 10 | 11 | 12 | def check_if_ipv6(ip): 13 | try: 14 | socket.inet_pton(socket.AF_INET6, ip) 15 | return True 16 | except socket.error: 17 | return False 18 | 19 | 20 | class LocalPortForwarding: 21 | def __init__(self, port, host, transport, bind_address): 22 | self.server = None 23 | self.port = port 24 | self.host = host 25 | self.transport = transport 26 | self.bind_address = bind_address 27 | 28 | def forward(self, local_port): 29 | class SubHandler(LocalPortForwardingHandler): 30 | port = self.port 31 | host = self.host 32 | ssh_transport = self.transport 33 | 34 | self.server = ForwardServer((self.bind_address or '', local_port), SubHandler, ipv6=check_if_ipv6(self.host)) 35 | t = threading.Thread(target=self.server.serve_forever) 36 | t.setDaemon(True) 37 | t.start() 38 | logger.info(f"Now forwarding port {local_port} to {self.host}:{self.port} ...") 39 | 40 | def close(self): 41 | if self.server: 42 | self.server.shutdown() 43 | self.server.server_close() 44 | try: 45 | logger.log_background_messages() 46 | except AttributeError: 47 | pass 48 | 49 | 50 | class ForwardServer(SocketServer.ThreadingTCPServer): 51 | daemon_threads = True 52 | allow_reuse_address = True 53 | 54 | def __init__(self, server_address, RequestHandlerClass, ipv6=False): 55 | if ipv6: 56 | ForwardServer.address_family = socket.AF_INET6 57 | SocketServer.ThreadingTCPServer.__init__(self, server_address, RequestHandlerClass, bind_and_activate=True) 58 | 59 | 60 | class LocalPortForwardingHandler(SocketServer.BaseRequestHandler): 61 | host, port, ssh_transport = None, None, None 62 | 63 | def handle(self): 64 | try: 65 | chan = self.ssh_transport.open_channel('direct-tcpip', (self.host, self.port), 66 | self.request.getpeername()) 67 | except Exception as e: 68 | logger.info(f"Incoming request to {self.host}:{self.port} failed: {repr(e)}") 69 | return 70 | if chan is None: 71 | logger.info(f"Incoming request to {self.host}:{self.port} was rejected by the SSH server.") 72 | return 73 | logger.info( 74 | f"Connected! Tunnel open {self.request.getpeername()!r} -> {chan.getpeername()!r} -> {(self.host, self.port)!r}") 75 | while True: 76 | r, w, x = select.select([self.request, chan], [], []) 77 | if self.request in r: 78 | data = self.request.recv(1024) 79 | if len(data) == 0: 80 | break 81 | chan.send(data) 82 | if chan in r: 83 | data = chan.recv(1024) 84 | if len(data) == 0: 85 | break 86 | self.request.send(data) 87 | peername = self.request.getpeername() 88 | chan.close() 89 | self.request.close() 90 | logger.info(f"Tunnel closed from {peername!r}") 91 | -------------------------------------------------------------------------------- /src/SSHLibrary/sshconnectioncache.py: -------------------------------------------------------------------------------- 1 | from robot.utils import ConnectionCache 2 | 3 | 4 | class SSHConnectionCache(ConnectionCache): 5 | def __init__(self): 6 | ConnectionCache.__init__(self, no_current_msg='No open connection.') 7 | 8 | @property 9 | def connections(self): 10 | return self._connections 11 | 12 | @property 13 | def aliases(self): 14 | return self._aliases 15 | 16 | def close_current(self): 17 | connection = self.current 18 | connection.close() 19 | if connection.config.alias is not None: 20 | self.aliases.pop(connection.config.alias) 21 | idx = connection.config.index - 1 22 | self.connections[idx] = self.current = self._no_current 23 | 24 | def close_all(self): 25 | open_connections = (conn for conn in self._connections if conn) 26 | for connection in open_connections: 27 | connection.close() 28 | self.empty_cache() 29 | return self.current 30 | 31 | def get_connection(self, alias_or_index=None): 32 | connection = super(SSHConnectionCache, self).get_connection(alias_or_index) 33 | if not connection: 34 | raise RuntimeError(f"Non-existing index or alias '{alias_or_index}'.") 35 | return connection 36 | -------------------------------------------------------------------------------- /src/SSHLibrary/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2008-2015 Nokia Networks 2 | # Copyright 2016- Robot Framework Foundation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | VERSION = '3.8.1rc2.dev1' 17 | -------------------------------------------------------------------------------- /tasks.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from pathlib import Path 3 | 4 | from docutils.core import publish_cmdline 5 | from invoke import task 6 | from rellu import initialize_labels, ReleaseNotesGenerator, Version 7 | from rellu.tasks import clean 8 | from robot.libdoc import libdoc 9 | 10 | 11 | assert Path.cwd() == Path(__file__).parent 12 | 13 | 14 | REPOSITORY = "MarketSquare/SSHLibrary" 15 | VERSION_PATH = Path("src/SSHLibrary/version.py") 16 | VERSION_PATTERN = "VERSION = '(.*)'" 17 | RELEASE_NOTES_PATH = Path("docs/SSHLibrary-{version}.rst") 18 | RELEASE_NOTES_TITLE = "SSHLibrary {version}" 19 | RELEASE_NOTES_INTRO = """ 20 | SSHLibrary_ is a `Robot Framework`_ test library for SSH and SFTP. 21 | SSHLibrary {version} is a new release with 22 | **UPDATE** enhancements and bug fixes. 23 | All issues targeted for SSHLibrary {version.milestone} can be found from 24 | the `issue tracker`_. 25 | 26 | **REMOVE the previous note about all issues in the tracker with final 27 | releases or otherwise if release notes contain all issues.** 28 | 29 | **ADD more intro stuff if needed...** 30 | 31 | **REMOVE ``--pre`` from the next command with final releases.** 32 | 33 | If you have pip_ installed, just run 34 | 35 | :: 36 | 37 | pip install --pre --upgrade robotframework-sshlibrary 38 | 39 | to install the latest release or use 40 | 41 | :: 42 | 43 | pip install robotframework-sshlibrary=={version} 44 | 45 | to install exactly this version. Alternatively you can download the source 46 | distribution from PyPI_ and install it manually. 47 | 48 | SSHLibrary {version} was released on {date}. 49 | 50 | .. _Robot Framework: http://robotframework.org 51 | .. _SSHLibrary: https://github.com/MarketSquare/SSHLibrary 52 | .. _pip: http://pip-installer.org 53 | .. _PyPI: https://pypi.python.org/pypi/robotframework-sshlibrary 54 | .. _issue tracker: https://github.com/MarketSquare/SSHLibrary/issues?q=milestone%3A{version.milestone} 55 | """ 56 | 57 | 58 | @task 59 | def kw_docs(ctx): 60 | """Generates the library keyword documentation 61 | 62 | Documentation is generated by using the Libdoc tool. 63 | """ 64 | libdoc(str(Path("src/SSHLibrary")), str(Path("docs/SSHLibrary.html"))) 65 | 66 | 67 | @task 68 | def project_docs(ctx): 69 | """Generate project documentation. 70 | 71 | These docs are visible at http://robotframework.org/SSHLibrary/. 72 | """ 73 | args = [ 74 | "--stylesheet=style.css,extra.css", 75 | "--link-stylesheet", 76 | "README.rst", 77 | "docs/index.html", 78 | ] 79 | publish_cmdline(writer_name="html5", argv=args) 80 | print(Path(args[-1]).absolute()) 81 | 82 | 83 | @task 84 | def set_version(ctx, version): 85 | """Set project version in `src/SSHLibrary/version.py`` file. 86 | 87 | Args: 88 | version: Project version to set or ``dev`` to set development version. 89 | 90 | Following PEP-440 compatible version numbers are supported: 91 | - Final version like 3.0 or 3.1.2. 92 | - Alpha, beta or release candidate with ``a``, ``b`` or ``rc`` postfix, 93 | respectively, and an incremented number like 3.0a1 or 3.0.1rc1. 94 | - Development version with ``.dev`` postfix and an incremented number like 95 | 3.0.dev1 or 3.1a1.dev2. 96 | 97 | When the given version is ``dev``, the existing version number is updated 98 | to the next suitable development version. For example, 3.0 -> 3.0.1.dev1, 99 | 3.1.1 -> 3.1.2.dev1, 3.2a1 -> 3.2a2.dev1, 3.2.dev1 -> 3.2.dev2. 100 | """ 101 | version = Version(version, VERSION_PATH, VERSION_PATTERN) 102 | version.write() 103 | print(version) 104 | 105 | 106 | @task 107 | def print_version(ctx): 108 | """Print the current project version.""" 109 | print(Version(path=VERSION_PATH, pattern=VERSION_PATTERN)) 110 | 111 | 112 | @task 113 | def release_notes(ctx, version=None, username=None, password=None, write=False): 114 | """Generates release notes based on issues in the issue tracker. 115 | 116 | Args: 117 | version: Generate release notes for this version. If not given, 118 | generated them for the current version. 119 | username: GitHub username. 120 | password: GitHub password. 121 | write: When set to True, write release notes to a file overwriting 122 | possible existing file. Otherwise just print them to the 123 | terminal. 124 | 125 | Username and password can also be specified using ``GITHUB_USERNAME`` and 126 | ``GITHUB_PASSWORD`` environment variable, respectively. If they aren't 127 | specified at all, communication with GitHub is anonymous and typically 128 | pretty slow. 129 | """ 130 | version = Version(version, VERSION_PATH, VERSION_PATTERN) 131 | file = RELEASE_NOTES_PATH if write else sys.stdout 132 | generator = ReleaseNotesGenerator( 133 | REPOSITORY, RELEASE_NOTES_TITLE, RELEASE_NOTES_INTRO 134 | ) 135 | generator.generate(version, username, password, file) 136 | 137 | 138 | @task 139 | def init_labels(ctx, username=None, password=None): 140 | """Initialize project by setting labels in the issue tracker. 141 | 142 | Args: 143 | username: GitHub username. 144 | password: GitHub password. 145 | 146 | Username and password can also be specified using ``GITHUB_USERNAME`` and 147 | ``GITHUB_PASSWORD`` environment variable, respectively. 148 | 149 | Should only be executed once when taking ``rellu`` tooling to use or 150 | when labels it uses have changed. 151 | """ 152 | initialize_labels(REPOSITORY, username, password) 153 | --------------------------------------------------------------------------------