osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40211?usp=email )
Change subject: Cosmetic: log_merge: modernize
......................................................................
Cosmetic: log_merge: modernize
Move license and copyright up and use an SPDX license identifier.
Change-Id: Iedd4f575edeaf47852f073d04d8cd8ffd92920dc
---
M log_merge.sh
1 file changed, 3 insertions(+), 15 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/log_merge.sh b/log_merge.sh
index d3d5986..aecca4a 100755
--- a/log_merge.sh
+++ b/log_merge.sh
@@ -1,4 +1,7 @@
#!/bin/sh
+# Copyright 2018 Harald Welte
+# Copyright 2018-2025 sysmocom - s.f.m.c. GmbH
+# SPDX-License-Identifier: Apache-2.0
# This script generates per-testcase merged logs.
# In order to work, you need to set the following test config:
@@ -7,21 +10,6 @@
#
# the output files will be called "Module-Testcase.merged"
-# Copyright 2018 Harald Welte
-# Copyright 2018 sysmocom - s.f.m.c. GmbH
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
if [ "x$1" = "x" ]; then
echo "You have to specify the Test Suite prefix"
exit 2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40211?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iedd4f575edeaf47852f073d04d8cd8ffd92920dc
Gerrit-Change-Number: 40211
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40210?usp=email )
Change subject: Common.cfg: Logging: add %p to LogFile format
......................................................................
Common.cfg: Logging: add %p to LogFile format
Add the process ID at the end of the log file that ttnc3 writes, to
avoid potential conflicts:
> Otherwise if you have eg TC_foobar in STP_Tests_M3UA and
> STP_Tests_IPA, you may end up rewriting one of them since both would be
> written with the same file name.
%e is the name of the TTCN-3 executable, e.g. STP_Tests even if the test
case is in STP_Tests_M3UA. It is not possible to get STP_Tests_M3UA into
the file name with any of the meta characters, I've tried it out.
Related: https://gitlab.eclipse.org/eclipse/titan/titan.core/-/blob/9.0.0/usrguide/r…
Change-Id: I0a2a376cd11784addff8ca228e3cc3e831b418a2
---
M Common.cfg
M log_merge.sh
2 files changed, 2 insertions(+), 2 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/Common.cfg b/Common.cfg
index b8c76e6..045a745 100644
--- a/Common.cfg
+++ b/Common.cfg
@@ -6,7 +6,7 @@
TCPDUMP_STOP := $TTCN3_HACKS_PATH"/ttcn3-tcpdump-stop.sh"
[LOGGING]
-LogFile := "%e-%c-%h-%r.%s"
+LogFile := "%e-%c-%h-%r-%p.%s"
AppendFile := Yes;
SourceInfoFormat := Single;
LogSourceInfo := Yes;
diff --git a/log_merge.sh b/log_merge.sh
index 886b788..d3d5986 100755
--- a/log_merge.sh
+++ b/log_merge.sh
@@ -3,7 +3,7 @@
# 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"
+# LogFile := "%e-%c-%h-%r-%p.%s"
#
# the output files will be called "Module-Testcase.merged"
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40210?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0a2a376cd11784addff8ca228e3cc3e831b418a2
Gerrit-Change-Number: 40210
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40213?usp=email )
Change subject: log_merge: use same prefix as for pcap files
......................................................................
log_merge: use same prefix as for pcap files
In some testsuites we have tests in ttcn3 files other than the main
testsuite executable. In that case we save the pcap files with the name
of the ttcn3 file with the test, but before this patch the merged log
file has the name of the main testsuite. This is inconsistent and may
lead to a conflict if a test exists in multiple ttcn3 files.
Fix this by getting the same prefix as we use for the pcap from the
logfile itself. Fall back to using the same prefix as without this patch
in case we can't parse the log line.
Fixes: OS#6787
Change-Id: Id2937d711a54a34c0d87d080199b4c3d5a5d6e06
---
M log_merge.sh
1 file changed, 32 insertions(+), 1 deletion(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/log_merge.sh b/log_merge.sh
index 7560fe9..65a3003 100755
--- a/log_merge.sh
+++ b/log_merge.sh
@@ -10,6 +10,37 @@
#
# the output files will be called "Module-Testcase.merged"
+# OS#6787: Get the same prefix as for the pcap files by parsing the external
+# command line from the logfile, e.g:
+# 11:34:37.106541 STP_Tests_M3UA.ttcn:877 Starting external command `/home/user/…/ttcn3-tcpdump-start.sh STP_Tests_M3UA.TC_rkm_unreg_active'.
+get_new_prefix() {
+ local prefix="$1"
+ local prefix_new
+ local start_cmd_line
+
+ for i in "$prefix"-*.log; do
+ if ! [ -e "$i" ]; then
+ continue
+ fi
+
+ start_cmd_line="$(grep -o 'Starting external command `.*-start.sh.*' "$i")"
+ if [ -z "$start_cmd_line" ]; then
+ continue
+ fi
+
+ prefix_new="$(echo "${start_cmd_line##* }" | cut -d "'" -f 1)"
+ if [ -z "$prefix_new" ]; then
+ continue
+ fi
+
+ echo "$prefix_new"
+ return
+ done
+
+ >&2 echo "log_merge: WARNING: get_new_prefix failed for: $prefix"
+ echo "$prefix"
+}
+
if [ "x$1" = "x" ]; then
echo "You have to specify the Test Suite prefix"
exit 2
@@ -22,7 +53,7 @@
for t in $TEST_CASES; do
PREFIX="$BASE_NAME-$t"
- OUTPUT="$BASE_NAME.$t.merged"
+ OUTPUT="$(get_new_prefix "$PREFIX").merged"
if [ -e "$OUTPUT" ]; then
>&2 echo "log_merge: ERROR: file already exists: $OUTPUT"
exit 1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40213?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id2937d711a54a34c0d87d080199b4c3d5a5d6e06
Gerrit-Change-Number: 40213
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria, pespin.
osmith has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40210?usp=email )
Change subject: Common.cfg: Logging: add %p to LogFile format
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40210/comment/ddcae605_a807… :
PS1, Line 18: the file name with any of the meta characters, I've tried it out.
> I didn't mean it's a bug, I simply meant there should be a way to easily access the testsuite name w […]
-> https://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/767
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40210?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0a2a376cd11784addff8ca228e3cc3e831b418a2
Gerrit-Change-Number: 40210
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 05 May 2025 12:03:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: osmith.
fixeria has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40213?usp=email )
Change subject: log_merge: use same prefix as for pcap files
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40213?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id2937d711a54a34c0d87d080199b4c3d5a5d6e06
Gerrit-Change-Number: 40213
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 05 May 2025 11:14:09 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes