Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ba9d152aa5552f2b6d9ea…
Commit: ba9d152aa5552f2b6d9ea3acf5ae644dc4dd1596
Parent: 09f29570f2dac1a84f5ee24107df6461194b269a
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Thu Jun 27 11:14:00 2019 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Thu Jun 27 11:14:00 2019 +0200
test: Remove now useless clvmd test
---
test/shell/clvmd-restart.sh | 73 -------------------------------------------
1 files changed, 0 insertions(+), 73 deletions(-)
diff --git a/test/shell/clvmd-restart.sh b/test/shell/clvmd-restart.sh
deleted file mode 100644
index 7e3257a..0000000
--- a/test/shell/clvmd-restart.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright (C) 2011-2015 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
-
-# set before test's clvmd is started, so it's passed in environ
-export LVM_CLVMD_BINARY=clvmd
-export LVM_BINARY=lvm
-
-SKIP_WITH_LVMLOCKD=1
-SKIP_WITHOUT_CLVMD=1
-SKIP_WITH_LVMPOLLD=1
-
-. lib/inittest
-
-# only clvmd based test, skip otherwise
-read -r LOCAL_CLVMD < LOCAL_CLVMD
-
-# TODO read from build, for now hardcoded
-CLVMD_SOCKET="/var/run/lvm/clvmd.sock"
-
-restart_clvmd_() {
- "$LVM_CLVMD_BINARY" -S
- ls -la "$CLVMD_SOCKET" || true
-
- for i in $(seq 1 20) ; do
- test -S "$CLVMD_SOCKET" && break
- sleep .1
- done
- # restarted clvmd has the same PID (no fork, only execvp)
- NEW_LOCAL_CLVMD=$(pgrep clvmd)
- test "$LOCAL_CLVMD" -eq "$NEW_LOCAL_CLVMD"
-}
-
-aux prepare_vg
-
-lvcreate -an --zero n -n $lv1 -l1 $vg
-lvcreate -an --zero n -n $lv2 -l1 $vg
-lvcreate -l1 $vg
-
-lvchange -aey $vg/$lv1
-lvchange -aey $vg/$lv2
-
-restart_clvmd_
-
-# try restart once more
-restart_clvmd_
-
-# FIXME: Hmm - how could we test exclusivity is preserved in singlenode ?
-lvchange -an $vg/$lv1
-lvchange -aey $vg/$lv1
-lvcreate -s -l3 -n snap $vg/$lv1
-
-"$LVM_CLVMD_BINARY" -R
-
-vgchange -an $vg
-
-# Test what happens after 'reboot'
-kill "$LOCAL_CLVMD"
-while test -e "$CLVMD_PIDFILE"; do echo -n .; sleep .1; done # wait for the pid removal
-aux prepare_clvmd
-
-vgchange -ay $vg
-lvremove -f $vg/snap
-
-vgremove -ff $vg
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b13ebfa4c289a5bc6eb4f…
Commit: b13ebfa4c289a5bc6eb4f8ba26126db8e6d78296
Parent: b62c0787debeb3a66a2e3658d1edb8a61a6f247b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jun 26 16:03:42 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jun 26 16:06:23 2019 -0500
pvremove/vgextend: fix using device aliases with lvmetad
These commands were looking for the requested device alias
before dev_cache_scan had created the list of devs on the
system, so they would fail and report the dev wasn't found.
---
tools/toollib.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 3221e5f..1b01ccc 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -5544,6 +5544,15 @@ int pvcreate_each_device(struct cmd_context *cmd,
lvmcache_label_scan(cmd);
/*
+ * When using lvmetad, we want to do a dev cache scan here (if not done
+ * already) so that the dev_cache_get just below will be able to find
+ * device aliases. When not using lvmetad, the label_scan just above
+ * has done dev_cache_scan, and this will not be run.
+ */
+ if (!dev_cache_has_scanned())
+ dev_cache_scan();
+
+ /*
* Translate arg names into struct device's.
*/
dm_list_iterate_items(pd, &pp->arg_devices)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9ba45d824adc91b5767fd…
Commit: 9ba45d824adc91b5767fd7a26c3ba83f7b23b250
Parent: b4402bd821723067c2becaf8e2a0452d4896cfd7
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Jun 25 15:45:47 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Jun 25 15:45:47 2019 -0500
tests: add exported.sh
to test how commands work with exported VGs/PVs.
---
test/shell/exported.sh | 207 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 207 insertions(+), 0 deletions(-)
diff --git a/test/shell/exported.sh b/test/shell/exported.sh
new file mode 100644
index 0000000..b6d17ce
--- /dev/null
+++ b/test/shell/exported.sh
@@ -0,0 +1,207 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2008-2013,2018 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
+
+. lib/inittest
+
+# Check what is and is not permitted on an exported VG/PV
+
+aux prepare_devs 3
+get_devs
+
+vgcreate $vg1 "$dev1"
+vgcreate $vg2 "$dev2"
+
+lvcreate -l1 -n $lv1 -an $vg1
+lvcreate -l1 -n $lv2 -an $vg2
+
+vgchange --addtag aa $vg1
+lvchange --addtag bb $vg1/$lv1
+
+# vgexport only when no lvs are active
+lvchange -ay $vg1/$lv1
+not vgexport $vg1
+lvchange -an $vg1/$lv1
+
+vgexport $vg1
+
+lvm fullreport |tee out
+grep $vg1 out
+
+lvm fullreport $vg1 |tee out
+grep $vg1 out
+
+not lvchange -ay $vg1
+not lvchange -ay $vg1/$lv1
+not lvchange --addtag bar $vg1/$lv1
+not lvchange --monitor y $vg1/$lv1
+
+not lvconvert --type mirror $vg1/$lv1
+
+not lvcreate -l1 $vg1
+
+not lvdisplay $vg1
+
+lvdisplay 2>&1|tee out
+not grep $vg1 out
+
+not lvextend -l+1 $vg1/$lv1
+
+lvmdiskscan 2>&1|tee foo
+grep "$dev1" foo
+
+not lvreduce -l-1 $vg1/$lv1
+
+not lvremove $vg1
+not lvremove $vg1/$lv1
+
+not lvrename $vg1 $lv1 $lv2
+
+not lvresize --size 1M $vg1/$lv1
+
+not lvs $vg1
+
+lvs 2>&1|tee out
+not grep $vg1 out
+
+lvscan 2>&1|tee out
+not grep $vg1 out
+
+not pvchange --addtag cc "$dev1"
+pvs -o+tags "$dev1" 2>&1|tee out
+grep "$dev1" out
+not grep cc out
+
+pvs -osize "$dev1" > before
+not pvresize --setphysicalvolumesize 100M "$dev1"
+pvs -osize "$dev1" > after
+diff before after
+
+pvck "$dev1"
+pvck --dump headers "$dev1" > out
+grep "label_header at 512" out
+
+not pvcreate "$dev1"
+
+pvdisplay "$dev1" 2>&1|tee out
+grep "$dev1" out
+
+not pvmove "$dev1"
+
+not pvremove "$dev1"
+
+pvs "$dev1" 2>&1|tee out
+grep "$dev1" out
+
+pvscan 2>&1|tee out
+grep "$dev1" out
+
+pvscan --cache 2>&1|tee out
+grep "$dev1" out
+
+vgcfgbackup $vg1
+
+vgcfgrestore $vg1
+
+not vgchange -ay $vg1
+not vgchange --addtag asdf $vg1
+not vgchange --monitor y $vg1
+
+not vgck $vg1
+
+not vgcreate $vg1 "$dev3"
+
+vgdisplay $vg1 2>&1|tee out
+grep $vg1 out
+
+not vgexport $vg1
+
+vgexport $vg2
+not lvcreate -l1 -n $lv3 -an $vg2
+vgimport $vg2
+lvcreate -l1 -n $lv3 -an $vg2
+lvremove $vg2/$lv3
+
+not vgextend $vg1 "$dev3"
+
+not vgmerge $vg1 $vg2
+
+not vgmknodes $vg1
+
+not vgreduce --removemissing $vg1
+
+not vgremove $vg1
+
+vgrename $vg1 $vg3
+vgrename $vg3 $vg1
+
+vgs $vg1 2>&1|tee out
+grep $vg1 out
+
+vgscan 2>&1|tee out
+grep $vg1 out
+
+# pvscan --cache tracks online state of exported PVs,
+# but autoactivation should not activate LVs.
+pvscan --cache -aay "$dev1"
+vgimport $vg1
+check inactive $vg1 $lv1
+vgexport $vg1
+
+# using a tag does not give access to exported vg
+lvchange -ay @foo
+vgimport $vg1
+check inactive $vg1 $lv1
+vgexport $vg1
+
+# using select does not give access to exported vg
+lvchange -ay --select lvname=$lv1
+vgimport $vg1
+check inactive $vg1 $lv1
+vgexport $vg1
+
+# tag or select do not work with vgremove on exported vg
+vgremove @foo
+vgs $vg1
+vgremove --select vgname=$vg1
+vgs $vg1
+
+# exported vg is skipped without error when not named
+vgchange -ay
+vgimport $vg1
+check inactive $vg1 $lv1
+vgexport $vg1
+
+# exported vg is skipped without error when not named
+vgchange --addtag newtag
+vgs -o tags $vg1 > out
+not grep newtag out
+vgchange --deltag aa
+vgs -o tags $vg1 > out
+grep aa out
+
+# exported vg is skipped without error when not named
+vgchange --monitor y
+vgchange --monitor n
+
+vgimport $vg1
+vgextend $vg1 "$dev3"
+vgexport $vg1
+
+not vgreduce $vg1 "$dev3"
+
+not vgsplit $vg1 "$vg3" "$dev3"
+
+# For vgimportclone see vgimportclone.sh
+
+vgimport $vg1
+vgremove -ff $vg1
+vgremove -ff $vg2