tests UPDATE use new known_hosts API
Stop using the client tests for now, might be added back later.
diff --git a/tests/test_auth.c b/tests/test_auth.c
index 63d7547..cdd14db 100644
--- a/tests/test_auth.c
+++ b/tests/test_auth.c
@@ -145,17 +145,6 @@
return NULL;
}
-static int
-ssh_hostkey_check_clb(const char *hostname, ssh_session session, void *priv)
-{
- (void)hostname;
- (void)session;
- (void)priv;
- /* skip the knownhost check */
-
- return 0;
-}
-
static char *
auth_interactive(const char *auth_name, const char *instruction, const char *prompt, int echo, void *priv)
{
@@ -181,6 +170,9 @@
struct nc_session *session = NULL;
struct test_state *state = arg;
+ /* skip all hostkey and known_hosts checks */
+ nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
+
ret = nc_client_set_schema_searchpath(MODULES_DIR);
assert_int_equal(ret, 0);
@@ -242,6 +234,9 @@
struct nc_session *session = NULL;
struct test_state *state = arg;
+ /* skip all hostkey and known_hosts checks */
+ nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
+
ret = nc_client_set_schema_searchpath(MODULES_DIR);
assert_int_equal(ret, 0);
@@ -288,6 +283,9 @@
struct nc_session *session = NULL;
struct test_state *state = arg;
+ /* skip all hostkey and known_hosts checks */
+ nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
+
ret = nc_client_set_schema_searchpath(MODULES_DIR);
assert_int_equal(ret, 0);
@@ -335,6 +333,9 @@
struct nc_session *session = NULL;
struct test_state *state = arg;
+ /* skip all hostkey and known_hosts checks */
+ nc_client_ssh_set_knownhosts_mode(NC_SSH_KNOWNHOSTS_SKIP);
+
ret = nc_client_set_schema_searchpath(MODULES_DIR);
assert_int_equal(ret, 0);
@@ -409,9 +410,6 @@
ret = nc_server_init();
assert_int_equal(ret, 0);
- /* skip the knownhost check */
- nc_client_ssh_set_auth_hostkey_check_clb(ssh_hostkey_check_clb, NULL);
-
lyd_free_all(tree);
return 0;