Revision 23683c26 test/ganeti.locking_unittest.py
b/test/ganeti.locking_unittest.py | ||
---|---|---|
1002 | 1002 |
|
1003 | 1003 |
def _AcquireOne(): |
1004 | 1004 |
# Try to get the same lock again with a timeout (should never succeed) |
1005 |
if self.ls.acquire(wanted, timeout=0.1, shared=0): |
|
1005 |
acquired = self.ls.acquire(wanted, timeout=0.1, shared=0) |
|
1006 |
if acquired: |
|
1006 | 1007 |
self.done.put("acquired") |
1007 | 1008 |
self.ls.release() |
1008 | 1009 |
else: |
1010 |
self.assert_(acquired is None) |
|
1009 | 1011 |
self.assert_(not self.ls._list_owned()) |
1010 | 1012 |
self.assert_(not self.ls._is_owned()) |
1011 | 1013 |
self.done.put("not acquired") |
Also available in: Unified diff