From ced8acf30581c36745bdf22d68acd802aa5a25c9 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 26 Feb 2019 05:03:22 +0100 Subject: [PATCH] log time in tcpdump-start and -stop.sh Also log the testcase name in tcpdump-start.sh. The output now looks like ------ MSC_Tests.TC_mo_cc_bssmap_clear ------ Thu Mar 7 13:21:00 UTC 2019 [...] Thu Mar 7 13:21:04 UTC 2019 ====== MSC_Tests.TC_mo_cc_bssmap_clear pass ====== The reason to log start and end dates came up like this: I noticed a segfault in a tested program at a specific time. From the timestamp I tried to find out which of the tests saw the failure. (After a segfault, all subsequent tests run and fail, but it is not obvious which failure occured because of a segfault, and which ones just normally failed before that.) Looking at the timestamps of the log files didn't help, because the ttcn3_logmerge touched those after the tests completed. So the only way is to cat each individual log file and find the timestamp. So this adds an overview of the timestamps without needing to open log files. Change-Id: I0832d9b5df599baad5dec8d3a993481b4286fbb3 --- ttcn3-tcpdump-start.sh | 3 +++ ttcn3-tcpdump-stop.sh | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ttcn3-tcpdump-start.sh b/ttcn3-tcpdump-start.sh index 395941d41..747002be5 100755 --- a/ttcn3-tcpdump-start.sh +++ b/ttcn3-tcpdump-start.sh @@ -4,6 +4,9 @@ PIDFILE=/tmp/tcpdump.pid TCPDUMP=/usr/sbin/tcpdump TESTCASE=$1 +echo "------ $TESTCASE ------" +date + if [ "z$TTCN3_PCAP_PATH" = "z" ]; then TTCN3_PCAP_PATH=/tmp fi diff --git a/ttcn3-tcpdump-stop.sh b/ttcn3-tcpdump-stop.sh index 940484112..baabefe4a 100755 --- a/ttcn3-tcpdump-stop.sh +++ b/ttcn3-tcpdump-stop.sh @@ -4,6 +4,8 @@ PIDFILE=/tmp/tcpdump.pid TESTCASE=$1 VERDICT="$2" +date + if [ x"$VERDICT" = x"pass" ]; then echo "\033[1;32m====== $TESTCASE $VERDICT ======\033[0m" else