Skip to content

feature request: Run-time Configuration File: LogFile: add a metacharacter for source file name

Summary

For example in osmo-ttcn3-hacks/stp we have STP_Tests.ttcn and STP_Tests_M3UA.ttcn, which will both be compiled into the executable name STP_Tests.

External commands BeginTestCase and EndTestCase get not only the test case name as argument, but also the source file in which it is. For example STP_Tests_M3UA.TC_rkm_unreg_active:

12:39:38.209837 141544 STP_Tests_M3UA.ttcn:877 Starting external command `/home/user/…/osmo-ttcn3-hacks/ttcn3-tcpdump-start.sh STP_Tests_M3UA.TC_rkm_unreg_active'.

It would be useful if there was a metacharacter in LogFile added that allows getting the source of the test case, STP_Tests_M3UA in the example.

This way we could have the log file named consistently with e.g. pcap files created from the external command for BeginTestCase.

(We are currently working around this by parsing the "Starting external command" line from the log file and getting the source file + test case name from there.)

Steps and/or TTCN-3 code to reproduce

To reproduce the example given above:

$ git clone https://gitea.osmocom.org/ttcn3/osmo-ttcn3-hacks/
$ cd osmo-ttcn3-hacks
$ git checkout bde6f20f3848c50d19c94b3867a4884c880efe13
$ ln -sf /usr/bin/false ./log_merge.sh
$ ./testenv.py run stp -n -p -t STP_Tests_M3UA.TC_rkm_unreg_active
$ find /tmp/logs/testsuite/
/tmp/logs/testsuite
/tmp/logs/testsuite/STP_Tests_M3UA.TC_rkm_unreg_active.pcap.gz
/tmp/logs/testsuite/STP_Tests-TC_rkm_unreg_active-hostname-mtc.log

What is the current bug behavior?

No metacharacter for the source file name.

What is the expected correct behavior?

Adding a metacharacter for the source file name.

Titan version

9.0.0, but checked docs for current master and it isn't there either.

Platform details (OS type and version)

Debian 12

/cc @aknappqwt @mmagyari