mirror of
https://github.com/ceph/ceph
synced 2024-12-18 01:16:55 +00:00
qa/workunits/rbd: handle exception thrown from close during lock test
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
parent
0a92973bec
commit
2ae1be4259
17
src/test/librbd/rbdrw.py
Executable file → Normal file
17
src/test/librbd/rbdrw.py
Executable file → Normal file
@ -18,14 +18,13 @@ import rados, rbd, sys
|
|||||||
|
|
||||||
with rados.Rados(conffile='') as r:
|
with rados.Rados(conffile='') as r:
|
||||||
with r.open_ioctx('rbd') as ioctx:
|
with r.open_ioctx('rbd') as ioctx:
|
||||||
with rbd.Image(ioctx, sys.argv[1]) as image:
|
try:
|
||||||
image.lock_exclusive(sys.argv[2])
|
with rbd.Image(ioctx, sys.argv[1]) as image:
|
||||||
while True:
|
image.lock_exclusive(sys.argv[2])
|
||||||
try:
|
while True:
|
||||||
image.write('A' * 4096, 0)
|
image.write('A' * 4096, 0)
|
||||||
r = image.read(0, 4096)
|
r = image.read(0, 4096)
|
||||||
except rbd.ConnectionShutdown:
|
except rbd.ConnectionShutdown:
|
||||||
# it so happens that the errno here is 108, but
|
# it so happens that the errno here is 108, but
|
||||||
# anything recognizable would do
|
# anything recognizable would do
|
||||||
exit(108)
|
exit(108)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user