summaryrefslogtreecommitdiffstats
path: root/tests/torture.c
diff options
context:
space:
mode:
authorAlan Dunn <amdunn@gmail.com>2014-04-19 14:27:48 -0500
committerAndreas Schneider <asn@cryptomilk.org>2015-01-20 19:41:53 +0100
commitf4154c503b4f16e318853a4ef028295558798655 (patch)
tree83ff50223c44ebe1c9e3c6fc3e6136f6d736c821 /tests/torture.c
parent8db4520d891249b287cc246626635dd550fb3e42 (diff)
downloadlibssh-f4154c503b4f16e318853a4ef028295558798655.tar.gz
libssh-f4154c503b4f16e318853a4ef028295558798655.tar.xz
libssh-f4154c503b4f16e318853a4ef028295558798655.zip
tests: Add port option to torture_ssh_session
Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/torture.c')
-rw-r--r--tests/torture.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/torture.c b/tests/torture.c
index 2ba5556c..74640031 100644
--- a/tests/torture.c
+++ b/tests/torture.c
@@ -315,6 +315,7 @@ int torture_isdir(const char *path) {
}
ssh_session torture_ssh_session(const char *host,
+ const unsigned int *port,
const char *user,
const char *password) {
ssh_session session;
@@ -334,6 +335,12 @@ ssh_session torture_ssh_session(const char *host,
goto failed;
}
+ if (port != NULL) {
+ if (ssh_options_set(session, SSH_OPTIONS_PORT, port) < 0) {
+ goto failed;
+ }
+ }
+
if (user != NULL) {
if (ssh_options_set(session, SSH_OPTIONS_USER, user) < 0) {
goto failed;