Beispiel #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()
Beispiel #2
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()
Beispiel #3
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()
Beispiel #4
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()
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
Beispiel #6
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