mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-05 12:50:30 +09:00
torture: Add support to specify verbosity level via env variable
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry-picked from commit 2a9c3966)
This commit is contained in:
@@ -771,7 +771,7 @@ static void torture_setup_create_sshd_config(void **state)
|
||||
"HostKey %s\n"
|
||||
"\n"
|
||||
"LogLevel DEBUG3\n"
|
||||
"Subsystem sftp %s\n"
|
||||
"Subsystem sftp %s -l DEBUG2\n"
|
||||
"\n"
|
||||
"PasswordAuthentication yes\n"
|
||||
"KbdInteractiveAuthentication yes\n"
|
||||
@@ -969,6 +969,7 @@ void _torture_filter_tests(UnitTest *tests, size_t ntests){
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
struct argument_s arguments;
|
||||
char *env = getenv("LIBSSH_VERBOSITY");
|
||||
|
||||
arguments.verbose=0;
|
||||
arguments.pattern=NULL;
|
||||
@@ -976,6 +977,12 @@ int main(int argc, char **argv) {
|
||||
verbosity=arguments.verbose;
|
||||
pattern=arguments.pattern;
|
||||
|
||||
if (verbosity == 0 && env != NULL && env[0] != '\0') {
|
||||
if (env[0] > '0' && env[0] < '9') {
|
||||
verbosity = atoi(env);
|
||||
}
|
||||
}
|
||||
|
||||
return torture_run_tests();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user