public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: elfutils-devel@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] tests: Accept any core if no core with the "correct" pid can be found.
Date: Fri, 16 Feb 2018 19:37:00 -0000	[thread overview]
Message-ID: <1518809824-20616-1-git-send-email-mark@klomp.org> (raw)

In some containers our view of pids is confused. We see the container
pid namespace, but the core is generated using the host pid namespace.
Since tests are run in a new fresh directory any core here is most like
is ours.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 tests/ChangeLog         | 5 +++++
 tests/backtrace-subr.sh | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index cfdd7f9..9a89676 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2018-02-16  Mark Wielaard  <mark@klomp.org>
+
+	* backtrace-subr.sh (check_native_core): Check if there is any core,
+	if so, use it.
+
 2018-02-15  Mark Wielaard  <mark@klomp.org>
 
 	* backtrace-child.c: Include signal.h after sys/ptrace.h.
diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh
index e04a7ea..ff42c6f 100644
--- a/tests/backtrace-subr.sh
+++ b/tests/backtrace-subr.sh
@@ -174,6 +174,13 @@ check_native_core()
     fi
   fi
   if [ ! -f "$core" ]; then
+    # In some containers our view of pids is confused. Since tests are
+    # run in a new fresh directory any core here is most like is ours.
+    if ls core.[0-9]* 1> /dev/null 2>&1; then
+      mv core.[0-9]* "$core"
+    fi
+  fi
+  if [ ! -f "$core" ]; then
     echo "No $core file generated";
     exit 77;
   fi
-- 
1.8.3.1

                 reply	other threads:[~2018-02-16 19:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1518809824-20616-1-git-send-email-mark@klomp.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).