Example #1
0
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
Example #2
0
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
Example #3
0
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
Example #4
0
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
Example #5
0
def test_tap_close():
    t = tap.Tap()
    t.close()
    assert ifconfig.findif(t.name, physical=False) is None
Example #6
0
def test_tap_create():
    t = tap.Tap()
    assert ifconfig.findif(t.name, physical=False) is not None
    assert t.fd
    assert t.name
Example #7
0
def test_tap_close():
    t = tap.Tap()
    t.close()
    assert ifconfig.findif(t.name, physical=False) is None
Example #8
0
def test_tap_create():
    t = tap.Tap()
    assert ifconfig.findif(t.name, physical=False) is not None
    assert t.fd
    assert t.name