testing: Clearly mark the tests that failed
authorTobias Brunner <tobias@strongswan.org>
Thu, 13 Jul 2017 17:09:07 +0000 (19:09 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 7 Aug 2017 08:44:05 +0000 (10:44 +0200)
testing/do-tests

index 2ebc96e..97d7e45 100755 (executable)
@@ -427,17 +427,14 @@ do
                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("cmd_out=\044(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("cmd_out=\044(ssh \044SSHCONF root@\044ipv4_%s %s | grep \"%s\"); ",  host, command, pattern)
                }
                printf("cmd_exit=\044?; ")
-               printf("echo \"\044cmd_out\"; ")
-               printf("echo; ")
+               printf("cmd_fail=0; ")
                if (hit ~ /^[0-9]+$/)
                {
                        printf("if [ \044(echo \"\044cmd_out\" | wc -l) -ne %d ] ", hit)
@@ -447,7 +444,20 @@ do
                        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")
+               printf("; then STATUS=\"failed\"; cmd_fail=1; fi; \n")
+
+               printf("if [ \044cmd_fail -ne 0 ]; then echo \"~~~~~~~ FAIL ~~~~~~~\"; fi; \n")
+               if (command == "tcpdump")
+               {
+                       printf("echo \"%s# cat /tmp/tcpdump.log | grep \047%s\047  [%s]\"; ", host, pattern, hit)
+               }
+               else
+               {
+                       printf("echo \"%s# %s | grep \047%s\047  [%s]\"; ", host, command, pattern, hit)
+               }
+               printf("if [ -n \"\044cmd_out\" ]; then echo \"\044cmd_out\"; fi; \n")
+               printf("if [ \044cmd_fail -ne 0 ]; then echo \"~~~~~~~~~~~~~~~~~~~~\"; fi; \n")
+               printf("echo; ")
        }' $TESTDIR/evaltest.dat` >> $CONSOLE_LOG 2>&1