mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-03-24 20:40:09 +09:00
torture: Add support to specify verbosity level via env variable
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -886,7 +886,7 @@ static void torture_setup_create_sshd_config(void **state)
|
||||
"TrustedUserCAKeys %s\n"
|
||||
"\n"
|
||||
"LogLevel DEBUG3\n"
|
||||
"Subsystem sftp %s\n"
|
||||
"Subsystem sftp %s -l DEBUG2\n"
|
||||
"\n"
|
||||
"PasswordAuthentication yes\n"
|
||||
"KbdInteractiveAuthentication yes\n"
|
||||
@@ -1083,6 +1083,7 @@ void _torture_filter_tests(struct CMUnitTest *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;
|
||||
@@ -1090,6 +1091,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