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 <manuel.pegourie-gonnard@arm.com>
diff --git a/library/ssl_tls13_server.c b/library/ssl_tls13_server.c
index fdf8634..5757d20 100644
--- a/library/ssl_tls13_server.c
+++ b/library/ssl_tls13_server.c
@@ -92,7 +92,7 @@
return;
}
- MBEDTLS_SSL_DEBUG_MSG(2, ("No matched ciphersuite, psk_ciphersuite_id=%x, psk_hash_alg=%lx",
+ MBEDTLS_SSL_DEBUG_MSG(1, ("No matched ciphersuite, psk_ciphersuite_id=%x, psk_hash_alg=%lx",
(unsigned) psk_ciphersuite_id,
(unsigned long) psk_hash_alg));
}
diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function
index e6c75bf..df9d9bc 100644
--- a/tests/suites/test_suite_ssl.function
+++ b/tests/suites/test_suite_ssl.function
@@ -5070,7 +5070,7 @@
srv_pattern.pattern = log_pattern;
options.srv_log_obj = &srv_pattern;
options.srv_log_fun = mbedtls_test_ssl_log_analyzer;
- mbedtls_debug_set_threshold(5);
+ mbedtls_debug_set_threshold(1);
options.pk_alg = pk_alg;
@@ -5102,7 +5102,11 @@
ret = mbedtls_ssl_handshake_step(&server.ssl);
} while (ret == 0 && server.ssl.state == state);
TEST_EQUAL(ret, expected_ret);
- TEST_EQUAL(srv_pattern.counter, 1);
+ /* If we're expected to suceeed and we do, that's enough.
+ * If we're expected to fail, also check it was in the expected way. */
+ if (expected_ret != 0) {
+ TEST_EQUAL(srv_pattern.counter, 1);
+ }
exit:
mbedtls_test_free_handshake_options(&options);
@@ -5147,7 +5151,7 @@
srv_pattern.pattern = log_pattern;
options.srv_log_obj = &srv_pattern;
options.srv_log_fun = mbedtls_test_ssl_log_analyzer;
- mbedtls_debug_set_threshold(5);
+ mbedtls_debug_set_threshold(1);
// Does't really matter but we want to know to declare dependencies.
options.pk_alg = MBEDTLS_PK_ECDSA;