Skip to content

Commit

Permalink
Merge pull request #8124 from dillaman/wip-qa-rbd-lock-fence
Browse files Browse the repository at this point in the history
test: handle exception thrown from close during rbd lock test

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
  • Loading branch information
jdurgin committed Mar 15, 2016
2 parents 35e6b76 + 2ae1be4 commit 09143ea
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/test/librbd/rbdrw.py 100755 → 100644
Expand Up @@ -18,14 +18,13 @@

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)

0 comments on commit 09143ea

Please sign in to comment.