master - test: Make lvm-wrapper available in the installed testsuite, too.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a6d006d9db033e...
Commit: a6d006d9db033e8251fd58848f8876b3e3d0fe90
Parent: 41c2e07a8dee3d3e5212c7c1939ddbd4624d3bed
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Sep 30 17:08:34 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:50:33 2015 +0100
test: Make lvm-wrapper available in the installed testsuite, too.
---
test/Makefile.in | 1 +
test/lib/lvm-wrapper.sh | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index 690e7e4..e0652e1 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -145,6 +145,7 @@ install: .tests-stamp lib/paths-installed
$(INSTALL_DATA) lib/paths-installed $(DATADIR)/lib/paths
$(INSTALL_DATA) $(LIB_FLAVOURS) $(DATADIR)/lib/
$(INSTALL_SCRIPT) $(LIB_SHARED) $(DATADIR)/lib/
+ for i in $(CMDS); do (cd $(DATADIR)/lib && ln -fs lvm-wrapper $$i); done
$(INSTALL_DIR) $(EXECDIR)
$(INSTALL_PROGRAM) $(LIB_EXEC) $(EXECDIR)
diff --git a/test/lib/lvm-wrapper.sh b/test/lib/lvm-wrapper.sh
index 082c640..013bc13 100644
--- a/test/lib/lvm-wrapper.sh
+++ b/test/lib/lvm-wrapper.sh
@@ -36,4 +36,9 @@ if test -n "$LVM_VALGRIND"; then
fi
# the exec is important, because otherwise fatal signals inside "not" go unnoticed
-exec $RUN_VALGRIND "$abs_top_builddir/tools/lvm" $CMD "$@"
+if test -n "$abs_top_builddir"; then
+ exec $RUN_DBG "$abs_top_builddir/tools/lvm" $CMD "$@"
+else # we are testing the lvm on $PATH
+ PATH=`echo $PATH | sed -e s,[^:]*lvm2-testsuite[^:]*:,,g`
+ exec $RUN_DBG lvm $CMD "$@"
+fi
9 years, 3 months
master - NIX: Install valgrind, gdb and strace in the test environment.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=41c2e07a8dee3d...
Commit: 41c2e07a8dee3d3e5212c7c1939ddbd4624d3bed
Parent: e4d5e22c91561a6722996e6b5c9735ae1397571d
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Sep 30 17:06:46 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:50:23 2015 +0100
NIX: Install valgrind, gdb and strace in the test environment.
---
nix/default.nix | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/nix/default.nix b/nix/default.nix
index fe1c377..8fc2152 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -285,6 +285,7 @@ let
extra_rpms = rec {
common = [ "libselinux-devel" "libsepol-devel" "ncurses-devel" "readline-devel"
"corosynclib-devel"
+ "valgrind" "strace" "gdb"
"redhat-rpm-config" # needed for rpmbuild of lvm
"which" "e2fsprogs" # needed for fsadm
"perl-GD" # for lcov
9 years, 3 months
master - NIX: Make timeout and test envvars configurable via --arg.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e4d5e22c91561a...
Commit: e4d5e22c91561a6722996e6b5c9735ae1397571d
Parent: c2b7642d4d8df4a9d6798f339415466c9b69a805
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Sep 30 17:06:19 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:47:21 2015 +0100
NIX: Make timeout and test envvars configurable via --arg.
---
nix/default.nix | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/nix/default.nix b/nix/default.nix
index 5999bd2..fe1c377 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -4,7 +4,7 @@
fc20_32_updates ? "", fc20_64_updates ? "",
fc19_32_updates ? "", fc19_64_updates ? "",
fc18_32_updates ? "", fc18_64_updates ? "",
- T ? "" }:
+ T ? "", ENV ? "", timeout ? 60 }:
let
pkgs = import nixpkgs {};
@@ -58,8 +58,9 @@ let
watch="--watch /xchg/udevd.log"
fi
+ export ${ENV}
lvm2-testsuite --batch --outdir /xchg/results --continue \
- --fatal-timeouts --heartbeat /xchg/heartbeat \
+ --timeout ${toString timeout} --fatal-timeouts --heartbeat /xchg/heartbeat \
--flavours ${flavour} $watch --kmsg ${if lib.eqStrings T "" then "" else "--only ${T}"}
# TODO: coverage reports
9 years, 3 months
master - test: Fix prepare_scsi_debug_dev.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c2b7642d4d8df4...
Commit: c2b7642d4d8df4a9d6798f339415466c9b69a805
Parent: 580370bea3a149afaffd9cfeeefb93b20c69c71f
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Sep 30 16:50:31 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:47:21 2015 +0100
test: Fix prepare_scsi_debug_dev.
---
test/lib/aux.sh | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 32268a6..fd537bd 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -334,9 +334,9 @@ prepare_scsi_debug_dev() {
# Create symlink to scsi_debug device in $DM_DEV_DIR
SCSI_DEBUG_DEV="$DM_DEV_DIR/$(basename $DEBUG_DEV)"
echo "$SCSI_DEBUG_DEV" > SCSI_DEBUG_DEV
- echo "$SCSI_DEBUG_DEV" > LOOP
+ echo "$SCSI_DEBUG_DEV" > BACKING_DEV
# Setting $LOOP provides means for prepare_devs() override
- test "$LVM_TEST_DEVDIR" = "/dev" || ln -snf "$DEBUG_DEV" "$SCSI_DEBUG_DEV"
+ test "$DEBUG_DEV" = "$SCSI_DEBUG_DEV" || ln -snf "$DEBUG_DEV" "$SCSI_DEBUG_DEV"
}
cleanup_scsi_debug_dev() {
@@ -345,7 +345,9 @@ cleanup_scsi_debug_dev() {
}
prepare_backing_dev() {
- if test -b "$LVM_TEST_BACKING_DEVICE"; then
+ if test -f BACKING_DEV; then
+ BACKING_DEV=$(< BACKING_DEV)
+ elif test -b "$LVM_TEST_BACKING_DEVICE"; then
BACKING_DEV="$LVM_TEST_BACKING_DEVICE"
echo "$BACKING_DEV" > BACKING_DEV
else
@@ -374,6 +376,7 @@ prepare_devs() {
test -n "$LVM_TEST_BACKING_DEVICE";
then # maybe the backing device is too small for this test
LVM_TEST_BACKING_DEVICE=
+ rm -f BACKING_DEV
prepare_devs "$@"
return $?
fi
9 years, 3 months
master - test: Avoid passing -c to flock.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=580370bea3a149...
Commit: 580370bea3a149afaffd9cfeeefb93b20c69c71f
Parent: 7a0aa25c28ccb89834a83b06917be803713b4804
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Sep 30 16:32:11 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:47:21 2015 +0100
test: Avoid passing -c to flock.
---
test/shell/lock-blocking.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/shell/lock-blocking.sh b/test/shell/lock-blocking.sh
index e05fa50..7c33067 100644
--- a/test/shell/lock-blocking.sh
+++ b/test/shell/lock-blocking.sh
@@ -20,7 +20,7 @@ vgcreate $vg "$dev1" "$dev2"
# if wait_for_locks set, vgremove should wait for orphan lock
# flock process should have exited by the time first vgremove completes
-flock -w 5 $TESTDIR/var/lock/lvm/P_orphans -c "sleep 10" &
+flock -w 5 $TESTDIR/var/lock/lvm/P_orphans sleep 10 &
while ! test -f $TESTDIR/var/lock/lvm/P_orphans ; do sleep .1 ; done
vgremove --config 'global { wait_for_locks = 1 }' $vg
@@ -31,7 +31,7 @@ test ! -f $TESTDIR/var/lock/lvm/P_orphans
# if wait_for_locks not set, vgremove should fail on non-blocking lock
# we must wait for flock process at the end - vgremove won't wait
vgcreate $vg "$dev1" "$dev2"
-flock -w 5 $TESTDIR/var/lock/lvm/P_orphans -c "sleep 10" &
+flock -w 5 $TESTDIR/var/lock/lvm/P_orphans sleep 10 &
while ! test -f $TESTDIR/var/lock/lvm/P_orphans ; do sleep .1 ; done
flock_pid=`jobs -p`
9 years, 3 months
master - test: Re-try with loopback if a backing device is too small.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7a0aa25c28ccb8...
Commit: 7a0aa25c28ccb89834a83b06917be803713b4804
Parent: f3cc6576ee065b02ff58974f0f0e8792dffbd824
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Sep 30 16:19:14 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:47:21 2015 +0100
test: Re-try with loopback if a backing device is too small.
---
test/lib/aux.sh | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 84edb7d..32268a6 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -370,7 +370,13 @@ prepare_devs() {
DEVICES[$count]=$dev
count=$(( $count + 1 ))
echo 0 $size linear "$BACKING_DEV" $((($i-1)*$size)) > "$name.table"
- dmsetup create -u "TEST-$name" "$name" "$name.table"
+ if not dmsetup create -u "TEST-$name" "$name" "$name.table" &&
+ test -n "$LVM_TEST_BACKING_DEVICE";
+ then # maybe the backing device is too small for this test
+ LVM_TEST_BACKING_DEVICE=
+ prepare_devs "$@"
+ return $?
+ fi
done
finish_udev_transaction
9 years, 3 months
master - NIX: Detect that the VM booted up more directly.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f3cc6576ee065b...
Commit: f3cc6576ee065b02ff58974f0f0e8792dffbd824
Parent: 734a183c5658c1f305a375da02bb24cccad566df
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Sep 30 11:02:25 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:47:21 2015 +0100
NIX: Detect that the VM booted up more directly.
---
nix/default.nix | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/nix/default.nix b/nix/default.nix
index 734fb3b..5999bd2 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -45,6 +45,7 @@ let
sha256 = "0ycdh5mb7p5ll76mqk0p6gpnjskvxxgh3a3bfr1crh94nvpwhp4z"; }}
mkdir -p /xchg/results
+ touch /xchg/booted
dmsetup targets
@@ -123,11 +124,17 @@ let
monitor &
for i in `seq 1 20`; do # we allow up to 20 VM restarts
+ rm -f xchg/booted
${vmtools.qemu}/bin/qemu-img create -f qcow2 /dev/shm/testdisk.img 4G
setsid bash -e ${vmtools.vmRunCommand (vmtools.qemuCommandLinux kernel)} &
pid=$!
- sleep 180 # give the VM some time to get up and running
+ # give the VM some time to get up and running
+ slept=0
+ while test $slept -le 180 && test ! -e xchg/booted; do
+ sleep 10
+ slept=$(($slept + 10))
+ done
echo $pid > pid # monitor go
wait $pid || true
rm -f pid # disarm the monitor process
9 years, 3 months
master - NIX: Avoid a spurious failure when all tests pass.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=734a183c5658c1...
Commit: 734a183c5658c1f305a375da02bb24cccad566df
Parent: bd0806e1f53f4b978cf298885e1d98365011ec3e
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Sep 30 11:01:48 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:47:21 2015 +0100
NIX: Avoid a spurious failure when all tests pass.
---
nix/default.nix | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/nix/default.nix b/nix/default.nix
index 445b0a7..734fb3b 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -22,7 +22,7 @@ let
cp $i/test-results'/'*.txt $out/test-results/ || true
done
mkdir -p $out/nix-support
- grep '\<failed\>' $out/test-results/list && touch $out/nix-support/failed
+ grep '\<failed\>' $out/test-results/list && touch $out/nix-support/failed || true
'';
buildInputs = map (x: runTest (args // { flavour = x; }))
9 years, 3 months
master - test: Fix failures due to undefined abs_top_builddir.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bd0806e1f53f4b...
Commit: bd0806e1f53f4b978cf298885e1d98365011ec3e
Parent: c6f9c4622378a312f0195ab968f8744b881d10b5
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Mon Sep 15 00:19:53 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:47:21 2015 +0100
test: Fix failures due to undefined abs_top_builddir.
---
test/shell/000-basic.sh | 2 ++
test/shell/dmeventd-restart.sh | 5 ++++-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/test/shell/000-basic.sh b/test/shell/000-basic.sh
index 7ad4d9f..027969e 100644
--- a/test/shell/000-basic.sh
+++ b/test/shell/000-basic.sh
@@ -13,6 +13,8 @@
lvm version
+test -n "$abs_top_builddir" || skip
+
v=$abs_top_builddir/lib/misc/lvm-version.h
sed -n "/#define LVM_VERSION ./s///p" "$v" | sed "s/ .*//" > expected
diff --git a/test/shell/dmeventd-restart.sh b/test/shell/dmeventd-restart.sh
index a94ede1..4344e82 100644
--- a/test/shell/dmeventd-restart.sh
+++ b/test/shell/dmeventd-restart.sh
@@ -43,7 +43,10 @@ not pgrep dmeventd
rm LOCAL_DMEVENTD
# set dmeventd path
-aux lvmconf "dmeventd/executable=\"$abs_top_builddir/test/lib/dmeventd\""
+if test -n "$abs_top_builddir"; then
+ aux lvmconf "dmeventd/executable=\"$abs_top_builddir/test/lib/dmeventd\""
+fi
+
lvchange --monitor y --verbose $vg/3way 2>&1 | tee lvchange.out
pgrep dmeventd >LOCAL_DMEVENTD
not grep 'already monitored' lvchange.out
9 years, 3 months
master - test: Avoid running 'dmsetup remove' with no devices.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c6f9c4622378a3...
Commit: c6f9c4622378a312f0195ab968f8744b881d10b5
Parent: ad0267b2ad70258fe79c90ed7cdd31fa19c8bec1
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Sun Sep 14 23:01:31 2014 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Thu Feb 5 13:47:21 2015 +0100
test: Avoid running 'dmsetup remove' with no devices.
---
test/shell/pvmove-restart.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/shell/pvmove-restart.sh b/test/shell/pvmove-restart.sh
index da6f3e5..86e2efa 100644
--- a/test/shell/pvmove-restart.sh
+++ b/test/shell/pvmove-restart.sh
@@ -41,7 +41,7 @@ wait
# Simulate reboot - forcibly remove related devices
dmsetup table
dmsetup remove $vg-$lv1
-dmsetup ls --exec echo | grep $vg-pvmove0 | xargs dmsetup remove
+dmsetup ls --exec echo | grep $vg-pvmove0 | xargs -r dmsetup remove
# Check we really have pvmove volume
check lv_attr_bit type $vg/pvmove0 "p"
9 years, 3 months