tests: Use global verbosity in tests

This allows adjusting the log level of config and options tests using
environment variable LIBSSH_VERBOSITY as it works in most of the other
tests.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2018-09-04 15:29:01 +02:00
committed by Andreas Schneider
parent 2eccd04ff6
commit 6dbcc21921
2 changed files with 13 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ extern LIBSSH_THREAD int ssh_log_level;
static int setup_config_files(void **state)
{
ssh_session session;
int verbosity;
unlink(LIBSSH_TESTCONFIG1);
unlink(LIBSSH_TESTCONFIG2);
@@ -106,6 +107,10 @@ static int setup_config_files(void **state)
"");
session = ssh_new();
verbosity = torture_libssh_verbosity();
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
*state = session;
return 0;

View File

@@ -15,7 +15,14 @@
static int setup(void **state)
{
ssh_session session = ssh_new();
ssh_session session;
int verbosity;
session = ssh_new();
verbosity = torture_libssh_verbosity();
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
*state = session;
return 0;