コード例 #1
0
def test_rename_router(hypervisor):

    router = Router(hypervisor, "my router to rename")
    assert router.name == "my router to rename"
    router.name = "my_router"
    assert router.name == "my_router"
    router.delete()
コード例 #2
0
ファイル: test_router.py プロジェクト: grossmj/gns3-server
def test_rename_router(hypervisor):

    router = Router(hypervisor, "my router to rename")
    assert router.name == "my router to rename"
    router.name = "my_router"
    assert router.name == "my_router"
    router.delete()
コード例 #3
0
def test_unallocate_hypervisor_for_router(hypervisor_manager):

    assert len(hypervisor_manager.hypervisors) == 2
    hypervisor = hypervisor_manager.hypervisors[0]
    assert hypervisor.memory_load == 768
    router = Router(hypervisor, "router", "c3725")  # default is 128MB of RAM
    hypervisor_manager.unallocate_hypervisor_for_router(router)
    assert hypervisor.memory_load == 640
    hypervisor.decrease_memory_load(512)  # forces memory load down to 128
    assert hypervisor.memory_load == 128
    router.delete()
    hypervisor_manager.unallocate_hypervisor_for_router(router)
    # router is deleted and memory load to 0 now, one hypervisor must
    # have been shutdown
    assert len(hypervisor_manager.hypervisors) == 1
コード例 #4
0
def test_unallocate_hypervisor_for_router(hypervisor_manager):

    assert len(hypervisor_manager.hypervisors) == 2
    hypervisor = hypervisor_manager.hypervisors[0]
    assert hypervisor.memory_load == 768
    router = Router(hypervisor, "router", "c3725")  # default is 128MB of RAM
    hypervisor_manager.unallocate_hypervisor_for_router(router)
    assert hypervisor.memory_load == 640
    hypervisor.decrease_memory_load(512)  # forces memory load down to 128
    assert hypervisor.memory_load == 128
    router.delete()
    hypervisor_manager.unallocate_hypervisor_for_router(router)
    # router is deleted and memory load to 0 now, one hypervisor must
    # have been shutdown
    assert len(hypervisor_manager.hypervisors) == 1
コード例 #5
0
def test_create_and_delete_router(hypervisor):

    router = Router(hypervisor, "test my router")
    assert router.id >= 0
    assert router.name == "test my router"
    assert router.platform == "c7200"  # default platform
    assert not router.is_running()
    router.delete()
    with pytest.raises(DynamipsError):
        router.get_status()
コード例 #6
0
ファイル: test_router.py プロジェクト: grossmj/gns3-server
def test_create_and_delete_router(hypervisor):

    router = Router(hypervisor, "test my router")
    assert router.id >= 0
    assert router.name == "test my router"
    assert router.platform == "c7200"  # default platform
    assert not router.is_running()
    router.delete()
    with pytest.raises(DynamipsError):
        router.get_status()
コード例 #7
0
def router(request, hypervisor):

    router = Router(hypervisor, "router", platform="c3725")
    request.addfinalizer(router.delete)
    return router