aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-12-27 22:47:37 +0100
committerAndreas Schneider <asn@cynapses.org>2010-12-27 22:47:37 +0100
commit32c0e1c99a46f91bbec9b203894afdb99e2f5344 (patch)
tree0606a6b596b7fdfff46b64913c95747ba13089fc
parentb4c62ac9ea7cc41a1c8c3fa062dee01f13d98e66 (diff)
downloadlibssh-32c0e1c99a46f91bbec9b203894afdb99e2f5344.tar.gz
libssh-32c0e1c99a46f91bbec9b203894afdb99e2f5344.tar.xz
libssh-32c0e1c99a46f91bbec9b203894afdb99e2f5344.zip
test: Added openssh checks to the compression tests.
-rw-r--r--tests/client/torture_algorithms.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/client/torture_algorithms.c b/tests/client/torture_algorithms.c
index 6cd7594..170c989 100644
--- a/tests/client/torture_algorithms.c
+++ b/tests/client/torture_algorithms.c
@@ -109,11 +109,14 @@ START_TEST (torture_algorithms_zlib)
rc=ssh_options_set(session,SSH_OPTIONS_COMPRESSION_S_C,"zlib");
ck_assert_msg(rc==SSH_OK,ssh_get_error(session));
rc=ssh_connect(session);
- ck_assert_msg(rc==SSH_OK,ssh_get_error(session));
- rc=ssh_userauth_none(session,NULL);
- if(rc != SSH_OK){
- rc=ssh_get_error_code(session);
- ck_assert_msg(rc==SSH_REQUEST_DENIED,ssh_get_error(session));
+ /* Don't run the test against openssh */
+ if (!ssh_get_openssh_version(session)) {
+ ck_assert_msg(rc==SSH_OK,ssh_get_error(session));
+ rc=ssh_userauth_none(session,NULL);
+ if(rc != SSH_OK){
+ rc=ssh_get_error_code(session);
+ ck_assert_msg(rc==SSH_REQUEST_DENIED,ssh_get_error(session));
+ }
}
ssh_disconnect(session);
}
@@ -128,11 +131,14 @@ START_TEST (torture_algorithms_zlib_openssh)
rc=ssh_options_set(session,SSH_OPTIONS_COMPRESSION_S_C,"zlib@openssh.com");
ck_assert_msg(rc==SSH_OK,ssh_get_error(session));
rc=ssh_connect(session);
- ck_assert_msg(rc==SSH_OK,ssh_get_error(session));
- rc=ssh_userauth_none(session,NULL);
- if(rc != SSH_OK){
- rc=ssh_get_error_code(session);
- ck_assert_msg(rc==SSH_REQUEST_DENIED,ssh_get_error(session));
+ /* Only run the test against openssh */
+ if (ssh_get_openssh_version(session)) {
+ ck_assert_msg(rc==SSH_OK,ssh_get_error(session));
+ rc=ssh_userauth_none(session,NULL);
+ if(rc != SSH_OK){
+ rc=ssh_get_error_code(session);
+ ck_assert_msg(rc==SSH_REQUEST_DENIED,ssh_get_error(session));
+ }
}
ssh_disconnect(session);
}