Ensure get_pid_to_kill works with rootwrap script

To ensure that correct process is killed when using a rootwrap
script, we must recursively list the children of our top-level
process and kill the last one. This patch uses the psutil python
module which is already used in the heat-cfntools project.

Change-Id: I702bb9dd794c08fcaab637284ee303de1778cbb9
This commit is contained in:
Terry Wilson
2013-10-22 13:22:18 -05:00
parent 43b22ddb7d
commit 61e9268bd4
6 changed files with 28 additions and 49 deletions

View File

@@ -69,7 +69,8 @@ class BaseMonitorTest(base.BaseTestCase):
self._check_test_requirements()
self.root_helper = 'sudo'
# Emulate using a rootwrap script with sudo
self.root_helper = 'sudo sudo'
self.ovs = ovs_lib.BaseOVS(self.root_helper)
self.bridge = create_ovs_resource('test-br-', self.ovs.add_bridge)