From 72f6b34dbc7fd8d2d48206ed807c2e5bd3f24419 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 7 May 2018 08:32:18 +0200 Subject: [PATCH] tests: We should only init and finalize libssh once This should fix a segfault with gcrypt. Signed-off-by: Andreas Schneider --- tests/client/torture_algorithms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/client/torture_algorithms.c b/tests/client/torture_algorithms.c index ce7d36ad..76ea2cef 100644 --- a/tests/client/torture_algorithms.c +++ b/tests/client/torture_algorithms.c @@ -56,8 +56,6 @@ static int session_setup(void **state) { rc = setuid(pwd->pw_uid); assert_return_code(rc, errno); - ssh_init(); - s->ssh.session = ssh_new(); assert_non_null(s->ssh.session); @@ -74,8 +72,6 @@ static int session_teardown(void **state) ssh_disconnect(s->ssh.session); ssh_free(s->ssh.session); - ssh_finalize(); - return 0; } @@ -467,8 +463,12 @@ int torture_run_tests(void) { #endif }; + ssh_init(); + torture_filter_tests(tests); rc = cmocka_run_group_tests(tests, sshd_setup, sshd_teardown); + ssh_finalize(); + return rc; }