fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/27012 )
Change subject: logging: fix printing of '\0' when filename printed last
......................................................................
logging: fix printing of '\0' when filename printed last
As was demonstrated in I54bf5e5c036efb1908232fe3d8e8e2989715fbb3,
when the logging is configured to print the filename *after* the
logging message, each logging line contains an artifact - '\0'.
The problem is that the 'len' variable is not updated. Fix this.
Change-Id: I5c920a0d5c1cf45bcdd327b39e33d63346b4f51c
Fixes: I393907b3c9e0cc1145e102328adad0a83ee13a9f
---
M src/logging.c
M tests/logging/logging_test_wqueue.err
2 files changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/27012/1
diff --git a/src/logging.c b/src/logging.c
index 5336e53..1a0abc2 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -586,6 +586,7 @@
break;
case LOG_FILENAME_PATH:
offset--;
+ len--;
ret = snprintf(buf + offset, rem, " (%s:%d)\n", file, line);
if (ret < 0)
goto err;
@@ -593,6 +594,7 @@
break;
case LOG_FILENAME_BASENAME:
offset--;
+ len--;
ret = snprintf(buf + offset, rem, " (%s:%d)\n", const_basename(file), line);
if (ret < 0)
goto err;
diff --git a/tests/logging/logging_test_wqueue.err b/tests/logging/logging_test_wqueue.err
index 3e2008b..01ab878 100644
--- a/tests/logging/logging_test_wqueue.err
+++ b/tests/logging/logging_test_wqueue.err
Binary files differ
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/27012
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I5c920a0d5c1cf45bcdd327b39e33d63346b4f51c
Gerrit-Change-Number: 27012
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/27013 )
Change subject: tests/logging: merge both logging_test_{stream,wqueue}.err
......................................................................
tests/logging: merge both logging_test_{stream,wqueue}.err
Change-Id: I0ff0a6e0d22575047cc00dd822bc94d696171076
---
R tests/logging/logging_test.err
D tests/logging/logging_test_wqueue.err
M tests/testsuite.at
3 files changed, 2 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/27013/1
diff --git a/tests/logging/logging_test_stream.err b/tests/logging/logging_test.err
similarity index 100%
rename from tests/logging/logging_test_stream.err
rename to tests/logging/logging_test.err
diff --git a/tests/logging/logging_test_wqueue.err b/tests/logging/logging_test_wqueue.err
deleted file mode 100644
index 01ab878..0000000
--- a/tests/logging/logging_test_wqueue.err
+++ /dev/null
@@ -1,11 +0,0 @@
-DRLL You should see this
-DCC You should see this
-DRLL You should see this
-DLGLOBAL You should see this on DLGLOBAL (a)
-DLGLOBAL You should see this on DLGLOBAL (b)
-DLGLOBAL You should see this on DLGLOBAL (c)
-DLGLOBAL You should see this on DLGLOBAL (d)
-DLGLOBAL You should see this on DLGLOBAL (e)
-DLGLOBAL You should see this (DLGLOBAL on DEBUG)
-DLGLOBAL logging_test.c:137 A message with source info printed first
-DLGLOBAL A message with source info printed last (logging_test.c:139)
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 5da08e5..ca133bb 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -171,14 +171,14 @@
AT_SETUP([logging_stream])
AT_KEYWORDS([logging_stream])
cat $abs_srcdir/logging/logging_test.ok > expout
-cat $abs_srcdir/logging/logging_test_stream.err > experr
+cat $abs_srcdir/logging/logging_test.err > experr
AT_CHECK([$abs_top_builddir/tests/logging/logging_test stream], [0], [expout], [experr])
AT_CLEANUP
AT_SETUP([logging_wqueue])
AT_KEYWORDS([logging_wqueue])
cat $abs_srcdir/logging/logging_test.ok > expout
-cat $abs_srcdir/logging/logging_test_wqueue.err > experr
+cat $abs_srcdir/logging/logging_test.err > experr
AT_CHECK([$abs_top_builddir/tests/logging/logging_test wqueue], [0], [expout], [experr])
AT_CLEANUP
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/27013
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0ff0a6e0d22575047cc00dd822bc94d696171076
Gerrit-Change-Number: 27013
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/27010 )
Change subject: tests/logging: also test printing the filename information
......................................................................
tests/logging: also test printing the filename information
This commit demonstrates a bug introduced in [1], which can be
observed when the logging is configured to print the filename
*after* the logging message (LOG_FILENAME_POS_HEADER_END):
logging print file 1 last
In this mode, the code in _output_buf() overwrites the '\n' sybmol
contained in the logging messate itself by shifting the 'offset'
backwards, and appends the nipped '\n' after the filename info.
The problem is that the 'len' variable is not updated in this case,
so the resulting length includes +1 character - '\0', which gets
printed at the end of every logging line.
Change-Id: I54bf5e5c036efb1908232fe3d8e8e2989715fbb3
---
M tests/logging/logging_test.c
M tests/logging/logging_test_stream.err
M tests/logging/logging_test_wqueue.err
3 files changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/27010/1
diff --git a/tests/logging/logging_test.c b/tests/logging/logging_test.c
index 12a7374..3548b1d 100644
--- a/tests/logging/logging_test.c
+++ b/tests/logging/logging_test.c
@@ -130,5 +130,13 @@
log_set_category_filter(stderr_target, DLGLOBAL, 1, LOGL_DEBUG);
DEBUGP(DLGLOBAL, "You should see this (DLGLOBAL on DEBUG)\n");
+ /* Test printing of the filename */
+ log_set_print_filename2(stderr_target, LOG_FILENAME_BASENAME);
+
+ log_set_print_filename_pos(stderr_target, LOG_FILENAME_POS_HEADER_END);
+ DEBUGP(DLGLOBAL, "A message with source info printed first\n");
+ log_set_print_filename_pos(stderr_target, LOG_FILENAME_POS_LINE_END);
+ DEBUGP(DLGLOBAL, "A message with source info printed last\n");
+
return 0;
}
diff --git a/tests/logging/logging_test_stream.err b/tests/logging/logging_test_stream.err
index 17b3cad..01ab878 100644
--- a/tests/logging/logging_test_stream.err
+++ b/tests/logging/logging_test_stream.err
@@ -7,3 +7,5 @@
DLGLOBAL You should see this on DLGLOBAL (d)
DLGLOBAL You should see this on DLGLOBAL (e)
DLGLOBAL You should see this (DLGLOBAL on DEBUG)
+DLGLOBAL logging_test.c:137 A message with source info printed first
+DLGLOBAL A message with source info printed last (logging_test.c:139)
diff --git a/tests/logging/logging_test_wqueue.err b/tests/logging/logging_test_wqueue.err
index 17b3cad..3e2008b 100644
--- a/tests/logging/logging_test_wqueue.err
+++ b/tests/logging/logging_test_wqueue.err
Binary files differ
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/27010
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I54bf5e5c036efb1908232fe3d8e8e2989715fbb3
Gerrit-Change-Number: 27010
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/27008 )
Change subject: ttcn3-pgw-test: fix jenkins.sh: do not use bash specific syntax
......................................................................
ttcn3-pgw-test: fix jenkins.sh: do not use bash specific syntax
On some systems /bin/sh is a symbolic link to bash, so everything
works fine. On systems where /bin/sh is a real sh, copy fails:
cp: cannot access 'open5gs-{smf,upf,nrf}.yaml': No such file or directory
Change-Id: I64e9ddefdb6deb21b3bce3bc1af875a92919e6c9
Related: SYS#5602
---
M ttcn3-pgw-test/jenkins.sh
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
fixeria: Looks good to me, approved; Verified
diff --git a/ttcn3-pgw-test/jenkins.sh b/ttcn3-pgw-test/jenkins.sh
index 0f6ee5d..662e49b 100755
--- a/ttcn3-pgw-test/jenkins.sh
+++ b/ttcn3-pgw-test/jenkins.sh
@@ -15,7 +15,7 @@
mkdir $VOL_BASE_DIR/pgw
cp freeDiameter-smf.conf $VOL_BASE_DIR/pgw/
-cp open5gs-{smf,upf,nrf}.yaml $VOL_BASE_DIR/pgw/
+cp open5gs-*.yaml $VOL_BASE_DIR/pgw/
SUBNET=18
network_create $SUBNET
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27008
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I64e9ddefdb6deb21b3bce3bc1af875a92919e6c9
Gerrit-Change-Number: 27008
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: merged
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/27008 )
Change subject: ttcn3-pgw-test: fix jenkins.sh: do not use bash specific syntax
......................................................................
Patch Set 1: Verified+1 Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27008
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I64e9ddefdb6deb21b3bce3bc1af875a92919e6c9
Gerrit-Change-Number: 27008
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Sat, 29 Jan 2022 12:56:17 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/27008 )
Change subject: ttcn3-pgw-test: fix jenkins.sh: do not use bash specific syntax
......................................................................
ttcn3-pgw-test: fix jenkins.sh: do not use bash specific syntax
On some systems /bin/sh is a symbolic link to bash, so everything
works fine. On systems where /bin/sh is a real sh, copy fails:
cp: cannot access 'open5gs-{smf,upf,nrf}.yaml': No such file or directory
Change-Id: I64e9ddefdb6deb21b3bce3bc1af875a92919e6c9
Related: SYS#5602
---
M ttcn3-pgw-test/jenkins.sh
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/08/27008/1
diff --git a/ttcn3-pgw-test/jenkins.sh b/ttcn3-pgw-test/jenkins.sh
index 0f6ee5d..662e49b 100755
--- a/ttcn3-pgw-test/jenkins.sh
+++ b/ttcn3-pgw-test/jenkins.sh
@@ -15,7 +15,7 @@
mkdir $VOL_BASE_DIR/pgw
cp freeDiameter-smf.conf $VOL_BASE_DIR/pgw/
-cp open5gs-{smf,upf,nrf}.yaml $VOL_BASE_DIR/pgw/
+cp open5gs-*.yaml $VOL_BASE_DIR/pgw/
SUBNET=18
network_create $SUBNET
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27008
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I64e9ddefdb6deb21b3bce3bc1af875a92919e6c9
Gerrit-Change-Number: 27008
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/27007 )
Change subject: ttcn3-bsc-test-sccplite: set OSMO_SUT_{HOST,PORT}
......................................................................
ttcn3-bsc-test-sccplite: set OSMO_SUT_{HOST,PORT}
This enables the test suite to obtain talloc reports between the
test case executions, which get stored together with the PCAP files.
Change-Id: I4e5474e8fc51d2ba8a0baca68e11df1346d7d4ab
---
M ttcn3-bsc-test/jenkins-sccplite.sh
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/07/27007/1
diff --git a/ttcn3-bsc-test/jenkins-sccplite.sh b/ttcn3-bsc-test/jenkins-sccplite.sh
index 7565a8d..0a3c073 100755
--- a/ttcn3-bsc-test/jenkins-sccplite.sh
+++ b/ttcn3-bsc-test/jenkins-sccplite.sh
@@ -48,6 +48,8 @@
$(docker_network_params $SUBNET 203) \
--ulimit core=-1 \
-e "TTCN3_PCAP_PATH=/data" \
+ -e "OSMO_SUT_HOST=172.18.$SUBNET.20" \
+ -e "OSMO_SUT_PORT=4242" \
-v $VOL_BASE_DIR/bsc-tester:/data \
--name ${BUILD_TAG}-ttcn3-bsc-test \
$DOCKER_ARGS \
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27007
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I4e5474e8fc51d2ba8a0baca68e11df1346d7d4ab
Gerrit-Change-Number: 27007
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/27006 )
Change subject: ttcn3-bsc-test-vamos: set OSMO_SUT_{HOST,PORT}
......................................................................
ttcn3-bsc-test-vamos: set OSMO_SUT_{HOST,PORT}
This enables the test suite to obtain talloc reports between the
test case executions, which get stored together with the PCAP files.
Change-Id: Ia9525778fcecc60177be651624e2b2cf9bc75422
---
M ttcn3-bsc-test-vamos/jenkins.sh
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/06/27006/1
diff --git a/ttcn3-bsc-test-vamos/jenkins.sh b/ttcn3-bsc-test-vamos/jenkins.sh
index e8ec34d..f37711f 100755
--- a/ttcn3-bsc-test-vamos/jenkins.sh
+++ b/ttcn3-bsc-test-vamos/jenkins.sh
@@ -62,6 +62,8 @@
$(docker_network_params $SUBNET 203) \
--ulimit core=-1 \
-e "TTCN3_PCAP_PATH=/data" \
+ -e "OSMO_SUT_HOST=172.18.$SUBNET.20" \
+ -e "OSMO_SUT_PORT=4242" \
-v $VOL_BASE_DIR/bsc-tester:/data \
--name ${BUILD_TAG}-ttcn3-bsc-test \
$DOCKER_ARGS \
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/27006
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: Ia9525778fcecc60177be651624e2b2cf9bc75422
Gerrit-Change-Number: 27006
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange