Skip to content

Commit

Permalink
Merge pull request #3848 from ceph/wip-10990
Browse files Browse the repository at this point in the history
qa/workunits/rbd/copy.sh: remove all image locks

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
  • Loading branch information
jdurgin committed Mar 2, 2015
2 parents 206cb70 + 6cff494 commit 172f24c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions qa/workunits/rbd/copy.sh
Expand Up @@ -233,11 +233,15 @@ test_locking() {
rbd lock list test1 | grep ' 2 '
rbd lock add test1 id2 --shared tag
rbd lock list test1 | grep ' 3 '
LOCKER=$(rbd lock list test1 | tail -n 1 | awk '{print $1;}')
ID=$(rbd lock list test1 | tail -n 1 | awk '{print $2;}')
rbd lock remove test1 $ID $LOCKER
# locks don't prevent you from removing an image,
# just from taking a lock
rbd lock list test1 | tail -n 1 | awk '{print $2, $1;}' | xargs rbd lock remove test1
if rbd info test1 | grep -qE "features:.*exclusive"
then
# new locking functionality requires all locks to be released
while [ -n "$(rbd lock list test1)" ]
do
rbd lock list test1 | tail -n 1 | awk '{print $2, $1;}' | xargs rbd lock remove test1
done
fi
rbd rm test1
}

Expand Down

0 comments on commit 172f24c

Please sign in to comment.