added ip route list and iptables -L
authorAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 3 Apr 2007 21:18:46 +0000 (21:18 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 3 Apr 2007 21:18:46 +0000 (21:18 -0000)
testing/do-tests

index 156a7e0..fd11a63 100755 (executable)
@@ -123,6 +123,21 @@ cat > $TESTRESULTSHTML <<@EOF
     <thead align="left"><th>Number</th><th>Test</th><th>Result</th></thead>
 @EOF
 
+cat > $ALLHTML <<@EOF
+<html>
+<head>
+  <title>strongSwan UML Testing</title>
+</head>
+<body>
+  <h2>strongSwan UML Testing</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>
+    <tr><td colspan="2">&nbsp;</td></tr>
+@EOF
+
 cecho "UML kernel: $KERNEL_VERSION"
 cecho "IPsec:      $IPSEC_VERSION"
 cecho "Date:       $TESTDATE"
@@ -156,6 +171,12 @@ do
        SUBDIR="`dirname $SUBDIR`"
     fi
 
+    if [ ! -d $TODAYDIR/$SUBDIR ]
+    then
+       mkdir $TODAYDIR/$SUBDIR
+       echo "<tr><td>&nbsp;</td><td><a href=\"$SUBDIR\">$SUBDIR</a></td>" >> $ALLHTML
+    fi
+
     for name in $SUBTESTS
     do
        let "testnumber += 1"
@@ -315,19 +336,6 @@ do
                    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 if (command == "tcpdumpcount")
-               {
-                   printf("if [ \044TDUP_%s == \"true\" ]; then stop_tcpdump %s; fi; \n", host, host)
-                   printf("echo -e \"%s# [ \\\\140cat /tmp/tcpdump.log | grep \047%s\047 | tee -a /dev/stderr | wc -l\\\\140 -eq %s ]  [YES]\"; ", host, pattern, hit)
-                   printf("tcpdumpcount=\`ssh root@\044ipv4_%s cat /tmp/tcpdump.log | grep \"%s\" | tee -a /dev/stderr | wc -l\`; ", host, pattern)
-                   printf("[ \044tcpdumpcount -eq %s ]; ", hit)
-                   hit="YES"
-               }
-               else if (command == "cmd")
-               {
-                   printf("echo \"%s# %s  [%s]\"; ", host, pattern, hit)
-                   printf("ssh root@\044ipv4_%s %s; ",  host, pattern)
-               }
                else
                {
                    printf("echo \"%s# %s | grep \047%s\047  [%s]\"; ", host, command, pattern, hit)
@@ -396,16 +404,32 @@ do
                    $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>
-      <li><a href="$host.daemon.log">daemon.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
@@ -528,6 +552,12 @@ cat >> $TESTRESULTSHTML << @EOF
 </html>
 @EOF
 
+cat >> $ALLHTML << @EOF
+  </table>
+</body>
+</html>
+@EOF
+
 cecho ""
 cecho "Passed:   $passed_cnt"
 cecho "Failed:   $failed_cnt"