[vs]: clean up process running in server namespace for vstests (#1862)
Signed-off-by: Guohan Lu <gulv@microsoft.com>
This commit is contained in:
parent
015d2d1d09
commit
1955a43055
@ -90,6 +90,11 @@ class VirtualServer(object):
|
||||
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user