https://github.com/redhatqe/ssh-tools
SSH utilities
https://github.com/redhatqe/ssh-tools
Last synced: 7 months ago
JSON representation
SSH utilities
- Host: GitHub
- URL: https://github.com/redhatqe/ssh-tools
- Owner: RedHatQE
- License: gpl-3.0
- Created: 2012-05-10T20:49:41.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2024-03-13T20:53:30.000Z (almost 2 years ago)
- Last Synced: 2025-05-07T19:47:32.824Z (8 months ago)
- Language: Java
- Size: 417 KB
- Stars: 1
- Watchers: 7
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
- License: LICENSE
Awesome Lists containing this project
README
# SSH tools for automated testing
Contains some extensions to a SSH library that make running remote command easier (see **SSHCommandRunner**).
Allows running commands on remote host and returning separate stdout, stderr. Also has some functions to copy and move files
from one host to another (see **RemoteFileTasks**).
## Prerequisities of testing
- ssh into a test server to accept a server key
```shell
ssh root@my-server.domain.com
```
- copy a test key to the test server
```shell
ssh-copy-id -i src/test/resources/test_rsa.pub root@my-server.domain.com
```
- try to use the key with ssh
```shell
ssh -i src/test/resources/test_rsa root@my-server.domain.com
```
## Testing
Most tests are written in `clojure`. You can see them in `src/test/clojure`. Or see `src/test/java` for junit tests.
Configuration of tests is placed in `src/test/resources`.
The vulnerable part of config file is read from a system environment.
```shell
export SERVER_HOSTNAME="some-rserver.domain.com"
export SERVER_USER="root"
export SERVER_PASSWORD="user-password"
export PRIVATE_KEY_PASSWORD="key-password"
lein test-refresh
```
## Emergency Timeout
There is a way to set a default `emergencyTimeoutMS` variable.
You can use a system property `ssh.emergencyTimeoutMS` to do so.
```java
java -Dssh.emergencyTimeoutMS=10000 run-this.java```