aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2011-09-23 22:33:21 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2011-09-23 22:33:21 +0200
commit717840fc09d1e42b1f924af9b9730eb070362d34 (patch)
treed8a7a8fbd0d5d549538b0b903630d77a54730ddc
parent046aa02f39947fff16dff6cfe6db6dcf53fb6d96 (diff)
downloadlibssh-717840fc09d1e42b1f924af9b9730eb070362d34.tar.gz
libssh-717840fc09d1e42b1f924af9b9730eb070362d34.tar.xz
libssh-717840fc09d1e42b1f924af9b9730eb070362d34.zip
torture: check for presence of ssh agent
-rw-r--r--tests/client/torture_auth.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/client/torture_auth.c b/tests/client/torture_auth.c
index 4fbcf58..83bbd40 100644
--- a/tests/client/torture_auth.c
+++ b/tests/client/torture_auth.c
@@ -25,6 +25,7 @@
#include "libssh/libssh.h"
#include "libssh/priv.h"
#include "libssh/session.h"
+#include "agent.c"
static void setup(void **state) {
int verbosity = torture_libssh_verbosity();
@@ -288,7 +289,10 @@ static void torture_auth_agent(void **state) {
" to enable this test!!\n");
return;
}
-
+ if (!agent_is_running(session)){
+ print_message("*** Agent not running. Test ignored");
+ return;
+ }
rc = ssh_options_set(session, SSH_OPTIONS_USER, user);
assert_true(rc == SSH_OK);
@@ -316,7 +320,10 @@ static void torture_auth_agent_nonblocking(void **state) {
" to enable this test!!\n");
return;
}
-
+ if (!agent_is_running(session)){
+ print_message("*** Agent not running. Test ignored");
+ return;
+ }
rc = ssh_options_set(session, SSH_OPTIONS_USER, user);
assert_true(rc == SSH_OK);