mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Add ssl-opt.sh support to outcome-analysis.sh
But make it optional as it makes things much slower. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
@ -8,6 +8,11 @@
|
|||||||
# implementation", namely: the sets of tests skipped in the default config and
|
# implementation", namely: the sets of tests skipped in the default config and
|
||||||
# the full config must be the same before and after the PR.
|
# the full config must be the same before and after the PR.
|
||||||
#
|
#
|
||||||
|
# USAGE:
|
||||||
|
# - First, commit any uncommited changes. (Also, see warning below.)
|
||||||
|
# - including ssl-opt.sh: docs/architecture/psa-migration/outcome-analysis.sh
|
||||||
|
# - or: SKIP_SSL_OPT=1 docs/architecture/psa-migration/outcome-analysis.sh
|
||||||
|
#
|
||||||
# WARNING: this script checks out a commit other than the head of the current
|
# WARNING: this script checks out a commit other than the head of the current
|
||||||
# branch; it checks out the current branch again when running successfully,
|
# branch; it checks out the current branch again when running successfully,
|
||||||
# but while the script is running, or if it terminates early in error, you
|
# but while the script is running, or if it terminates early in error, you
|
||||||
@ -18,6 +23,8 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
: ${SKIP_SSL_OPT:=0}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
make clean
|
make clean
|
||||||
git checkout -- include/mbedtls/mbedtls_config.h include/psa/crypto_config.h
|
git checkout -- include/mbedtls/mbedtls_config.h include/psa/crypto_config.h
|
||||||
@ -26,7 +33,14 @@ cleanup() {
|
|||||||
record() {
|
record() {
|
||||||
export MBEDTLS_TEST_OUTCOME_FILE="$PWD/outcome-$1.csv"
|
export MBEDTLS_TEST_OUTCOME_FILE="$PWD/outcome-$1.csv"
|
||||||
rm -f $MBEDTLS_TEST_OUTCOME_FILE
|
rm -f $MBEDTLS_TEST_OUTCOME_FILE
|
||||||
|
|
||||||
make check
|
make check
|
||||||
|
|
||||||
|
if [ $SKIP_SSL_OPT -eq 0 ]; then
|
||||||
|
make -C programs ssl/ssl_server2 ssl/ssl_client2 \
|
||||||
|
test/udp_proxy test/query_compile_time_config
|
||||||
|
tests/ssl-opt.sh
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# save current HEAD
|
# save current HEAD
|
||||||
@ -35,21 +49,27 @@ HEAD=$(git branch --show-current)
|
|||||||
# get the numbers before this PR for default and full
|
# get the numbers before this PR for default and full
|
||||||
cleanup
|
cleanup
|
||||||
git checkout $(git merge-base HEAD development)
|
git checkout $(git merge-base HEAD development)
|
||||||
|
|
||||||
record "before-default"
|
record "before-default"
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
|
||||||
scripts/config.py full
|
scripts/config.py full
|
||||||
record "before-full"
|
record "before-full"
|
||||||
|
|
||||||
# get the numbers now for default and full
|
# get the numbers now for default and full
|
||||||
cleanup
|
cleanup
|
||||||
git checkout $HEAD
|
git checkout $HEAD
|
||||||
|
|
||||||
record "after-default"
|
record "after-default"
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
|
||||||
scripts/config.py full
|
scripts/config.py full
|
||||||
record "after-full"
|
record "after-full"
|
||||||
|
|
||||||
|
cleanup
|
||||||
|
|
||||||
# analysis
|
# analysis
|
||||||
|
|
||||||
populate_suites () {
|
populate_suites () {
|
||||||
@ -57,11 +77,19 @@ populate_suites () {
|
|||||||
make generated_files >/dev/null
|
make generated_files >/dev/null
|
||||||
data_files=$(cd tests/suites && echo *.data)
|
data_files=$(cd tests/suites && echo *.data)
|
||||||
for data in $data_files; do
|
for data in $data_files; do
|
||||||
suite=${data#test_suite_}
|
suite=${data%.data}
|
||||||
suite=${suite%.data}
|
|
||||||
SUITES="$SUITES $suite"
|
SUITES="$SUITES $suite"
|
||||||
done
|
done
|
||||||
make neat
|
make neat
|
||||||
|
|
||||||
|
if [ $SKIP_SSL_OPT -eq 0 ]; then
|
||||||
|
SUITES="$SUITES ssl-opt"
|
||||||
|
extra_files=$(cd tests/opt-testcases && echo *.sh)
|
||||||
|
for extra in $extra_files; do
|
||||||
|
suite=${extra%.sh}
|
||||||
|
SUITES="$SUITES $suite"
|
||||||
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
compare_suite () {
|
compare_suite () {
|
||||||
@ -69,7 +97,7 @@ compare_suite () {
|
|||||||
new="outcome-$2.csv"
|
new="outcome-$2.csv"
|
||||||
suite="$3"
|
suite="$3"
|
||||||
|
|
||||||
pattern_suite=";test_suite_$suite;"
|
pattern_suite=";$suite;"
|
||||||
total=$(grep -c "$pattern_suite" "$ref")
|
total=$(grep -c "$pattern_suite" "$ref")
|
||||||
sed_cmd="s/^.*$pattern_suite\(.*\);SKIP.*/\1/p"
|
sed_cmd="s/^.*$pattern_suite\(.*\);SKIP.*/\1/p"
|
||||||
sed -n "$sed_cmd" "$ref" > skipped-ref
|
sed -n "$sed_cmd" "$ref" > skipped-ref
|
||||||
@ -77,8 +105,9 @@ compare_suite () {
|
|||||||
nb_ref=$(wc -l <skipped-ref)
|
nb_ref=$(wc -l <skipped-ref)
|
||||||
nb_new=$(wc -l <skipped-new)
|
nb_new=$(wc -l <skipped-new)
|
||||||
|
|
||||||
printf "%36s: total %4d; skipped %4d -> %4d\n" \
|
name=${suite#test_suite_}
|
||||||
$suite $total $nb_ref $nb_new
|
printf "%40s: total %4d; skipped %4d -> %4d\n" \
|
||||||
|
$name $total $nb_ref $nb_new
|
||||||
if diff skipped-ref skipped-new | grep '^> '; then
|
if diff skipped-ref skipped-new | grep '^> '; then
|
||||||
ret=1
|
ret=1
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user