mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-13 04:13:45 +00:00
Fix scripts to support multiple openssl and gnutls
This commit is contained in:
parent
94d73b0b0a
commit
84c46db746
@ -181,6 +181,12 @@ echo "GNUTLS_SERV: $GNUTLS_SERV"
|
|||||||
echo "GNUTLS_LEGACY_CLI: $GNUTLS_LEGACY_CLI"
|
echo "GNUTLS_LEGACY_CLI: $GNUTLS_LEGACY_CLI"
|
||||||
echo "GNUTLS_LEGACY_SERV: $GNUTLS_LEGACY_SERV"
|
echo "GNUTLS_LEGACY_SERV: $GNUTLS_LEGACY_SERV"
|
||||||
|
|
||||||
|
# To avoid setting OpenSSL and GnuTLS for each call to compat.sh and ssl-opt.sh
|
||||||
|
# we just export the variables they require
|
||||||
|
export OPENSSL_CMD="$OPENSSL"
|
||||||
|
export GNUTLS_CLI="$GNUTLS_CLI"
|
||||||
|
export GNUTLS_SERV="$GNUTLS_SERV"
|
||||||
|
|
||||||
# Make sure the tools we need are available.
|
# Make sure the tools we need are available.
|
||||||
check_tools "$OPENSSL" "$OPENSSL_LEGACY" "$GNUTLS_CLI" "$GNUTLS_SERV" \
|
check_tools "$OPENSSL" "$OPENSSL_LEGACY" "$GNUTLS_CLI" "$GNUTLS_SERV" \
|
||||||
"$GNUTLS_LEGACY_CLI" "$GNUTLS_LEGACY_SERV" "doxygen" "dot" \
|
"$GNUTLS_LEGACY_CLI" "$GNUTLS_LEGACY_SERV" "doxygen" "dot" \
|
||||||
|
@ -36,11 +36,30 @@ if [ -d library -a -d include -a -d tests ]; then :; else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
: ${OPENSSL:="openssl"}
|
||||||
|
: ${OPENSSL_LEGACY:="$OPENSSL"}
|
||||||
|
: ${GNUTLS_CLI:="gnutls-cli"}
|
||||||
|
: ${GNUTLS_SERV:="gnutls-serv"}
|
||||||
|
: ${GNUTLS_LEGACY_CLI:="$GNUTLS_CLI"}
|
||||||
|
: ${GNUTLS_LEGACY_SERV:="$GNUTLS_SERV"}
|
||||||
|
|
||||||
|
# To avoid setting OpenSSL and GnuTLS for each call to compat.sh and ssl-opt.sh
|
||||||
|
# we just export the variables they require
|
||||||
|
export OPENSSL_CMD="$OPENSSL"
|
||||||
|
export GNUTLS_CLI="$GNUTLS_CLI"
|
||||||
|
export GNUTLS_SERV="$GNUTLS_SERV"
|
||||||
|
|
||||||
CONFIG_H='include/mbedtls/config.h'
|
CONFIG_H='include/mbedtls/config.h'
|
||||||
CONFIG_BAK="$CONFIG_H.bak"
|
CONFIG_BAK="$CONFIG_H.bak"
|
||||||
|
|
||||||
# Step 0 - print build environment info
|
# Step 0 - print build environment info
|
||||||
scripts/output_env.sh
|
OPENSSL="$OPENSSL" \
|
||||||
|
OPENSSL_LEGACY="$OPENSSL_LEGACY" \
|
||||||
|
GNUTLS_CLI="$GNUTLS_CLI" \
|
||||||
|
GNUTLS_SERV="$GNUTLS_SERV" \
|
||||||
|
GNUTLS_LEGACY_CLI="$GNUTLS_LEGACY_CLI" \
|
||||||
|
GNUTLS_LEGACY_SERV="$GNUTLS_LEGACY_SERV" \
|
||||||
|
scripts/output_env.sh
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Step 1 - Make and instrumented build for code coverage
|
# Step 1 - Make and instrumented build for code coverage
|
||||||
@ -65,7 +84,15 @@ sh ssl-opt.sh |tee sys-test-$TEST_OUTPUT
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
# Step 2c - Compatibility tests
|
# Step 2c - Compatibility tests
|
||||||
sh compat.sh |tee compat-test-$TEST_OUTPUT
|
sh compat.sh -m 'tls1 tls1_1 tls1_2 dtls1 dtls1_2' | \
|
||||||
|
tee compat-test-$TEST_OUTPUT
|
||||||
|
OPENSSL_CMD="$OPENSSL_LEGACY" \
|
||||||
|
sh compat.sh -m 'ssl3' |tee -a compat-test-$TEST_OUTPUT
|
||||||
|
OPENSSL_CMD="$OPENSSL_LEGACY" \
|
||||||
|
GNUTLS_CLI="$GNUTLS_LEGACY_CLI" \
|
||||||
|
GNUTLS_SERV="$GNUTLS_LEGACY_SERV" \
|
||||||
|
sh compat.sh -e '3DES\|DES-CBC3' -f 'NULL\|DES\|RC4\|ARCFOUR' | \
|
||||||
|
tee -a compat-test-$TEST_OUTPUT
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Step 3 - Process the coverage report
|
# Step 3 - Process the coverage report
|
||||||
@ -128,9 +155,9 @@ TOTAL_EXED=$(($TOTAL_EXED + $TOTAL_TESTS))
|
|||||||
# Step 4c - System Compatibility tests
|
# Step 4c - System Compatibility tests
|
||||||
echo "System/Compatibility tests - tests/compat.sh"
|
echo "System/Compatibility tests - tests/compat.sh"
|
||||||
|
|
||||||
PASSED_TESTS=$(tail -n5 compat-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* skipped))$/\1/p')
|
PASSED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* skipped))$/\1/p' | awk 'BEGIN{ s = 0 } { s += $1 } END{ print s }')
|
||||||
SKIPPED_TESTS=$(tail -n5 compat-test-$TEST_OUTPUT|sed -n -e 's/.* ([0-9]* \/ [0-9]* tests (\([0-9]*\) skipped))$/\1/p')
|
SKIPPED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* ([0-9]* \/ [0-9]* tests (\([0-9]*\) skipped))$/\1/p' | awk 'BEGIN{ s = 0 } { s += $1 } END{ print s }')
|
||||||
EXED_TESTS=$(tail -n5 compat-test-$TEST_OUTPUT|sed -n -e 's/.* ([0-9]* \/ \([0-9]*\) tests ([0-9]* skipped))$/\1/p')
|
EXED_TESTS=$(cat compat-test-$TEST_OUTPUT | sed -n -e 's/.* ([0-9]* \/ \([0-9]*\) tests ([0-9]* skipped))$/\1/p' | awk 'BEGIN{ s = 0 } { s += $1 } END{ print s }')
|
||||||
FAILED_TESTS=$(($EXED_TESTS - $PASSED_TESTS))
|
FAILED_TESTS=$(($EXED_TESTS - $PASSED_TESTS))
|
||||||
|
|
||||||
echo "Passed : $PASSED_TESTS"
|
echo "Passed : $PASSED_TESTS"
|
||||||
|
@ -1,12 +1,26 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Do test builds of the yotta module for all supported targets
|
# yotta-build.sh
|
||||||
|
#
|
||||||
|
# This file is part of mbed TLS (https://tls.mbed.org)
|
||||||
|
#
|
||||||
|
# Copyright (c) 2015-2016, ARM Limited, All Rights Reserved
|
||||||
|
#
|
||||||
|
# Purpose
|
||||||
|
#
|
||||||
|
# To run test builds of the yotta module for all supported targets.
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
yotta/create-module.sh
|
check_tools()
|
||||||
cd yotta/module
|
{
|
||||||
yt update || true # needs network
|
for TOOL in "$@"; do
|
||||||
|
if ! `hash "$TOOL" >/dev/null 2>&1`; then
|
||||||
|
echo "$TOOL not found!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
yotta_build()
|
yotta_build()
|
||||||
{
|
{
|
||||||
@ -19,22 +33,29 @@ yotta_build()
|
|||||||
yt -t $TARGET build -d
|
yt -t $TARGET build -d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Make sure the tools we need are available.
|
||||||
|
check_tools "arm-none-eabi-gcc" "armcc" "yotta"
|
||||||
|
|
||||||
|
yotta/create-module.sh
|
||||||
|
cd yotta/module
|
||||||
|
yt update || true # needs network
|
||||||
|
|
||||||
if uname -a | grep 'Linux.*x86' >/dev/null; then
|
if uname -a | grep 'Linux.*x86' >/dev/null; then
|
||||||
yotta_build x86-linux-native
|
yotta_build x86-linux-native
|
||||||
fi
|
fi
|
||||||
if uname -a | grep 'Darwin.*x86' >/dev/null; then
|
if uname -a | grep 'Darwin.*x86' >/dev/null; then
|
||||||
yotta_build x86-osx-native
|
yotta_build x86-osx-native
|
||||||
fi
|
fi
|
||||||
if which armcc >/dev/null && armcc --help >/dev/null 2>&1; then
|
|
||||||
yotta_build frdm-k64f-armcc
|
# armcc build tests.
|
||||||
#yotta_build nordic-nrf51822-16k-armcc
|
yotta_build frdm-k64f-armcc
|
||||||
fi
|
#yotta_build nordic-nrf51822-16k-armcc
|
||||||
if which arm-none-eabi-gcc >/dev/null; then
|
|
||||||
yotta_build frdm-k64f-gcc
|
# arm-none-eabi-gcc build tests.
|
||||||
#yotta_build st-nucleo-f401re-gcc # dirent
|
yotta_build frdm-k64f-gcc
|
||||||
#yotta_build stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4
|
#yotta_build st-nucleo-f401re-gcc # dirent
|
||||||
#yotta_build nordic-nrf51822-16k-gcc # fails in minar-platform
|
#yotta_build stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4
|
||||||
#yotta_build bbc-microbit-classic-gcc # fails in minar-platform
|
#yotta_build nordic-nrf51822-16k-gcc # fails in minar-platform
|
||||||
#yotta_build st-stm32f439zi-gcc # fails in mbed-hal-st-stm32f4
|
#yotta_build bbc-microbit-classic-gcc # fails in minar-platform
|
||||||
#yotta_build st-stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4
|
#yotta_build st-stm32f439zi-gcc # fails in mbed-hal-st-stm32f4
|
||||||
fi
|
#yotta_build st-stm32f429i-disco-gcc # fails in mbed-hal-st-stm32f4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user