Yaniv Bronhaim has uploaded a new change for review. Change subject: terminating tests - verify process death ......................................................................
terminating tests - verify process death Change-Id: Ib1600a298b3faaffe3cc72b4eb62201370bf03c7 Signed-off-by: Yaniv Bronhaim <ybron...@redhat.com> --- M tests/utilsTests.py 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/52362/1 diff --git a/tests/utilsTests.py b/tests/utilsTests.py index 01a0796..059ce48 100644 --- a/tests/utilsTests.py +++ b/tests/utilsTests.py @@ -76,6 +76,20 @@ self.patch.revert() +class TerminatingTests(TestCaseBase): + def testTerminating(self): + proc = commands.execCmd([EXT_SLEEP, "5"], sync=False) + pids = utils.pgrep(EXT_SLEEP) + # verify process is up and running + self.assertTrue(proc.pid in pids) + with utils.terminating(proc): + # do whatever with proc + pass + # here process should not exist + pids = utils.pgrep(EXT_SLEEP) + self.assertFalse(proc.pid in pids) + + class RetryTests(TestCaseBase): def testStopCallback(self): counter = [0] -- To view, visit https://gerrit.ovirt.org/52362 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1600a298b3faaffe3cc72b4eb62201370bf03c7 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Yaniv Bronhaim <ybron...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches