2013-12-22 00:42:33 +00:00
|
|
|
from gns3server.modules.dynamips import Bridge
|
|
|
|
from gns3server.modules.dynamips import NIO_Null
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def bridge(request, hypervisor):
|
|
|
|
|
|
|
|
bridge = Bridge(hypervisor, "bridge")
|
|
|
|
request.addfinalizer(bridge.delete)
|
|
|
|
return bridge
|
|
|
|
|
|
|
|
|
|
|
|
def test_bridge_exists(bridge):
|
|
|
|
|
|
|
|
assert bridge.list()
|
|
|
|
|
|
|
|
|
|
|
|
def test_rename_bridge(bridge):
|
|
|
|
|
2014-02-05 22:45:33 +00:00
|
|
|
bridge.name = "new bridge"
|
2013-12-22 00:42:33 +00:00
|
|
|
assert bridge.name == "new bridge"
|
|
|
|
|
|
|
|
|
|
|
|
def test_add_remove_nio(bridge):
|
|
|
|
|
|
|
|
nio = NIO_Null(bridge.hypervisor)
|
|
|
|
bridge.add_nio(nio)
|
|
|
|
assert bridge.nios
|
|
|
|
bridge.remove_nio(nio)
|
|
|
|
nio.delete()
|