summaryrefslogtreecommitdiffstats
path: root/test/t-clvmd-restart.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/t-clvmd-restart.sh')
-rw-r--r--test/t-clvmd-restart.sh19
1 files changed, 14 insertions, 5 deletions
diff --git a/test/t-clvmd-restart.sh b/test/t-clvmd-restart.sh
index 9a5b1b9d..690fc583 100644
--- a/test/t-clvmd-restart.sh
+++ b/test/t-clvmd-restart.sh
@@ -9,13 +9,15 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-export LVM_CLVMD_BINARY="lib/clvmd"
-export LVM_BINARY="lib/lvm"
+# set before test's clvmd is started, so it's passed in environ
+export LVM_CLVMD_BINARY=clvmd
+export LVM_BINARY=lvm
. lib/test
# only clvmd based test, skip otherwise
test -e LOCAL_CLVMD || skip
+read LOCAL_CLVMD < LOCAL_CLVMD
aux prepare_devs 1
@@ -30,15 +32,22 @@ lvchange -aey $vg/$lv2
"$LVM_CLVMD_BINARY" -S
sleep .2
-# restarted clvmd has the same PID (no fork, only execve)
+# restarted clvmd has the same PID (no fork, only execvp)
+NEW_LOCAL_CLVMD=$(pgrep clvmd)
+test "$LOCAL_CLVMD" -eq "$NEW_LOCAL_CLVMD"
+
+# try restart once more
+
+"$LVM_CLVMD_BINARY" -S
+sleep .2
+# restarted clvmd has the same PID (no fork, only execvp)
NEW_LOCAL_CLVMD=$(pgrep clvmd)
-read LOCAL_CLVMD < LOCAL_CLVMD
test "$LOCAL_CLVMD" -eq "$NEW_LOCAL_CLVMD"
# FIXME: Hmm - how could we test exclusivity is preserved in singlenode ?
lvchange -an $vg/$lv1
lvchange -ay $vg/$lv1
-lib/clvmd -R
+"$LVM_CLVMD_BINARY" -R
vgremove -ff $vg