diff options
author | Tobias Brunner <tobias@strongswan.org> | 2016-09-13 11:50:09 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2016-09-20 15:36:14 +0200 |
commit | d8b2980aa5a9fcc87ec43089e0fc1e91907e4501 (patch) | |
tree | db92ad93c68151a45abc27fb15ed0c0b0b5b358d /testing/do-tests | |
parent | 4f1c6bc5a6195c0189858b920ab5c2bcf645a169 (diff) | |
download | strongswan-d8b2980aa5a9fcc87ec43089e0fc1e91907e4501.tar.bz2 strongswan-d8b2980aa5a9fcc87ec43089e0fc1e91907e4501.tar.xz |
testing: Log leaks and fail tests if any are detected
Diffstat (limited to 'testing/do-tests')
-rwxr-xr-x | testing/do-tests | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/testing/do-tests b/testing/do-tests index 8fcd7c82e..e24cbe5f4 100755 --- a/testing/do-tests +++ b/testing/do-tests @@ -357,7 +357,7 @@ do ########################################################################## - # copy test specific configurations to uml hosts and clear auth.log files + # copy test specific configurations to hosts and clear log files # DBDIR=/etc/db.d @@ -410,6 +410,16 @@ do done ########################################################################## + # remove leak detective log on all hosts + # + + export LEAK_DETECTIVE_LOG=/var/log/leak-detective.log + for host in $STRONGSWANHOSTS + do + ssh $SSHCONF root@`eval echo \\\$ipv4_$host` 'rm -f $LEAK_DETECTIVE_LOG' >/dev/null 2>&1 + done + + ########################################################################## # flush IPsec state on all hosts # @@ -802,6 +812,25 @@ do fi done + + ########################################################################## + # make sure there were no leaks + # + + for host in $STRONGSWANHOSTS + do + eval HOSTLOGIN=root@\$ipv4_${host} + LEAKS=`ssh $SSHCONF $HOSTLOGIN 'cat $LEAK_DETECTIVE_LOG 2>/dev/null | grep -v "No leaks detected.*"'` + if [ -n "$LEAKS" ] + then + echo -e "\n$host# cat $LEAK_DETECTIVE_LOG [NO]" >> $CONSOLE_LOG + echo "$LEAKS" >> $CONSOLE_LOG + echo "<<< $host $LEAK_DETECTIVE_LOG >>>" >> $CONSOLE_LOG + STATUS="failed" + fi + done + + ########################################################################## # get a copy of /var/log/auth.log # |