Merge pull request from dillaman/wip-qa-rbd-lock-fence

test: handle exception thrown from close during rbd lock test

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Josh Durgin 2016-03-15 08:17:21 -07:00
commit 09143ea797

17
src/test/librbd/rbdrw.py Executable file → Normal file
View File

@ -18,14 +18,13 @@ import rados, rbd, sys
with rados.Rados(conffile='') as r:
with r.open_ioctx('rbd') as ioctx:
with rbd.Image(ioctx, sys.argv[1]) as image:
image.lock_exclusive(sys.argv[2])
while True:
try:
try:
with rbd.Image(ioctx, sys.argv[1]) as image:
image.lock_exclusive(sys.argv[2])
while True:
image.write('A' * 4096, 0)
r = image.read(0, 4096)
except rbd.ConnectionShutdown:
# it so happens that the errno here is 108, but
# anything recognizable would do
exit(108)
except rbd.ConnectionShutdown:
# it so happens that the errno here is 108, but
# anything recognizable would do
exit(108)