コード例 #1
0
def test_findif_existent(br1, br2):
    br1.addif(b'eth1')
    br2.addif(b'eth2')

    res = brctl.findif(b'eth1')
    assert res is not None
    assert res.name == br1.name

    res = brctl.findif(b'eth2')
    assert res is not None
    assert res.name == br2.name
コード例 #2
0
def test_findif_nonexistent(br1, br2):
    br1.addif(b'eth1')
    br2.addif(b'eth2')
    res = brctl.findif(b'foobar')
    assert res is None