All of lore.kernel.org
 help / color / mirror / Atom feed
From: mornfall@sourceware.org <mornfall@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/test test-utils.sh
Date: 13 Apr 2010 08:01:55 -0000	[thread overview]
Message-ID: <20100413080155.9253.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall at sourceware.org	2010-04-13 08:01:53

Modified files:
	test           : test-utils.sh 

Log message:
	Process all core dumps that exist upon a test failure (this would hopefully
	include eg. clvmd cores, apart from the usual lvm ones).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/test-utils.sh.diff?cvsroot=lvm2&r1=1.35&r2=1.36

--- LVM2/test/test-utils.sh	2010/04/13 07:02:14	1.35
+++ LVM2/test/test-utils.sh	2010/04/13 08:01:53	1.36
@@ -22,19 +22,17 @@
 		i=$(($i + 1));
 	done
 
-	# Attempt to get a stacktrace if a core file exists
-	# and the lvm binary was built with debugging
+	# Get backtraces from coredumps
 	TEST_LVM_BINARY=$(dirname $(which lvm))/../../tools/lvm
-	TEST_LVM_CORE=`ls core* | head -1`
-	GDB_BINARY=`which gdb`
-	READELF_BINARY=`which readelf`
-	if [ -n "$TEST_LVM_CORE" -a -n "$GDB_BINARY" -a -n "$READELF_BINARY" ]; then
-		if $READELF_BINARY -S $TEST_LVM_BINARY 2>&1 | grep -q .debug_info; then
-			echo bt full > gdb_commands.txt
-			echo l >> gdb_commands.txt
-			echo quit >> gdb_commands.txt
-			$GDB_BINARY -batch -c $TEST_LVM_CORE -x gdb_commands.txt $TEST_LVM_BINARY
-		fi
+	if which gdb >& /dev/null; then
+		echo bt full > gdb_commands.txt
+		echo l >> gdb_commands.txt
+		echo quit >> gdb_commands.txt
+		for core in core*; do
+			bin=$(gdb -batch -c $core 2>&1 | grep "generated by" | \
+				sed -e "s,.*generated by \`\([^ ']*\).*,\1,")
+			gdb -batch -c $core -x gdb_commands.txt `which $bin`
+		done
 	fi
 }
 
@@ -130,7 +128,7 @@
 }
 
 trap_teardown() {
-	trap 'set +vex; STACKTRACE; set -vex' ERR
+	trap 'set +vx; STACKTRACE; set -vx' ERR
 	trap 'aux teardown' EXIT # don't forget to clean up
 }
 
@@ -387,6 +385,8 @@
 
 prepare() {
 	ulimit -c unlimited
+	# FIXME any way to set this just for our children?
+	# echo 1 > /proc/sys/kernel/core_uses_pid
 	prepare_testroot
 	prepare_lvmconf
 	prepare_clvmd



             reply	other threads:[~2010-04-13  8:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13  8:01 mornfall [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-12-09 11:19 LVM2/test test-utils.sh mbroz
2010-10-26  1:25 snitzer
2010-10-12 16:13 mornfall
2010-08-27  8:52 mbroz
2010-08-27  7:59 mbroz
2010-08-02 13:18 zkabelac
2010-05-24 17:19 mbroz
2010-05-24 17:18 mbroz
2010-05-12 11:58 mornfall
2010-04-20 18:18 snitzer
2010-04-14 12:04 mornfall
2010-04-13  7:02 mornfall
2010-04-13  6:24 mornfall
2010-04-07 21:38 mornfall
2010-04-07 21:19 mornfall
2010-04-07 16:04 mornfall
2010-04-06 14:25 agk
2010-03-28 15:52 mornfall
2010-03-18  9:27 mornfall
2010-02-01 19:43 wysochanski
2009-05-13 19:18 wysochanski
2009-04-24  8:00 mornfall
2008-12-10 16:16 zkabelac
2008-12-05  5:03 wysochanski
2008-11-10 12:36 mornfall
2008-11-04 14:38 mornfall
2008-10-14 19:48 mornfall

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=20100413080155.9253.qmail@sourceware.org \
    --to=mornfall@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.