testing: Install iptables-dev to guest images
[strongswan.git] / testing / do-tests
index c48d64f..35f13ec 100755 (executable)
 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 # for more details.
-#
-# RCSID $Id: do-tests,v 1.20 2006/02/08 21:27:59 as Exp $
-
-DIR=`dirname $0`
 
-source $DIR/scripts/function.sh
+DIR=$(dirname `readlink -f $0`)
+. $DIR/testing.conf
+. $DIR/scripts/function.sh
+SSHCONF="-F $DIR/ssh_config"
 
-[ -f $DIR/testing.conf ] || die "Configuration file 'testing.conf' not found"
 [ -d $DIR/hosts ] || die "Directory 'hosts' not found"
 [ -d $DIR/tests ] || die "Directory 'tests' not found"
+[ -d $BUILDDIR ] ||
+       die "Directory '$BUILDDIR' does not exist, please run make-testing first"
 
-source $DIR/testing.conf
-
-
-##############################################################################
-# test if UMLs have been built at all
-#
-
-[ -d $BUILDDIR ] || die "Directory '$BUILDDIR' does not exist. Please run 'make-testing'first."
-
+ln -sfT $DIR $TESTDIR/testing
 
 ##############################################################################
 # take care of new path and file variables
@@ -40,15 +32,15 @@ source $DIR/testing.conf
 
 [ -d $TESTRESULTSDIR ] || mkdir $TESTRESULTSDIR
 
-TESTDATE=`date +%Y%m%d-%H%M`
+TESTDATE=`date +%Y%m%d-%H%M-%S`
 
 TODAYDIR=$TESTRESULTSDIR/$TESTDATE
 mkdir $TODAYDIR
 TESTRESULTSHTML=$TODAYDIR/all.html
 INDEX=$TODAYDIR/index.html
-DEFAULTTESTSDIR=$UMLTESTDIR/testing/tests
+DEFAULTTESTSDIR=$TESTDIR/testing/tests
 
-SOURCEIP_ROUTING_TABLE=100
+SOURCEIP_ROUTING_TABLE=220
 
 testnumber="0"
 failed_cnt="0"
@@ -103,46 +95,66 @@ done
 
 
 ##############################################################################
-# create header for the results html file
+# open ssh sessions
 #
+for host in $STRONGSWANHOSTS
+do
+    ssh $SSHCONF -N root@`eval echo \\\$ipv4_$host` >/dev/null 2>&1 &
+    eval ssh_pid_$host="`echo $!`"
+    do_on_exit kill `eval echo \\\$ssh_pid_$host`
+done
 
-KERNEL_VERSION=`basename $KERNEL .tar.bz2`
-IPSEC_VERSION=`basename $STRONGSWAN .tar.bz2`
 
-cat > $INDEX <<@EOF
-<html>
-<head>
-  <title>strongSwan UML Tests</title>
-</head>
-<body>
-  <h2>strongSwan UML Tests</h2>
-  <table border="0" cellspacing="2">
+##############################################################################
+# create header for the results html file
+#
+
+ENVIRONMENT_HEADER=$(cat <<@EOF
+  <table border="0" cellspacing="2" cellpadding="2">
     <tr valign="top">
-      <td><b>Host:</b></td>
+      <td><b>Host</b></td>
       <td colspan="3">`uname -a`</td>
     </tr>
     <tr valign="top">
-      <td><b>UML kernel: &nbsp;</b></td>
-      <td colspan="3">$KERNEL_VERSION</td>
+      <td><b>Guest kernel</b></td>
+      <td colspan="3">$KERNELVERSION</td>
     </tr>
     <tr valign="top">
-      <td><b>IPsec:</b></td>
-      <td colspan="3">$IPSEC_VERSION</td>
+      <td><b>strongSwan</b></td>
+      <td colspan="3">$SWANVERSION</td>
     </tr>
     <tr valign="top">
-      <td><b>Date:</b></td>
+      <td><b>Date</b></td>
       <td colspan="3">$TESTDATE</td>
     </tr>
     <tr>
       <td width="100">&nbsp;</td>
-      <td width="200">&nbsp;</td>
+      <td width="300">&nbsp;</td>
       <td width=" 50">&nbsp;</td>
       <td >&nbsp;</td>
     </tr>
 @EOF
+)
+
+cat > $INDEX <<@EOF
+<html>
+<head>
+  <title>strongSwan KVM Tests</title>
+</head>
+<body>
+  <h2>strongSwan KVM Tests</h2>
+  $ENVIRONMENT_HEADER
+@EOF
 
