Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c66e01569862a421d137e…
Commit: c66e01569862a421d137eedbf9e6abe4e1152853
Parent: 9b41118b9c8fed755eaabb1b0833f2518ddf1c36
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 20 14:16:13 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 20 15:21:38 2020 +0100
tests: add corruption write on PV test
Test a case where PV is readable, but fails on write updating.
Check the failure is reported only for a single PV.
---
test/shell/pv-corruption.sh | 52 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/test/shell/pv-corruption.sh b/test/shell/pv-corruption.sh
new file mode 100644
index 0000000..3958ee1
--- /dev/null
+++ b/test/shell/pv-corruption.sh
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2020 Red Hat, Inc. All rights reserved.
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# tests, write failer on PV1 is not reporting errors on PV2 or PV3...
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+#
+# Main
+#
+aux prepare_devs 3 20
+
+pvcreate -y --setphysicalvolumesize 10m "$dev1"
+pvcreate "$dev2"
+pvcreate "$dev3"
+
+vgcreate $vg "$dev1" "$dev2" "$dev3"
+
+pvs -o +uuid
+
+# Keep device readable, but any write fails
+aux writeerror_dev "$dev1" 0:100
+
+# Suppose to fail, size PV1 is not writable
+not pvresize "$dev1" 2>&1 | tee out
+
+# Output should not complain about any error on pv2 nor pv3
+not grep pv2 out
+not grep pv3 out
+
+# Restore working PV1 back
+aux enable_dev "$dev1"
+
+# FIXME: Takes a lot of time ATM....
+pvck "$dev2"
+
+pvs -o +uuid
+vgdisplay
+
+vgremove $vg
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9b41118b9c8fed755eaab…
Commit: 9b41118b9c8fed755eaabb1b0833f2518ddf1c36
Parent: 440ced192a5ae6d5fa7c191981abcdf59926e90b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 20 13:15:46 2020 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jan 20 15:21:38 2020 +0100
tests: writeerror_dev
Intruduce aux function for easy simulation of disk areas,
that are 'normally' readable, but will fail on write.
---
test/lib/aux.sh | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index ec0699f..b90063d 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -564,6 +564,8 @@ teardown() {
echo -n "## teardown..."
unset LVM_LOG_FILE_EPOCH
+ test ! -f ERR_DEV || should dmsetup remove $(cat ERR_DEV_NAME)
+
if test -f TESTNAME ; then
if test ! -f SKIP_THIS_TEST ; then
@@ -985,6 +987,8 @@ common_dev_() {
case "$tgtype" in
delay)
echo "$from $len delay $pvdev $(( pos + offset )) $read_ms $pvdev $(( pos + offset )) $write_ms" ;;
+ writeerror)
+ echo "$from $len delay $pvdev $(( pos + offset )) 0 $(cat ERR_DEV) 0 0" ;;
error|zero)
echo "$from $len $tgtype" ;;
esac
@@ -1125,6 +1129,24 @@ error_dev() {
}
#
+# Convert device to device with write errors but normal reads.
+# For this 'delay' dev is used and reroutes 'reads' back to original device
+# and for writes it will use extra new TEST-errordev (huge error target)
+# i.e. writeerror_dev "$dev1" 8:32
+writeerror_dev() {
+ local name=${PREFIX}-errordev
+
+ if test ! -e ERR_DEV; then
+ dmsetup create -u "TEST-$name" "$name" --table "0 4611686018427387904 error"
+ # Take major:minor of our error device
+ echo "$name" > ERR_DEV_NAME
+ dmsetup info -c --noheadings -o major,minor "$name" > ERR_DEV
+ fi
+
+ common_dev_ writeerror "$@"
+}
+
+#
# Convert existing device to a device with zero segments
# Takes the list of pairs of zero segment from:len
# Combination with error or delay is unsupported
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=440ced192a5ae6d5fa7c1…
Commit: 440ced192a5ae6d5fa7c191981abcdf59926e90b
Parent: d20490f76dd5a82b5fe61adc1c4e8044593e1c98
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Mon Jan 20 14:36:16 2020 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Mon Jan 20 14:48:58 2020 +0100
base: Get Makefile from master
---
base/Makefile | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/base/Makefile b/base/Makefile
new file mode 100644
index 000000000..056ea5910
--- /dev/null
+++ b/base/Makefile
@@ -0,0 +1,38 @@
+# Copyright (C) 2018 Red Hat, Inc. All rights reserved.
+#
+# This file is part of the device-mapper userspace tools.
+#
+# 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 Lesser General Public License v.2.1.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Uncomment this to build the simple radix tree. You'll need to make clean too.
+# Comment to build the advanced radix tree.
+#base/data-struct/radix-tree.o: CFLAGS += -DSIMPLE_RADIX_TREE
+
+# NOTE: this Makefile only works as 'include' for toplevel Makefile
+# which defined all top_* variables
+
+BASE_SOURCE=\
+ base/data-struct/radix-tree.c
+
+BASE_TARGET = base/libbase.a
+BASE_DEPENDS = $(BASE_SOURCE:%.c=%.d)
+BASE_OBJECTS = $(BASE_SOURCE:%.c=%.o)
+CLEAN_TARGETS += $(BASE_DEPENDS) $(BASE_OBJECTS) \
+ $(BASE_SOURCE:%.c=%.gcda) \
+ $(BASE_SOURCE:%.c=%.gcno) \
+ $(BASE_TARGET)
+
+$(BASE_TARGET): $(BASE_OBJECTS)
+ @echo " [AR] $@"
+ $(Q) $(RM) $@
+ $(Q) $(AR) rsv $@ $(BASE_OBJECTS) > /dev/null
+
+ifeq ("$(DEPENDS)","yes")
+-include $(BASE_DEPENDS)
+endif