master - man: expanded explanation of lvmetad
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6a171bbdf5bc57...
Commit: 6a171bbdf5bc579670b225c291421eb8ee14d2c3
Parent: 9273b1a964c4edafbc59598f7a800f5cd524a8f3
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri May 1 14:45:50 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 1 15:23:43 2015 -0500
man: expanded explanation of lvmetad
---
man/lvmetad.8.in | 63 +++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 53 insertions(+), 10 deletions(-)
diff --git a/man/lvmetad.8.in b/man/lvmetad.8.in
index 3ea80c9..cdaf198 100644
--- a/man/lvmetad.8.in
+++ b/man/lvmetad.8.in
@@ -1,6 +1,7 @@
.TH LVMETAD 8 "LVM TOOLS #VERSION#" "Red Hat Inc" \" -*- nroff -*-
.SH NAME
lvmetad \(em LVM metadata cache daemon
+
.SH SYNOPSIS
.B lvmetad
.RB [ \-l
@@ -13,16 +14,56 @@ lvmetad \(em LVM metadata cache daemon
.RB [ \-h ]
.RB [ \-V ]
.RB [ \-? ]
+
.SH DESCRIPTION
-lvmetad is a metadata caching daemon for LVM. The daemon receives notifications
-from udev rules (which must be installed for LVM to work correctly when lvmetad
-is in use). Through these notifications, lvmetad has an up-to-date and
-consistent image of the volume groups available in the system.
-
-lvmetad is used by LVM only if it is enabled in \fBlvm.conf\fP(5) by specifying the
-\fBglobal/use_lvmetad\fP setting. If this is not defined in the LVM configuration
-explicitly then default setting is used instead (see the output of
-\fBlvmconfig \-\-type default global/use_lvmetad\fP command).
+
+The lvmetad daemon caches LVM metadata, so that LVM commands can read
+metadata without scanning disks.
+
+Metadata caching can be an advantage because scanning disks is time
+consuming and may interfere with the normal work of the system and disks.
+
+lvmetad does not read metadata from disks itself. The 'pvscan \-\-cache'
+command scans disks, reads the LVM metadata and sends it to lvmetad.
+
+New LVM disks that appear on the system must be scanned by pvscan before
+lvmetad knows about them. If lvmetad does not know about a disk, then LVM
+commands using lvmetad will also not know about it. When disks are added
+or removed from the system, lvmetad must be updated.
+
+lvmetad is usually combined with event-based system services that
+automatically run pvscan \-\-cache on new disks. This way, the lvmetad
+cache is automatically updated with metadata from new disks when they
+appear. LVM udev rules and systemd services implement this automation.
+Automatic scanning is usually combined with automatic activation. For
+more information, see
+.BR pvscan (8).
+
+If lvmetad is started or restarted after disks have been added to the
+system, or if the global_filter has changed, the cache must be updated by
+running 'pvscan \-\-cache'.
+
+When lvmetad is not used, LVM commands revert to scanning disks for LVM
+metadata.
+
+Use of lvmetad is enabled/disabled by:
+.br
+.BR lvm.conf (5)
+.B global/use_lvmetad
+
+For more information on this setting, see:
+.br
+.B lvmconfig \-\-withcomments global/use_lvmetad
+
+To ignore disks from LVM at the system level, e.g. lvmetad, pvscan use:
+.br
+.BR lvm.conf (5)
+.B devices/global_filter
+
+For more information on this setting, see
+.br
+.B lvmconfig \-\-withcomments devices/global_filter
+
.SH OPTIONS
To run the daemon in a test environment both the pidfile_path and the
@@ -68,4 +109,6 @@ Path for the socket file.
.SH SEE ALSO
.BR lvm (8),
-.BR lvm.conf (5)
+.BR lvmconfig (8),
+.BR lvm.conf (5),
+.BR pvscan (8)
9 years
master - man: expanded explanation of pvscan
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9273b1a964c4ed...
Commit: 9273b1a964c4edafbc59598f7a800f5cd524a8f3
Parent: 9c7063ef893449742922a4bcbcbe6c38f191b8dc
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri May 1 13:44:31 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri May 1 15:23:32 2015 -0500
man: expanded explanation of pvscan
Related to it's role with lvmetad and auto-activation.
---
man/pvscan.8.in | 146 ++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 119 insertions(+), 27 deletions(-)
diff --git a/man/pvscan.8.in b/man/pvscan.8.in
index f976b40..010c091 100644
--- a/man/pvscan.8.in
+++ b/man/pvscan.8.in
@@ -1,6 +1,7 @@
.TH PVSCAN 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
.SH NAME
pvscan \(em scan all disks for physical volumes
+
.SH SYNOPSIS
.B pvscan
.RB [ \-\-commandprofile
@@ -30,9 +31,118 @@ pvscan \(em scan all disks for physical volumes
.IR DevicePath
|
.IR major:minor ]...
+
.SH DESCRIPTION
-pvscan scans all supported LVM block devices in the system for
-physical volumes.
+pvscan scans all supported LVM block devices in the system for physical
+volumes.
+
+.SS Scanning with lvmetad
+
+pvscan operates differently when used with the
+.BR lvmetad (8)
+daemon.
+
+Scanning disks is required to read LVM metadata and identify LVM PVs.
+Once read, lvmetad caches the metadata so that LVM commands can read it
+without repeatedly scanning disks. This is helpful because scanning disks
+is time consuming, and frequent scanning may interfere with the normal
+work of the system and disks.
+
+When lvmetad is not used, LVM commands revert to scanning disks to read
+metadata. Any LVM command that needs metadata will scan disks for it;
+running the pvscan command is not necessary for the sake of other LVM
+commands.
+
+When lvmetad is used, LVM commands avoid scanning disks by reading
+metadata from lvmetad. When new disks appear, they must be scanned so
+their metadata can be cached in lvmetad. This is done by the command
+pvscan \-\-cache, which scans disks and passes the metadata to lvmetad.
+
+The pvscan \-\-cache command is typically run automatically by system
+services when a new device appears. Users do not generally need to run
+this command if the system and lvmetad are running properly.
+
+Many scripts contain unnecessary pvscan (or vgscan) commands for
+historical reasons. To avoid disrupting the system with extraneous disk
+scanning, an ordinary pvscan (without \-\-cache) will simply read metadata
+from lvmetad like other LVM commands. It does not do anything beyond
+displaying the current state of the cache.
+
+.I Notes
+
+.IP \[bu] 2
+When given specific device name arguments, pvscan \-\-cache will only
+read the named devices.
+
+.IP \[bu] 2
+LVM udev rules and systemd services are used to intiate automatic device
+scanning.
+
+.IP \[bu] 2
+To prevent devices from being scanned by pvscan --cache, add them
+to
+.BR lvm.conf (5)
+.B devices/global_filter.
+The devices/filter setting does not
+apply to system level scanning.
+For more information, see:
+.br
+.B lvmconfig --withcomments devices/global_filter
+
+.IP \[bu] 2
+If lvmetad is started or restarted after devices are visible, or
+if the global_filter has changed, then all devices must be rescanned
+for metadata with the command pvscan \-\-cache.
+
+.IP \[bu] 2
+lvmetad ignores older metadata formats, e.g. lvm1, and should not be
+used if they exist.
+
+.IP \[bu] 2
+To notify lvmetad about a device that is no longer present, the major and
+minor numbers must be given, not the path.
+
+.SS Automatic activation
+
+When event-driven system services detect a new LVM device, the first step
+is to automatically scan and cache the metadata from the device. This is
+done by pvscan \-\-cache. A second step is to automatically activate LVs
+that are present on the new device. This auto-activation is done by the
+same pvscan \-\-cache command when the option '\-a|\-\-activate ay' is
+included.
+
+Auto-activation of VGs or LVs can be enabled/disabled using:
+.br
+.BR lvm.conf (5)
+.B activation/auto_activation_volume_list
+
+For more information, see:
+.br
+.B lvmconfig --withcomments activation/auto_activation_volume_list
+
+When this setting is undefined, all LVs are auto-activated (when lvm is
+fully integrated with the event-driven system services.)
+
+When a VG or LV is not auto-activated, traditional activation using
+vgchange or lvchange -a|--activate is needed.
+
+.I Notes
+
+.IP \[bu] 2
+pvscan auto-activation can be only done in combination with \-\-cache.
+
+.IP \[bu] 2
+Auto-activation is designated by the "a" argument in '-a|--activate ay'.
+This is meant to distinguish system generated commands from explicit user
+commands, although it can be used in any activation command. Whenever it
+is used, the auto_activation_volume_list is applied.
+
+.IP \[bu] 2
+Auto-activation is not yet supported for LVs that are part of partial or
+clustered volume groups.
+
+.P
+
.SH OPTIONS
See \fBlvm\fP(8) for common options.
.TP
@@ -46,37 +156,19 @@ Only show physical volumes not belonging to any volume group.
Short listing format.
.TP
.BR \-u ", " \-\-uuid
-Show UUIDs (Uniform Unique Identifiers) in addition to device special names.
+Show UUIDs in addition to device names.
.TP
.BR \-a ", " \-\-activate " " \fIay
-Together with the information already cached in lvmetad, automatically activate
-any logical volumes that become activatable after the scan done on one or more devices.
-The logical volume to autoactivate is matched against the
-activation/auto_activation_volume_list set in lvm.conf. If this list is not set, then
-all volumes are considered for autoactivation. The autoactivation is not yet
-supported for logical volumes that are part of partial or clustered volume groups.
+Automatically activate any logical volumes that are possible to activate
+with the addition of the new devices.
.TP
.BR \-b ", " \-\-background
Run the command in the background.
.TP
.BR \-\-cache " [" \-\-major " " \fImajor " " \-\-minor " " \fIminor " | " \fIDevicePath " | " \fImajor:minor " ]..."
-Scan one or more devices and instruct the lvmetad daemon to update its cached
-state accordingly. Called internally by udev rules.
-All devices listed explicitly are processed \fBregardless\fP of any device
-filters set using \fBdevices/filter\fP configuration setting. To filter
-devices even in this case, the \fBdevices/global_filter\fP must be used.
-If lvmetad has not yet cached any metadata or the filters have recently been
-changed, then all devices may be scanned, effectively ignoring the rest of
-the command line. Otherwise, if all the devices referenced on the command line
-contain metadata in the default lvm2 format, other devices are not accessed.
-If metadata written using the obsolete GFS pool or lvm1 format is encountered,
-this is ignored and so lvmetad should not be used.
-To notify lvmetad about a device that is not present in the system anymore,
-\fB\-\-major\fP and \fB\-\-minor\fP pair of that device must be always supplied,
-not \fBDevicePath\fP as pvscan is not able to translate the \fBDevicePath\fP
-into major and minor pair which lvmetad requires.
+Scan one or more devices and send the metadata to lvmetad.
+
.SH SEE ALSO
.BR lvm (8),
-.BR lvmetad (8),
-.BR pvcreate (8),
-.BR pvdisplay (8)
+.BR lvmconfig (8),
+.BR lvmetad (8)
9 years
master - tests: free -h is quite new option
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9c7063ef893449...
Commit: 9c7063ef893449742922a4bcbcbe6c38f191b8dc
Parent: 79844b9066e53d9618f6641d5cee9c7264fe01fd
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 1 15:37:50 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 1 15:40:04 2015 +0200
tests: free -h is quite new option
Stay with -g and and ignore failure.
---
test/lib/inittest.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index d5c80f4..98abae6 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -78,7 +78,7 @@ echo "$TESTNAME" >TESTNAME
echo "Kernel is $(uname -a)"
# Report SELinux mode
echo "Selinux mode is $(getenforce 2>/dev/null || echo not installed)."
-free -h
+free -m || true
# Set vars from utils now that we have TESTDIR/PREFIX/...
prepare_test_vars
9 years
master - tests: minor simplifications
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=79844b9066e53d...
Commit: 79844b9066e53d9618f6641d5cee9c7264fe01fd
Parent: fee09f0964bd64dee982eb615a6853e770ad0a4d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 30 21:51:43 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 1 15:07:59 2015 +0200
tests: minor simplifications
minor updates
---
test/lib/aux.sh | 9 ++++-----
test/shell/lvchange-raid.sh | 2 +-
test/shell/lvmetad-pvscan-nomda.sh | 6 ++----
test/shell/process-each-duplicate-vgnames.sh | 13 ++++---------
test/shell/process-each-pv-nomda-all.sh | 1 -
5 files changed, 11 insertions(+), 20 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index ae15235..c1889ac 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -34,8 +34,6 @@ prepare_clvmd() {
if test -z "${installed_testsuite+varset}"; then
(which clvmd 2>/dev/null | grep -q "$abs_builddir") || skip
fi
- # lvs is executed from clvmd - use our version
- export LVM_BINARY=$(which lvm)
test -e "$DM_DEV_DIR/control" || dmsetup table >/dev/null # create control node
# skip if singlenode is not compiled in
@@ -46,7 +44,8 @@ prepare_clvmd() {
test "${LVM_VALGRIND_CLVMD:-0}" -eq 0 || run_valgrind="run_valgrind"
rm -f "$CLVMD_PIDFILE"
echo "<======== Starting CLVMD ========>"
- LVM_LOG_FILE_EPOCH=CLVMD $run_valgrind clvmd -Isinglenode -d 1 -f &
+ # lvs is executed from clvmd - use our version
+ LVM_LOG_FILE_EPOCH=CLVMD LVM_BINARY=$(which lvm) $run_valgrind clvmd -Isinglenode -d 1 -f &
echo $! > LOCAL_CLVMD
for i in $(seq 1 100) ; do
@@ -422,7 +421,7 @@ prepare_md_dev() {
mddev=/dev/md_lvm_test0
mdadm --create --metadata=1.0 "$mddev" --auto=md --level $level --chunk $rchunk --raid-devices=$rdevs "${@:4}"
- test -b "$mddev" || skip "mdadm has not create device!"
+ test -b "$mddev" || skip "mdadm has not created device!"
# LVM/DM will see this device
case "$DM_DEV_DIR" in
@@ -467,7 +466,7 @@ prepare_backing_dev() {
if test -f BACKING_DEV; then
BACKING_DEV=$(< BACKING_DEV)
elif test -b "$LVM_TEST_BACKING_DEVICE"; then
- BACKING_DEV="$LVM_TEST_BACKING_DEVICE"
+ BACKING_DEV=$LVM_TEST_BACKING_DEVICE
echo "$BACKING_DEV" > BACKING_DEV
else
prepare_loop "$@"
diff --git a/test/shell/lvchange-raid.sh b/test/shell/lvchange-raid.sh
index 00b5265..4ce776f 100644
--- a/test/shell/lvchange-raid.sh
+++ b/test/shell/lvchange-raid.sh
@@ -209,7 +209,7 @@ run_refresh_check() {
# Disable dev2 and do some I/O to make the kernel notice
aux disable_dev "$dev2"
- dd if=/dev/urandom of=$DM_DEV_DIR/$sizelv bs=1k count=$size
+ dd if=/dev/urandom of="$DM_DEV_DIR/$sizelv" bs=1k count=$size
sync
# Check for 'p'artial flag
diff --git a/test/shell/lvmetad-pvscan-nomda.sh b/test/shell/lvmetad-pvscan-nomda.sh
index 39604d0..395e326 100644
--- a/test/shell/lvmetad-pvscan-nomda.sh
+++ b/test/shell/lvmetad-pvscan-nomda.sh
@@ -23,13 +23,11 @@ vgcreate $vg1 "$dev1" "$dev2"
lvcreate -n foo -l 1 -an --zero n $vg1
# start lvmetad but make sure it doesn't know about $dev1 or $dev2
-aux disable_dev "$dev1"
-aux disable_dev "$dev2"
+aux disable_dev "$dev1" "$dev2"
aux prepare_lvmetad
lvs
mv LOCAL_LVMETAD XXX
-aux enable_dev "$dev2"
-aux enable_dev "$dev1"
+aux enable_dev "$dev2" "$dev1"
mv XXX LOCAL_LVMETAD
aux lvmconf 'global/use_lvmetad = 0'
diff --git a/test/shell/process-each-duplicate-vgnames.sh b/test/shell/process-each-duplicate-vgnames.sh
index 5867fd1..9b1f807 100644
--- a/test/shell/process-each-duplicate-vgnames.sh
+++ b/test/shell/process-each-duplicate-vgnames.sh
@@ -14,8 +14,7 @@ aux prepare_devs 2
pvcreate "$dev1"
pvcreate "$dev2"
-aux disable_dev "$dev1"
-aux disable_dev "$dev2"
+aux disable_dev "$dev1" "$dev2"
aux enable_dev "$dev1"
vgscan
@@ -35,8 +34,7 @@ vgscan
pvs "$dev1"
pvs "$dev2"
-vgs -o+vg_uuid >err
-cat err
+vgs -o+vg_uuid | tee err
grep $UUID1 err
grep $UUID2 err
@@ -45,18 +43,15 @@ grep $UUID2 err
# grep $UUID1 err
aux disable_dev "$dev2"
-vgs -o+vg_uuid >err
-cat err
+vgs -o+vg_uuid | tee err
grep $UUID1 err
not grep $UUID2 err
aux enable_dev "$dev2"
vgscan
aux disable_dev "$dev1"
-vgs -o+vg_uuid >err
-cat err
+vgs -o+vg_uuid | tee err
grep $UUID2 err
not grep $UUID1 err
aux enable_dev "$dev1"
vgscan
-
diff --git a/test/shell/process-each-pv-nomda-all.sh b/test/shell/process-each-pv-nomda-all.sh
index 93eb0bd..44cde5a 100644
--- a/test/shell/process-each-pv-nomda-all.sh
+++ b/test/shell/process-each-pv-nomda-all.sh
@@ -57,4 +57,3 @@ grep "$dev11" err
grep "$dev12" err
grep "$dev13" err
grep "$dev14" err
-
9 years
master - tests: disable usage of fuser
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fee09f0964bd64...
Commit: fee09f0964bd64dee982eb615a6853e770ad0a4d
Parent: 4ce5b5fdf3e2758adf7e1313c98381071de85056
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 1 13:26:07 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 1 15:07:59 2015 +0200
tests: disable usage of fuser
Seems we captured problems with debug.log overwrite,
so avoid quite expensive usage of fuser tool with each lvm command.
---
test/lib/lvm-wrapper.sh | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/lib/lvm-wrapper.sh b/test/lib/lvm-wrapper.sh
index 5840175..178c45b 100644
--- a/test/lib/lvm-wrapper.sh
+++ b/test/lib/lvm-wrapper.sh
@@ -39,10 +39,10 @@ case "$CMD" in
esac
# Capture parallel users of debug.log file
-test -z "$(fuser debug.log 2>/dev/null)" || {
- echo "TEST WARNING: \"debug.log\" is still in use while running $CMD $@" >&2
- fuser -v debug.log >&2
-}
+#test -z "$(fuser debug.log 2>/dev/null)" || {
+# echo "TEST WARNING: \"debug.log\" is still in use while running $CMD $@" >&2
+# fuser -v debug.log >&2
+#}
# the exec is important, because otherwise fatal signals inside "not" go unnoticed
if test -n "$abs_top_builddir"; then
9 years
master - tests: run api tests from startup dir
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4ce5b5fdf3e275...
Commit: 4ce5b5fdf3e2758adf7e1313c98381071de85056
Parent: a3473e60db68a4d122f68dd66625ee35ac1021be
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 1 15:01:33 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 1 15:07:59 2015 +0200
tests: run api tests from startup dir
---
test/lib/aux.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 329c086..ae15235 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -870,8 +870,8 @@ prepare_profiles() {
}
apitest() {
- test -x "api/$1.t" || skip
- "api/$1.t" "${@:2}" && rm -f debug.log strace.log
+ test -x "$TESTOLDPWD/api/$1.t" || skip
+ "$TESTOLDPWD/api/$1.t" "${@:2}" && rm -f debug.log strace.log
}
mirror_recovery_works() {
9 years
master - tests: no lvmetad reload for debugless output
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a3473e60db68a4...
Commit: a3473e60db68a4d122f68dd66625ee35ac1021be
Parent: dd4e6b4e7e1afc959f054732f5388b915f62ab18
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri May 1 14:45:47 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 1 15:07:58 2015 +0200
tests: no lvmetad reload for debugless output
Introduce LVM_TEST_LVMETAD_DEBUG_OPTS to allow to override
default debug opts for lvmetad.
However could be still overloaded on command line:
make check_lvmetad LVM_TEST_LVMETAD_DEBUG_OPTS="-l all"...
---
test/Makefile.in | 1 +
test/lib/aux.sh | 6 ++++--
test/shell/lvconvert-mirror-basic.sh | 6 +++---
test/shell/lvconvert-mirror.sh | 6 +++---
test/shell/lvconvert-raid.sh | 6 +++---
test/shell/mirror-vgreduce-removemissing.sh | 6 +++---
test/shell/process-each-lv.sh | 6 +++---
test/shell/pvmove-basic.sh | 6 +++---
test/shell/vgsplit-operation.sh | 6 +++---
9 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index 04fbea0..4144d14 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -82,6 +82,7 @@ help:
@echo " LVM_TEST_DIR Where to create test files [$(LVM_TEST_DIR)]."
@echo " LVM_TEST_LOCKING Normal (1), Cluster (3)."
@echo " LVM_TEST_LVMETAD Start lvmetad (1)."
+ @echo " LVM_TEST_LVMETAD_DEBUG_OPTS Allows to override debug opts [-l all]."
@echo " LVM_TEST_NODEBUG Do not debug lvm commands."
@echo " LVM_TEST_PARALLEL May skip agresive wipe of LVMTEST resources."
@echo " LVM_TEST_RESULTS Where to create result files [results]."
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index e6fd9fa..329c086 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -84,7 +84,6 @@ prepare_dmeventd() {
}
prepare_lvmetad() {
- test $# -eq 0 && default_opts="-l all"
rm -f debug.log strace.log
# skip if we don't have our own lvmetad...
if test -z "${installed_testsuite+varset}"; then
@@ -96,8 +95,11 @@ prepare_lvmetad() {
kill_sleep_kill_ LOCAL_LVMETAD ${LVM_VALGRIND_LVMETAD:-0}
+ # Default debug is "-l all" and could be override
+ # by setting LVM_TEST_LVMETAD_DEBUG_OPTS before calling inittest.
echo "preparing lvmetad..."
- $run_valgrind lvmetad -f "$@" -s "$TESTDIR/lvmetad.socket" $default_opts "$@" &
+ $run_valgrind lvmetad -f "$@" -s "$TESTDIR/lvmetad.socket" \
+ ${LVM_TEST_LVMETAD_DEBUG_OPTS--l all} "$@" &
echo $! > LOCAL_LVMETAD
while ! test -e "$TESTDIR/lvmetad.socket"; do echo -n .; sleep .1; done # wait for the socket
echo ok
diff --git a/test/shell/lvconvert-mirror-basic.sh b/test/shell/lvconvert-mirror-basic.sh
index ce5b344..4a3e62f 100644
--- a/test/shell/lvconvert-mirror-basic.sh
+++ b/test/shell/lvconvert-mirror-basic.sh
@@ -9,6 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# disable lvmetad logging as it bogs down test systems
+export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
+
. lib/inittest
log_name_to_count() {
@@ -110,9 +113,6 @@ test_lvconvert() {
fi
}
-# disable lvmetad logging as it bogs down test systems
-test -e LOCAL_LVMETAD && aux prepare_lvmetad ""
-
aux prepare_pvs 5 5
vgcreate -s 32k $vg $(cat DEVICES)
diff --git a/test/shell/lvconvert-mirror.sh b/test/shell/lvconvert-mirror.sh
index 5dde921..844f8e9 100644
--- a/test/shell/lvconvert-mirror.sh
+++ b/test/shell/lvconvert-mirror.sh
@@ -9,10 +9,10 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-. lib/inittest
-
# disable lvmetad logging as it bogs down test systems
-test -e LOCAL_LVMETAD && aux prepare_lvmetad ""
+export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
+
+. lib/inittest
aux prepare_pvs 5 10
# proper DEVRANGE needs to be set according to extent size
diff --git a/test/shell/lvconvert-raid.sh b/test/shell/lvconvert-raid.sh
index 34c94bf..d3253eb 100644
--- a/test/shell/lvconvert-raid.sh
+++ b/test/shell/lvconvert-raid.sh
@@ -9,10 +9,10 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-. lib/inittest
-
# disable lvmetad logging as it bogs down test systems
-test -e LOCAL_LVMETAD && aux prepare_lvmetad ""
+export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
+
+. lib/inittest
get_image_pvs() {
local d
diff --git a/test/shell/mirror-vgreduce-removemissing.sh b/test/shell/mirror-vgreduce-removemissing.sh
index 8891369..e4791f8 100644
--- a/test/shell/mirror-vgreduce-removemissing.sh
+++ b/test/shell/mirror-vgreduce-removemissing.sh
@@ -12,10 +12,10 @@
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 ""
+export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
+
+. lib/inittest
lv_is_on_ ()
{
diff --git a/test/shell/process-each-lv.sh b/test/shell/process-each-lv.sh
index 355e92e..bd9e042 100644
--- a/test/shell/process-each-lv.sh
+++ b/test/shell/process-each-lv.sh
@@ -11,10 +11,10 @@
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 ""
+export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
+
+. lib/inittest
aux prepare_devs 10
diff --git a/test/shell/pvmove-basic.sh b/test/shell/pvmove-basic.sh
index f7830da..42b004d 100644
--- a/test/shell/pvmove-basic.sh
+++ b/test/shell/pvmove-basic.sh
@@ -12,13 +12,13 @@
test_description="ensure that pvmove works with basic options"
+# disable lvmetad logging as it bogs down test systems
+export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
+
. lib/inittest
which md5sum || skip
-# disable lvmetad logging as it bogs down test systems
-test -e LOCAL_LVMETAD && aux prepare_lvmetad ""
-
# ---------------------------------------------------------------------
# Utilities
diff --git a/test/shell/vgsplit-operation.sh b/test/shell/vgsplit-operation.sh
index f2baafd..91cdcdc 100644
--- a/test/shell/vgsplit-operation.sh
+++ b/test/shell/vgsplit-operation.sh
@@ -11,10 +11,10 @@
# Test vgsplit operation, including different LV types
-. lib/inittest
-
# disable lvmetad logging as it bogs down test systems
-test -e LOCAL_LVMETAD && aux prepare_lvmetad ""
+export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
+
+. lib/inittest
COMM() {
LAST_TEST="$@"
9 years
master - tests: lower version of dm-delay
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dd4e6b4e7e1afc...
Commit: dd4e6b4e7e1afc959f054732f5388b915f62ab18
Parent: 16e8006eb05a3fd18d1efeb58f79ffbb41ba61e2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 30 22:21:18 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 1 15:07:58 2015 +0200
tests: lower version of dm-delay
Let's see what will break with lower version 1.1.
Also avoid repeated check of target version.
---
test/lib/aux.sh | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 716d596..e6fd9fa 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -597,7 +597,10 @@ common_dev_() {
# If the size is missing, the remaing portion of device is taken
# i.e. delay_dev "$dev1" 0 200 256:
delay_dev() {
- target_at_least dm-delay 1 2 0 || skip
+ if test ! -f HAVE_DM_DELAY ; then
+ target_at_least dm-delay 1 1 0 || skip
+ fi
+ touch HAVE_DM_DELAY
common_dev_ delay "$@"
}
9 years
master - tests: rename kill_tagged_processes
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=16e8006eb05a3f...
Commit: 16e8006eb05a3fd18d1efeb58f79ffbb41ba61e2
Parent: c18e969e30a44ec392f40414e1f134ff70cecb38
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 30 18:42:31 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 1 15:07:58 2015 +0200
tests: rename kill_tagged_processes
Better name for aux function.
First use normal -TERM, and only after a while use -KILL
(leaving some time to correctly finish)
Print INFO about killed processes.
---
test/lib/aux.sh | 31 +++++++++++++++++++++++++------
test/shell/pvmove-abort-all.sh | 2 +-
test/shell/pvmove-abort.sh | 2 +-
test/shell/pvmove-restart.sh | 2 +-
test/shell/pvmove-resume-1.sh | 2 +-
test/shell/pvmove-resume-2.sh | 2 +-
test/shell/pvmove-resume-multiseg.sh | 2 +-
7 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index e20b6b0..716d596 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -233,17 +233,36 @@ kill_sleep_kill_() {
}
print_procs_by_tag_() {
- ps -o pid=,args= ehax 2>/dev/null | grep -weLVM_TEST_TAG=${1:-kill_me_$PREFIX} 2>/dev/null || true
+ (ps -o pid,args ehax | grep -we"LVM_TEST_TAG=${1:-kill_me_$PREFIX}") || true
}
count_processes_with_tag() {
print_procs_by_tag_ | wc -l
}
-kill_listed_processes() {
- while read pid b; do
- test -z "$pid" || kill -9 $pid
- done <<< $(print_procs_by_tag_ $@)
+kill_tagged_processes() {
+ local pid
+ local pids
+ local wait
+
+ # read uses all vars within pipe subshell
+ print_procs_by_tag_ "$@" | while read -r pid wait; do
+ if test -n "$pid" ; then
+ echo "Killing tagged process: $pid ${wait:0:120}..."
+ kill -TERM $pid 2>/dev/null || true
+ fi
+ pids="$pids $pid"
+ done
+
+ # wait if process exited and eventually -KILL
+ wait=0
+ for pid in $pids ; do
+ while ps $pid > /dev/null && test $wait -le 10; do
+ sleep .2
+ wait=$(($wait + 1))
+ done
+ test $wait -le 10 || kill -KILL $pid 2>/dev/null || true
+ done
}
teardown() {
@@ -252,7 +271,7 @@ teardown() {
if test -f TESTNAME ; then
- kill_listed_processes
+ kill_tagged_processes
kill_sleep_kill_ LOCAL_LVMETAD ${LVM_VALGRIND_LVMETAD:-0}
diff --git a/test/shell/pvmove-abort-all.sh b/test/shell/pvmove-abort-all.sh
index 5bca8a2..da43da6 100644
--- a/test/shell/pvmove-abort-all.sh
+++ b/test/shell/pvmove-abort-all.sh
@@ -67,7 +67,7 @@ not grep "^\[pvmove" out
lvremove -ff $vg $vg1
wait
-aux kill_listed_processes
+aux kill_tagged_processes
done
done
diff --git a/test/shell/pvmove-abort.sh b/test/shell/pvmove-abort.sh
index 2332521..6b807ac 100644
--- a/test/shell/pvmove-abort.sh
+++ b/test/shell/pvmove-abort.sh
@@ -58,7 +58,7 @@ pvmove --abort
lvremove -ff $vg
wait
-aux kill_listed_processes
+aux kill_tagged_processes
done
done
diff --git a/test/shell/pvmove-restart.sh b/test/shell/pvmove-restart.sh
index b91f624..1496b35 100644
--- a/test/shell/pvmove-restart.sh
+++ b/test/shell/pvmove-restart.sh
@@ -90,7 +90,7 @@ pvmove --abort
lvs -a -o+devices $vg
lvremove -ff $vg
-aux kill_listed_processes
+aux kill_tagged_processes
done
# Restore delayed device back
diff --git a/test/shell/pvmove-resume-1.sh b/test/shell/pvmove-resume-1.sh
index 9825e76..acf35ee 100644
--- a/test/shell/pvmove-resume-1.sh
+++ b/test/shell/pvmove-resume-1.sh
@@ -98,7 +98,7 @@ test_pvmove_resume() {
i=$((i + 1))
done
- aux kill_listed_processes
+ aux kill_tagged_processes
lvremove -ff $vg $vg1
}
diff --git a/test/shell/pvmove-resume-2.sh b/test/shell/pvmove-resume-2.sh
index dee82cc..37a552d 100644
--- a/test/shell/pvmove-resume-2.sh
+++ b/test/shell/pvmove-resume-2.sh
@@ -80,7 +80,7 @@ test_pvmove_resume() {
i=$((i + 1))
done
- aux kill_listed_processes
+ aux kill_tagged_processes
lvremove -ff $vg
}
diff --git a/test/shell/pvmove-resume-multiseg.sh b/test/shell/pvmove-resume-multiseg.sh
index d70662d..be21d56 100644
--- a/test/shell/pvmove-resume-multiseg.sh
+++ b/test/shell/pvmove-resume-multiseg.sh
@@ -92,7 +92,7 @@ test_pvmove_resume() {
i=$((i + 1))
done
- aux kill_listed_processes
+ aux kill_tagged_processes
lvremove -ff $vg
}
9 years
master - tests: move conf preparing
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c18e969e30a44e...
Commit: c18e969e30a44ec392f40414e1f134ff70cecb38
Parent: 0eea780bceccb5e1693429529f292b2fb36afadd
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 30 13:57:54 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri May 1 15:07:58 2015 +0200
tests: move conf preparing
If the test in the middle is restarting lvmetad
avoid conf regenerating.
---
test/lib/aux.sh | 2 --
test/lib/inittest.sh | 1 +
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index c6b05f8..e20b6b0 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -90,8 +90,6 @@ prepare_lvmetad() {
if test -z "${installed_testsuite+varset}"; then
(which lvmetad 2>/dev/null | grep -q "$abs_builddir") || skip
fi
- lvmconf "global/use_lvmetad = 1" \
- "devices/md_component_detection = 0"
local run_valgrind=
test "${LVM_VALGRIND_LVMETAD:-0}" -eq 0 || run_valgrind="run_valgrind"
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index dd4f060..d5c80f4 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -92,6 +92,7 @@ echo "@PREFIX=$PREFIX"
if test -n "$LVM_TEST_LVMETAD" ; then
export LVM_LVMETAD_SOCKET="$TESTDIR/lvmetad.socket"
export LVM_LVMETAD_PIDFILE="$TESTDIR/lvmetad.pid"
+ aux lvmconf "global/use_lvmetad = 1" "devices/md_component_detection = 0"
aux prepare_lvmetad
else
# lvmetad prepares its own lvmconf
9 years