File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
1717import unittest
18+ import psutil
1819
19- from psutil import process_iter
2020from base_vyostest_shim import VyOSUnitTestSHIM
2121
2222from vyos .configsession import ConfigSessionError
@@ -48,10 +48,13 @@ def tearDown(self):
4848 # Validate PPPoE client process
4949 for interface in self ._interfaces :
5050 running = False
51- for proc in process_iter ():
52- if interface in proc .cmdline ():
53- running = True
54- break
51+ for proc in psutil .process_iter ():
52+ try :
53+ if interface in proc .cmdline ():
54+ running = True
55+ break
56+ except psutil .ZombieProcess :
57+ pass
5558 self .assertTrue (running )
5659
5760 self .cli_delete (base_path )
@@ -110,10 +113,13 @@ def test_pppoe_client_disabled_interface(self):
110113 # Validate PPPoE client process - must not run as interfaces are disabled
111114 for interface in self ._interfaces :
112115 running = False
113- for proc in process_iter ():
114- if interface in proc .cmdline ():
115- running = True
116- break
116+ for proc in psutil .process_iter ():
117+ try :
118+ if interface in proc .cmdline ():
119+ running = True
120+ break
121+ except psutil .ZombieProcess :
122+ pass
117123 self .assertFalse (running )
118124
119125 # enable PPPoE interfaces
You can’t perform that action at this time.
0 commit comments