Skip to content

Commit

Permalink
[vs]: clean up process running in server namespace for vstests (#1862)
Browse files Browse the repository at this point in the history
Signed-off-by: Guohan Lu <[email protected]>
  • Loading branch information
lguohan authored Jul 14, 2018
1 parent 015d2d1 commit 1955a43
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions platform/vs/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ def __init__(self, ctn_name, pid, i):

def __del__(self):
if self.cleanup:
pids = subprocess.check_output("ip netns pids %s" % (self.nsname), shell=True)
if pids:
for pid in pids.split('\n'):
if len(pid) > 0:
os.system("kill %s" % int(pid))
os.system("ip netns delete %s" % self.nsname)

def runcmd(self, cmd):
Expand Down

0 comments on commit 1955a43

Please sign in to comment.