aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-05-07 13:51:10 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-05-07 13:51:10 +0200
commitb0cdbf5b22248e9c8e28d5b92cb3c92e2a99d583 (patch)
tree3ca01415a6327fb9a59a25ea5e0e0b4b369bb4c4
parent231e3781571c5283fbb648cda8fc44621d2ab5a2 (diff)
downloadlibssh-b0cdbf5b22248e9c8e28d5b92cb3c92e2a99d583.tar.gz
libssh-b0cdbf5b22248e9c8e28d5b92cb3c92e2a99d583.tar.xz
libssh-b0cdbf5b22248e9c8e28d5b92cb3c92e2a99d583.zip
Added test for zlib compression method
Unfortunately the test doesn't pass. (my host doesn't support zlib, only zlib@openssh.com)
-rw-r--r--tests/unittests/torture_algorithms.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/unittests/torture_algorithms.c b/tests/unittests/torture_algorithms.c
index f790a093..dcaca216 100644
--- a/tests/unittests/torture_algorithms.c
+++ b/tests/unittests/torture_algorithms.c
@@ -100,6 +100,25 @@ START_TEST (torture_algorithms_blowfish_cbc)
}
END_TEST
+START_TEST (torture_algorithms_zlib)
+{
+ int rc;
+ ssh_options_set(session,SSH_OPTIONS_HOST,"localhost");
+ rc=ssh_options_set(session,SSH_OPTIONS_COMPRESSION_C_S,"zlib");
+ ck_assert_msg(rc==SSH_OK,ssh_get_error(session));
+ 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));
+ }
+ ssh_disconnect(session);
+}
+END_TEST
+
static Suite *torture_make_suite(void) {
Suite *s = suite_create("libssh_algorithms");
@@ -119,7 +138,9 @@ static Suite *torture_make_suite(void) {
torture_algorithms_3des_cbc, setup, teardown);
torture_create_case_fixture(s, "torture_algorithms_blowfish-cbc",
torture_algorithms_blowfish_cbc, setup, teardown);
- return s;
+ torture_create_case_fixture(s, "torture_algorithms_zlib",
+ torture_algorithms_zlib, setup, teardown);
+ return s;
}
int main(int argc, char **argv) {