osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41152?usp=email )
Change subject: testenv: coredump: support core_pattern=core
......................................................................
testenv: coredump: support core_pattern=core
Support getting core files from a typical core_pattern=core where the
coredump just gets stored in the current working dir, instead of always
retrieving it from coredumpctl. This is what we will use with jenkins in
the future, as it makes getting core files in other jobs easier. Remove
support for the custom testenv-coredump-helper code that isn't needed
anymore.
Change-Id: Ia765b01432e4cb4cd36c45de874b966e3ebf55bc
---
M _testenv/README.md
M _testenv/testenv/coredump.py
M _testenv/testenv/daemons.py
M _testenv/testenv/requirements.py
4 files changed, 46 insertions(+), 65 deletions(-)
Approvals:
daniel: Looks good to me, but someone else must approve
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/_testenv/README.md b/_testenv/README.md
index 072dcd2..b62295e 100644
--- a/_testenv/README.md
+++ b/_testenv/README.md
@@ -202,15 +202,6 @@
available but doesn't work in podman. QEMU runs a bit slower when this is
set.
-* `TESTENV_COREDUMP_FROM_LXC_HOST`:
- Instead of using coredumpctl to retrieve the coredump, assume testenv is
- running inside an LXC and try to retrieve the coredump from the LXC host
- (OS#6769). This is used in jenkins.
-
-* `TESTENV_COREDUMP_FROM_LXC_HOST_IP`:
- Instead of attempting to automatically detect the LXC host IP, use this IP.
- This can be set to 127.0.0.1 for testing.
-
### Environment variables set by testenv
Testenv sets the following variables while running shell commands from
diff --git a/_testenv/testenv/coredump.py b/_testenv/testenv/coredump.py
index 0343c67..d3fa35f 100644
--- a/_testenv/testenv/coredump.py
+++ b/_testenv/testenv/coredump.py
@@ -2,63 +2,20 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import datetime
import fnmatch
+import glob
import json
import logging
-import os
+import re
import shlex
import shutil
import subprocess
import testenv
import testenv.daemons
import testenv.testdir
-import urllib
-import urllib.request
+core_path = None
executable_path = None
-lxc_netdev = "eth0"
-lxc_ip_pattern = "10.0.*"
-lxc_port = 8042
-
-
-def find_lxc_host_ip():
- cmd = ["ip", "-j", "-o", "-4", "addr", "show", "dev", lxc_netdev]
- p = testenv.cmd.run(cmd, check=False, no_podman=True, capture_output=True, text=True)
- ret = json.loads(p.stdout)[0]["addr_info"][0]["local"]
- if fnmatch.fnmatch(ret, lxc_ip_pattern):
- ret = ret.split(".")
- ret = f"{ret[0]}.{ret[1]}.{ret[2]}.1"
- return ret
- return None
-
-
-def get_from_coredumpctl_lxc_host():
- # Server implementation: osmo-ci, ansible/roles/testenv-coredump-helper
- global executable_path
-
- logging.info("Looking for a coredump on lxc host")
-
- ip = os.environ.get("TESTENV_COREDUMP_FROM_LXC_HOST_IP") or find_lxc_host_ip()
- if not ip:
- logging.warning("Failed to get lxc host ip, can't look for coredump")
- return
-
- try:
- with urllib.request.urlopen(f"http://{ip}:{lxc_port}/core") as response:
- executable_path = dict(response.getheaders())["X-Executable-Path"]
- with open(f"{testenv.testdir.testdir}/core", "wb") as h:
- shutil.copyfileobj(response, h)
- logging.debug("Coredump found and copied to log dir")
- except urllib.error.HTTPError as e:
- executable_path = None
- if e.code == 404:
- logging.debug("No coredump found")
- else:
- logging.error(f"Unexpected error while attempting to fetch the coredump: {e}")
- except urllib.error.URLError as e:
- executable_path = None
- logging.error(f"Unexpected error while attempting to fetch the coredump: {e}")
-
def executable_is_relevant(exe):
if testenv.args.binary_repo:
@@ -77,10 +34,11 @@
return False
-def get_from_coredumpctl_local():
+def get_from_coredumpctl():
+ global core_path
global executable_path
- logging.info("Looking for a coredump")
+ logging.info("Looking for a coredump with coredumpctl")
if not shutil.which("coredumpctl"):
logging.debug("coredumpctl is not available, won't try to get coredump")
@@ -113,18 +71,49 @@
executable_path = coredump["exe"]
-def get_from_coredumpctl():
- if os.environ.get("TESTENV_COREDUMP_FROM_LXC_HOST"):
- get_from_coredumpctl_lxc_host()
+def get_from_file():
+ global core_path
+ global executable_path
+
+ logging.info("Looking for a coredump file")
+
+ glob_matches = glob.glob(f"{testenv.testdir.testdir}/*/core*")
+ if not glob_matches:
+ return
+
+ core_path = glob_matches[0]
+ p = testenv.cmd.run(
+ ["file", core_path],
+ no_podman=True,
+ capture_output=True,
+ text=True,
+ )
+ print(p.stdout, end="")
+
+ execfn_match = re.search(r"execfn: '(.*?)'", p.stdout)
+ if execfn_match:
+ executable_path = execfn_match.group(1)
+ logging.debug("Coredump file and execfn found")
else:
- get_from_coredumpctl_local()
+ logging.debug("Failed to get execfn path from coredump file")
+
+
+def get_coredump():
+ with open("/proc/sys/kernel/core_pattern") as f:
+ pattern = f.readline().rstrip()
+
+ if "systemd-coredump" in pattern:
+ get_from_coredumpctl()
+ elif pattern.startswith("core"):
+ get_from_file()
+ else:
+ logging.debug(f"Unsupported core_pattern, won't try to get coredump: {pattern}")
def get_backtrace():
global executable_path
- core_path = f"{testenv.testdir.testdir}/core"
- if not executable_path or not os.path.exists(core_path):
+ if not executable_path or not core_path:
return
logging.info("Running gdb to get a backtrace")
diff --git a/_testenv/testenv/daemons.py b/_testenv/testenv/daemons.py
index 3a38850..f57b4b4 100644
--- a/_testenv/testenv/daemons.py
+++ b/_testenv/testenv/daemons.py
@@ -68,7 +68,7 @@
# Wait 200ms and check if it is still running
time.sleep(0.2)
if daemons[section].poll() is not None:
- testenv.coredump.get_from_coredumpctl()
+ testenv.coredump.get_coredump()
raise testenv.NoTraceException(f"program failed to start: {program}")
# Run setup script
@@ -118,7 +118,7 @@
return
current_test = testenv.testsuite.get_current_test()
- testenv.coredump.get_from_coredumpctl()
+ testenv.coredump.get_coredump()
if current_test:
logging.error(f"{daemon_name} unexpected exit during {current_test}! rc={returncode}")
diff --git a/_testenv/testenv/requirements.py b/_testenv/testenv/requirements.py
index 97fae0c..2e53081 100644
--- a/_testenv/testenv/requirements.py
+++ b/_testenv/testenv/requirements.py
@@ -11,6 +11,7 @@
def check_programs():
programs = [
+ "file",
"git",
]
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41152?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: Ia765b01432e4cb4cd36c45de874b966e3ebf55bc
Gerrit-Change-Number: 41152
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Attention is currently required from: laforge.
jolly has posted comments on this change by jolly. ( https://gerrit.osmocom.org/c/osmo-e1d/+/41139?usp=email )
Change subject: Add Channel-Associated Signalling (CAS) support
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS2:
> I think it would be more logical if the CAS bits fo a given B-channel is associated with that channe […]
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/41139?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: Ib4f5e6ef02c9b0d1eec2a86d9c48376112805972
Gerrit-Change-Number: 41139
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Sun, 28 Sep 2025 16:00:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Attention is currently required from: jolly, laforge.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-abis/+/41140?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review-1 by laforge, Verified-1 by Jenkins Builder
Change subject: Add CAS channel support
......................................................................
Add CAS channel support
CAS is currently supported by e1d driver only.
Change-Id: I81cc89e01bb4207dc899ab28f24a131f24b61c9c
---
M include/osmocom/abis/e1_input.h
M src/e1_input.c
M src/input/e1d.c
3 files changed, 41 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/40/41140/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/41140?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I81cc89e01bb4207dc899ab28f24a131f24b61c9c
Gerrit-Change-Number: 41140
Gerrit-PatchSet: 2
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Attention is currently required from: jolly.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-e1d/+/41139?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: Add Channel-Associated Signalling (CAS) support
......................................................................
Add Channel-Associated Signalling (CAS) support
CAS frames are sent and received repeatedly. They consist of 16 frames
(octets) on time slot 16. This is a CAS multiframe. This multiframe
carries 30 individual CAS signaling channels.
Whenever a CAS frames changes, an event (E1DP_EVT_CAS) is forwarded to
the e1d client. The event includes one octet with the CAS information.
The e1d client requests to transmit a new CAS frame by sending a command
(E1DP_CMD_CAS). The command includes one octet with the CAS information.
The e1d client requests to receive current CAS frame of a given time
slot by setting a query flag in the E1DP_CMD_CAS command. This is useful
if the CAS signals changed before the application was started.
The lower 4 bits of each octet in the message represent the signaling
sub-channels: A, B, C and D. They are packed like this: 'xxxxABCD'
To enable cas support on an interface, set line attribute "cas" via VTY.
Change-Id: Ib4f5e6ef02c9b0d1eec2a86d9c48376112805972
---
M include/osmocom/e1d/proto.h
M include/osmocom/e1d/proto_clnt.h
M src/ctl.c
M src/e1d.h
M src/intf_line.c
M src/mux_demux.c
M src/proto.c
M src/proto_clnt.c
M src/vty.c
9 files changed, 268 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/39/41139/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/41139?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: Ib4f5e6ef02c9b0d1eec2a86d9c48376112805972
Gerrit-Change-Number: 41139
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41173?usp=email )
Change subject: debian: fixup: add missing libsctp dependency
......................................................................
debian: fixup: add missing libsctp dependency
I found `${libsctp:Version}` in `debian/control` of the erlang package
(https://salsa.debian.org/erlang-team/packages/erlang). As it turns
out, this is not a standard debhelper substvar (like `${shlibs:Depends}`
or `${python3:Depends}`), but a custom one defined in `debian/rules`:
dh_gencontrol -a -- -Vlibsctp:Version='$(LIBSCTPDEP)'
Thus in our case it yields nothing. Use the package name instead.
Change-Id: Ia74d75e86b1436fc7dcdfa40d90c7e0c2e5648a1
Fixes: 9455ca1 ("debian: add missing libsctp dependency")
---
M debian/control
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/73/41173/1
diff --git a/debian/control b/debian/control
index 515e3b2..018077a 100644
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,7 @@
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
- ${libsctp:Version}
+ libsctp1
Suggests: osmo-s1gw-cli
Multi-Arch: foreign
Description: Osmocom S1 gateway
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41173?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: Ia74d75e86b1436fc7dcdfa40d90c7e0c2e5648a1
Gerrit-Change-Number: 41173
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41170?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: [REST] MetricsList: return 404 on invalid path
......................................................................
[REST] MetricsList: return 404 on invalid path
Change-Id: If5ab039654007ccf3703a2364b767eaa19e43461
Related: SYS#7066
---
M contrib/openapi.yaml
M priv/openapi.json
M src/rest_server.erl
3 files changed, 15 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/70/41170/2
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41170?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: If5ab039654007ccf3703a2364b767eaa19e43461
Gerrit-Change-Number: 41170
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41171?usp=email )
Change subject: README.md, doc/osmo-s1gw-cli.md: fix broken links
......................................................................
README.md, doc/osmo-s1gw-cli.md: fix broken links
Change-Id: I2f035c6baf5ec19784bda915b802f28fd1063043
---
M README.md
M doc/osmo-s1gw-cli.md
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/71/41171/1
diff --git a/README.md b/README.md
index a593ac0..5ff4589 100644
--- a/README.md
+++ b/README.md
@@ -190,4 +190,4 @@
OsmoS1GW comes with [`osmo-s1gw-cli.py`](contrib/osmo-s1gw-cli.py) - an interactive
shell based on Python's **cmd2** library. This script serves as an alternative to the
traditional telnet/VTY interface found in many Osmocom projects. For more details,
-see (doc/osmo-s1gw-cli.md).
+see the respective [documentation](doc/osmo-s1gw-cli.md).
diff --git a/doc/osmo-s1gw-cli.md b/doc/osmo-s1gw-cli.md
index b801b25..db29852 100644
--- a/doc/osmo-s1gw-cli.md
+++ b/doc/osmo-s1gw-cli.md
@@ -1,7 +1,7 @@
Interactive CLI
===============
-[`osmo-s1gw-cli.py`](contrib/osmo-s1gw-cli.py) is an interactive shell based on
+[`osmo-s1gw-cli.py`](../contrib/osmo-s1gw-cli.py) is an interactive shell based on
Python's **cmd2** library. This script serves as an alternative to the traditional
telnet/VTY interface found in many Osmocom projects. It communicates with the main
process via the **REST interface**, allowing users to inspect and interact with
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41171?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I2f035c6baf5ec19784bda915b802f28fd1063043
Gerrit-Change-Number: 41171
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>