-cat $INDEX > $TESTRESULTSHTML
-cat >> $TESTRESULTSHTML <<@EOF
+cat > $TESTRESULTSHTML <<@EOF
+<html>
+<head>
+  <title>strongSwan KVM Tests - All Tests</title>
+</head>
+<body>
+  <div><a href="index.html">strongSwan KVM Tests</a> / All Tests</div>
+  <h2>All Tests</h2>
+  $ENVIRONMENT_HEADER
     <tr align="left">
       <th>Number</th>
       <th>Test</th>
@@ -150,10 +162,10 @@ cat >> $TESTRESULTSHTML <<@EOF
     </tr>
 @EOF
 
-cecho "UML kernel: $KERNEL_VERSION"
-cecho "IPsec:      $IPSEC_VERSION"
-cecho "Date:       $TESTDATE"
-cecho ""
+echo "Guest kernel : $KERNELVERSION"
+echo "strongSwan   : $SWANVERSION"
+echo "Date         : $TESTDATE"
+echo
 
 
 ##############################################################################
@@ -163,10 +175,6 @@ cecho ""
 if [ $# -gt 0 ]
 then
     TESTS=$*
-elif [ $SELECTEDTESTSONLY = "yes" ]
-then
-    # set internal field seperator
-    TESTS=$SELECTEDTESTS
 else
     # set internal field seperator
     TESTS="`ls $DEFAULTTESTSDIR`"
@@ -188,7 +196,7 @@ do
        mkdir $TODAYDIR/$SUBDIR
        if [ $testnumber == 0 ]
        then
-           FIRST="<b>Category:</b"
+           FIRST="<b>Category</b>"
        else
            FIRST="&nbsp;"
        fi
@@ -205,23 +213,24 @@ do
   <title>strongSwan $SUBDIR Tests</title>
 </head>
 <body>
+  <div><a href="../index.html">strongSwan KVM Tests</a> / $SUBDIR</div>
   <h2>strongSwan $SUBDIR Tests</h2>
-  <table border="0" cellspacing="2">
+  <table border="0" cellspacing="2" cellpadding="2">
     <tr valign="top">
-      <td><b>UML kernel: &nbsp;</b></td>
-      <td colspan="3">$KERNEL_VERSION</td>
+      <td><b>Guest kernel</b></td>
+      <td colspan="3">$KERNELVERSION</td>
     </tr>
     <tr valign="top">
-      <td><b>IPsec:</b></td>
-      <td colspan="3">$IPSEC_VERSION</td>
+      <td><b>strongSwan</b></td>
+      <td colspan="3">$SWANVERSION</td>
     </tr>
     <tr valign="top">
-      <td><b>Date:</b></td>
+      <td><b>Date</b></td>
       <td colspan="3">$TESTDATE</td>
     </tr>
     <tr>
       <td width="100">&nbsp;</td>
-      <td width="200">&nbsp;</td>
+      <td width="300">&nbsp;</td>
       <td width=" 50">&nbsp;</td>
       <td >&nbsp;</td>
     </tr>
@@ -237,14 +246,35 @@ do
     do
        let "testnumber += 1"
        testname=$SUBDIR/$name
-       cecho-n " $testnumber $testname.."
+       log_action " $testnumber $testname:"
 
        if [ ! -d $DEFAULTTESTSDIR/${testname} ]
        then
-           cecho "is missing..skipped"
+           echo "is missing..skipped"
            continue
        fi
 
+       if [ $SUBDIR = "ipv6" -o $name = "rw-psk-ipv6" ]
+       then
+           IPROUTE_CMD="ip -6 route list table $SOURCEIP_ROUTING_TABLE"
+           IPROUTE_DSP=$IPROUTE_CMD
+           IPTABLES_CMD="ip6tables -v -n -L"
+           IPTABLES_DSP="ip6tables -L"
+       else
+           IPROUTE_CMD="ip route list table $SOURCEIP_ROUTING_TABLE"
+           IPROUTE_DSP=$IPROUTE_CMD
+           IPTABLES_CMD="iptables -v -n -L"
+           IPTABLES_DSP="iptables -L"
+       fi
+
+       if [ $name = "net2net-ip4-in-ip6-ikev2" -o $name = "net2net-ip6-in-ip4-ikev2" ]
+       then
+           IPROUTE_CMD="ip route list table $SOURCEIP_ROUTING_TABLE; echo; ip -6 route list table $SOURCEIP_ROUTING_TABLE"
+           IPROUTE_DSP="ip (-6) route list table $SOURCEIP_ROUTING_TABLE"
+           IPTABLES_CMD="iptables -v -n -L ; echo ; ip6tables -v -n -L"
+           IPTABLES_DSP="iptables -L ; ip6tables -L"
+       fi
+
        [ -f $DEFAULTTESTSDIR/${testname}/description.txt ] || die "!! File 'description.txt' is missing"
        [ -f $DEFAULTTESTSDIR/${testname}/test.conf ]       || die "!! File 'test.conf' is missing"
        [ -f $DEFAULTTESTSDIR/${testname}/pretest.dat ]     || die "!! File 'pretest.dat' is missing"
@@ -320,6 +350,7 @@ do
        #
 
        $DIR/scripts/load-testconfig $testname
+       unset RADIUSHOSTS
        source $TESTDIR/test.conf
 
 
@@ -335,26 +366,35 @@ do
            do
                host=`echo $host_iface | awk -F ":" '{print $1}'`
                iface=`echo $host_iface | awk -F ":" '{if ($2 != "") { print $2 } else { printf("eth0") }}'`
-               tcpdump_cmd="tcpdump -i $iface not port ssh and not port domain and not arp > /tmp/tcpdump.log 2>&1 &"
+               tcpdump_cmd="tcpdump -i $iface not port ssh and not port domain > /tmp/tcpdump.log 2>&1 &"
                echo "${host}# $tcpdump_cmd" >> $CONSOLE_LOG
-               ssh root@`eval echo \\\$ipv4_$host '$tcpdump_cmd'`
+               ssh $SSHCONF root@`eval echo \\\$ipv4_$host '$tcpdump_cmd'`
                eval TDUP_${host}="true"
            done
        fi
 
+       ##########################################################################
+       # flush conntrack table on all hosts
+       #
+
+       for host in $STRONGSWANHOSTS
+       do
+               ssh $SSHCONF root@`eval echo \\\$ipv4_$host` 'conntrack -F' >/dev/null 2>&1
+       done
+
 
        ##########################################################################
        # execute pre-test commands
        #
 
-       cecho-n "pre.."
+       echo -n "pre.."
        echo -e "\nPRE-TEST\n" >> $CONSOLE_LOG 2>&1
 
        eval `awk -F "::" '{
            if ($2 != "")
            {
                printf("echo \"%s# %s\"; ", $1, $2)
-               printf("ssh root@\044ipv4_%s \"%s\"; ", $1, $2)
+               printf("ssh \044SSHCONF root@\044ipv4_%s \"%s\"; ", $1, $2)
                printf("echo;\n")
            }
        }' $TESTDIR/pretest.dat` >> $CONSOLE_LOG 2>&1
@@ -366,7 +406,7 @@ do
 
        function stop_tcpdump {
            echo "${1}# killall tcpdump" >> $CONSOLE_LOG
-           eval ssh root@\$ipv4_${1} killall tcpdump
+           eval ssh $SSHCONF root@\$ipv4_${1} killall tcpdump
            eval TDUP_${1}="false"
            echo ""
        }
@@ -376,7 +416,7 @@ do
        # get and evaluate test results
        #
 
-       cecho-n "test.."
+       echo -n "test.."
        echo -e "\nTEST\n" >> $CONSOLE_LOG 2>&1
 
        STATUS="passed"
@@ -392,12 +432,12 @@ do
                {
                    printf("if [ \044TDUP_%s == \"true\" ]; then stop_tcpdump %s; fi; \n", host, host)
                    printf("echo \"%s# cat /tmp/tcpdump.log | grep \047%s\047  [%s]\"; ", host, pattern, hit)
-                   printf("ssh root@\044ipv4_%s cat /tmp/tcpdump.log | grep \"%s\"; ", host, pattern)
+                   printf("ssh \044SSHCONF root@\044ipv4_%s cat /tmp/tcpdump.log | grep \"%s\"; ", host, pattern)
                }
                else
                {
                    printf("echo \"%s# %s | grep \047%s\047  [%s]\"; ", host, command, pattern, hit)
-                   printf("ssh root@\044ipv4_%s %s | grep \"%s\"; ",  host, command, pattern)
+                   printf("ssh \044SSHCONF root@\044ipv4_%s %s | grep \"%s\"; ",  host, command, pattern)
                }
                printf("cmd_exit=\044?; ")
                printf("echo; ")
@@ -431,8 +471,9 @@ do
   <title>Test $testname</title>
 </head>
 <body>
-<table border="0" width="600">
+<table border="0" cellpadding="0" cellspacing="0" width="600">
   <tr><td>
+    <div><a href="../../index.html">strongSwan KVM Tests</a> / <a href="../index.html">$SUBDIR</a> / $name</div>
     <h2>Test $testname</h2>
     <h3>Description</h3>
 @EOF
@@ -443,48 +484,180 @@ do
     <ul>
       <li><a href="console.log">console.log</a></li>
     </ul>
-    <img src="../../images/$DIAGRAM" alt="$UMLHOSTS">
+    <img src="../../images/$DIAGRAM" alt="$VIRTHOSTS">
 @EOF
 
        for host in $IPSECHOSTS
        do
            eval HOSTLOGIN=root@\$ipv4_${host}
 
-           for command in statusall listall
-           do
-               ssh $HOSTLOGIN ipsec $command \
-                   > $TESTRESULTDIR/${host}.$command 2>/dev/null
-           done
+               scp $SSHCONF $HOSTLOGIN:/etc/strongswan.conf \
+                   $TESTRESULTDIR/${host}.strongswan.conf  > /dev/null 2>&1
 
-           for file in ipsec.conf ipsec.secrets
-           do
-               scp $HOSTLOGIN:/etc/$file \
-                   $TESTRESULTDIR/${host}.$file  > /dev/null 2>&1
-           done
+               if [ $SUBDIR = "swanctl" ]
+               then
+                       scp $SSHCONF $HOSTLOGIN:/etc/swanctl/swanctl.conf \
+                       $TESTRESULTDIR/${host}.swanctl.conf  > /dev/null 2>&1
+
+                   ssh $SSHCONF $HOSTLOGIN swanctl --list-conns \
+                           > $TESTRESULTDIR/${host}.swanctl.conns 2>/dev/null
+
+                   ssh $SSHCONF $HOSTLOGIN swanctl --list-certs \
+                           > $TESTRESULTDIR/${host}.swanctl.certs 2>/dev/null
+
+                   ssh $SSHCONF $HOSTLOGIN swanctl --list-pools \
+                           > $TESTRESULTDIR/${host}.swanctl.pools 2>/dev/null
 
-           ssh $HOSTLOGIN ip route list table $SOURCEIP_ROUTING_TABLE \
-                   > $TESTRESULTDIR/${host}.iproute 2>/dev/null
-           ssh $HOSTLOGIN iptables -v -n -L \
+                   ssh $SSHCONF $HOSTLOGIN swanctl --list-sas \
+                           > $TESTRESULTDIR/${host}.swanctl.sas 2>/dev/null
+
+                   ssh $SSHCONF $HOSTLOGIN swanctl --list-pols \
+                           > $TESTRESULTDIR/${host}.swanctl.pols 2>/dev/null
+
+                   ssh $SSHCONF $HOSTLOGIN swanctl --stats \
+                           > $TESTRESULTDIR/${host}.swanctl.stats 2>/dev/null
+               else
+                   for file in ipsec.conf ipsec.secrets
+                   do
+                               scp $SSHCONF $HOSTLOGIN:/etc/$file \
+                           $TESTRESULTDIR/${host}.$file  > /dev/null 2>&1
+                   done
+
+                   for command in statusall listall
+                   do
+                               ssh $SSHCONF $HOSTLOGIN ipsec $command \
+                           > $TESTRESULTDIR/${host}.$command 2>/dev/null
+                   done
+
+                   scp $SSHCONF $HOSTLOGIN:/etc/ipsec.d/ipsec.sql \
+                       $TESTRESULTDIR/${host}.ipsec.sql  > /dev/null 2>&1
+               fi
+
+           ssh $SSHCONF $HOSTLOGIN ip -s xfrm policy \
+                   > $TESTRESULTDIR/${host}.ip.policy 2>/dev/null
+           ssh $SSHCONF $HOSTLOGIN ip -s xfrm state \
+                   > $TESTRESULTDIR/${host}.ip.state 2>/dev/null
+           ssh $SSHCONF $HOSTLOGIN $IPROUTE_CMD \
+                   > $TESTRESULTDIR/${host}.ip.route 2>/dev/null
+           ssh $SSHCONF $HOSTLOGIN $IPTABLES_CMD \
                    > $TESTRESULTDIR/${host}.iptables 2>/dev/null
-           cat >> $TESTRESULTDIR/index.html <<@EOF
+           chmod a+r $TESTRESULTDIR/*
+
+               if [ $SUBDIR = "swanctl" ]
+               then
+                   cat >> $TESTRESULTDIR/index.html <<@EOF
+    <h3>$host</h3>
+      <table border="0" cellspacing="0" width="600">
+      <tr>
+       <td valign="top">
+         <ul>
+           <li><a href="$host.swanctl.conf">swanctl.conf</a></li>
+           <li><a href="$host.swanctl.conns">swanctl --list-conns</a></li>
+           <li><a href="$host.swanctl.certs">swanctl --list-certs</a></li>
+           <li><a href="$host.swanctl.pools">swanctl --list-pools</a></li>
+           <li><a href="$host.strongswan.conf">strongswan.conf</a></li>
+         </ul>
+       </td>
+       <td valign="top">
+         <ul>
+           <li><a href="$host.swanctl.sas">swanctl --list-sas</a></li>
+           <li><a href="$host.swanctl.pols">swanctl --list-pols</a></li>
+           <li><a href="$host.swanctl.stats">swanctl --stats</a></li>
+           <li><a href="$host.auth.log">auth.log</a></li>
+           <li><a href="$host.daemon.log">daemon.log</a></li>
+         </ul>
+      </td>
+       <td valign="top">
+         <ul>
+           <li><a href="$host.ip.policy">ip -s xfrm policy</a></li>
+           <li><a href="$host.ip.state">ip -s xfrm state</a></li>
+           <li><a href="$host.ip.route">$IPROUTE_DSP</a></li>
+           <li><a href="$host.iptables">$IPTABLES_DSP</a></li>
+         </ul>
+         &nbsp;
+      </td>
+    </tr>
+    </table>
+@EOF
+
+               else
+                   cat >> $TESTRESULTDIR/index.html <<@EOF
     <h3>$host</h3>
-      <table border="0" cellspacing="0" width="400">
+      <table border="0" cellspacing="0" width="600">
       <tr>
-       <td>
+       <td valign="top">
          <ul>
            <li><a href="$host.ipsec.conf">ipsec.conf</a></li>
            <li><a href="$host.ipsec.secrets">ipsec.secrets</a></li>
+           <li><a href="$host.ipsec.sql">ipsec.sql</a></li>
+           <li><a href="$host.strongswan.conf">strongswan.conf</a></li>
+         </ul>
+       </td>
+       <td valign="top">
+         <ul>
            <li><a href="$host.statusall">ipsec statusall</a></li>
            <li><a href="$host.listall">ipsec listall</a></li>
+           <li><a href="$host.auth.log">auth.log</a></li>
+           <li><a href="$host.daemon.log">daemon.log</a></li>
+         </ul>
+      </td>
+       <td valign="top">
+         <ul>
+           <li><a href="$host.ip.policy">ip -s xfrm policy</a></li>
+           <li><a href="$host.ip.state">ip -s xfrm state</a></li>
+           <li><a href="$host.ip.route">$IPROUTE_DSP</a></li>
+           <li><a href="$host.iptables">$IPTABLES_DSP</a></li>
+         </ul>
+      </td>
+    </tr>
+    </table>
+@EOF
+               fi
+       done
+
+       for host in $RADIUSHOSTS
+       do
+           eval HOSTLOGIN=root@\$ipv4_${host}
+
+           for file in clients.conf eap.conf radiusd.conf proxy.conf users
+           do
+               scp $SSHCONF $HOSTLOGIN:/etc/freeradius/$file \
+                   $TESTRESULTDIR/${host}.$file  > /dev/null 2>&1
+           done
+
+               scp $SSHCONF $HOSTLOGIN:/etc/strongswan.conf \
+                   $TESTRESULTDIR/${host}.strongswan.conf  > /dev/null 2>&1
+
+           scp $SSHCONF $HOSTLOGIN:/var/log/freeradius/radius.log \
+               $TESTRESULTDIR/${host}.radius.log  > /dev/null 2>&1
+
+           ssh $SSHCONF $HOSTLOGIN grep imcv /var/log/daemon.log \
+               >> $TESTRESULTDIR/${host}.daemon.log 2>/dev/null
+
+           chmod a+r $TESTRESULTDIR/*
+           cat >> $TESTRESULTDIR/index.html <<@EOF
+    <h3>$host</h3>
+      <table border="0" cellspacing="0" width="600">
+      <tr>
+       <td valign="top">
+         <ul>
+           <li><a href="$host.clients.conf">clients.conf</a></li>
+           <li><a href="$host.radiusd.conf">radiusd.conf</a></li>
+           <li><a href="$host.strongswan.conf">strongswan.conf</a></li>
          </ul>
        </td>
-       <td>
+       <td valign="top">
          <ul>
-           <li><a href="$host.auth.log">auth.log</a></li>
+           <li><a href="$host.eap.conf">eap.conf</a></li>
+           <li><a href="$host.radius.log">radius.log</a></li>
            <li><a href="$host.daemon.log">daemon.log</a></li>
-           <li><a href="$host.iproute">ip route list table $SOURCEIP_ROUTING_TABLE</a></li>
-           <li><a href="$host.iptables">iptables -L</a></li>
-       </ul>
+         </ul>
+      </td>
+       <td valign="top">
+         <ul>
+           <li><a href="$host.proxy.conf">proxy.conf</a></li>
+           <li><a href="$host.users">users</a></li>
+         </ul>
       </td>
     </tr>
     </table>
@@ -493,9 +666,28 @@ do
        done
 
        cat >> $TESTRESULTDIR/index.html <<@EOF
-  </td></tr>
-  <tr><td align="right">
-    <b><a href="../index.html">Back</a></b>
+       <h3>tcpdump</h3>
+       <ul>
+@EOF
+
+       for host in $TCPDUMPHOSTS
+       do
+           eval HOSTLOGIN=root@\$ipv4_${host}
+
+               scp $SSHCONF $HOSTLOGIN:/tmp/tcpdump.log \
+                       $TESTRESULTDIR/${host}.tcpdump.log > /dev/null 2>&1
+
+           cat >> $TESTRESULTDIR/index.html <<@EOF
+           <li><a href="$host.tcpdump.log">$host tcpdump.log</a></li>
+@EOF
+
+       done
+
+       cat >> $TESTRESULTDIR/index.html <<@EOF
+       </ul>
+@EOF
+
+       cat >> $TESTRESULTDIR/index.html <<@EOF
   </td></tr>
 </table>
 </body>
@@ -507,14 +699,14 @@ do
        # execute post-test commands
        #
 
-       cecho-n "post.."
+       echo -n "post"
        echo -e "\nPOST-TEST\n" >> $CONSOLE_LOG 2>&1
 
        eval `awk -F "::" '{
            if ($2 != "")
            {
                printf("echo \"%s# %s\"; ", $1, $2)
-               printf("ssh root@\044ipv4_%s \"%s\"; ", $1, $2)
+               printf("ssh \044SSHCONF root@\044ipv4_%s \"%s\"; ", $1, $2)
                printf("echo;\n")
            }
        }' $TESTDIR/posttest.dat` >> $CONSOLE_LOG 2>&1
@@ -527,11 +719,8 @@ do
        for host in $IPSECHOSTS
        do
            eval HOSTLOGIN=root@\$ipv4_${host}
-           ssh $HOSTLOGIN grep pluto /var/log/auth.log \
-               > $TESTRESULTDIR/${host}.auth.log
-           echo >> $TESTRESULTDIR/${host}.auth.log
-           ssh $HOSTLOGIN grep charon /var/log/auth.log \
-               >> $TESTRESULTDIR/${host}.auth.log
+           ssh $SSHCONF $HOSTLOGIN "grep -E 'charon|last message repeated|imcv|pt-tls-client' \
+               /var/log/auth.log" >> $TESTRESULTDIR/${host}.auth.log
        done
 
 
@@ -542,11 +731,8 @@ do
        for host in $IPSECHOSTS
        do
            eval HOSTLOGIN=root@\$ipv4_${host}
-           ssh $HOSTLOGIN grep pluto /var/log/daemon.log \
-               > $TESTRESULTDIR/${host}.daemon.log
-           echo >> $TESTRESULTDIR/${host}.daemon.log
-           ssh $HOSTLOGIN grep charon /var/log/daemon.log \
-               >> $TESTRESULTDIR/${host}.daemon.log
+           ssh $SSHCONF $HOSTLOGIN "grep -E 'charon|last message repeated|imcv' \
+               /var/log/daemon.log" >> $TESTRESULTDIR/${host}.daemon.log
        done
 
 
@@ -559,7 +745,7 @@ do
            if [ "`eval echo \\\$TDUP_${host}`" = "true" ]
            then
                echo "${host}# killall tcpdump" >> $CONSOLE_LOG
-               eval ssh root@\$ipv4_$host killall tcpdump
+               eval ssh $SSHCONF root@\$ipv4_$host killall tcpdump
                eval TDUP_${host}="false"
            fi
        done
@@ -578,17 +764,17 @@ do
 
        if [ $STATUS = "passed" ]
        then
-           COLOR="green"
-           cecho "\033[1;32m$STATUS"
+               COLOR="green"
+               log_status 0
        else
-           COLOR="red"
-           cecho "$STATUS"
+               COLOR="red"
+               log_status 1
        fi
 
        cat >> $TESTRESULTSHTML << @EOF
   <tr>
     <td>$testnumber</td>
-    <td><a href="$testname/">$testname</a></td>
+    <td><a href="$testname/index.html">$testname</a></td>
     <td><a href="$testname/console.log"><font color="$COLOR">$STATUS</font></a></td>
     <td>&nbsp;</td>
   </tr>
@@ -596,12 +782,23 @@ do
        cat >> $SUBTESTSINDEX << @EOF
   <tr>
     <td>$testnumber</td>
-    <td><a href="$name/">$name</a></td>
+    <td><a href="$name/index.html">$name</a></td>
     <td><a href="$name/console.log"><font color="$COLOR">$STATUS</font></a></td>
     <td>&nbsp;</td>
   </tr>
 @EOF
 
+
+       ##########################################################################
+       # remove any charon.pid files that still may exist
+       #
+
+       for host in $IPSECHOSTS
+       do
+           eval HOSTLOGIN=root@\$ipv4_${host}
+           ssh $SSHCONF $HOSTLOGIN 'if [ -f /var/run/charon.pid ]; then rm /var/run/charon.pid; echo "    removed charon.pid on `hostname`"; fi'
+       done
+
     done
 
 done
@@ -612,11 +809,16 @@ done
 #
 
 cat >> $TESTRESULTSHTML << @EOF
+    <tr>
+      <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
+    </tr>
+    <tr>
+      <td><b>Passed</b></td><td><b><font color="green">$passed_cnt</font></b></td><td>&nbsp;</td><td>&nbsp;</td>
+    </tr>
+    <tr>
+      <td><b>Failed</b></td><td><b><font color="red">$failed_cnt</font></b></td><td>&nbsp;</td><td>&nbsp;</td>
+    </tr>
   </table>
-  <p>
-  <b>Passed: &nbsp; <font color="green">$passed_cnt</font></b><br>
-  <b>Failed: &nbsp; <font color="red">$failed_cnt</font></b><br>
-  <p>
 </body>
 </html>
 @EOF
@@ -631,7 +833,7 @@ cat >> $INDEX << @EOF
       <td>&nbsp;</td>
     </tr>
     <tr>
-      <td><b>Failed:</b></td>
+      <td><b>Failed</b></td>
       <td>&nbsp;</td>
       <td align="right"><b><font color="red">$failed_cnt</font></b></td>
       <td>&nbsp;</td>
@@ -641,23 +843,25 @@ cat >> $INDEX << @EOF
 </html>
 @EOF
 
-cecho ""
-cecho "\033[1;32mPassed:   $passed_cnt"
-cecho "Failed:   $failed_cnt"
-cecho ""
+echo
+echo_ok     "Passed : $passed_cnt"
+echo_failed "Failed : $failed_cnt"
+echo
 
 
 ##############################################################################
 # copy the test results to the apache server
 #
 
-HTDOCS="/var/www/localhost/htdocs"
+HTDOCS="/var/www"
+
+ssh $SSHCONF root@${ipv4_winnetou} mkdir -p $HTDOCS/testresults > /dev/null 2>&1
+scp $SSHCONF -r $TODAYDIR root@${ipv4_winnetou}:$HTDOCS/testresults > /dev/null 2>&1
+ssh $SSHCONF root@${ipv4_winnetou} ln -s $HTDOCS/images $HTDOCS/testresults/$TESTDATE/images > /dev/null 2>&1
+echo
+echo "The results are available in $TODAYDIR"
+echo "or via the link http://$ipv4_winnetou/testresults/$TESTDATE"
 
-cecho-n "Copying test results to winnetou.."
-ssh root@${ipv4_winnetou} mkdir -p $HTDOCS/testresults > /dev/null 2>&1
-scp -r $TODAYDIR root@${ipv4_winnetou}:$HTDOCS/testresults > /dev/null 2>&1
-ssh root@${ipv4_winnetou} ln -s $HTDOCS/images $HTDOCS/testresults/$TESTDATE/images > /dev/null 2>&1
-cgecho "done"
-cecho ""
-cecho "The results are available in $TODAYDIR"
-cecho "or via the link http://$ipv4_winnetou/testresults/$TESTDATE"
+ENDDATE=`date +%Y%m%d-%H%M`
+echo
+echo "Finished : $ENDDATE"