Change in vdsm[master]: terminating tests - verify process death

ybronhei at redhat.com ybronhei at redhat.com
Mon Jan 18 14:19:11 UTC 2016


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 <ybronhei at 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 <ybronhei at redhat.com>


More information about the vdsm-patches mailing list