1
1

tests: Fix session management of torture_knownhosts

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
Andreas Schneider 2016-11-08 08:16:20 +01:00
родитель 3daf1760a1
Коммит f8ef200e76

Просмотреть файл

@ -250,7 +250,10 @@ static void torture_knownhosts_other_auto(void **state) {
ssh_free(session);
/* connect again and check host key */
*state = session = ssh_new();
session = ssh_new();
assert_non_null(session);
s->ssh.session = session;
rc = ssh_options_set(session, SSH_OPTIONS_HOST, TORTURE_SSH_SERVER);
assert_int_equal(rc, SSH_OK);
@ -265,8 +268,7 @@ static void torture_knownhosts_other_auto(void **state) {
rc = ssh_is_server_known(session);
assert_int_equal(rc, SSH_SERVER_KNOWN_OK);
ssh_disconnect(session);
ssh_free(session);
/* session will be freed by session_teardown() */
}
static void torture_knownhosts_conflict(void **state) {
@ -310,7 +312,10 @@ static void torture_knownhosts_conflict(void **state) {
ssh_free(session);
/* connect again and check host key */
*state = session = ssh_new();
session = ssh_new();
assert_non_null(session);
s->ssh.session = session;
ssh_options_set(session, SSH_OPTIONS_HOST, TORTURE_SSH_SERVER);
ssh_options_set(session, SSH_OPTIONS_KNOWNHOSTS, known_hosts_file);
@ -323,8 +328,7 @@ static void torture_knownhosts_conflict(void **state) {
rc = ssh_is_server_known(session);
assert_int_equal(rc, SSH_SERVER_KNOWN_OK);
ssh_disconnect(session);
ssh_free(session);
/* session will be freed by session_teardown() */
}
static void torture_knownhosts_precheck(void **state) {