Adam Litke has uploaded a new change for review.
Change subject: tests: Add basic tests for RWLock ......................................................................
tests: Add basic tests for RWLock
Change-Id: I77b9ea1cd6d378738fbf14de119c88bf0ebc94e2 Signed-off-by: Adam Litke alitke@redhat.com --- M tests/miscTests.py 1 file changed, 18 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/72/42772/1
diff --git a/tests/miscTests.py b/tests/miscTests.py index 976b503..c6d9690 100644 --- a/tests/miscTests.py +++ b/tests/miscTests.py @@ -1268,3 +1268,21 @@
def _run(self): self.result = self._func() + + +class RWLockTests(TestCaseBase): + + def test_multiple_acquire(self): + lock = misc.RWLock() + self.assertTrue(lock.acquire(exclusive=True)) + self.assertTrue(lock.acquire(exclusive=True)) + + def test_demote(self): + lock = misc.RWLock() + self.assertTrue(lock.acquire(exclusive=True)) + self.assertTrue(lock.acquire(exclusive=False)) + + def test_promote(self): + lock = misc.RWLock() + self.assertTrue(lock.acquire(False)) + self.assertRaises(RuntimeError, lock.acquire, True)
automation@ovirt.org has posted comments on this change.
Change subject: tests: Add basic tests for RWLock ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Adam Litke has posted comments on this change.
Change subject: tests: Add basic tests for RWLock ......................................................................
Patch Set 1: Verified+1
Nir Soffer has posted comments on this change.
Change subject: tests: Add basic tests for RWLock ......................................................................
Patch Set 1:
(3 comments)
https://gerrit.ovirt.org/#/c/42772/1/tests/miscTests.py File tests/miscTests.py:
Line 1274: Line 1275: def test_multiple_acquire(self): Line 1276: lock = misc.RWLock() Line 1277: self.assertTrue(lock.acquire(exclusive=True)) Line 1278: self.assertTrue(lock.acquire(exclusive=True)) I don't think these tests are correct without the next patch - lock.acquire() returns always None. Line 1279: Line 1280: def test_demote(self): Line 1281: lock = misc.RWLock() Line 1282: self.assertTrue(lock.acquire(exclusive=True))
Line 1279: Line 1280: def test_demote(self): Line 1281: lock = misc.RWLock() Line 1282: self.assertTrue(lock.acquire(exclusive=True)) Line 1283: self.assertTrue(lock.acquire(exclusive=False)) Same Line 1284: Line 1285: def test_promote(self): Line 1286: lock = misc.RWLock() Line 1287: self.assertTrue(lock.acquire(False))
Line 1283: self.assertTrue(lock.acquire(exclusive=False)) Line 1284: Line 1285: def test_promote(self): Line 1286: lock = misc.RWLock() Line 1287: self.assertTrue(lock.acquire(False)) Same
automation@ovirt.org has posted comments on this change.
Change subject: tests: Add basic tests for RWLock ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: tests: Add basic tests for RWLock ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: tests: Add basic tests for RWLock ......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Nir Soffer has posted comments on this change.
Change subject: tests: Add basic tests for RWLock ......................................................................
Patch Set 4: Code-Review-1
Can be abandoned now.
Jenkins CI RO has abandoned this change.
Change subject: tests: Add basic tests for RWLock ......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
gerrit-hooks has posted comments on this change.
Change subject: tests: Add basic tests for RWLock ......................................................................
Patch Set 4:
* Update Tracker::IGNORE, no bug url/s found
vdsm-patches@lists.fedorahosted.org