[PATCH] osmo-ttcn3-hacks[master]: add log_merge.sh script to generate per-testcase merged logs

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Mar 18 13:17:11 UTC 2018


Review at  https://gerrit.osmocom.org/7364

add log_merge.sh script to generate per-testcase merged logs

Change-Id: Ife6153d2cc10f85e79e8df7a0e34a44648618976
---
M Common.cfg
A log_merge.sh
2 files changed, 32 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/64/7364/1

diff --git a/Common.cfg b/Common.cfg
index 38beb5a..96f0687 100644
--- a/Common.cfg
+++ b/Common.cfg
@@ -6,6 +6,8 @@
 TCPDUMP_STOP := $TTCN3_HACKS_PATH"/ttcn3-tcpdump-stop.sh"
 
 [LOGGING]
+LogFile := "%e-%c-%h-%r.%s"
+AppendFile := Yes;
 SourceInfoFormat := Single;
 LogSourceInfo := Yes;
 LoggerPlugins := { JUnitLogger := "libjunitlogger2" }
diff --git a/log_merge.sh b/log_merge.sh
new file mode 100755
index 0000000..d57ab99
--- /dev/null
+++ b/log_merge.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# This script generates per-testcase merged logs.
+# In order to work, you need to set the following test config:
+#	[LOGGING]
+#	LogFile := "%e-%c-%h-%r.%s"
+#
+# the output files will be called "Module-Testcase.merged"
+
+if [ "x$1" == "x" ]; then
+	echo "You have to specify the Test Suite prefix"
+	exit 2
+fi
+
+BASE_NAME="$1"
+LOG_FILES="$BASE_NAME*.log"
+
+TEST_CASES=`ls -1 $LOG_FILES | awk 'BEGIN { FS = "-" } { print $2 }' | sort | uniq`
+
+for t in $TEST_CASES; do
+	PREFIX="$BASE_NAME-$t"
+	OUTPUT="$PREFIX.merged"
+	ttcn3_logmerge $PREFIX-*.log > $OUTPUT
+	echo "Generated $OUTPUT"
+done
+
+if [ "$2" == "--rm" ]; then
+	echo "Removing Input log files !!!"
+	rm $LOG_FILES
+fi

-- 
To view, visit https://gerrit.osmocom.org/7364
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife6153d2cc10f85e79e8df7a0e34a44648618976
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list