master - configure: Use pkg-config to look for valgrind/memcheck.h.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d760669e80f029...
Commit: d760669e80f029a4d507e91ad431431b627f5555
Parent: 19971492632fb2273bb2a991858e5cd5b48e2c5d
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Oct 9 20:54:41 2012 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Tue Oct 9 20:54:41 2012 +0200
configure: Use pkg-config to look for valgrind/memcheck.h.
---
configure.in | 4 +++-
libdm/Makefile.in | 3 +++
libdm/mm/dbg_malloc.c | 2 +-
libdm/mm/pool-fast.c | 2 +-
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/configure.in b/configure.in
index 2bdffca..16f91fb 100644
--- a/configure.in
+++ b/configure.in
@@ -871,8 +871,10 @@ AC_ARG_ENABLE(valgrind_pool,
AC_MSG_RESULT($VALGRIND_POOL)
if test "$VALGRIND_POOL" = yes; then
- AC_CHECK_HEADERS([valgrind/memcheck.h], , [AC_MSG_ERROR(bailing out)])
+ PKG_CHECK_MODULES(VALGRIND, valgrind, [], [AC_MSG_ERROR(bailing out)])
AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool])
+ AC_SUBST(VALGRIND_POOL)
+ AC_SUBST(VALGRIND_CFLAGS)
fi
################################################################################
diff --git a/libdm/Makefile.in b/libdm/Makefile.in
index b4f137a..bddb0a0 100644
--- a/libdm/Makefile.in
+++ b/libdm/Makefile.in
@@ -34,6 +34,9 @@ SOURCES =\
$(interface)/libdm-iface.c
INCLUDES = -I$(srcdir)/$(interface) -I$(srcdir)
+ifeq ("@VALGRIND_POOL@", "yes")
+INCLUDES += @VALGRIND_CFLAGS@
+endif
ifeq ("@STATIC_LINK@", "yes")
LIB_STATIC = $(interface)/libdevmapper.a
diff --git a/libdm/mm/dbg_malloc.c b/libdm/mm/dbg_malloc.c
index fe8f5a9..d37083f 100644
--- a/libdm/mm/dbg_malloc.c
+++ b/libdm/mm/dbg_malloc.c
@@ -16,7 +16,7 @@
#include "dmlib.h"
#ifdef VALGRIND_POOL
-#include "valgrind/memcheck.h"
+#include "memcheck.h"
#endif
#include <assert.h>
diff --git a/libdm/mm/pool-fast.c b/libdm/mm/pool-fast.c
index d54527a..61e076a 100644
--- a/libdm/mm/pool-fast.c
+++ b/libdm/mm/pool-fast.c
@@ -14,7 +14,7 @@
*/
#ifdef VALGRIND_POOL
-#include "valgrind/memcheck.h"
+#include "memcheck.h"
#endif
#include "dmlib.h"
11 years, 7 months
master - lvmetad: Only create pidfile when running as a daemon (no -f).
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=19971492632fb2...
Commit: 19971492632fb2273bb2a991858e5cd5b48e2c5d
Parent: 329d10268cf64f6d2ddb801f0191f3112c76ef66
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Oct 9 20:25:17 2012 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Tue Oct 9 20:37:34 2012 +0200
lvmetad: Only create pidfile when running as a daemon (no -f).
Additionally, -f now makes -s mandatory, so the foreground (debugging) lvmetad
does not steal the system-wide socket accidentally.
---
daemons/lvmetad/lvmetad-core.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 4741649..ff861a2 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -1060,6 +1060,7 @@ int main(int argc, char *argv[])
daemon_state s = { .private = NULL };
lvmetad_state ls;
int _restart = 0;
+ int _socket_override = 1;
s.name = "lvmetad";
s.private = &ls;
@@ -1067,8 +1068,10 @@ int main(int argc, char *argv[])
s.daemon_fini = fini;
s.handler = handler;
s.socket_path = getenv("LVM_LVMETAD_SOCKET");
- if (!s.socket_path)
+ if (!s.socket_path) {
+ _socket_override = 0;
s.socket_path = DEFAULT_RUN_DIR "/lvmetad.socket";
+ }
s.pidfile = LVMETAD_PIDFILE;
s.protocol = "lvmetad";
s.protocol_version = 1;
@@ -1094,6 +1097,7 @@ int main(int argc, char *argv[])
break;
case 's': // --socket
s.socket_path = optarg;
+ _socket_override = 1;
break;
case 'V':
printf("lvmetad version 0\n");
@@ -1101,6 +1105,13 @@ int main(int argc, char *argv[])
}
}
+ if (s.foreground && !_socket_override) {
+ fprintf(stderr, "A socket path (-s) is required in foreground mode.");
+ exit(2);
+ } else {
+ s.pidfile = NULL;
+ }
+
daemon_start(s);
return 0;
}
11 years, 7 months
master - libdaemon-server: Do not create pidfile if NULL.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=329d10268cf64f...
Commit: 329d10268cf64f6d2ddb801f0191f3112c76ef66
Parent: ff752c60dfde5f40e400746b98b17e511c9f1e34
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Oct 9 20:22:30 2012 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Tue Oct 9 20:37:34 2012 +0200
libdaemon-server: Do not create pidfile if NULL.
---
libdaemon/server/daemon-server.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index b15a7cc..9dd911f 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -466,16 +466,18 @@ void daemon_start(daemon_state s)
daemon_log_enable(s.log, DAEMON_LOG_OUTLET_SYSLOG, DAEMON_LOG_FATAL, 1);
daemon_log_enable(s.log, DAEMON_LOG_OUTLET_SYSLOG, DAEMON_LOG_ERROR, 1);
- (void) dm_prepare_selinux_context(s.pidfile, S_IFREG);
+ if (s.pidfile) {
+ (void) dm_prepare_selinux_context(s.pidfile, S_IFREG);
- /*
- * NB. Take care to not keep stale locks around. Best not exit(...)
- * after this point.
- */
- if (dm_create_lockfile(s.pidfile) == 0)
- exit(1);
+ /*
+ * NB. Take care to not keep stale locks around. Best not exit(...)
+ * after this point.
+ */
+ if (dm_create_lockfile(s.pidfile) == 0)
+ exit(1);
- (void) dm_prepare_selinux_context(NULL, 0);
+ (void) dm_prepare_selinux_context(NULL, 0);
+ }
/* Set normal exit signals to request shutdown instead of dying. */
signal(SIGINT, &_exit_handler);
@@ -526,7 +528,8 @@ void daemon_start(daemon_state s)
INFO(&s, "%s shutting down", s.name);
closelog(); /* FIXME */
- remove_lockfile(s.pidfile);
+ if (s.pidfile)
+ remove_lockfile(s.pidfile);
if (failed)
exit(1);
}
11 years, 7 months
master - TEST: Avoid building unit tests with --disable-testing.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ff752c60dfde5f...
Commit: ff752c60dfde5f40e400746b98b17e511c9f1e34
Parent: 439989adab473b2fa867b1e492b205084471051a
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Oct 9 11:20:28 2012 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Tue Oct 9 20:37:34 2012 +0200
TEST: Avoid building unit tests with --disable-testing.
---
test/unit/Makefile.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/unit/Makefile.in b/test/unit/Makefile.in
index 65e8bec..740eb14 100644
--- a/test/unit/Makefile.in
+++ b/test/unit/Makefile.in
@@ -15,8 +15,8 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
VPATH = $(srcdir)
-SOURCES = bitset_t.c matcher_t.c config_t.c string_t.c run.c
ifeq ("@TESTING@", "yes")
+SOURCES = bitset_t.c matcher_t.c config_t.c string_t.c run.c
TARGETS = run
endif
11 years, 7 months
master - test: more thin tests
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=439989adab473b...
Commit: 439989adab473b2fa867b1e492b205084471051a
Parent: d7b3179669dd82de7dab88309a9234d4cdbc6554
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 9 16:32:11 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 9 16:38:42 2012 +0200
test: more thin tests
---
test/shell/discards-thin.sh | 56 +++++++++++++++++++++++++++++++++
test/shell/lvconvert-thin.sh | 49 +++++++++++++++++++++++++++++
test/shell/lvcreate-thin-snap.sh | 63 ++++++++++++++++++++++++++++++++++++++
3 files changed, 168 insertions(+), 0 deletions(-)
diff --git a/test/shell/discards-thin.sh b/test/shell/discards-thin.sh
new file mode 100644
index 0000000..28300d9
--- /dev/null
+++ b/test/shell/discards-thin.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# Copyright (C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# test support of thin discards
+#
+
+. lib/test
+
+#
+# Main
+#
+aux target_at_least dm-thin-pool 1 1 0 || skip
+
+aux prepare_pvs 2 64
+
+# disable thin_check if not present in system
+which thin_check || aux lvmconf 'global/thin_check_executable = ""'
+
+clustered=
+test -e LOCAL_CLVMD && clustered="--clustered y"
+
+vgcreate $clustered $vg -s 64K $(cat DEVICES)
+
+# Create named pool only
+lvcreate -l1 --discards ignore -T $vg/pool
+check lv_field $vg/pool discards "ignore"
+lvcreate -l1 --discards nopassdown -T $vg/pool1
+check lv_field $vg/pool1 discards "nopassdown"
+lvcreate -l1 --discards passdown -T $vg/pool2
+check lv_field $vg/pool2 discards "passdown"
+
+lvchange --discards nopassdown $vg/pool2
+
+# cannot convert active ignore -> passdown
+not lvchange --discards passdown $vg/pool
+
+# cannot convert active nopassdown -> ignore
+not lvchange --discards ignore $vg/pool1
+
+# deactivate
+lvchange -an $vg/pool $vg/pool1
+lvchange --discards passdown $vg/pool
+check lv_field $vg/pool discards "passdown"
+lvchange --discards ignore $vg/pool1
+check lv_field $vg/pool1 discards "ignore"
+
+vgremove -ff $vg
diff --git a/test/shell/lvconvert-thin.sh b/test/shell/lvconvert-thin.sh
new file mode 100644
index 0000000..3ad3248
--- /dev/null
+++ b/test/shell/lvconvert-thin.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# Copyright (C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/test
+
+#
+# Main
+#
+aux target_at_least dm-thin-pool 1 0 0 || skip
+
+aux prepare_pvs 4 64
+
+# disable thin_check if not present in system
+which thin_check || aux lvmconf 'global/thin_check_executable = ""'
+
+clustered=
+test -e LOCAL_CLVMD && clustered="--clustered y"
+
+vgcreate $clustered $vg -s 64K $(cat DEVICES)
+
+# create mirrored LVs for data and metadata volumes
+lvcreate -l8 -m1 --mirrorlog core -n $lv1 $vg
+lvcreate -l4 -m1 --mirrorlog core -n $lv2 $vg
+
+lvconvert -c 64K --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
+
+lvcreate -V10M -T $vg/$lv1 --name $lv3
+
+# check lvrename work properly
+lvrename $vg/$lv1 $vg/pool
+check lv_field $vg/pool name "pool"
+
+lvrename $vg/$lv3 $vg/$lv4
+check lv_field $vg/$lv4 name "$lv4"
+
+# not yet supported conversions
+not lvconvert -m 1 $vg/pool
+not lvconvert -m 1 $vg/$lv3
+
+vgremove -ff $vg
diff --git a/test/shell/lvcreate-thin-snap.sh b/test/shell/lvcreate-thin-snap.sh
new file mode 100644
index 0000000..0e91222
--- /dev/null
+++ b/test/shell/lvcreate-thin-snap.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+# Copyright (C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/test
+
+check_lv_field_modules_()
+{
+ mod=$1
+ shift
+
+ for d in $*; do
+ check lv_field $vg/$d modules $mod
+ done
+}
+
+
+#
+# Main
+#
+aux target_at_least dm-thin-pool 1 0 0 || skip
+
+aux prepare_pvs 2 64
+
+# disable thin_check if not present in system
+which thin_check || aux lvmconf 'global/thin_check_executable = ""'
+
+clustered=
+test -e LOCAL_CLVMD && clustered="--clustered y"
+
+vgcreate $clustered $vg -s 64K $(cat DEVICES)
+
+lvcreate -L10M -V10M -T $vg/pool --name $lv1
+mkfs.ext4 $DM_DEV_DIR/$vg/$lv1
+# create thin snapshot of thin LV
+lvcreate -s $vg/$lv1
+# check snapshot filesystem was properly frozen before snapping
+fsck -p $DM_DEV_DIR/$vg/lvol0
+lvcreate -s $vg/$lv1 --name $lv2
+lvcreate -s $vg/$lv1 --name $vg/$lv3
+lvcreate --type snapshot $vg/$lv1
+lvcreate --type snapshot $vg/$lv1 --name $lv4
+lvcreate --type snapshot $vg/$lv1 --name $vg/$lv5
+
+# create old-style snapshot
+lvcreate -s -L10M --name oldsnap1 $vg/$lv2
+lvcreate -s -L10M --name oldsnap2 $vg/$lv2
+
+# thin snap of snap of snap...
+lvcreate -s --name sn1 $vg/$lv2
+lvcreate -s --name sn2 $vg/sn1
+lvcreate -s --name sn3 $vg/sn2
+lvcreate -s --name sn4 $vg/sn3
+
+vgremove -ff $vg
11 years, 7 months
master - test: move raid10 test into separate test files
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d7b3179669dd82...
Commit: d7b3179669dd82de7dab88309a9234d4cdbc6554
Parent: 93d7d3ed2c16317812e553a25babf5225471e8d4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 9 13:51:30 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 9 16:38:12 2012 +0200
test: move raid10 test into separate test files
New features tested in new files.
---
test/shell/lvcreate-raid.sh | 25 +---------------------
test/shell/lvcreate-raid10.sh | 42 +++++++++++++++++++++++++++++++++++++
test/shell/lvresize-raid.sh | 33 -----------------------------
test/shell/lvresize-raid10.sh | 46 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 89 insertions(+), 57 deletions(-)
diff --git a/test/shell/lvcreate-raid.sh b/test/shell/lvcreate-raid.sh
index 81e5a5d..05c7428 100644
--- a/test/shell/lvcreate-raid.sh
+++ b/test/shell/lvcreate-raid.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2011 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2011-2012 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
@@ -47,26 +47,3 @@ for i in raid4 \
aux wait_for_sync $vg $lv1
lvremove -ff $vg
done
-
-#
-# Create RAID10:
-#
-
-aux target_at_least dm-raid 1 3 0 || skip
-
-# Should not allow more than 2-way mirror
-not lvcreate --type raid10 -m 2 -i 2 -l 2 -n $lv1 $vg
-
-# 2-way mirror, 2-stripes
-lvcreate --type raid10 -m 1 -i 2 -l 2 -n $lv1 $vg
-aux wait_for_sync $vg $lv1
-lvremove -ff $vg
-
-# 2-way mirror, 3-stripes
-lvcreate --type raid10 -m 1 -i 3 -l 3 -n $lv1 $vg
-aux wait_for_sync $vg $lv1
-lvremove -ff $vg
-
-#
-# FIXME: Add tests that specify particular PVs to use for creation
-#
diff --git a/test/shell/lvcreate-raid10.sh b/test/shell/lvcreate-raid10.sh
new file mode 100644
index 0000000..63d086f
--- /dev/null
+++ b/test/shell/lvcreate-raid10.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+# Copyright (C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/test
+
+########################################################
+# MAIN
+########################################################
+aux target_at_least dm-raid 1 3 0 || skip
+
+aux prepare_pvs 6 20 # 6 devices for RAID10 (2-mirror,3-stripe) test
+vgcreate -c n -s 512k $vg $(cat DEVICES)
+
+#
+# Create RAID10:
+#
+
+
+# Should not allow more than 2-way mirror
+not lvcreate --type raid10 -m 2 -i 2 -l 2 -n $lv1 $vg
+
+# 2-way mirror, 2-stripes
+lvcreate --type raid10 -m 1 -i 2 -l 2 -n $lv1 $vg
+aux wait_for_sync $vg $lv1
+lvremove -ff $vg
+
+# 2-way mirror, 3-stripes
+lvcreate --type raid10 -m 1 -i 3 -l 3 -n $lv1 $vg
+aux wait_for_sync $vg $lv1
+lvremove -ff $vg
+
+#
+# FIXME: Add tests that specify particular PVs to use for creation
+#
diff --git a/test/shell/lvresize-raid.sh b/test/shell/lvresize-raid.sh
index 08382a5..f999a31 100644
--- a/test/shell/lvresize-raid.sh
+++ b/test/shell/lvresize-raid.sh
@@ -78,36 +78,3 @@ for i in 4 5 6 ; do
lvremove -ff $vg
done
done
-
-aux target_at_least dm-raid 1 3 0 || skip
-
-# Extend RAID10 (2-stripes, 2-mirror)
-for deactivate in true false; do
- lvcreate --type raid10 -m 1 -i 2 -l 2 -n $lv1 $vg
-
- if $deactivate; then
- lvchange -an $vg/$lv1
- fi
-
- lvresize -l +2 $vg/$lv1
-
- #check raid_images_contiguous $vg $lv1
-
- lvremove -ff $vg
-done
-
-# Reduce RAID10 (2-stripes, 2-mirror)
-for deactivate in true false; do
- lvcreate --type raid10 -m 1 -i 2 -l 4 -n $lv1 $vg
-
- if $deactivate; then
- lvchange -an $vg/$lv1
- fi
-
- should lvresize -y -l -2 $vg/$lv1
-
- #check raid_images_contiguous $vg $lv1
-
- lvremove -ff $vg
-done
-
diff --git a/test/shell/lvresize-raid10.sh b/test/shell/lvresize-raid10.sh
new file mode 100644
index 0000000..9b71708
--- /dev/null
+++ b/test/shell/lvresize-raid10.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+# Copyright (C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/test
+
+aux target_at_least dm-raid 1 3 0 || skip
+
+aux prepare_vg 5 80
+
+# Extend RAID10 (2-stripes, 2-mirror)
+for deactivate in true false; do
+ lvcreate --type raid10 -m 1 -i 2 -l 2 -n $lv1 $vg
+
+ if $deactivate; then
+ lvchange -an $vg/$lv1
+ fi
+
+ lvresize -l +2 $vg/$lv1
+
+ #check raid_images_contiguous $vg $lv1
+
+ lvremove -ff $vg
+done
+
+# Reduce RAID10 (2-stripes, 2-mirror)
+for deactivate in true false; do
+ lvcreate --type raid10 -m 1 -i 2 -l 4 -n $lv1 $vg
+
+ if $deactivate; then
+ lvchange -an $vg/$lv1
+ fi
+
+ should lvresize -y -l -2 $vg/$lv1
+
+ #check raid_images_contiguous $vg $lv1
+
+ lvremove -ff $vg
+done
11 years, 7 months
master - test: split raid tests
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=93d7d3ed2c1631...
Commit: 93d7d3ed2c16317812e553a25babf5225471e8d4
Parent: cdb7502e54aeb464216af271289deec12f15442e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 9 12:17:33 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 9 12:22:26 2012 +0200
test: split raid tests
Separate original raid test and new raid10 test,
so the old could be tested on platforms without raid10 support.
Replace test-unfriendly `ls /dev/mapper` with dmsetup ls
---
test/shell/lvconvert-raid.sh | 35 +-----------------------
test/shell/lvconvert-raid10.sh | 56 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+), 33 deletions(-)
diff --git a/test/shell/lvconvert-raid.sh b/test/shell/lvconvert-raid.sh
index 9c3cff6..7f4dd4b 100644
--- a/test/shell/lvconvert-raid.sh
+++ b/test/shell/lvconvert-raid.sh
@@ -13,11 +13,9 @@
get_image_pvs() {
local d
- local images=""
+ local images
- for d in `ls /dev/mapper/${1}-${2}_?image_*`; do
- images="$images `basename $d | sed s:-:/:`"
- done
+ images=`dmsetup ls | grep ${1}-${2}_.image_.* | cut -f1 | sed -e s:-:/:`
lvs --noheadings -a -o devices $images | sed s/\(.\)//
}
@@ -222,32 +220,3 @@ for i in 4 5 6; do
lvremove -ff $vg
done
-
-# RAID10: Can replace 'copies - 1' devices from each stripe
-# Tests are run on 2-way mirror, 3-way stripe RAID10
-aux target_at_least dm-raid 1 3 1 || skip
-
-lvcreate --type raid10 -m 1 -i 3 -l 3 -n $lv1 $vg
-aux wait_for_sync $vg $lv1
-
-# Can replace any single device
-for i in $(get_image_pvs $vg $lv1); do
- lvconvert --replace $i $vg/$lv1
- aux wait_for_sync $vg $lv1
-done
-
-# Can't replace adjacent devices
-devices=( $(get_image_pvs $vg $lv1) )
-not lvconvert --replace ${devices[0]} --replace ${devices[1]} $vg/$lv1
-not lvconvert --replace ${devices[2]} --replace ${devices[3]} $vg/$lv1
-not lvconvert --replace ${devices[4]} --replace ${devices[5]} $vg/$lv1
-
-# Can replace non-adjacent devices
-for i in 0 1; do
- lvconvert \
- --replace ${devices[$i]} \
- --replace ${devices[$(($i + 2))]} \
- --replace ${devices[$(($i + 4))]} \
- $vg/$lv1
- aux wait_for_sync $vg $lv1
-done
diff --git a/test/shell/lvconvert-raid10.sh b/test/shell/lvconvert-raid10.sh
new file mode 100644
index 0000000..2e4381d
--- /dev/null
+++ b/test/shell/lvconvert-raid10.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+# Copyright (C) 2012 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+. lib/test
+
+get_image_pvs() {
+ local d
+ local images
+
+ images=`dmsetup ls | grep ${1}-${2}_.image_.* | cut -f1 | sed -e s:-:/:`
+ lvs --noheadings -a -o devices $images | sed s/\(.\)//
+}
+
+########################################################
+# MAIN
+########################################################
+# RAID10: Can replace 'copies - 1' devices from each stripe
+# Tests are run on 2-way mirror, 3-way stripe RAID10
+aux target_at_least dm-raid 1 3 1 || skip
+
+# 9 PVs needed for RAID10 testing (3-stripes/2-mirror - replacing 3 devs)
+aux prepare_pvs 9 80
+vgcreate -c n -s 256k $vg $(cat DEVICES)
+
+lvcreate --type raid10 -m 1 -i 3 -l 3 -n $lv1 $vg
+aux wait_for_sync $vg $lv1
+
+# Can replace any single device
+for i in $(get_image_pvs $vg $lv1); do
+ lvconvert --replace $i $vg/$lv1
+ aux wait_for_sync $vg $lv1
+done
+
+# Can't replace adjacent devices
+devices=( $(get_image_pvs $vg $lv1) )
+not lvconvert --replace ${devices[0]} --replace ${devices[1]} $vg/$lv1
+not lvconvert --replace ${devices[2]} --replace ${devices[3]} $vg/$lv1
+not lvconvert --replace ${devices[4]} --replace ${devices[5]} $vg/$lv1
+
+# Can replace non-adjacent devices
+for i in 0 1; do
+ lvconvert \
+ --replace ${devices[$i]} \
+ --replace ${devices[$(($i + 2))]} \
+ --replace ${devices[$(($i + 4))]} \
+ $vg/$lv1
+ aux wait_for_sync $vg $lv1
+done
11 years, 7 months
master - lvchange: do not start dmevent for resyn
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cdb7502e54aeb4...
Commit: cdb7502e54aeb464216af271289deec12f15442e
Parent: d414fe28fa1754690e8c72a16df5c2cdc1cc87e1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 9 12:20:47 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 9 12:22:26 2012 +0200
lvchange: do not start dmevent for resyn
If monitoring is disabled in lvm.conf, avoid its starting and preserve
DMEVENTD_MONITOR_IGNORE settings internally.
---
WHATS_NEW | 1 +
tools/lvchange.c | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index cf1b563..b1ed58c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.98 -
=================================
+ Do not start dmeventd for lvchange --resync when monitoring is off.
Remove ExecStartPost with pvscan --cache from lvm2-lvmetad.service.
Report invalid percentage for property snap_percent of non-snaphot LVs.
Disallow convertion of thins to mirrors.
diff --git a/tools/lvchange.c b/tools/lvchange.c
index b2c1fe4..3525617 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -370,7 +370,8 @@ static int lvchange_resync(struct cmd_context *cmd,
/* Activate exclusively to ensure no nodes still have LV active */
monitored = dmeventd_monitor_mode();
- init_dmeventd_monitor(0);
+ if (monitored != DMEVENTD_MONITOR_IGNORE)
+ init_dmeventd_monitor(0);
if (!deactivate_lv(cmd, lv)) {
log_error("Unable to deactivate %s for resync", lv->name);
@@ -383,7 +384,8 @@ static int lvchange_resync(struct cmd_context *cmd,
return 0;
}
- init_dmeventd_monitor(monitored);
+ if (monitored != DMEVENTD_MONITOR_IGNORE)
+ init_dmeventd_monitor(monitored);
init_mirror_in_sync(0);
log_very_verbose("Starting resync of %s%s%s%s \"%s\"",
11 years, 7 months
master - example.conf: Warn about running lvmetad with use_lvmetad = 0.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d414fe28fa1754...
Commit: d414fe28fa1754690e8c72a16df5c2cdc1cc87e1
Parent: f0d34f383df7a00902e8d0512a815fd764ee05a9
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Tue Oct 9 10:47:29 2012 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Tue Oct 9 10:49:26 2012 +0200
example.conf: Warn about running lvmetad with use_lvmetad = 0.
---
doc/example.conf.in | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/doc/example.conf.in b/doc/example.conf.in
index b4cda6f..f7344bb 100644
--- a/doc/example.conf.in
+++ b/doc/example.conf.in
@@ -488,6 +488,9 @@ global {
# lvmetad udev rules *must* be set up for LVM to work correctly. Without
# proper udev rules, all changes in block device configuration will be
# *ignored* until a manual 'pvscan --cache' is performed.
+ #
+ # If lvmetad has been running while use_lvmetad was 0, it MUST be stopped
+ # before changing use_lvmetad to 1 and started again afterwards.
use_lvmetad = 0
# Full path of the utility called to check that a thin metadata device
11 years, 7 months
master - test: ignore modprobe failure
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f0d34f383df7a0...
Commit: f0d34f383df7a00902e8d0512a815fd764ee05a9
Parent: 9ff2f1a3dbaa6f77b1693b7a9cf540a902cf618d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 9 10:37:37 2012 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 9 10:37:37 2012 +0200
test: ignore modprobe failure
If the system doesn't have modprobe but happens to have modules
loaded, allow version testing.
---
test/lib/aux.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 107afc1..6cfd6db 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -506,7 +506,7 @@ wait_for_sync() {
target_at_least()
{
case "$1" in
- dm-*) modprobe "$1" ;;
+ dm-*) modprobe "$1" || true ;;
esac
local version=$(dmsetup targets 2>/dev/null | grep "${1##dm-} " 2>/dev/null)
11 years, 7 months