Skip to content

Commit d1587e2

Browse files
committed
Reduce the level of logging used in tests
This should avoid running into a bug with printf format specifiers one windows. It's also a logical move for actual tests: I used the highest debug level for discovery, but we don't need that all the time. Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
1 parent f1243d2 commit d1587e2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

library/ssl_tls13_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static void ssl_tls13_select_ciphersuite(
9292
return;
9393
}
9494

95-
MBEDTLS_SSL_DEBUG_MSG(2, ("No matched ciphersuite, psk_ciphersuite_id=%x, psk_hash_alg=%lx",
95+
MBEDTLS_SSL_DEBUG_MSG(1, ("No matched ciphersuite, psk_ciphersuite_id=%x, psk_hash_alg=%lx",
9696
(unsigned) psk_ciphersuite_id,
9797
(unsigned long) psk_hash_alg));
9898
}

tests/suites/test_suite_ssl.function

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5070,7 +5070,7 @@ void inject_client_content_on_the_wire(int pk_alg,
50705070
srv_pattern.pattern = log_pattern;
50715071
options.srv_log_obj = &srv_pattern;
50725072
options.srv_log_fun = mbedtls_test_ssl_log_analyzer;
5073-
mbedtls_debug_set_threshold(5);
5073+
mbedtls_debug_set_threshold(1);
50745074

50755075
options.pk_alg = pk_alg;
50765076

@@ -5102,7 +5102,11 @@ void inject_client_content_on_the_wire(int pk_alg,
51025102
ret = mbedtls_ssl_handshake_step(&server.ssl);
51035103
} while (ret == 0 && server.ssl.state == state);
51045104
TEST_EQUAL(ret, expected_ret);
5105-
TEST_EQUAL(srv_pattern.counter, 1);
5105+
/* If we're expected to suceeed and we do, that's enough.
5106+
* If we're expected to fail, also check it was in the expected way. */
5107+
if (expected_ret != 0) {
5108+
TEST_EQUAL(srv_pattern.counter, 1);
5109+
}
51065110

51075111
exit:
51085112
mbedtls_test_free_handshake_options(&options);
@@ -5147,7 +5151,7 @@ void send_large_fragmented_hello(int hs_len_int, int first_frag_content_len_int,
51475151
srv_pattern.pattern = log_pattern;
51485152
options.srv_log_obj = &srv_pattern;
51495153
options.srv_log_fun = mbedtls_test_ssl_log_analyzer;
5150-
mbedtls_debug_set_threshold(5);
5154+
mbedtls_debug_set_threshold(1);
51515155

51525156
// Does't really matter but we want to know to declare dependencies.
51535157
options.pk_alg = MBEDTLS_PK_ECDSA;

0 commit comments

Comments
 (0)