Merge branch 'development' into dtls

* development:
  Fix previous commit
  Allow flexible location of valgrind
  Fix test scripts portability issues
  Fix Gnu-ism in script

Conflicts:
	tests/ssl-opt.sh
This commit is contained in:
Manuel Pégourié-Gonnard 2015-01-12 14:54:55 +01:00
commit a65d5082b6
4 changed files with 31 additions and 27 deletions

View file

@ -104,8 +104,10 @@ if(ENABLE_TESTING)
) )
ADD_CUSTOM_TARGET(memcheck ADD_CUSTOM_TARGET(memcheck
COMMAND sed -i.bak s+/usr/bin/valgrind+`which valgrind`+ DartConfiguration.tcl
COMMAND ctest -O memcheck.log -D ExperimentalMemCheck COMMAND ctest -O memcheck.log -D ExperimentalMemCheck
COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null
COMMAND rm -f memcheck.log COMMAND rm -f memcheck.log
COMMAND mv DartConfiguration.tcl.bak DartConfiguration.tcl
) )
endif() endif()

View file

@ -56,16 +56,16 @@ PEERS="OpenSSL$PEER_GNUTLS PolarSSL"
print_usage() { print_usage() {
echo "Usage: $0" echo "Usage: $0"
echo -e " -h|--help\tPrint this help." printf " -h|--help\tPrint this help.\n"
echo -e " -f|--filter\tOnly matching ciphersuites are tested (Default: '$FILTER')" printf " -f|--filter\tOnly matching ciphersuites are tested (Default: '$FILTER')\n"
echo -e " -e|--exclude\tMatching ciphersuites are excluded (Default: '$EXCLUDE')" printf " -e|--exclude\tMatching ciphersuites are excluded (Default: '$EXCLUDE')\n"
echo -e " -m|--modes\tWhich modes to perform (Default: '$MODES')" printf " -m|--modes\tWhich modes to perform (Default: '$MODES')\n"
echo -e " -t|--types\tWhich key exchange type to perform (Default: '$TYPES')" printf " -t|--types\tWhich key exchange type to perform (Default: '$TYPES')\n"
echo -e " -V|--verify\tWhich verification modes to perform (Default: '$VERIFIES')" printf " -V|--verify\tWhich verification modes to perform (Default: '$VERIFIES')\n"
echo -e " -p|--peers\tWhich peers to use (Default: '$PEERS')" printf " -p|--peers\tWhich peers to use (Default: '$PEERS')\n"
echo -e " \tAlso available: GnuTLS (needs v3.2.15 or higher)" printf " \tAlso available: GnuTLS (needs v3.2.15 or higher)\n"
echo -e " -M|--memcheck\tCheck memory leaks and errors." printf " -M|--memcheck\tCheck memory leaks and errors.\n"
echo -e " -v|--verbose\tSet verbose output." printf " -v|--verbose\tSet verbose output.\n"
} }
get_options() { get_options() {
@ -166,7 +166,7 @@ filter()
done done
# normalize whitespace # normalize whitespace
echo "$NEW_LIST" | sed -e 's/[[:space:]]\+/ /g' -e 's/^ //' -e 's/ $//' echo "$NEW_LIST" | sed -e 's/[[:space:]][[:space:]]*/ /g' -e 's/^ //' -e 's/ $//'
} }
# OpenSSL 1.0.1h with -Verify wants a ClientCertificate message even for # OpenSSL 1.0.1h with -Verify wants a ClientCertificate message even for
@ -923,9 +923,9 @@ run_client() {
VERIF=$(echo $VERIFY | tr '[:upper:]' '[:lower:]') VERIF=$(echo $VERIFY | tr '[:upper:]' '[:lower:]')
TITLE="`echo $1 | head -c1`->`echo $SERVER_NAME | head -c1`" TITLE="`echo $1 | head -c1`->`echo $SERVER_NAME | head -c1`"
TITLE="$TITLE $MODE,$VERIF $2" TITLE="$TITLE $MODE,$VERIF $2"
echo -n "$TITLE " printf "$TITLE "
LEN=$(( 72 - `echo "$TITLE" | wc -c` )) LEN=$(( 72 - `echo "$TITLE" | wc -c` ))
for i in `seq 1 $LEN`; do echo -n '.'; done; echo -n ' ' for i in `seq 1 $LEN`; do printf '.'; done; printf ' '
# should we skip? # should we skip?
if [ "X$SKIP_NEXT" = "XYES" ]; then if [ "X$SKIP_NEXT" = "XYES" ]; then
@ -1201,9 +1201,9 @@ echo "------------------------------------------------------------------------"
if [ $FAILED -ne 0 -o $SRVMEM -ne 0 ]; if [ $FAILED -ne 0 -o $SRVMEM -ne 0 ];
then then
echo -n "FAILED" printf "FAILED"
else else
echo -n "PASSED" printf "PASSED"
fi fi
if [ "$MEMCHECK" -gt 0 ]; then if [ "$MEMCHECK" -gt 0 ]; then

View file

@ -44,7 +44,7 @@ cleanup()
{ {
make clean make clean
find -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} \+ find . -iname '*cmake*' -not -name CMakeLists.txt -exec rm -rf {} \+
rm -f include/Makefile include/polarssl/Makefile programs/*/Makefile rm -f include/Makefile include/polarssl/Makefile programs/*/Makefile
git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile
git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile

View file

@ -35,10 +35,10 @@ EXCLUDE='^$'
print_usage() { print_usage() {
echo "Usage: $0 [options]" echo "Usage: $0 [options]"
echo -e " -h|--help\tPrint this help." printf " -h|--help\tPrint this help.\n"
echo -e " -m|--memcheck\tCheck memory leaks and errors." printf " -m|--memcheck\tCheck memory leaks and errors.\n"
echo -e " -f|--filter\tOnly matching tests are executed (default: '$FILTER')" printf " -f|--filter\tOnly matching tests are executed (default: '$FILTER')\n"
echo -e " -e|--exclude\tMatching tests are excluded (default: '$EXCLUDE')" printf " -e|--exclude\tMatching tests are excluded (default: '$EXCLUDE')\n"
} }
get_options() { get_options() {
@ -145,10 +145,10 @@ needs_more_time() {
# print_name <name> # print_name <name>
print_name() { print_name() {
echo -n "$1 " printf "$1 "
LEN=$(( 72 - `echo "$1" | wc -c` )) LEN=$(( 72 - `echo "$1" | wc -c` ))
for i in `seq 1 $LEN`; do echo -n '.'; done for i in `seq 1 $LEN`; do printf '.'; done
echo -n ' ' printf ' '
TESTS=$(( $TESTS + 1 )) TESTS=$(( $TESTS + 1 ))
} }
@ -229,9 +229,11 @@ wait_server_start() {
# make a tight loop, server usually takes less than 1 sec to start # make a tight loop, server usually takes less than 1 sec to start
if [ "$DTLS" -eq 1 ]; then if [ "$DTLS" -eq 1 ]; then
until lsof -nbi UDP:"$SRV_PORT" | grep UDP >/dev/null; do :; done until lsof -nbi UDP:"$SRV_PORT" 2>/dev/null | grep UDP >/dev/null;
do :; done
else else
until lsof -nbi TCP:"$SRV_PORT" | grep LISTEN >/dev/null; do :; done until lsof -nbi TCP:"$SRV_PORT" 2>/dev/null | grep LISTEN >/dev/null;
do :; done
fi fi
kill $DOG_PID >/dev/null 2>&1 kill $DOG_PID >/dev/null 2>&1
@ -2782,9 +2784,9 @@ run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \
echo "------------------------------------------------------------------------" echo "------------------------------------------------------------------------"
if [ $FAILS = 0 ]; then if [ $FAILS = 0 ]; then
echo -n "PASSED" printf "PASSED"
else else
echo -n "FAILED" printf "FAILED"
fi fi
PASSES=$(( $TESTS - $FAILS )) PASSES=$(( $TESTS - $FAILS ))
echo " ($PASSES / $TESTS tests ($SKIPS skipped))" echo " ($PASSES / $TESTS tests ($SKIPS skipped))"