[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests: torture_connect: warn if ssh is not running on localhost
[Thread Prev] | [Thread Next]
- Subject: [PATCH] tests: torture_connect: warn if ssh is not running on localhost
- From: Luka Perkov <luka.perkov@xxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Fri, 14 Mar 2014 12:17:34 +0000
- To: libssh@xxxxxxxxxx
- Cc: Luka Perkov <luka.perkov@xxxxxxxxxx>
While at it make some trivial style fixes. Signed-off-by: Luka Perkov <luka.perkov@xxxxxxxxxx> --- tests/client/torture_connect.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/client/torture_connect.c b/tests/client/torture_connect.c index 0e23fcd..fb94bb5 100644 --- a/tests/client/torture_connect.c +++ b/tests/client/torture_connect.c @@ -54,12 +54,14 @@ static void torture_connect_nonblocking(void **state) { ssh_set_blocking(session,0); do { - rc = ssh_connect(session); - assert_true(rc != SSH_ERROR); + rc = ssh_connect(session); + if (rc == SSH_ERROR) { + print_message("*** make sure that ssh is listening on %s\n", HOST); + } + assert_true(rc != SSH_ERROR); } while(rc == SSH_AGAIN); - assert_true(rc==SSH_OK); - + assert_true(rc == SSH_OK); } static void torture_connect_timeout(void **state) { @@ -102,10 +104,9 @@ static void torture_connect_double(void **state) { rc = ssh_connect(session); assert_true(rc == SSH_OK); - } -static void torture_connect_failure(void **state){ +static void torture_connect_failure(void **state) { /* * The intent of this test is to check that a fresh * ssh_new/ssh_disconnect/ssh_free sequence doesn't crash/leak @@ -114,6 +115,7 @@ static void torture_connect_failure(void **state){ ssh_session session = *state; ssh_disconnect(session); } + int torture_run_tests(void) { int rc; const UnitTest tests[] = { -- 1.9.0
Archive administrator: postmaster@lists.cynapses.org