mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
tests: more waits on restart
Check for socket presence (hardcoded for now)
This commit is contained in:
parent
31f1375d23
commit
224e30a4b1
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Copyright (C) 2011 Red Hat, Inc. All rights reserved.
|
# Copyright (C) 2011-2015 Red Hat, Inc. All rights reserved.
|
||||||
#
|
#
|
||||||
# This copyrighted material is made available to anyone wishing to use,
|
# This copyrighted material is made available to anyone wishing to use,
|
||||||
# modify, copy, or redistribute it subject to the terms and conditions
|
# modify, copy, or redistribute it subject to the terms and conditions
|
||||||
@ -19,9 +19,23 @@ export LVM_BINARY=lvm
|
|||||||
test -e LOCAL_CLVMD || skip
|
test -e LOCAL_CLVMD || skip
|
||||||
read LOCAL_CLVMD < LOCAL_CLVMD
|
read LOCAL_CLVMD < LOCAL_CLVMD
|
||||||
|
|
||||||
aux prepare_pvs 1
|
# TODO read from build, for now hardcoded
|
||||||
|
CLVMD_SOCKET="/var/run/lvm/clvmd.sock"
|
||||||
|
|
||||||
vgcreate --clustered y $vg $(cat DEVICES)
|
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 $lv1 -l1 $vg
|
||||||
lvcreate -an --zero n -n $lv2 -l1 $vg
|
lvcreate -an --zero n -n $lv2 -l1 $vg
|
||||||
@ -30,19 +44,10 @@ lvcreate -l1 $vg
|
|||||||
lvchange -aey $vg/$lv1
|
lvchange -aey $vg/$lv1
|
||||||
lvchange -aey $vg/$lv2
|
lvchange -aey $vg/$lv2
|
||||||
|
|
||||||
"$LVM_CLVMD_BINARY" -S
|
restart_clvmd_
|
||||||
sleep .2
|
|
||||||
# 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
|
# try restart once more
|
||||||
|
restart_clvmd_
|
||||||
"$LVM_CLVMD_BINARY" -S
|
|
||||||
sleep .2
|
|
||||||
# restarted clvmd has the same PID (no fork, only execvp)
|
|
||||||
NEW_LOCAL_CLVMD=$(pgrep clvmd)
|
|
||||||
test "$LOCAL_CLVMD" -eq "$NEW_LOCAL_CLVMD"
|
|
||||||
|
|
||||||
# FIXME: Hmm - how could we test exclusivity is preserved in singlenode ?
|
# FIXME: Hmm - how could we test exclusivity is preserved in singlenode ?
|
||||||
lvchange -an $vg/$lv1
|
lvchange -an $vg/$lv1
|
||||||
@ -55,7 +60,7 @@ vgchange -an $vg
|
|||||||
|
|
||||||
# Test what happens after 'reboot'
|
# Test what happens after 'reboot'
|
||||||
kill "$LOCAL_CLVMD"
|
kill "$LOCAL_CLVMD"
|
||||||
while test -e "/var/run/clvmd.pid"; do echo -n .; sleep .1; done # wait for the pid removal
|
while test -e "$CLVMD_PIDFILE"; do echo -n .; sleep .1; done # wait for the pid removal
|
||||||
aux prepare_clvmd
|
aux prepare_clvmd
|
||||||
|
|
||||||
vgchange -ay $vg
|
vgchange -ay $vg
|
||||||
|
Loading…
Reference in New Issue
Block a user