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

nsoffer at redhat.com nsoffer at redhat.com
Mon Jan 18 20:37:51 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: terminating tests - verify process death
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.ovirt.org/#/c/52362/1/tests/utilsTests.py
File tests/utilsTests.py:

Line 78: 
Line 79: class TerminatingTests(TestCaseBase):
Line 80:     def testTerminating(self):
Line 81:         proc = commands.execCmd([EXT_SLEEP, "5"], sync=False)
Line 82:         pids = utils.pgrep(EXT_SLEEP)
Lets check /proc/pid instead of using pgrep.
Line 83:         # verify process is up and running
Line 84:         self.assertTrue(proc.pid in pids)
Line 85:         with utils.terminating(proc):
Line 86:             # do whatever with proc


Line 86:             # do whatever with proc
Line 87:             pass
Line 88:         # here process should not exist
Line 89:         pids = utils.pgrep(EXT_SLEEP)
Line 90:         self.assertFalse(proc.pid in pids)
We can do:

    self.assertFalse(os.path.exists("/proc/pid"))
Line 91: 
Line 92: 
Line 93: class RetryTests(TestCaseBase):
Line 94:     def testStopCallback(self):


-- 
To view, visit https://gerrit.ovirt.org/52362
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib1600a298b3faaffe3cc72b4eb62201370bf03c7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list