]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: backtrace-subr.sh (check_native_core) should check core file name.
authorMatthias Klose <doko@ubuntu.com>
Tue, 7 Jan 2014 09:25:29 +0000 (10:25 +0100)
committerMark Wielaard <mjw@redhat.com>
Tue, 7 Jan 2014 09:25:29 +0000 (10:25 +0100)
Needed when /proc/sys/kernel/core_uses_pid is set to 0. Try to rename
the core file, and if it does still fail, skip the test.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
tests/ChangeLog
tests/backtrace-subr.sh

index 63b7bed736693ffaf94aeaf1807f9211d07a7088..7e9dcf4b0968e63b85e1ddd9622f41fc7f41b042 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-07  Matthias Klose <doko@ubuntu.com>
+
+       * backtrace-subr.sh (check_native_core): Check to see if core file
+       was created without ".PID" extension, if so mv core to core.PID.
+       Skip test if no core file was created or could be found.
+
 2014-01-04  Mark Wielaard  <mjw@redhat.com>
 
        * backtrace-data.c (main): Don't assert if raise returns.
index e7ece91ca4a591ac141129e0a4fac5ac58a6c7b0..62b873c79675ba2291462a3950b594417d299e40 100644 (file)
@@ -111,6 +111,11 @@ check_native_core()
 
   # Skip the test if we cannot adjust core ulimit.
   core="core.`ulimit -c unlimited || exit 77; set +ex; testrun ${abs_builddir}/$child --gencore; true`"
+  # see if /proc/sys/kernel/core_uses_pid is set to 0
+  if [ -f core ]; then
+    mv core "$core"
+  fi
+  if [ ! -f "$core" ]; then exit 77; fi
 
   if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then
     VALGRIND_CMD="$SAVED_VALGRIND_CMD"