2
# Copyright (C) 2008 Red Hat, Inc. All rights reserved.
4
# This copyrighted material is made available to anyone wishing to use,
5
# modify, copy, or redistribute it subject to the terms and conditions
6
# of the GNU General Public License v.2.
8
# You should have received a copy of the GNU General Public License
9
# along with this program; if not, write to the Free Software Foundation,
10
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
12
test_description='test some blocking / non-blocking multi-vg operations'
17
test -e LOCAL_CLVMD && exit 200
19
vgcreate $vg $dev1 $dev2
21
# if wait_for_locks set, vgremove should wait for orphan lock
22
# flock process should have exited by the time first vgremove completes
23
flock -w 5 $TESTDIR/var/lock/lvm/P_orphans -c "sleep 10" &
24
while ! test -f $TESTDIR/var/lock/lvm/P_orphans ; do sleep .1 ; done
26
vgremove --config 'global { wait_for_locks = 1 }' $vg
27
not vgremove --config 'global { wait_for_locks = 1 }' $vg
29
test ! -f $TESTDIR/var/lock/lvm/P_orphans
31
# if wait_for_locks not set, vgremove should fail on non-blocking lock
32
# we must wait for flock process at the end - vgremove won't wait
33
vgcreate $vg $dev1 $dev2
34
flock -w 5 $TESTDIR/var/lock/lvm/P_orphans -c "sleep 10" &
36
while ! test -f $TESTDIR/var/lock/lvm/P_orphans ; do sleep .1 ; done
39
not vgremove --config 'global { wait_for_locks = 0 }' $vg
40
test -f $TESTDIR/var/lock/lvm/P_orphans # still running