def test_tap_persistent(): name = b'test_tap' t1 = tap.Tap(name) t1.persist() t1.close() assert ifconfig.findif(name, physical=False) is not None t2 = tap.Tap(name) t2.unpersist() t2.close() assert ifconfig.findif(name, physical=False) is None
def test_findif(if1, if2): for i in [if1, if2]: i2 = ifconfig.findif(i.name) assert i2 is not None assert i2.name == i.name
def test_tap_close(): t = tap.Tap() t.close() assert ifconfig.findif(t.name, physical=False) is None
def test_tap_create(): t = tap.Tap() assert ifconfig.findif(t.name, physical=False) is not None assert t.fd assert t.name