aboutsummaryrefslogtreecommitdiff
path: root/tests/client
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-09-07 10:39:51 +0200
committerAndreas Schneider <asn@cryptomilk.org>2015-09-07 10:40:12 +0200
commit82a80b205bb5159c3e8da635c47882a14c17120b (patch)
tree9e00b3d674276c9a227f167b4b4712db912a5b96 /tests/client
parent5b586fdfecbe12f3f8e69099d809ca96c7cb978e (diff)
downloadlibssh-82a80b205bb5159c3e8da635c47882a14c17120b.tar.gz
libssh-82a80b205bb5159c3e8da635c47882a14c17120b.tar.xz
libssh-82a80b205bb5159c3e8da635c47882a14c17120b.zip
tests: Migrate to new cmocka API
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/client')
-rw-r--r--tests/client/torture_algorithms.c68
-rw-r--r--tests/client/torture_auth.c32
-rw-r--r--tests/client/torture_connect.c22
-rw-r--r--tests/client/torture_forward.c14
-rw-r--r--tests/client/torture_knownhosts.c24
-rw-r--r--tests/client/torture_proxycommand.c16
-rw-r--r--tests/client/torture_request_env.c14
-rw-r--r--tests/client/torture_session.c14
-rw-r--r--tests/client/torture_sftp_dir.c14
-rw-r--r--tests/client/torture_sftp_read.c16
-rw-r--r--tests/client/torture_sftp_static.c6
11 files changed, 141 insertions, 99 deletions
diff --git a/tests/client/torture_algorithms.c b/tests/client/torture_algorithms.c
index dc7b6539..8dc76c85 100644
--- a/tests/client/torture_algorithms.c
+++ b/tests/client/torture_algorithms.c
@@ -26,15 +26,19 @@
#include "libssh/priv.h"
-static void setup(void **state) {
+static int setup(void **state) {
int verbosity=torture_libssh_verbosity();
ssh_session session = ssh_new();
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
*state = session;
+
+ return 0;
}
-static void teardown(void **state) {
+static int teardown(void **state) {
ssh_free(*state);
+
+ return 0;
}
static void test_algorithm(ssh_session session, const char *algo, const char *hmac) {
@@ -289,42 +293,42 @@ static void torture_algorithms_dh_group1(void **state) {
}
int torture_run_tests(void) {
int rc;
- UnitTest tests[] = {
- unit_test_setup_teardown(torture_algorithms_aes128_cbc_hmac_sha1, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes128_cbc_hmac_sha2_256, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes128_cbc_hmac_sha2_512, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes192_cbc_hmac_sha1, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes192_cbc_hmac_sha2_256, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes192_cbc_hmac_sha2_512, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes256_cbc_hmac_sha1, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes256_cbc_hmac_sha2_256, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes256_cbc_hmac_sha2_512, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes128_ctr_hmac_sha1, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes128_ctr_hmac_sha2_256, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes128_ctr_hmac_sha2_512, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes192_ctr_hmac_sha1, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes192_ctr_hmac_sha2_256, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes192_ctr_hmac_sha2_512, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes256_ctr_hmac_sha1, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes256_ctr_hmac_sha2_256, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_aes256_ctr_hmac_sha2_512, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_3des_cbc_hmac_sha1, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_3des_cbc_hmac_sha2_256, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_3des_cbc_hmac_sha2_512, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_blowfish_cbc_hmac_sha1, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_blowfish_cbc_hmac_sha2_256, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_blowfish_cbc_hmac_sha2_512, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_zlib, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_zlib_openssh, setup, teardown),
- unit_test_setup_teardown(torture_algorithms_dh_group1,setup,teardown),
+ struct CMUnitTest tests[] = {
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes128_cbc_hmac_sha1, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes128_cbc_hmac_sha2_256, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes128_cbc_hmac_sha2_512, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes192_cbc_hmac_sha1, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes192_cbc_hmac_sha2_256, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes192_cbc_hmac_sha2_512, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes256_cbc_hmac_sha1, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes256_cbc_hmac_sha2_256, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes256_cbc_hmac_sha2_512, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes128_ctr_hmac_sha1, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes128_ctr_hmac_sha2_256, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes128_ctr_hmac_sha2_512, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes192_ctr_hmac_sha1, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes192_ctr_hmac_sha2_256, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes192_ctr_hmac_sha2_512, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes256_ctr_hmac_sha1, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes256_ctr_hmac_sha2_256, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_aes256_ctr_hmac_sha2_512, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_3des_cbc_hmac_sha1, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_3des_cbc_hmac_sha2_256, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_3des_cbc_hmac_sha2_512, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_blowfish_cbc_hmac_sha1, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_blowfish_cbc_hmac_sha2_256, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_blowfish_cbc_hmac_sha2_512, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_zlib, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_zlib_openssh, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_algorithms_dh_group1,setup,teardown),
#if defined(HAVE_LIBCRYPTO) && defined(HAVE_ECC)
- unit_test_setup_teardown(torture_algorithms_ecdh_sha2_nistp256,setup,teardown)
+ cmocka_unit_test_setup_teardown(torture_algorithms_ecdh_sha2_nistp256,setup,teardown)
#endif
};
ssh_init();
torture_filter_tests(tests);
- rc = run_tests(tests);
+ rc = cmocka_run_group_tests(tests, NULL, NULL);
ssh_finalize();
return rc;
diff --git a/tests/client/torture_auth.c b/tests/client/torture_auth.c
index 7f5167e8..d686b4c5 100644
--- a/tests/client/torture_auth.c
+++ b/tests/client/torture_auth.c
@@ -27,7 +27,7 @@
#include "libssh/session.h"
#include "agent.c"
-static void setup(void **state) {
+static int setup(void **state) {
int verbosity = torture_libssh_verbosity();
ssh_session session = ssh_new();
@@ -35,11 +35,15 @@ static void setup(void **state) {
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
*state = session;
+
+ return 0;
}
-static void teardown(void **state) {
+static int teardown(void **state) {
ssh_disconnect(*state);
ssh_free(*state);
+
+ return 0;
}
static void torture_auth_autopubkey(void **state) {
@@ -421,22 +425,22 @@ static void torture_auth_none_nonblocking(void **state) {
int torture_run_tests(void) {
int rc;
- UnitTest tests[] = {
- unit_test_setup_teardown(torture_auth_kbdint, setup, teardown),
- unit_test_setup_teardown(torture_auth_kbdint_nonblocking, setup, teardown),
- unit_test_setup_teardown(torture_auth_password, setup, teardown),
- unit_test_setup_teardown(torture_auth_password_nonblocking, setup, teardown),
- unit_test_setup_teardown(torture_auth_autopubkey, setup, teardown),
- unit_test_setup_teardown(torture_auth_autopubkey_nonblocking, setup, teardown),
- unit_test_setup_teardown(torture_auth_agent, setup, teardown),
- unit_test_setup_teardown(torture_auth_agent_nonblocking, setup, teardown),
- unit_test_setup_teardown(torture_auth_none, setup, teardown),
- unit_test_setup_teardown(torture_auth_none_nonblocking, setup, teardown),
+ struct CMUnitTest tests[] = {
+ cmocka_unit_test_setup_teardown(torture_auth_kbdint, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_auth_kbdint_nonblocking, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_auth_password, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_auth_password_nonblocking, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_auth_autopubkey, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_auth_autopubkey_nonblocking, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_auth_agent, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_auth_agent_nonblocking, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_auth_none, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_auth_none_nonblocking, setup, teardown),
};
ssh_init();
torture_filter_tests(tests);
- rc = run_tests(tests);
+ rc = cmocka_run_group_tests(tests, NULL, NULL);
ssh_finalize();
return rc;
diff --git a/tests/client/torture_connect.c b/tests/client/torture_connect.c
index a8829b85..4a588f10 100644
--- a/tests/client/torture_connect.c
+++ b/tests/client/torture_connect.c
@@ -32,19 +32,23 @@
/* Should work until Apnic decides to assign it :) */
#define BLACKHOLE "1.1.1.1"
-static void setup(void **state) {
+static int setup(void **state) {
int verbosity=torture_libssh_verbosity();
ssh_session session = ssh_new();
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
*state = session;
+
+ return 0;
}
-static void teardown(void **state) {
+static int teardown(void **state) {
ssh_session session = *state;
ssh_disconnect(session);
ssh_free(session);
+
+ return 0;
}
static void torture_connect_nonblocking(void **state) {
@@ -141,18 +145,18 @@ static void torture_connect_socket(void **state) {
int torture_run_tests(void) {
int rc;
- UnitTest tests[] = {
- unit_test_setup_teardown(torture_connect_nonblocking, setup, teardown),
- unit_test_setup_teardown(torture_connect_double, setup, teardown),
- unit_test_setup_teardown(torture_connect_failure, setup, teardown),
- unit_test_setup_teardown(torture_connect_timeout, setup, teardown),
- unit_test_setup_teardown(torture_connect_socket, setup, teardown),
+ struct CMUnitTest tests[] = {
+ cmocka_unit_test_setup_teardown(torture_connect_nonblocking, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_connect_double, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_connect_failure, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_connect_timeout, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_connect_socket, setup, teardown),
};
ssh_init();
torture_filter_tests(tests);
- rc = run_tests(tests);
+ rc = cmocka_run_group_tests(tests, NULL, NULL);
ssh_finalize();
return rc;
diff --git a/tests/client/torture_forward.c b/tests/client/torture_forward.c
index 876ed74b..608a9d8f 100644
--- a/tests/client/torture_forward.c
+++ b/tests/client/torture_forward.c
@@ -24,7 +24,7 @@
#include "torture.h"
#include <libssh/libssh.h>
-static void setup(void **state)
+static int setup(void **state)
{
ssh_session session;
const char *host;
@@ -43,9 +43,11 @@ static void setup(void **state)
assert_non_null(session);
*state = session;
+
+ return 0;
}
-static void teardown(void **state)
+static int teardown(void **state)
{
ssh_session session = (ssh_session) *state;
@@ -55,6 +57,8 @@ static void teardown(void **state)
ssh_disconnect(session);
}
ssh_free(session);
+
+ return 0;
}
static void torture_ssh_forward(void **state)
@@ -81,14 +85,14 @@ static void torture_ssh_forward(void **state)
int torture_run_tests(void) {
int rc;
- UnitTest tests[] = {
- unit_test_setup_teardown(torture_ssh_forward, setup, teardown),
+ struct CMUnitTest tests[] = {
+ cmocka_unit_test_setup_teardown(torture_ssh_forward, setup, teardown),
};
ssh_init();
torture_filter_tests(tests);
- rc = run_tests(tests);
+ rc = cmocka_run_group_tests(tests, NULL, NULL);
ssh_finalize();
return rc;
diff --git a/tests/client/torture_knownhosts.c b/tests/client/torture_knownhosts.c
index ee7e04c8..c1c32d7d 100644
--- a/tests/client/torture_knownhosts.c
+++ b/tests/client/torture_knownhosts.c
@@ -44,22 +44,26 @@
"h0dSi8VJXI1wes5HTyLsv9VBmU1uCXUUvufoQKfF/OcSH0ufcCpnd62g1/adZcy2" \
"WJg=="
-static void setup(void **state) {
+static int setup(void **state) {
int verbosity=torture_libssh_verbosity();
ssh_session session = ssh_new();
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
*state = session;
+
+ return 0;
}
-static void teardown(void **state) {
+static int teardown(void **state) {
ssh_session session = *state;
ssh_disconnect(session);
ssh_free(session);
unlink(KNOWNHOSTFILES);
+
+ return 0;
}
static void torture_knownhosts_port(void **state) {
@@ -282,19 +286,19 @@ static void torture_knownhosts_precheck(void **state) {
int torture_run_tests(void) {
int rc;
- UnitTest tests[] = {
- unit_test_setup_teardown(torture_knownhosts_port, setup, teardown),
- unit_test_setup_teardown(torture_knownhosts_fail, setup, teardown),
- unit_test_setup_teardown(torture_knownhosts_other, setup, teardown),
- unit_test_setup_teardown(torture_knownhosts_other_auto, setup, teardown),
- unit_test_setup_teardown(torture_knownhosts_conflict, setup, teardown),
- unit_test_setup_teardown(torture_knownhosts_precheck, setup, teardown)
+ struct CMUnitTest tests[] = {
+ cmocka_unit_test_setup_teardown(torture_knownhosts_port, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_knownhosts_fail, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_knownhosts_other, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_knownhosts_other_auto, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_knownhosts_conflict, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_knownhosts_precheck, setup, teardown)
};
ssh_init();
torture_filter_tests(tests);
- rc = run_tests(tests);
+ rc = cmocka_run_group_tests(tests, NULL, NULL);
ssh_finalize();
return rc;
diff --git a/tests/client/torture_proxycommand.c b/tests/client/torture_proxycommand.c
index a1508811..5167f492 100644
--- a/tests/client/torture_proxycommand.c
+++ b/tests/client/torture_proxycommand.c
@@ -4,14 +4,18 @@
#include <libssh/libssh.h>
#include "libssh/priv.h"
-static void setup(void **state) {
+static int setup(void **state) {
ssh_session session = ssh_new();
*state = session;
+
+ return 0;
}
-static void teardown(void **state) {
+static int teardown(void **state) {
ssh_free(*state);
+
+ return 0;
}
static void torture_options_set_proxycommand(void **state) {
@@ -42,16 +46,16 @@ static void torture_options_set_proxycommand_notexist(void **state) {
int torture_run_tests(void) {
int rc;
- UnitTest tests[] = {
- unit_test_setup_teardown(torture_options_set_proxycommand, setup, teardown),
- unit_test_setup_teardown(torture_options_set_proxycommand_notexist, setup, teardown),
+ struct CMUnitTest tests[] = {
+ cmocka_unit_test_setup_teardown(torture_options_set_proxycommand, setup, teardown),
+ cmocka_unit_test_setup_teardown(torture_options_set_proxycommand_notexist, setup, teardown),
};
ssh_init();
torture_filter_tests(tests);
- rc = run_tests(tests);
+ rc = cmocka_run_group_tests(tests, NULL, NULL);
ssh_finalize();
return rc;
diff --git a/tests/client/torture_request_env.c b/tests/client/torture_request_env.c
index 5296f7d2..345426c6 100644
--- a/tests/client/torture_request_env.c
+++ b/tests/client/torture_request_env.c
@@ -24,7 +24,7 @@
#include "torture.h"
#include <libssh/libssh.h>
-static void setup(void **state)
+static int setup(void **state)
{
ssh_session session;
const char *host;
@@ -43,9 +43,11 @@ static void setup(void **state)
assert_false(session == NULL);
*state = session;
+
+ return 0;
}
-static void teardown(void **state)
+static int teardown(void **state)
{
ssh_session session = *state;
@@ -55,6 +57,8 @@ static void teardown(void **state)
ssh_disconnect(session);
}
ssh_free(session);
+
+ return 0;
}
static void torture_request_env(void **state)
@@ -100,14 +104,14 @@ static void torture_request_env(void **state)
int torture_run_tests(void) {
int rc;
- UnitTest tests[] = {
- unit_test_setup_teardown(torture_request_env, setup, teardown),
+ struct CMUnitTest tests[] = {
+ cmocka_unit_test_setup_teardown(torture_request_env, setup, teardown),
};
ssh_init();
torture_filter_tests(tests);
- rc = run_tests(tests);
+ rc = cmocka_run_group_tests(tests, NULL, NULL);
ssh_finalize();
return rc;
diff --git a/tests/client/torture_session.c b/tests/client/torture_session.c
index 94296a3f..4ac25e45 100644
--- a/tests/client/torture_session.c
+++ b/tests/client/torture_session.c
@@ -29,7 +29,7 @@
#define BUFLEN 4096
static char buffer[BUFLEN];
-static void setup(void **state) {
+static int setup(void **state) {
int verbosity = torture_libssh_verbosity();
ssh_session session = ssh_new();
@@ -37,10 +37,14 @@ static void setup(void **state) {
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
*state = session;
+
+ return 0;
}
-static void teardown(void **state) {
+static int teardown(void **state) {
ssh_disconnect(*state);
+
+ return 0;
ssh_free(*state);
}
@@ -99,14 +103,14 @@ static void torture_channel_read_error(void **state) {
int torture_run_tests(void) {
int rc;
- UnitTest tests[] = {
- unit_test_setup_teardown(torture_channel_read_error, setup, teardown),
+ struct CMUnitTest tests[] = {
+ cmocka_unit_test_setup_teardown(torture_channel_read_error, setup, teardown),
};
ssh_init();
torture_filter_tests(tests);
- rc = run_tests(tests);
+ rc = cmocka_run_group_tests(tests, NULL, NULL);
ssh_finalize();
return rc;
diff --git a/tests/client/torture_sftp_dir.c b/tests/client/torture_sftp_dir.c
index 67303324..e5b5369a 100644
--- a/tests/client/torture_sftp_dir.c
+++ b/tests/client/torture_sftp_dir.c
@@ -3,7 +3,7 @@
#include "torture.h"
#include "sftp.c"
-static void setup(void **state) {
+static int setup(void **state) {
ssh_session session;
struct torture_sftp *t;
const char *host;
@@ -24,15 +24,19 @@ static void setup(void **state) {
assert_false(t == NULL);
*state = t;
+
+ return 0;
}
-static void teardown(void **state) {
+static int teardown(void **state) {
struct torture_sftp *t = *state;
assert_false(t == NULL);
torture_rmdirs(t->testdir);
torture_sftp_close(t);
+
+ return 0;
}
static void torture_sftp_mkdir(void **state) {
@@ -61,14 +65,14 @@ static void torture_sftp_mkdir(void **state) {
int torture_run_tests(void) {
int rc;
- UnitTest tests[] = {
- unit_test_setup_teardown(torture_sftp_mkdir, setup, teardown)
+ struct CMUnitTest tests[] = {
+ cmocka_unit_test_setup_teardown(torture_sftp_mkdir, setup, teardown)
};
ssh_init();
torture_filter_tests(tests);
- rc = run_tests(tests);
+ rc = cmocka_run_group_tests(tests, NULL, NULL);
ssh_finalize();
return rc;
diff --git a/tests/client/torture_sftp_read.c b/tests/client/torture_sftp_read.c
index eca8a8c6..35bb7e43 100644
--- a/tests/client/torture_sftp_read.c
+++ b/tests/client/torture_sftp_read.c
@@ -5,7 +5,8 @@
#define MAX_XFER_BUF_SIZE 16384
-static void setup(void **state) {
+static int setup(void **state)
+{
ssh_session session;
struct torture_sftp *t;
const char *host;
@@ -26,15 +27,20 @@ static void setup(void **state) {
assert_false(t == NULL);
*state = t;
+
+ return 0;
}
-static void teardown(void **state) {
+static int teardown(void **state)
+{
struct torture_sftp *t = (struct torture_sftp*) *state;
assert_false(t == NULL);
torture_rmdirs(t->testdir);
torture_sftp_close(t);
+
+ return 0;
}
static void torture_sftp_read_blocking(void **state) {
@@ -72,14 +78,14 @@ static void torture_sftp_read_blocking(void **state) {
int torture_run_tests(void) {
int rc;
- UnitTest tests[] = {
- unit_test_setup_teardown(torture_sftp_read_blocking, setup, teardown)
+ struct CMUnitTest tests[] = {
+ cmocka_unit_test_setup_teardown(torture_sftp_read_blocking, setup, teardown)
};
ssh_init();
torture_filter_tests(tests);
- rc = run_tests(tests);
+ rc = cmocka_run_group_tests(tests, NULL, NULL);
ssh_finalize();
return rc;
diff --git a/tests/client/torture_sftp_static.c b/tests/client/torture_sftp_static.c
index 0cfd9e20..53644ce9 100644
--- a/tests/client/torture_sftp_static.c
+++ b/tests/client/torture_sftp_static.c
@@ -19,14 +19,14 @@ static void torture_sftp_ext_new(void **state) {
int torture_run_tests(void) {
int rc;
- UnitTest tests[] = {
- unit_test(torture_sftp_ext_new),
+ struct CMUnitTest tests[] = {
+ cmocka_unit_test(torture_sftp_ext_new),
};
ssh_init();
torture_filter_tests(tests);
- rc = run_tests(tests);
+ rc = cmocka_run_group_tests(tests, NULL, NULL);
ssh_finalize();
return rc;