master - test: Only force an IO sync when the testcase has finished.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c96e42006d3bbb...
Commit: c96e42006d3bbbcc21cf952c96bf1fc7b15f1bd0
Parent: 72ee3f920b235c516328e92757571d311308f439
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Oct 1 11:27:44 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:51:06 2015 +0100
test: Only force an IO sync when the testcase has finished.
---
test/lib/brick-shelltest.h | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index 7c6a021..71194cf 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -339,7 +339,7 @@ struct TimedBuffer {
struct Sink {
virtual void outline( bool ) {}
virtual void push( std::string x ) = 0;
- virtual void sync() {}
+ virtual void sync( bool ) {}
virtual ~Sink() {}
};
@@ -410,11 +410,11 @@ struct FdSink : Sink {
write( fd, out.c_str(), out.length() );
}
- virtual void sync() {
+ virtual void sync( bool force ) {
if ( killed )
return;
- while ( !stream.empty( true ) )
- outline( true );
+ while ( !stream.empty( force ) )
+ outline( force );
}
virtual void push( std::string x ) {
@@ -429,13 +429,13 @@ struct FileSink : FdSink {
std::string file;
FileSink( std::string n ) : FdSink( -1 ), file( n ) {}
- void sync() {
+ void sync( bool force ) {
if ( fd < 0 && !killed ) {
fd = open( file.c_str(), O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644 );
if ( fd < 0 )
killed = true;
}
- FdSink::sync();
+ FdSink::sync( force );
}
~FileSink() {
@@ -561,12 +561,12 @@ struct IO : Sink {
(*i)->push( x );
}
- void sync() {
+ void sync( bool force ) {
for ( Sources::iterator i = sources.begin(); i != sources.end(); ++i )
(*i)->sync( this );
for ( Sinks::iterator i = sinks.begin(); i != sinks.end(); ++i )
- (*i)->sync();
+ (*i)->sync( force );
}
void close() {
@@ -717,7 +717,7 @@ struct TestCase {
}
if ( wait4(pid, &status, WNOHANG, &usage) != 0 ) {
- io.sync();
+ io.sync( true );
return false;
}
@@ -732,7 +732,7 @@ struct TestCase {
waitpid( pid, &status, 0 );
}
timeout = true;
- io.sync();
+ io.sync( true );
return false;
}
@@ -755,7 +755,7 @@ struct TestCase {
if ( select( nfds, &set, NULL, NULL, &wait ) > 0 )
silent_start = end; /* something happened */
- io.sync();
+ io.sync( false );
return true;
}
9 years, 3 months
master - test: Allow a longer timeout for lvextend-snapshot-dmeventd.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=72ee3f920b235c...
Commit: 72ee3f920b235c516328e92757571d311308f439
Parent: 839ea48aa97a541638cf7f2ac6ea48695116c014
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Oct 1 09:52:09 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:51:06 2015 +0100
test: Allow a longer timeout for lvextend-snapshot-dmeventd.
---
test/shell/lvextend-snapshot-dmeventd.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvextend-snapshot-dmeventd.sh b/test/shell/lvextend-snapshot-dmeventd.sh
index 3d9ce1f..448df96 100644
--- a/test/shell/lvextend-snapshot-dmeventd.sh
+++ b/test/shell/lvextend-snapshot-dmeventd.sh
@@ -26,7 +26,7 @@ percent_() {
wait_for_change_() {
# dmeventd only checks every 10 seconds :(
- for i in $(seq 1 15) ; do
+ for i in $(seq 1 25) ; do
test "$(percent_)" != "$1" && return
sleep 1
done
9 years, 3 months
master - test: Make dmsetup remove more robust in pvmove-restart.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=839ea48aa97a54...
Commit: 839ea48aa97a541638cf7f2ac6ea48695116c014
Parent: 210a66fbf85fcb16ad645950b18d4ef631af3d53
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Oct 1 09:08:26 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:51:06 2015 +0100
test: Make dmsetup remove more robust in pvmove-restart.
---
test/shell/pvmove-restart.sh | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/test/shell/pvmove-restart.sh b/test/shell/pvmove-restart.sh
index 86e2efa..b4a2893 100644
--- a/test/shell/pvmove-restart.sh
+++ b/test/shell/pvmove-restart.sh
@@ -40,8 +40,7 @@ wait
# Simulate reboot - forcibly remove related devices
dmsetup table
-dmsetup remove $vg-$lv1
-dmsetup ls --exec echo | grep $vg-pvmove0 | xargs -r dmsetup remove
+dmsetup ls --exec echo | egrep '$vg-$lv1|$vg-pvmove0' | xargs -r -n 1 dmsetup remove
# Check we really have pvmove volume
check lv_attr_bit type $vg/pvmove0 "p"
9 years, 3 months
master - test: Make killing local (test) daemons more robust.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=210a66fbf85fcb...
Commit: 210a66fbf85fcb16ad645950b18d4ef631af3d53
Parent: 17575403d487d8f0deeceea78520f53b68c8573c
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Oct 1 08:53:27 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:51:06 2015 +0100
test: Make killing local (test) daemons more robust.
---
test/lib/aux.sh | 17 ++++++++++++-----
test/lib/utils.sh | 2 +-
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 88b821a..3ef2da0 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -210,11 +210,18 @@ teardown_devs() {
}
kill_sleep_kill_() {
- if test -s "$1" ; then
- if kill -TERM "$(< $1)" ; then
- if test "$2" -eq 0 ; then sleep .1 ; else sleep 1 ; fi
- kill -KILL "$(< $1)" 2>/dev/null || true
- fi
+ pidfile=$1
+ slow=$2
+ if test -s $pidfile ; then
+ pid=$(< $pidfile)
+ kill -TERM $pid
+ if test $slow -eq 0 ; then sleep .1 ; else sleep 1 ; fi
+ kill -KILL $pid 2>/dev/null || true
+ wait=0
+ while ps $pid > /dev/null && test $wait -le 10; do
+ sleep .5
+ wait=$(($wait + 1))
+ done
fi
}
diff --git a/test/lib/utils.sh b/test/lib/utils.sh
index 0599f4d..2f7dc65 100644
--- a/test/lib/utils.sh
+++ b/test/lib/utils.sh
@@ -112,7 +112,7 @@ STACKTRACE() {
test "${LVM_TEST_PARALLEL:-0}" -eq 1 -o -n "$RUNNING_DMEVENTD" -o -f LOCAL_DMEVENTD || {
pgrep dmeventd &>/dev/null && \
- die "** During test dmeventd has been started!"
+ die "ERROR: The test started dmeventd unexpectedly."
}
# Get backtraces from coredumps
9 years, 3 months
master - test: Disable lvmetad debug log on another bunch of tests.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=17575403d487d8...
Commit: 17575403d487d8f0deeceea78520f53b68c8573c
Parent: 1f727f3f3d925af35877ad572ba606965bc6f1e7
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Oct 1 08:31:53 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:51:06 2015 +0100
test: Disable lvmetad debug log on another bunch of tests.
---
test/shell/mirror-vgreduce-removemissing.sh | 3 +++
test/shell/process-each-lv.sh | 3 +++
test/shell/pvmove-basic.sh | 5 ++++-
test/shell/vgsplit-operation.sh | 3 +++
4 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/test/shell/mirror-vgreduce-removemissing.sh b/test/shell/mirror-vgreduce-removemissing.sh
index fd71696..8891369 100644
--- a/test/shell/mirror-vgreduce-removemissing.sh
+++ b/test/shell/mirror-vgreduce-removemissing.sh
@@ -14,6 +14,9 @@ test_description="ensure that 'vgreduce --removemissing' works on mirrored LV"
. lib/inittest
+# disable lvmetad logging as it bogs down test systems
+test -e LOCAL_LVMETAD && aux prepare_lvmetad ""
+
lv_is_on_ ()
{
local lv=$vg/$1
diff --git a/test/shell/process-each-lv.sh b/test/shell/process-each-lv.sh
index 0260951..355e92e 100644
--- a/test/shell/process-each-lv.sh
+++ b/test/shell/process-each-lv.sh
@@ -13,6 +13,9 @@ test_description='Exercise toollib process_each_lv'
. lib/inittest
+# disable lvmetad logging as it bogs down test systems
+test -e LOCAL_LVMETAD && aux prepare_lvmetad ""
+
aux prepare_devs 10
#
diff --git a/test/shell/pvmove-basic.sh b/test/shell/pvmove-basic.sh
index c326dc3..e5add05 100644
--- a/test/shell/pvmove-basic.sh
+++ b/test/shell/pvmove-basic.sh
@@ -16,6 +16,9 @@ test_description="ensure that pvmove works with basic options"
which md5sum || skip
+# disable lvmetad logging as it bogs down test systems
+test -e LOCAL_LVMETAD && aux prepare_lvmetad ""
+
# ---------------------------------------------------------------------
# Utilities
@@ -355,4 +358,4 @@ else
fi
lvremove -ff $vg
-done
\ No newline at end of file
+done
diff --git a/test/shell/vgsplit-operation.sh b/test/shell/vgsplit-operation.sh
index 8081b38..6b478e8 100644
--- a/test/shell/vgsplit-operation.sh
+++ b/test/shell/vgsplit-operation.sh
@@ -13,6 +13,9 @@
. lib/inittest
+# disable lvmetad logging as it bogs down test systems
+test -e LOCAL_LVMETAD && aux prepare_lvmetad ""
+
COMM() {
LAST_TEST="$@"
}
9 years, 3 months
master - test: Call $VALGRIND directly in lvm-wrapper.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1f727f3f3d925a...
Commit: 1f727f3f3d925af35877ad572ba606965bc6f1e7
Parent: 3af008d4051d54d9138933d99ca234ede8ea6b05
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Oct 1 08:19:05 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:51:06 2015 +0100
test: Call $VALGRIND directly in lvm-wrapper.
---
test/lib/aux.sh | 2 +-
test/lib/lvm-wrapper.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index ca06c69..88b821a 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -14,7 +14,7 @@
run_valgrind() {
# Execute script which may use $TESTNAME for creating individual
# log files for each execute command
- exec "${VALGRIND:-valg}" "$@"
+ exec "${VALGRIND:-valgrind}" "$@"
}
expect_failure() {
diff --git a/test/lib/lvm-wrapper.sh b/test/lib/lvm-wrapper.sh
index 3eb0d99..496facc 100644
--- a/test/lib/lvm-wrapper.sh
+++ b/test/lib/lvm-wrapper.sh
@@ -24,7 +24,7 @@ test -z "$LVM_GDB" || exec gdb --readnow --args "$abs_top_builddir/tools/lvm" $C
# Multiple level of LVM_VALGRIND support
# the higher level the more commands are traced
if test -n "$LVM_VALGRIND"; then
- RUN_DBG="aux run_valgrind";
+ RUN_DBG="${VALGRIND:-valgrind}";
fi
if test -n "$LVM_STRACE"; then
9 years, 3 months
master - NIX: Add valgrind-devel to the build environment.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3af008d4051d54...
Commit: 3af008d4051d54d9138933d99ca234ede8ea6b05
Parent: 2a8dc7fb538595ffecee53298a38a284f8df89c0
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Oct 1 08:18:46 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:51:04 2015 +0100
NIX: Add valgrind-devel to the build environment.
---
nix/default.nix | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/nix/default.nix b/nix/default.nix
index 8fc2152..603b3dc 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -285,7 +285,7 @@ let
extra_rpms = rec {
common = [ "libselinux-devel" "libsepol-devel" "ncurses-devel" "readline-devel"
"corosynclib-devel"
- "valgrind" "strace" "gdb"
+ "valgrind" "valgrind-devel" "gdb" "strace"
"redhat-rpm-config" # needed for rpmbuild of lvm
"which" "e2fsprogs" # needed for fsadm
"perl-GD" # for lcov
9 years, 3 months
master - memlock: Do not check memory balance if RUNNING_ON_VALGRIND.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2a8dc7fb538595...
Commit: 2a8dc7fb538595ffecee53298a38a284f8df89c0
Parent: d571eab3b2bbb9be80e75e633bf2e30834975552
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Oct 1 08:17:59 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:50:34 2015 +0100
memlock: Do not check memory balance if RUNNING_ON_VALGRIND.
---
lib/mm/memlock.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
index c5358dc..2327d4c 100644
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
@@ -27,6 +27,10 @@
#include <sys/resource.h>
#include <malloc.h>
+#ifdef HAVE_VALGRIND
+#include <valgrind.h>
+#endif
+
#ifndef DEVMAPPER_SUPPORT
void memlock_inc_daemon(struct cmd_context *cmd)
@@ -254,12 +258,13 @@ static int _maps_line(const struct dm_config_node *cn, lvmlock_t lock,
}
}
-#ifdef VALGRIND_POOL
+#ifdef HAVE_VALGRIND
/*
* Valgrind is continually eating memory while executing code
* so we need to deactivate check of locked memory size
*/
- sz -= sz; /* = 0, but avoids getting warning about dead assigment */
+ if (RUNNING_ON_VALGRIND)
+ sz -= sz; /* = 0, but avoids getting warning about dead assigment */
#endif
*mstats += sz;
9 years, 3 months
master - configure: Look for valgrind.h independently of VALGRIND_POOLS.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d571eab3b2bbb9...
Commit: d571eab3b2bbb9be80e75e633bf2e30834975552
Parent: 5d833fd4587ce30eb1fb4e20363ede07c40bc2f0
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Oct 1 08:16:27 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:50:34 2015 +0100
configure: Look for valgrind.h independently of VALGRIND_POOLS.
---
configure.in | 14 ++++++++++----
lib/Makefile.in | 2 +-
libdm/Makefile.in | 5 +----
make.tmpl.in | 1 +
4 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/configure.in b/configure.in
index add6653..18e1c17 100644
--- a/configure.in
+++ b/configure.in
@@ -1023,12 +1023,18 @@ AC_ARG_ENABLE(valgrind_pool,
VALGRIND_POOL=$enableval, VALGRIND_POOL=no)
AC_MSG_RESULT($VALGRIND_POOL)
-if test "$VALGRIND_POOL" = yes; then
- pkg_config_init
- PKG_CHECK_MODULES(VALGRIND, valgrind, [], [AC_MSG_ERROR(bailing out)])
+pkg_config_init
+PKG_CHECK_MODULES(VALGRIND, valgrind, [HAVE_VALGRIND=yes], [if test x$VALGRIND_POOL = xyes; then AC_MSG_ERROR(bailing out); fi])
+AC_SUBST(VALGRIND_CFLAGS)
+
+if test x$HAVE_VALGRIND = xyes; then
+ AC_DEFINE([HAVE_VALGRIND], 1, [valgrind.h found])
+ AC_SUBST(HAVE_VALGRIND)
+fi
+
+if test x$VALGRIND_POOL = xyes; then
AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
AC_SUBST(VALGRIND_POOL)
- AC_SUBST(VALGRIND_CFLAGS)
fi
################################################################################
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 62600d5..749342d 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -222,7 +222,7 @@ CFLOW_LIST_TARGET = $(LIB_NAME).cflow
include $(top_builddir)/make.tmpl
-CFLAGS += $(BLKID_CFLAGS) $(UDEV_CFLAGS)
+CFLAGS += $(BLKID_CFLAGS) $(UDEV_CFLAGS) $(VALGRIND_CFLAGS)
$(SUBDIRS): $(LIB_STATIC)
diff --git a/libdm/Makefile.in b/libdm/Makefile.in
index e50b174..8e057c3 100644
--- a/libdm/Makefile.in
+++ b/libdm/Makefile.in
@@ -34,10 +34,7 @@ SOURCES =\
$(interface)/libdm-iface.c
INCLUDES = -I$(srcdir)/$(interface) -I$(srcdir)
-ifeq ("@VALGRIND_POOL@", "yes")
-INCLUDES += @VALGRIND_CFLAGS@
-endif
-CFLAGS += $(UDEV_CFLAGS)
+CFLAGS += $(UDEV_CFLAGS) $(VALGRIND_CFLAGS)
ifeq ("@STATIC_LINK@", "yes")
LIB_STATIC = $(interface)/libdevmapper.a
diff --git a/make.tmpl.in b/make.tmpl.in
index 3a82731..cfa065c 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -61,6 +61,7 @@ UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
BLKID_CFLAGS = @BLKID_CFLAGS@
BLKID_LIBS = @BLKID_LIBS@
+VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
TESTING = @TESTING@
# Setup directory variables
9 years, 3 months
master - test: Add support for running LVM commands in tests through strace.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5d833fd4587ce3...
Commit: 5d833fd4587ce30eb1fb4e20363ede07c40bc2f0
Parent: a6d006d9db033e8251fd58848f8876b3e3d0fe90
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Sep 30 17:09:26 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:50:34 2015 +0100
test: Add support for running LVM commands in tests through strace.
---
test/lib/aux.sh | 18 +++++++++---------
test/lib/lvm-wrapper.sh | 23 ++++++++++++++---------
test/lib/utils.sh | 1 +
3 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index fd537bd..ca06c69 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -22,7 +22,7 @@ expect_failure() {
}
prepare_clvmd() {
- rm -f debug.log
+ rm -f debug.log strace.log
test "${LVM_TEST_LOCKING:-0}" -ne 3 && return # not needed
if pgrep clvmd ; then
@@ -54,7 +54,7 @@ prepare_clvmd() {
}
prepare_dmeventd() {
- rm -f debug.log
+ rm -f debug.log strace.log
if pgrep dmeventd ; then
echo "Cannot test dmeventd with real dmeventd ($(pgrep dmeventd)) running."
skip
@@ -81,7 +81,7 @@ prepare_dmeventd() {
prepare_lvmetad() {
test $# -eq 0 && default_opts="-l wire,debug"
- rm -f debug.log
+ rm -f debug.log strace.log
# skip if we don't have our own lvmetad...
(which lvmetad 2>/dev/null | grep "$abs_builddir") || skip
@@ -227,7 +227,7 @@ teardown() {
# Avoid activation of dmeventd if there is no pid
cfg=$(test -s LOCAL_DMEVENTD || echo "--config activation{monitoring=0}")
vgremove -ff $cfg \
- $vg $vg1 $vg2 $vg3 $vg4 &>/dev/null || rm -f debug.log
+ $vg $vg1 $vg2 $vg3 $vg4 &>/dev/null || rm -f debug.log strace.log
}
kill_sleep_kill_ LOCAL_CLVMD ${LVM_VALGRIND_CLVMD:-0}
@@ -478,7 +478,7 @@ enable_dev() {
shift
fi
- rm -f debug.log
+ rm -f debug.log strace.log
init_udev_transaction
for dev in "$@"; do
local name=$(echo "$dev" | sed -e 's,.*/,,')
@@ -601,7 +601,7 @@ unhide_dev() {
}
mkdev_md5sum() {
- rm -f debug.log
+ rm -f debug.log strace.log
mkfs.ext2 "$DM_DEV_DIR/$1/$2" || return 1
md5sum "$DM_DEV_DIR/$1/$2" > "md5.$1-$2"
}
@@ -704,12 +704,12 @@ apitest() {
local t=$1
shift
test -x "$abs_top_builddir/test/api/$t.t" || skip
- "$abs_top_builddir/test/api/$t.t" "$@" && rm -f debug.log
+ "$abs_top_builddir/test/api/$t.t" "$@" && rm -f debug.log strace.log
}
api() {
test -x "$abs_top_builddir/test/api/wrapper" || skip
- "$abs_top_builddir/test/api/wrapper" "$@" && rm -f debug.log
+ "$abs_top_builddir/test/api/wrapper" "$@" && rm -f debug.log strace.log
}
mirror_recovery_works() {
@@ -820,7 +820,7 @@ version_at_least() {
#
# i.e. dm_target_at_least dm-thin-pool 1 0
target_at_least() {
- rm -f debug.log
+ rm -f debug.log strace.log
case "$1" in
dm-*) modprobe "$1" || true ;;
esac
diff --git a/test/lib/lvm-wrapper.sh b/test/lib/lvm-wrapper.sh
index 013bc13..3eb0d99 100644
--- a/test/lib/lvm-wrapper.sh
+++ b/test/lib/lvm-wrapper.sh
@@ -24,17 +24,22 @@ test -z "$LVM_GDB" || exec gdb --readnow --args "$abs_top_builddir/tools/lvm" $C
# Multiple level of LVM_VALGRIND support
# the higher level the more commands are traced
if test -n "$LVM_VALGRIND"; then
- RUN_VALGRIND="aux run_valgrind";
- case "$CMD" in
- lvs|pvs|vgs|vgck|vgscan)
- test "$LVM_VALGRIND" -gt 2 || unset RUN_VALGRIND ;;
- pvcreate|pvremove|lvremove|vgcreate|vgremove)
- test "$LVM_VALGRIND" -gt 1 || unset RUN_VALGRIND ;;
- *)
- test "$LVM_VALGRIND" -gt 0 || unset RUN_VALGRIND ;;
- esac
+ RUN_DBG="aux run_valgrind";
fi
+if test -n "$LVM_STRACE"; then
+ RUN_DBG="strace $LVM_STRACE -o strace.log"
+fi
+
+set -x
+
+case "$CMD" in
+ lvs|pvs|vgs|vgck|vgscan)
+ test ${LVM_DEBUG_LEVEL:-0} -lt 2 && RUN_DBG= ;;
+ pvcreate|pvremove|lvremove|vgcreate|vgremove)
+ test ${LVM_DEBUG_LEVEL:-0} -lt 1 && RUN_DBG= ;;
+esac
+
# the exec is important, because otherwise fatal signals inside "not" go unnoticed
if test -n "$abs_top_builddir"; then
exec $RUN_DBG "$abs_top_builddir/tools/lvm" $CMD "$@"
diff --git a/test/lib/utils.sh b/test/lib/utils.sh
index 70f8ca5..0599f4d 100644
--- a/test/lib/utils.sh
+++ b/test/lib/utils.sh
@@ -129,6 +129,7 @@ STACKTRACE() {
test -z "$LVM_TEST_NODEBUG" -a -f debug.log && {
sed -e "s,^,## DEBUG: ,;s,$top_srcdir/\?,," < debug.log
+ test -e strace.log && sed -e "s,^,## STRACE: ,;s,$top_srcdir/\?,," < strace.log
}
test -f SKIP_THIS_TEST && exit 200
9 years, 3 months