Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41133?usp=email )
Change subject: Split SCCP_Adapter out of RAN_Adapter
......................................................................
Patch Set 3: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41133?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: I0558d74d53ceb1b33c4f3d583f1b4489f6d7ee60
Gerrit-Change-Number: 41133
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 25 Sep 2025 13:35:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41132?usp=email )
Change subject: RAN_{Emulation,Adapter}: Split transport type from transport client/server mode
......................................................................
Patch Set 3: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41132?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: Ib2e7d029bd7eb59cc6f3b3a28bc417f00d3fed9c
Gerrit-Change-Number: 41132
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 25 Sep 2025 13:30:50 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41152?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: 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(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/41152/2
--
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: newpatchset
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
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/41155?usp=email )
Change subject: scripts/wrapper_core_bt_on_error: new script
......................................................................
scripts/wrapper_core_bt_on_error: new script
Add a wrapper script that runs a given program, and checks the exit
code. If it is not 0, and a core file appears, then load the coredump in
gdb and display its backtrace.
Change-Id: I9673abf3ae3b154505ea09237d37d7da4bf5d57f
---
A scripts/wrapper_core_bt_on_error.sh
1 file changed, 38 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/55/41155/1
diff --git a/scripts/wrapper_core_bt_on_error.sh b/scripts/wrapper_core_bt_on_error.sh
new file mode 100755
index 0000000..ca1eaef
--- /dev/null
+++ b/scripts/wrapper_core_bt_on_error.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Copyright 2025 sysmocom - s.f.m.c. GmbH
+# SPDX-License-Identifier: GPL-3.0-or-later
+# Run a program and check for coredumps if it does not exit with 0. If there
+# are any coredumps, then show the backtrace.
+msg() {
+ echo "[wrapper_core_bt_on_error] $@"
+}
+
+if [ $# -lt 1 ]; then
+ echo "usage: wrapper_core_bt_on_error.sh PROGRAM [ARG1 [ARG2 […]]]"
+ exit 1
+fi
+
+ulimit -c unlimited
+
+"$@"
+RC=$?
+
+if [ "$RC" != 0 ]; then
+ for i in $(find -name 'core' -type f); do
+ msg "Found coredump: $i"
+ execfn="$(file "$i" | grep -P -o "execfn: '.*?'" | cut -d "'" -f 2)"
+ if [ -z "$execfn" ] || ! [ -e "$execfn" ]; then
+ msg "Failed to get execfn, ignoring..."
+ continue
+ fi
+
+ echo
+ gdb --batch \
+ "$execfn" \
+ "$i" \
+ -ex bt \
+ | tee "$i.backtrace"
+ echo
+ done
+ exit $RC
+fi
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/41155?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I9673abf3ae3b154505ea09237d37d7da4bf5d57f
Gerrit-Change-Number: 41155
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/41154?usp=email )
Change subject: testenv-coredump-helper: remove
......................................................................
testenv-coredump-helper: remove
After looking at this again, it makes more sense to keep
/proc/sys/kernel/core_pattern as "core" on build4 and build5, which we
use for jenkins jobs instead of installing systemd's coredumpctl and
making all coredumps go through that. The motivation for using
coredumpctl in testenv was that lots of developers may have it already
installed (though I'm not sure about that anymore), and that it gives a
nice API for retrieving the related executable name to a coredump
instead of having to parse the output of e.g. "file".
Using coredumpctl had the disadvantage that coredumps for all other
jobs, such as the master-builds are also caught by that and cannot be
easily placed in the workspace directory. I have started implementing
this by extending testenv-coredump-helper to communicate through a
socket and mounting that socket inside docker containers running
contrib/jenkins.sh (host -> lxc -> docker), and it works, but this
complexity is not useful here.
Instead the related patch will make testenv pick the core files when
coredumpctl is not available, and read the path from "file", making
testenv-coredump-helper obsolete.
Related: osmo-ttcn3-hacks Ia765b01432e4cb4cd36c45de874b966e3ebf55bc
Change-Id: I2959c6e6d97d5691ee2a4ae5d49a351eb5811f10
---
D ansible/roles/testenv-coredump-helper/README.md
D ansible/roles/testenv-coredump-helper/files/testenv-coredump-helper.py
D ansible/roles/testenv-coredump-helper/files/testenv-coredump-helper.service
D ansible/roles/testenv-coredump-helper/handlers/main.yml
D ansible/roles/testenv-coredump-helper/tasks/main.yml
M ansible/setup-build-host.yml
6 files changed, 0 insertions(+), 210 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/54/41154/1
diff --git a/ansible/roles/testenv-coredump-helper/README.md b/ansible/roles/testenv-coredump-helper/README.md
deleted file mode 100644
index d27f457..0000000
--- a/ansible/roles/testenv-coredump-helper/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-# testenv-coredump-helper
-
-A simple webserver to make Osmocom related coredumps available in LXCs.
-
-## Architecture
-
-```
-.-----------------------------------------------------------------------------.
-| build host (build4) .--------------------------.|
-| | LXC (deb12build-ansible) ||
-| | ||
-| shell | HTTP ||
-| coredumpctl --------- testenv-coredump-helper ------------- testenv ||
-| |__________________________||
-|_____________________________________________________________________________|
-```
-
-## What this script does
-
-This role installs a systemd service running the script in
-`files/testenv-coredump-helper.py`, which runs a HTTP server on port `8042` of
-the `lxcbr0`'s IP (e.g. `10.0.3.1`) on the build host. The IP is detected
-dynamically as it is random on each build host.
-
-The HTTP server provides one GET endpoint `/core`. When it is requested (by
-testenv running inside the LXC), the script runs `coredumpctl` with parameters
-to check for any coredump within the last three seconds that was created for
-any Osmocom specific program (starting with `osmo-*` or `open5gs-*`).
-
-* If no matching coredump was found, it returns HTTP status code `404`.
-
-* If a matching coredump was found, it returns HTTP status code `200`, sends
- the path to the executable in an `X-Executable-Path` header and sends the
- coredump itself as body.
-
-The coredump and path to the executable are retrieved from `coredumpctl`. The
-coredump is stored in a temporary file for the duration of the transfer.
-
-## Client implementation
-
-The clientside implementation is in `osmo-ttcn3-hacks.git`,
-`_testenv/testenv/coredump.py` in the `get_from_coredumpctl_lxc_host()`
-function.
-
-## Maximum coredump size
-
-The `testenv-coredump-helper` script does not limit the size of the coredump,
-however a maximum size that `systemd-coredump` accepts can be configured in
-`/etc/systemd/coredump.conf`.
diff --git a/ansible/roles/testenv-coredump-helper/files/testenv-coredump-helper.py b/ansible/roles/testenv-coredump-helper/files/testenv-coredump-helper.py
deleted file mode 100644
index a56bd0f..0000000
--- a/ansible/roles/testenv-coredump-helper/files/testenv-coredump-helper.py
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/usr/bin/env python3
-# Copyright 2025 sysmocom - s.f.m.c. GmbH
-# SPDX-License-Identifier: GPL-3.0-or-later
-# Simple webserver to make Osmocom related coredumps available in LXCs. See
-# ../README.md and OS#6769 for details.
-import datetime
-import fnmatch
-import http.server
-import json
-import os
-import shutil
-import signal
-import socket
-import socketserver
-import subprocess
-import sys
-import tempfile
-
-
-NETDEV = "lxcbr0"
-IP_PATTERN = "10.0.*"
-PORT = 8042
-
-
-def find_lxc_ip():
- cmd = ["ip", "-j", "-o", "-4", "addr", "show", "dev", NETDEV]
- p = subprocess.run(cmd, capture_output=True, text=True, check=True)
- ret = json.loads(p.stdout)[0]["addr_info"][0]["local"]
- if not fnmatch.fnmatch(ret, IP_PATTERN):
- print(f"ERROR: IP doesn't match pattern {IP_PATTERN}: {ret}")
- sys.exit(1)
- return ret
-
-
-def executable_is_relevant(exe):
- basename = os.path.basename(exe)
- patterns = [
- "open5gs-*",
- "osmo-*",
- ]
-
- for pattern in patterns:
- if fnmatch.fnmatch(basename, pattern):
- return True
-
- return False
-
-
-class CustomRequestHandler(http.server.SimpleHTTPRequestHandler):
- def do_GET(self):
- if self.path == "/core":
- # Check for any coredump within last 3 seconds
- since = (datetime.datetime.now() - datetime.timedelta(seconds=3)).strftime("%Y-%m-%d %H:%M:%S")
- cmd = ["coredumpctl", "-q", "-S", since, "--json=short", "-n1"]
-
- p = subprocess.run(cmd, capture_output=True, text=True)
- if p.returncode != 0:
- self.send_error(404, "No coredump found")
- return None
-
- # Check if the coredump executable is from osmo-*, open5gs-*, etc.
- coredump = json.loads(p.stdout)[0]
- if not executable_is_relevant(coredump["exe"]):
- self.send_error(404, "No coredump found")
- return None
-
- # Put coredump into a temporary file and return it
- with tempfile.TemporaryDirectory() as tmpdirname:
- core_path = os.path.join(tmpdirname, "core")
- cmd = [
- "coredumpctl",
- "dump",
- "-q",
- "-S",
- since,
- "-o",
- core_path,
- str(coredump["pid"]),
- coredump["exe"],
- ]
- subprocess.run(cmd, stdout=subprocess.DEVNULL, check=True)
-
- with open(core_path, "rb") as f:
- self.send_response(200)
- self.send_header("X-Executable-Path", coredump["exe"])
- self.end_headers()
- self.wfile.write(f.read())
- else:
- self.send_error(404, "File Not Found")
-
-
-def signal_handler(sig, frame):
- sys.exit(0)
-
-
-def main():
- if not shutil.which("coredumpctl"):
- print("ERROR: coredumpctl not found!")
- sys.exit(1)
-
- ip = os.environ.get("LXC_HOST_IP") or find_lxc_ip()
- print(f"Listening on {ip}:{PORT}")
- signal.signal(signal.SIGINT, signal_handler)
- with socketserver.TCPServer((ip, PORT), CustomRequestHandler, False) as httpd:
- httpd.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
- httpd.server_bind()
- httpd.server_activate()
- httpd.serve_forever()
-
-
-if __name__ == "__main__":
- main()
diff --git a/ansible/roles/testenv-coredump-helper/files/testenv-coredump-helper.service b/ansible/roles/testenv-coredump-helper/files/testenv-coredump-helper.service
deleted file mode 100644
index ef5a851..0000000
--- a/ansible/roles/testenv-coredump-helper/files/testenv-coredump-helper.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=testenv coredump helper
-After=lxc.service
-
-[Service]
-Environment="PYTHONUNBUFFERED=1"
-Type=simple
-Restart=always
-ExecStart=/opt/testenv-coredump-helper/testenv-coredump-helper
-
-[Install]
-WantedBy=multi-user.target
diff --git a/ansible/roles/testenv-coredump-helper/handlers/main.yml b/ansible/roles/testenv-coredump-helper/handlers/main.yml
deleted file mode 100644
index 0f7ef57..0000000
--- a/ansible/roles/testenv-coredump-helper/handlers/main.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- name: restart testenv-coredump-helper
- service:
- name: testenv-coredump-helper
- state: restarted
diff --git a/ansible/roles/testenv-coredump-helper/tasks/main.yml b/ansible/roles/testenv-coredump-helper/tasks/main.yml
deleted file mode 100644
index 9ff2769..0000000
--- a/ansible/roles/testenv-coredump-helper/tasks/main.yml
+++ /dev/null
@@ -1,31 +0,0 @@
----
-- name: install coredumpctl
- apt:
- name:
- - systemd-coredump
- cache_valid_time: 3600
- update_cache: yes
-
-- name: mkdir /opt/testenv-coredump-helper
- ansible.builtin.file:
- path: /opt/testenv-coredump-helper
- state: directory
-
-- name: install testenv-coredump-helper
- ansible.builtin.copy:
- src: testenv-coredump-helper.py
- dest: /opt/testenv-coredump-helper/testenv-coredump-helper
- mode: '0755'
- notify: restart testenv-coredump-helper
-
-- name: install testenv-coredump-helper service
- ansible.builtin.copy:
- src: testenv-coredump-helper.service
- dest: /etc/systemd/system/testenv-coredump-helper.service
- mode: '0644'
- notify: restart testenv-coredump-helper
-
-- name: enable testenv-coredump-helper service
- ansible.builtin.systemd_service:
- name: testenv-coredump-helper
- enabled: true
diff --git a/ansible/setup-build-host.yml b/ansible/setup-build-host.yml
index d1d9874..ed8def5 100644
--- a/ansible/setup-build-host.yml
+++ b/ansible/setup-build-host.yml
@@ -18,4 +18,3 @@
update_cache: yes
roles:
- name: apt-allow-relinfo-change
- - name: testenv-coredump-helper
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/41154?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I2959c6e6d97d5691ee2a4ae5d49a351eb5811f10
Gerrit-Change-Number: 41154
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41151?usp=email )
Change subject: testenv: run daemons with 'ulimit -c unlimited'
......................................................................
testenv: run daemons with 'ulimit -c unlimited'
Prepare to support getting core files without having systemd-coredump
installed, as we plan to uninstall it from the jenkins servers to make
retrieving coredumps for other jobs feasible again.
When starting daemons, set the maximum core file size to unlimited.
Otherwise it might be at 0, resulting in no core files getting
generated.
I have considered using resource.setrlimit() on the python process
instead, but this wouldn't work when spawning the daemons inside the
podman container.
Change-Id: Ideaf0386c8d6111c2634f276f926e976023ff511
---
M _testenv/testenv/daemons.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/51/41151/1
diff --git a/_testenv/testenv/daemons.py b/_testenv/testenv/daemons.py
index d4804d0..3a38850 100644
--- a/_testenv/testenv/daemons.py
+++ b/_testenv/testenv/daemons.py
@@ -53,7 +53,7 @@
pipe = f"2>&1 | tee {shlex.quote(log)}"
else:
pipe = f">{shlex.quote(log)} 2>&1"
- cmd = ["sh", "-c", f"{program} {pipe}"]
+ cmd = ["sh", "-c", f"ulimit -c unlimited; {program} {pipe}"]
env = {}
if testenv.args.io_uring:
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41151?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ideaf0386c8d6111c2634f276f926e976023ff511
Gerrit-Change-Number: 41151
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( 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/testenv/coredump.py
M _testenv/testenv/daemons.py
M _testenv/testenv/requirements.py
3 files changed, 46 insertions(+), 56 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/41152/1
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: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ia765b01432e4cb4cd36c45de874b966e3ebf55bc
Gerrit-Change-Number: 41152
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>