aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2016-10-08 13:38:18 +0200
committerAndreas Schneider <asn@cryptomilk.org>2016-10-08 13:38:18 +0200
commit2a9c396603e286500791da1dc7f385487a0381a7 (patch)
treeb80029e4b254bdd6f84d7fe78bced1290addb106 /tests
parent4f392ebc7ed202d1a9ca754c9aad19a449213621 (diff)
downloadlibssh-2a9c396603e286500791da1dc7f385487a0381a7.tar.gz
libssh-2a9c396603e286500791da1dc7f385487a0381a7.tar.xz
libssh-2a9c396603e286500791da1dc7f385487a0381a7.zip
torture: Add support to specify verbosity level via env variable
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/torture.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/torture.c b/tests/torture.c
index e1de509c..545fc2e3 100644
--- a/tests/torture.c
+++ b/tests/torture.c
@@ -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();
}