Commit 909c1079 authored by Peter V. Saveliev's avatar Peter V. Saveliev

compat: fix the control pipes leak

Bug-Url: https://github.com/svinota/pyroute2/issues/298
parent 23d76639
......@@ -259,6 +259,8 @@ def sync(f):
finally:
os.write(cmd, b'q')
t.join()
os.close(rcmd)
os.close(cmd)
return ret
return decorated
......
from pyroute2 import IPRoute
from pyroute2 import IPDB
from pyroute2 import NetNS
from pyroute2.common import uifname
from nose.tools import assert_raises
import fcntl
import sys
......@@ -28,6 +29,23 @@ class TestRespawn(object):
pass
class TestIfs(object):
def test_bridge_fd_leaks(self):
ifs = []
for _ in range(RESPAWNS):
ifs.append(uifname())
with IPDB() as ipdb:
for name in ifs:
ipdb.create(ifname=name, kind="bridge").commit()
with IPDB() as ipdb:
for name in ifs:
ipdb.interfaces[name].remove().commit()
class TestNetNS(object):
def test_fd_leaks(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment