1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/test/lib/lvm-wrapper.sh
Zdenek Kabelac fd818eb3aa Update aux.sh lvmwrapper
Indent

Add valgrind support:
 env LVM_TEST_VALGRIND={0123} (the higher level, more commands tested)
 env LVM_TEST_CLVMD=1   runs clvmd within valgrind.
 env VALGRIND  script name executed for each lvm command (def. is valg).

Smarted teardown - should minimize occurence of left dev entries
 (using dmsetup remove -f only as last resort)
 sort removed devices by open count before actual removal

Use "" around string that may contain spaces.

Set log/verbose and activation/retry_deactivation to defined value.

Remove  debug.log after successful lvm command (easier to check output).
2012-03-16 12:59:02 +00:00

33 lines
1.0 KiB
Bash

#!/bin/sh
# Copyright (C) 2011-2012 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/paths
CMD=${0##*/}
test "$CMD" != lvm || unset CMD
# 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
fi
$RUN_VALGRIND "$abs_top_builddir/tools/lvm" $CMD "$@" && \
rm -f debug.log # Remove log for successful command