Skip to content

Commit 1955a43

Browse files
authored
[vs]: clean up process running in server namespace for vstests (#1862)
Signed-off-by: Guohan Lu <[email protected]>
1 parent 015d2d1 commit 1955a43

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

platform/vs/tests/conftest.py

+5
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ def __init__(self, ctn_name, pid, i):
9090

9191
def __del__(self):
9292
if self.cleanup:
93+
pids = subprocess.check_output("ip netns pids %s" % (self.nsname), shell=True)
94+
if pids:
95+
for pid in pids.split('\n'):
96+
if len(pid) > 0:
97+
os.system("kill %s" % int(pid))
9398
os.system("ip netns delete %s" % self.nsname)
9499

95100
def runcmd(self, cmd):

0 commit comments

Comments
 (0)