master - tests: utils.sh looks for more dumps
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=413209f3f8f35963dda8b0fbbbaaa785e44958e2 Commit: 413209f3f8f35963dda8b0fbbbaaa785e44958e2 Parent: 2154f30a996967fa192b33997704d47038b5f077 Author: Zdenek Kabelac <[email protected]> AuthorDate: Sat Jul 15 00:12:07 2017 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Sat Jul 15 00:12:07 2017 +0200
tests: utils.sh looks for more dumps
Check for core in sysctl kernel.core_pattern
(assuming core prefix still)
--- test/lib/utils.sh | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-)
test/lib/utils.sh +8 -5
@@ -140,13 +140,16 @@ STACKTRACE() { echo l echo quit } > gdb_commands.txt - # TODO: use sysctl to get 'core' position in system - for i in core*; do - test -f "$i" || break # empty globbing + + # Check for all cores newer then TESTNAME file + # Assume users keep prefix 'core' + while IFS= read -r i; do bin=$(gdb -batch -c "$i" 2>&1 | grep "generated by" | \ sed -e "s,.*generated by \`\([^ ']*\).*,\1,") || continue - gdb -batch -c "$i" -x gdb_commands.txt "$(which "$bin")" || continue - done + echo "## Checking coredump: $i generated by $bin." + gdb -batch -c "$i" -x gdb_commands.txt "$(which "$bin")" 2>/dev/null | \ + sed -e "s,^,## GDB: ," || continue + done < <(find . $(dirname $(sysctl -n kernel.core_pattern)) -name 'core*' -newer TESTNAME 2>/dev/null || true) fi test -f SKIP_THIS_TEST && exit 200