hierarchical display of tests
[strongswan.git] / testing / do-tests
index 8c0c12a..537a439 100755 (executable)
@@ -44,7 +44,8 @@ TESTDATE=`date +%Y%m%d-%H%M`
 
 TODAYDIR=$TESTRESULTSDIR/$TESTDATE
 mkdir $TODAYDIR
-TESTRESULTSHTML=$TODAYDIR/index.html
+TESTRESULTSHTML=$TODAYDIR/all.html
+INDEX=$TODAYDIR/index.html
 DEFAULTTESTSDIR=$UMLTESTDIR/testing/tests
 
 testnumber="0"
@@ -58,9 +59,6 @@ passed_cnt="0"
 
 TESTSDIR=$BUILDDIR/tests
 [ -d $TESTSDIR ] || mkdir $TESTSDIR
-rm -rf $TESTSDIR/*
-cp -rfp $DEFAULTTESTSDIR/* $TESTSDIR
-
 
 ##############################################################################
 # assign IP for each host to hostname
@@ -70,54 +68,31 @@ for host in $STRONGSWANHOSTS
 do
     eval ipv4_${host}="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
     eval ipv6_${host}="`echo $HOSTNAMEIPV6 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
+
     case $host in
     moon)
         eval ipv4_moon1="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
-        searchandreplace PH_IP_MOON1 $ipv4_moon1 $TESTSDIR
-        searchandreplace PH_IP_MOON  $ipv4_moon  $TESTSDIR
         eval ipv6_moon1="`echo $HOSTNAMEIPV6 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
-        searchandreplace PH_IP6_MOON1 $ipv6_moon1 $TESTSDIR
-        searchandreplace PH_IP6_MOON  $ipv6_moon  $TESTSDIR
         ;;
     sun)
         eval ipv4_sun1="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
-        searchandreplace PH_IP_SUN1 $ipv4_sun1 $TESTSDIR
-        searchandreplace PH_IP_SUN  $ipv4_sun  $TESTSDIR
         eval ipv6_sun1="`echo $HOSTNAMEIPV6 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
-        searchandreplace PH_IP6_SUN1 $ipv6_sun1 $TESTSDIR
-        searchandreplace PH_IP6_SUN  $ipv6_sun  $TESTSDIR
         ;;
     alice)
-        searchandreplace PH_IP_ALICE  $ipv4_alice $TESTSDIR
-        searchandreplace PH_IP6_ALICE $ipv6_alice $TESTSDIR
         ;;
     venus)
-        searchandreplace PH_IP_VENUS  $ipv4_venus $TESTSDIR
-        searchandreplace PH_IP6_VENUS $ipv6_venus $TESTSDIR
         ;;
     bob)
-        searchandreplace PH_IP_BOB   $ipv4_bob $TESTSDIR
-        searchandreplace PH_IPV6_BOB $ipv6_bob $TESTSDIR
         ;;
     carol)
         eval ipv4_carol1="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
-        searchandreplace PH_IP_CAROL1 $ipv4_carol1 $TESTSDIR
-        searchandreplace PH_IP_CAROL  $ipv4_carol  $TESTSDIR
         eval ipv6_carol1="`echo $HOSTNAMEIPV6 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
-        searchandreplace PH_IP6_CAROL1 $ipv6_carol1 $TESTSDIR
-        searchandreplace PH_IP6_CAROL  $ipv6_carol  $TESTSDIR
-        ;;
+         ;;
     dave)
         eval ipv4_dave1="`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
-        searchandreplace PH_IP_DAVE1 $ipv4_dave1 $TESTSDIR
-        searchandreplace PH_IP_DAVE  $ipv4_dave  $TESTSDIR
         eval ipv6_dave1="`echo $HOSTNAMEIPV6 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $2 }' | awk '{ print $1 }'`"
-        searchandreplace PH_IP6_DAVE1 $ipv6_dave1 $TESTSDIR
-        searchandreplace PH_IP6_DAVE  $ipv6_dave  $TESTSDIR
         ;;
     winnetou)
-        searchandreplace PH_IP_WINNETOU  $ipv4_winnetou $TESTSDIR
-        searchandreplace PH_IP6_WINNETOU $ipv6_winnetou $TESTSDIR
         ;;
     esac
 done
@@ -130,22 +105,45 @@ done
 KERNEL_VERSION=`basename $KERNEL .tar.bz2`
 IPSEC_VERSION=`basename $STRONGSWAN .tar.bz2`
 
-cat > $TESTRESULTSHTML <<@EOF
+cat > $INDEX <<@EOF
 <html>
 <head>
-  <title>strongSwan UML Testing</title>
+  <title>strongSwan UML Tests</title>
 </head>
 <body>
-  <h2>strongSwan UML Testing</h2>
+  <h2>strongSwan UML Tests</h2>
   <table border="0" cellspacing="2">
-    <tr><td><b>Host:</b></td><td>`uname -a`</td></tr>
-    <tr><td><b>UML kernel: &nbsp;</b></td><td>$KERNEL_VERSION</td></tr>
-    <tr><td><b>IPsec:</b></td><td>$IPSEC_VERSION</td></tr>
-    <tr><td><b>Date:</b></td><td>$TESTDATE</td></tr>
-  </table>
-  <p>
-  <table border="0" width="500">
-    <thead align="left"><th>Number</th><th>Test</th><th>Result</th></thead>
+    <tr valign="top">
+      <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>
+    </tr>
+    <tr valign="top">
+      <td><b>IPsec:</b></td>
+      <td colspan="3">$IPSEC_VERSION</td>
+    </tr>
+    <tr valign="top">
+      <td><b>Date:</b></td>
+      <td colspan="3">$TESTDATE</td>
+    </tr>
+    <tr>
+      <td width="100">&nbsp;</td>
+      <td width="200">&nbsp;</td>
+      <td width=" 50">&nbsp;</td>
+      <td >&nbsp;</td>
+    </tr>
+@EOF
+
+cat $INDEX > $TESTRESULTSHTML
+cat >> $TESTRESULTSHTML <<@EOF
+    <tr align="left">
+      <th>Number</th>
+      <th>Test</th>
+      <th colspan="2">Result</th>
+    </tr>
 @EOF
 
 cecho "UML kernel: $KERNEL_VERSION"
@@ -167,143 +165,256 @@ then
     TESTS=$SELECTEDTESTS
 else
     # set internal field seperator
-    TESTS="`ls $TESTSDIR`"
+    TESTS="`ls $DEFAULTTESTSDIR`"
 fi
 
-for testname in $TESTS
+for SUBDIR in $TESTS
 do
-    let "testnumber += 1"
-    cecho-n " $testnumber $testname.."
-    
-    if [ ! -d $TESTSDIR/${testname} ]
+    SUBTESTS="`basename $SUBDIR`"
+
+    if [ $SUBTESTS = $SUBDIR ]
     then
-       cecho "is missing..skipped"
-       continue
+       SUBTESTS="`ls $DEFAULTTESTSDIR/$SUBDIR`"
+    else
+       SUBDIR="`dirname $SUBDIR`"
     fi
 
-    [ -f $TESTSDIR/${testname}/description.txt ] || die "!! File 'description.txt' is missing"
-    [ -f $TESTSDIR/${testname}/test.conf ]       || die "!! File 'test.conf' is missing"
-    [ -f $TESTSDIR/${testname}/pretest.dat ]     || die "!! File 'pretest.dat' is missing"
-    [ -f $TESTSDIR/${testname}/posttest.dat ]    || die "!! File 'posttest.dat' is missing"
-    [ -f $TESTSDIR/${testname}/evaltest.dat ]    || die "!! File 'evaltest.dat' is missing"
+    if [ ! -d $TODAYDIR/$SUBDIR ]
+    then
+       mkdir $TODAYDIR/$SUBDIR
+       if [ $testnumber == 0 ]
+       then
+           FIRST="<b>Category:</b"
+       else
+           FIRST="&nbsp;"
+       fi
+       echo "    <tr><td>$FIRST</td><td><a href=\"$SUBDIR/index.html\">$SUBDIR</a></td></tr>" >> $INDEX
+       SUBTESTSINDEX=$TODAYDIR/$SUBDIR/index.html
+       cat > $SUBTESTSINDEX <<@EOF
+<html>
+<head>
+  <title>strongSwan $SUBDIR Tests</title>
+</head>
+<body>
+  <h2>strongSwan $SUBDIR Tests</h2>
+  <table border="0" cellspacing="2">
+    <tr valign="top">
+      <td><b>UML kernel: &nbsp;</b></td>
+      <td colspan="3">$KERNEL_VERSION</td>
+    </tr>
+    <tr valign="top">
+      <td><b>IPsec:</b></td>
+      <td colspan="3">$IPSEC_VERSION</td>
+    </tr>
+    <tr valign="top">
+      <td><b>Date:</b></td>
+      <td colspan="3">$TESTDATE</td>
+    </tr>
+    <tr>
+      <td width="100">&nbsp;</td>
+      <td width="200">&nbsp;</td>
+      <td width=" 50">&nbsp;</td>
+      <td >&nbsp;</td>
+    </tr>
+    <tr align="left">
+       <th>Number</th>
+       <th>Test</th>
+       <th colspan="2">Result</th>
+    </tr>
+@EOF
+    fi
 
-    TESTRESULTDIR=$TODAYDIR/$testname
-    mkdir $TESTRESULTDIR
-    CONSOLE_LOG=$TESTRESULTDIR/console.log
-    touch $CONSOLE_LOG
+    for name in $SUBTESTS
+    do
+       let "testnumber += 1"
+       testname=$SUBDIR/$name
+       cecho-n " $testnumber $testname.."
 
+       if [ ! -d $DEFAULTTESTSDIR/${testname} ]
+       then
+           cecho "is missing..skipped"
+           continue
+       fi
 
-    ##########################################################################
-    # copy test specific configurations to uml hosts and clear auth.log files
-    #
+       [ -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"
+       [ -f $DEFAULTTESTSDIR/${testname}/posttest.dat ]    || die "!! File 'posttest.dat' is missing"
+       [ -f $DEFAULTTESTSDIR/${testname}/evaltest.dat ]    || die "!! File 'evaltest.dat' is missing"
 
-    $DIR/scripts/load-testconfig $testname
-    source $TESTSDIR/$testname/test.conf
+       TESTRESULTDIR=$TODAYDIR/$testname
+       mkdir -p $TESTRESULTDIR
+       CONSOLE_LOG=$TESTRESULTDIR/console.log
+       touch $CONSOLE_LOG
 
-    
-    ##########################################################################
-    # run tcpdump in the background
-    #
+       TESTDIR=$TESTSDIR/${testname}
+       rm -rf $TESTDIR
+       mkdir -p $TESTDIR
+       cp -rfp $DEFAULTTESTSDIR/${testname}/* $TESTDIR
 
-    if [ "$TCPDUMPHOSTS" != "" ]
-    then
-        echo -e "TCPDUMP\n" >> $CONSOLE_LOG 2>&1
-
-        for host_iface in $TCPDUMPHOSTS
-        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 &"
-            echo "${host}# $tcpdump_cmd" >> $CONSOLE_LOG
-            ssh root@`eval echo \\\$ipv4_$host '$tcpdump_cmd'`
-           eval TDUP_${host}="true"
-        done
-    fi
 
-    ##########################################################################
-    # execute pre-test commands
-    #
+       ##############################################################################
+       # replace IP wildcards with actual IPv4 and IPv6 addresses
+       #
 
-    cecho-n "pre.."
-    echo -e "\nPRE-TEST\n" >> $CONSOLE_LOG 2>&1
+       for host in $STRONGSWANHOSTS
+       do
+           case $host in
+           moon)
+               searchandreplace PH_IP_MOON1     $ipv4_moon1 $TESTDIR
+               searchandreplace PH_IP_MOON      $ipv4_moon  $TESTDIR
+               searchandreplace PH_IP6_MOON1    $ipv6_moon1 $TESTDIR
+               searchandreplace PH_IP6_MOON     $ipv6_moon  $TESTDIR
+               ;;
+           sun)
+               searchandreplace PH_IP_SUN1      $ipv4_sun1 $TESTDIR
+               searchandreplace PH_IP_SUN       $ipv4_sun  $TESTDIR
+               searchandreplace PH_IP6_SUN1     $ipv6_sun1 $TESTDIR
+               searchandreplace PH_IP6_SUN      $ipv6_sun  $TESTDIR
+               ;;
+           alice)
+               searchandreplace PH_IP_ALICE     $ipv4_alice $TESTDIR
+               searchandreplace PH_IP6_ALICE    $ipv6_alice $TESTDIR
+               ;;
+           venus)
+               searchandreplace PH_IP_VENUS     $ipv4_venus $TESTDIR
+               searchandreplace PH_IP6_VENUS    $ipv6_venus $TESTDIR
+               ;;
+           bob)
+               searchandreplace PH_IP_BOB       $ipv4_bob $TESTDIR
+               searchandreplace PH_IPV6_BOB     $ipv6_bob $TESTDIR
+               ;;
+           carol)
+               searchandreplace PH_IP_CAROL1    $ipv4_carol1 $TESTDIR
+               searchandreplace PH_IP_CAROL     $ipv4_carol  $TESTDIR
+               searchandreplace PH_IP6_CAROL1   $ipv6_carol1 $TESTDIR
+               searchandreplace PH_IP6_CAROL    $ipv6_carol  $TESTDIR
+               ;;
+           dave)
+               searchandreplace PH_IP_DAVE1     $ipv4_dave1 $TESTDIR
+               searchandreplace PH_IP_DAVE      $ipv4_dave  $TESTDIR
+               searchandreplace PH_IP6_DAVE1    $ipv6_dave1 $TESTDIR
+               searchandreplace PH_IP6_DAVE     $ipv6_dave  $TESTDIR
+               ;;
+           winnetou)
+               searchandreplace PH_IP_WINNETOU  $ipv4_winnetou $TESTDIR
+               searchandreplace PH_IP6_WINNETOU $ipv6_winnetou $TESTDIR
+               ;;
+           esac
+       done
 
-    eval `awk -F "::" '{
-       if ($2 != "")
-       {
-           printf("echo \"%s# %s\"; ", $1, $2)
-           printf("ssh root@\044ipv4_%s \"%s\"; ", $1, $2)
-           printf("echo;\n")
-       }
-    }' $TESTSDIR/${testname}/pretest.dat` >> $CONSOLE_LOG 2>&1
 
+       ##########################################################################
+       # copy test specific configurations to uml hosts and clear auth.log files
+       #
 
-    ##########################################################################
-    # stop tcpdump
-    #
+       $DIR/scripts/load-testconfig $testname
+       source $TESTDIR/test.conf
 
-    function stop_tcpdump {
-        echo "${1}# killall tcpdump" >> $CONSOLE_LOG
-        eval ssh root@\$ipv4_${1} killall tcpdump
-        eval TDUP_${1}="false"
-       echo ""
-    }
 
+       ##########################################################################
+       # run tcpdump in the background
+       #
 
-    ##########################################################################
-    # get and evaluate test results
-    #
+       if [ "$TCPDUMPHOSTS" != "" ]
+       then
+           echo -e "TCPDUMP\n" >> $CONSOLE_LOG 2>&1
+
+           for host_iface in $TCPDUMPHOSTS
+           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 &"
+               echo "${host}# $tcpdump_cmd" >> $CONSOLE_LOG
+               ssh root@`eval echo \\\$ipv4_$host '$tcpdump_cmd'`
+               eval TDUP_${host}="true"
+           done
+       fi
 
-    cecho-n "test.."
-    echo -e "\nTEST\n" >> $CONSOLE_LOG 2>&1
 
-    STATUS="passed"
+       ##########################################################################
+       # execute pre-test commands
+       #
 
-    eval `awk -F "::" '{
-       host=$1
-       command=$2
-       pattern=$3
-       hit=$4
-       if (command != "")
-       {
-           if (command == "tcpdump")
-           {
-               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)
-           }
-           else
+       cecho-n "pre.."
+       echo -e "\nPRE-TEST\n" >> $CONSOLE_LOG 2>&1
+
+       eval `awk -F "::" '{
+           if ($2 != "")
            {
-               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("echo \"%s# %s\"; ", $1, $2)
+               printf("ssh root@\044ipv4_%s \"%s\"; ", $1, $2)
+               printf("echo;\n")
            }
-           printf("cmd_exit=\044?; ")
-           printf("echo; ")
-           printf("if [ \044cmd_exit -eq 0 -a \"%s\" = \"NO\"  ] ", hit)
-           printf("|| [ \044cmd_exit -ne 0 -a \"%s\" = \"YES\" ] ", hit)
-           printf("; then STATUS=\"failed\"; fi; \n")
+       }' $TESTDIR/pretest.dat` >> $CONSOLE_LOG 2>&1
+
 
+       ##########################################################################
+       # stop tcpdump
+       #
+
+       function stop_tcpdump {
+           echo "${1}# killall tcpdump" >> $CONSOLE_LOG
+           eval ssh root@\$ipv4_${1} killall tcpdump
+           eval TDUP_${1}="false"
+           echo ""
        }
-    }' $TESTSDIR/${testname}/evaltest.dat` >> $CONSOLE_LOG 2>&1
 
 
-    ##########################################################################
-    # set counters
-    #
+       ##########################################################################
+       # get and evaluate test results
+       #
+
+       cecho-n "test.."
+       echo -e "\nTEST\n" >> $CONSOLE_LOG 2>&1
+
+       STATUS="passed"
+
+       eval `awk -F "::" '{
+           host=$1
+           command=$2
+           pattern=$3
+           hit=$4
+           if (command != "")
+           {
+               if (command == "tcpdump")
+               {
+                   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)
+               }
+               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("cmd_exit=\044?; ")
+               printf("echo; ")
+               printf("if [ \044cmd_exit -eq 0 -a \"%s\" = \"NO\"  ] ", hit)
+               printf("|| [ \044cmd_exit -ne 0 -a \"%s\" = \"YES\" ] ", hit)
+               printf("; then STATUS=\"failed\"; fi; \n")
+           }
+       }' $TESTDIR/evaltest.dat` >> $CONSOLE_LOG 2>&1
 
-    if [ $STATUS = "failed" ]
-    then
-        let "failed_cnt += 1"
-    else
-        let "passed_cnt += 1"
-    fi
 
+       ##########################################################################
+       # set counters
+       #
+
+       if [ $STATUS = "failed" ]
+       then
+           let "failed_cnt += 1"
+       else
+           let "passed_cnt += 1"
+       fi
 
-    ##########################################################################
-    # log statusall and listall output
-    # get copies of ipsec.conf, ipsec.secrets
-    # create index.html for the given test case
 
-    cat > $TESTRESULTDIR/index.html <<@EOF
+       ##########################################################################
+       # log statusall and listall output
+       # get copies of ipsec.conf, ipsec.secrets
+       # create index.html for the given test case
+
+       cat > $TESTRESULTDIR/index.html <<@EOF
 <html>
 <head>
   <title>Test $testname</title>
@@ -315,46 +426,62 @@ do
     <h3>Description</h3>
 @EOF
 
-    cat $TESTSDIR/${testname}/description.txt >> $TESTRESULTDIR/index.html
+       cat $TESTDIR/description.txt >> $TESTRESULTDIR/index.html
 
-    cat >> $TESTRESULTDIR/index.html <<@EOF
+       cat >> $TESTRESULTDIR/index.html <<@EOF
     <ul>
       <li><a href="console.log">console.log</a></li>
     </ul>
-    <img src="../images/$DIAGRAM" alt="$UMLHOSTS">
+    <img src="../../images/$DIAGRAM" alt="$UMLHOSTS">
 @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
-
-       for file in ipsec.conf ipsec.secrets
+       for host in $IPSECHOSTS
        do
-           scp $HOSTLOGIN:/etc/$file \
-               $TESTRESULTDIR/${host}.$file  > /dev/null 2>&1
-       done
-
-       cat >> $TESTRESULTDIR/index.html <<@EOF
+           eval HOSTLOGIN=root@\$ipv4_${host}
+
+           for command in statusall listall
+           do
+               ssh $HOSTLOGIN ipsec $command \
+                   > $TESTRESULTDIR/${host}.$command 2>/dev/null
+           done
+
+           for file in ipsec.conf ipsec.secrets
+           do
+               scp $HOSTLOGIN:/etc/$file \
+                   $TESTRESULTDIR/${host}.$file  > /dev/null 2>&1
+           done
+
+           ssh $HOSTLOGIN ip route list \
+                   > $TESTRESULTDIR/${host}.iproute 2>/dev/null
+           ssh $HOSTLOGIN iptables -v -n -L \
+                   > $TESTRESULTDIR/${host}.iptables 2>/dev/null
+           cat >> $TESTRESULTDIR/index.html <<@EOF
     <h3>$host</h3>
-    <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.statusall">ipsec statusall</a></li>
-      <li><a href="$host.listall">ipsec listall</a></li>
-      <li><a href="$host.auth.log">auth.log</a></li>
-    </ul>
+      <table border="0" cellspacing="0" width="400">
+      <tr>
+       <td>
+         <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.statusall">ipsec statusall</a></li>
+           <li><a href="$host.listall">ipsec listall</a></li>
+         </ul>
+       </td>
+       <td>
+         <ul>
+           <li><a href="$host.auth.log">auth.log</a></li>
+           <li><a href="$host.daemon.log">daemon.log</a></li>
+           <li><a href="$host.iproute">ip route list</a></li>
+           <li><a href="$host.iptables">iptables -L</a></li>
+       </ul>
+      </td>
+    </tr>
+    </table>
 @EOF
 
-    done
+       done
 
-    cat >> $TESTRESULTDIR/index.html <<@EOF
+       cat >> $TESTRESULTDIR/index.html <<@EOF
   </td></tr>
   <tr><td align="right">
     <b><a href="../index.html">Back</a></b>
@@ -365,79 +492,105 @@ do
 @EOF
 
 
-    ##########################################################################
-    # execute post-test commands
-    #
+       ##########################################################################
+       # execute post-test commands
+       #
 
-    cecho-n "post.."
-    echo -e "\nPOST-TEST\n" >> $CONSOLE_LOG 2>&1
+       cecho-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("echo;\n")
-       }
-    }' $TESTSDIR/${testname}/posttest.dat` >> $CONSOLE_LOG 2>&1
+       eval `awk -F "::" '{
+           if ($2 != "")
+           {
+               printf("echo \"%s# %s\"; ", $1, $2)
+               printf("ssh root@\044ipv4_%s \"%s\"; ", $1, $2)
+               printf("echo;\n")
+           }
+       }' $TESTDIR/posttest.dat` >> $CONSOLE_LOG 2>&1
 
 
-    ##########################################################################
-    # get a copy of /var/log/auth.log
-    #
+       ##########################################################################
+       # get a copy of /var/log/auth.log
+       #
 
-    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
-    done
+       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
+       done
 
 
-    ##########################################################################
-    # stop tcpdump if necessary
-    #
+       ##########################################################################
+       # get a copy of /var/log/daemon.log
+       #
 
-    for host in $TCPDUMPHOSTS
-    do
-       if [ "`eval echo \\\$TDUP_${host}`" = "true" ]
-       then
-           echo "${host}# killall tcpdump" >> $CONSOLE_LOG
-           eval ssh root@\$ipv4_$host killall tcpdump
-           eval TDUP_${host}="false"
-       fi
-    done
+       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
+       done
 
 
-    ##########################################################################
-    # copy default host config back if necessary
-    #
+       ##########################################################################
+       # stop tcpdump if necessary
+       #
 
-    $DIR/scripts/restore-defaults $testname
+       for host in $TCPDUMPHOSTS
+       do
+           if [ "`eval echo \\\$TDUP_${host}`" = "true" ]
+           then
+               echo "${host}# killall tcpdump" >> $CONSOLE_LOG
+               eval ssh root@\$ipv4_$host killall tcpdump
+               eval TDUP_${host}="false"
+           fi
+       done
 
 
-    ##########################################################################
-    # write test status to html file
-    #
+       ##########################################################################
+       # copy default host config back if necessary
+       #
 
-    cecho "$STATUS"
-    if [ $STATUS = "passed" ]
-    then
-        COLOR="green"
-    else
-        COLOR="red"
-    fi
+       $DIR/scripts/restore-defaults $testname
+
+
+       ##########################################################################
+       # write test status to html file
+       #
+
+       cecho "$STATUS"
+       if [ $STATUS = "passed" ]
+       then
+           COLOR="green"
+       else
+           COLOR="red"
+       fi
 
-    cat >> $TESTRESULTSHTML << @EOF
+       cat >> $TESTRESULTSHTML << @EOF
   <tr>
     <td>$testnumber</td>
     <td><a href="$testname/">$testname</a></td>
     <td><a href="$testname/console.log"><font color="$COLOR">$STATUS</font></a></td>
+    <td>&nbsp;</td>
   </tr>
 @EOF
+       cat >> $SUBTESTSINDEX << @EOF
+  <tr>
+    <td>$testnumber</td>
+    <td><a href="$name/">$name</a></td>
+    <td><a href="$name/console.log"><font color="$COLOR">$STATUS</font></a></td>
+    <td>&nbsp;</td>
+  </tr>
+@EOF
+
+    done
 
 done
 
@@ -449,13 +602,33 @@ done
 cat >> $TESTRESULTSHTML << @EOF
   </table>
   <p>
-  <b>Passed: &nbsp; $passed_cnt</b><br>
-  <b>Failed: &nbsp; $failed_cnt</b><br>
+  <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
 
+let "all_cnt = $passed_cnt + $failed_cnt"
+
+cat >> $INDEX << @EOF
+    <tr>
+      <td>&nbsp;</td>
+      <td><a href="all.html"><b>all</b></a></td>
+         <td><b>$all_cnt</td>
+         <td>&nbsp;</td>
+    </tr>
+    <tr>
+      <td><b>Failed:</b></td>
+      <td>&nbsp;</td>
+         <td><b><font color="red">$failed_cnt</font></b></td>
+         <td>&nbsp;</td>
+    </tr>
+  </table>
+</body>
+</html>
+@EOF
+
 cecho ""
 cecho "Passed:   $passed_cnt"
 cecho "Failed:   $failed_cnt"