From d42a1a35b0c2f2178e459b9328f97f9e988a1cb0 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Tue, 2 Sep 2014 09:07:17 +0200 Subject: tests: allow conditionnal execution on pattern Option can be used to filter out irrelevant tests usage: ./torture_pki '*ed25519' Signed-off-by: Aris Adamantiadis Reviewed-by: Andreas Schneider --- tests/client/torture_algorithms.c | 4 ++-- tests/client/torture_auth.c | 4 ++-- tests/client/torture_connect.c | 3 ++- tests/client/torture_forward.c | 3 ++- tests/client/torture_knownhosts.c | 3 ++- tests/client/torture_proxycommand.c | 3 ++- tests/client/torture_request_env.c | 3 ++- tests/client/torture_session.c | 3 ++- tests/client/torture_sftp_dir.c | 3 ++- tests/client/torture_sftp_read.c | 3 ++- tests/client/torture_sftp_static.c | 3 ++- 11 files changed, 22 insertions(+), 13 deletions(-) (limited to 'tests/client') diff --git a/tests/client/torture_algorithms.c b/tests/client/torture_algorithms.c index 8a466380..dc7b6539 100644 --- a/tests/client/torture_algorithms.c +++ b/tests/client/torture_algorithms.c @@ -289,7 +289,7 @@ static void torture_algorithms_dh_group1(void **state) { } int torture_run_tests(void) { int rc; - const UnitTest tests[] = { + UnitTest tests[] = { unit_test_setup_teardown(torture_algorithms_aes128_cbc_hmac_sha1, setup, teardown), unit_test_setup_teardown(torture_algorithms_aes128_cbc_hmac_sha2_256, setup, teardown), unit_test_setup_teardown(torture_algorithms_aes128_cbc_hmac_sha2_512, setup, teardown), @@ -323,7 +323,7 @@ int torture_run_tests(void) { }; ssh_init(); - + torture_filter_tests(tests); rc = run_tests(tests); ssh_finalize(); diff --git a/tests/client/torture_auth.c b/tests/client/torture_auth.c index af36b79f..7f5167e8 100644 --- a/tests/client/torture_auth.c +++ b/tests/client/torture_auth.c @@ -421,7 +421,7 @@ static void torture_auth_none_nonblocking(void **state) { int torture_run_tests(void) { int rc; - const UnitTest tests[] = { + UnitTest tests[] = { unit_test_setup_teardown(torture_auth_kbdint, setup, teardown), unit_test_setup_teardown(torture_auth_kbdint_nonblocking, setup, teardown), unit_test_setup_teardown(torture_auth_password, setup, teardown), @@ -435,7 +435,7 @@ int torture_run_tests(void) { }; ssh_init(); - + torture_filter_tests(tests); rc = run_tests(tests); ssh_finalize(); diff --git a/tests/client/torture_connect.c b/tests/client/torture_connect.c index 31573ea3..bb28609a 100644 --- a/tests/client/torture_connect.c +++ b/tests/client/torture_connect.c @@ -139,7 +139,7 @@ static void torture_connect_socket(void **state) { int torture_run_tests(void) { int rc; - const UnitTest tests[] = { + UnitTest tests[] = { unit_test_setup_teardown(torture_connect_nonblocking, setup, teardown), unit_test_setup_teardown(torture_connect_double, setup, teardown), unit_test_setup_teardown(torture_connect_failure, setup, teardown), @@ -149,6 +149,7 @@ int torture_run_tests(void) { ssh_init(); + torture_filter_tests(tests); rc = run_tests(tests); ssh_finalize(); diff --git a/tests/client/torture_forward.c b/tests/client/torture_forward.c index 0ffeae05..876ed74b 100644 --- a/tests/client/torture_forward.c +++ b/tests/client/torture_forward.c @@ -81,12 +81,13 @@ static void torture_ssh_forward(void **state) int torture_run_tests(void) { int rc; - const UnitTest tests[] = { + UnitTest tests[] = { unit_test_setup_teardown(torture_ssh_forward, setup, teardown), }; ssh_init(); + torture_filter_tests(tests); rc = run_tests(tests); ssh_finalize(); diff --git a/tests/client/torture_knownhosts.c b/tests/client/torture_knownhosts.c index df99ae90..ee7e04c8 100644 --- a/tests/client/torture_knownhosts.c +++ b/tests/client/torture_knownhosts.c @@ -282,7 +282,7 @@ static void torture_knownhosts_precheck(void **state) { int torture_run_tests(void) { int rc; - const UnitTest tests[] = { + UnitTest tests[] = { unit_test_setup_teardown(torture_knownhosts_port, setup, teardown), unit_test_setup_teardown(torture_knownhosts_fail, setup, teardown), unit_test_setup_teardown(torture_knownhosts_other, setup, teardown), @@ -293,6 +293,7 @@ int torture_run_tests(void) { ssh_init(); + torture_filter_tests(tests); rc = run_tests(tests); ssh_finalize(); diff --git a/tests/client/torture_proxycommand.c b/tests/client/torture_proxycommand.c index 8cf68685..a1508811 100644 --- a/tests/client/torture_proxycommand.c +++ b/tests/client/torture_proxycommand.c @@ -42,7 +42,7 @@ static void torture_options_set_proxycommand_notexist(void **state) { int torture_run_tests(void) { int rc; - const UnitTest tests[] = { + UnitTest tests[] = { unit_test_setup_teardown(torture_options_set_proxycommand, setup, teardown), unit_test_setup_teardown(torture_options_set_proxycommand_notexist, setup, teardown), }; @@ -50,6 +50,7 @@ int torture_run_tests(void) { ssh_init(); + torture_filter_tests(tests); rc = run_tests(tests); ssh_finalize(); diff --git a/tests/client/torture_request_env.c b/tests/client/torture_request_env.c index fc3843df..5296f7d2 100644 --- a/tests/client/torture_request_env.c +++ b/tests/client/torture_request_env.c @@ -100,12 +100,13 @@ static void torture_request_env(void **state) int torture_run_tests(void) { int rc; - const UnitTest tests[] = { + UnitTest tests[] = { unit_test_setup_teardown(torture_request_env, setup, teardown), }; ssh_init(); + torture_filter_tests(tests); rc = run_tests(tests); ssh_finalize(); diff --git a/tests/client/torture_session.c b/tests/client/torture_session.c index ef9ef653..94296a3f 100644 --- a/tests/client/torture_session.c +++ b/tests/client/torture_session.c @@ -99,12 +99,13 @@ static void torture_channel_read_error(void **state) { int torture_run_tests(void) { int rc; - const UnitTest tests[] = { + UnitTest tests[] = { unit_test_setup_teardown(torture_channel_read_error, setup, teardown), }; ssh_init(); + torture_filter_tests(tests); rc = run_tests(tests); ssh_finalize(); diff --git a/tests/client/torture_sftp_dir.c b/tests/client/torture_sftp_dir.c index b2e3fa38..67303324 100644 --- a/tests/client/torture_sftp_dir.c +++ b/tests/client/torture_sftp_dir.c @@ -61,12 +61,13 @@ static void torture_sftp_mkdir(void **state) { int torture_run_tests(void) { int rc; - const UnitTest tests[] = { + UnitTest tests[] = { unit_test_setup_teardown(torture_sftp_mkdir, setup, teardown) }; ssh_init(); + torture_filter_tests(tests); rc = run_tests(tests); ssh_finalize(); diff --git a/tests/client/torture_sftp_read.c b/tests/client/torture_sftp_read.c index dac5ef7b..6586d49e 100644 --- a/tests/client/torture_sftp_read.c +++ b/tests/client/torture_sftp_read.c @@ -70,12 +70,13 @@ static void torture_sftp_read_blocking(void **state) { int torture_run_tests(void) { int rc; - const UnitTest tests[] = { + UnitTest tests[] = { unit_test_setup_teardown(torture_sftp_read_blocking, setup, teardown) }; ssh_init(); + torture_filter_tests(tests); rc = run_tests(tests); ssh_finalize(); diff --git a/tests/client/torture_sftp_static.c b/tests/client/torture_sftp_static.c index 7631def0..0cfd9e20 100644 --- a/tests/client/torture_sftp_static.c +++ b/tests/client/torture_sftp_static.c @@ -19,12 +19,13 @@ static void torture_sftp_ext_new(void **state) { int torture_run_tests(void) { int rc; - const UnitTest tests[] = { + UnitTest tests[] = { unit_test(torture_sftp_ext_new), }; ssh_init(); + torture_filter_tests(tests); rc = run_tests(tests); ssh_finalize(); -- cgit