From 5eb2b028627a674325dbbafb548290173dd7fdd0 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 7 Jan 2022 15:47:02 +0100 Subject: [PATCH] Report correct test suite names for opt-testcases/* in outcome file In the outcome file, report each test case in the file it's in, rather than reporting them all from ssl-opt. This is more informative and matches what check_test_cases.py does. This fixes a bug whereby test cases from opt-testcases/* were not detected as having run on the CI, because analyze_outcomes.py (which uses check_test_cases.py) expects them in the containing file whereas they were reported in ssl-opt. Signed-off-by: Gilles Peskine --- tests/ssl-opt.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 762830486..4dea6685d 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -543,16 +543,18 @@ print_name() { # record_outcome [] # The test name must be in $NAME. +# Use $TEST_SUITE_NAME as the test suite name if set. record_outcome() { echo "$1" if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then printf '%s;%s;%s;%s;%s;%s\n' \ "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ - "ssl-opt" "$NAME" \ + "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ "$1" "${2-}" \ >>"$MBEDTLS_TEST_OUTCOME_FILE" fi } +unset TEST_SUITE_NAME # True if the presence of the given pattern in a log definitely indicates # that the test has failed. False if the presence is inconclusive. @@ -9015,8 +9017,11 @@ run_test "TLS 1.3: HelloRetryRequest check - gnutls" \ for i in opt-testcases/*.sh do - . $i + TEST_SUITE_NAME=${i##*/} + TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} + . "$i" done +unset TEST_SUITE_NAME requires_openssl_tls1_3 requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3