From 57612ebcf3b5414c6a2f6153a3338803ac94d759 Mon Sep 17 00:00:00 2001 From: Andrew Yourtchenko Date: Wed, 28 Mar 2018 15:32:10 +0200 Subject: make test: print a warning in case a core_pattern contains a filter program The default config on Ubuntu 16.04.4 desktop results in truncated cores when running make test which coredumps. Uninstalling the filter program (apport) makes the corefiles normal size. Print a warning about that fact, so the others potentially affected didn't have to wonder. Change-Id: Iba4b0a2765a25100d6e24fd7f4de0e0339efd835 Signed-off-by: Andrew Yourtchenko --- test/util.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/util.py') diff --git a/test/util.py b/test/util.py index 7d973bde237..65e25f77f0c 100644 --- a/test/util.py +++ b/test/util.py @@ -70,6 +70,21 @@ def ip6_normalize(ip6): socket.inet_pton(socket.AF_INET6, ip6)) +def check_core_path(logger, core_path): + with open("/proc/sys/kernel/core_pattern", "r") as f: + corefmt = f.read() + if corefmt.startswith("|"): + logger.error( + "WARNING: redirecting the core dump through a" + " filter may result in truncated dumps.") + logger.error( + " You may want to check the filter settings" + " or uninstall it and edit the" + " /proc/sys/kernel/core_pattern accordingly.") + logger.error( + " current core pattern is: %s" % corefmt) + + class NumericConstant(object): __metaclass__ = ABCMeta -- cgit 1.2.3-korg