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 -n "$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" &
25 vgremove --config 'global { wait_for_locks = 1 }' $vg
26 not vgremove --config 'global { wait_for_locks = 1 }' $vg
27 not ps $flock_pid # finished
29 # if wait_for_locks not set, vgremove should fail on non-blocking lock
30 # we must wait for flock process at the end - vgremove won't wait
31 vgcreate $vg $dev1 $dev2
32 flock -w 5 $TESTDIR/var/lock/lvm/P_orphans -c "sleep 10" &
34 not vgremove --config 'global { wait_for_locks = 0 }' $vg
35 ps $flock_pid # still running