Beispiel #1
0
def grpc_controller_client(request,
                           engine_name,
                           volume_name,
                           frontend=FRONTEND_TGT_BLOCKDEV):
    em_client = engine_manager_client(request)
    e = create_engine_process(em_client,
                              name=engine_name,
                              volume_name=volume_name,
                              frontend=frontend)

    return ControllerClient(e.spec.listen)
Beispiel #2
0
def grpc_controller_client(request):
    em_client = engine_manager_client(request)
    e = create_engine_process(em_client)

    return ControllerClient(e.spec.listen)
Beispiel #3
0
def grpc_controller_no_frontend_client(request):
    c = ControllerClient(GRPC_CONTROLLER_NO_FRONTEND)
    request.addfinalizer(lambda: cleanup_controller(c))
    return cleanup_controller(c)
Beispiel #4
0
def grpc_controller_client(request):
    c = ControllerClient(GRPC_CONTROLLER)
    request.addfinalizer(lambda: cleanup_controller(c))
    return cleanup_controller(c)
Beispiel #5
0
def test_port_update():
    grpc_client = ControllerClient(GRPC_CONTROLLER)
    v = grpc_client.volume_get()
    assert v.replicaCount == 0

    addresses = ['file://' + random_str(), 'file://' + random_str()]
    v = grpc_client.volume_start(replicas=addresses)
    assert v.replicaCount == 2

    new_url = "localhost:9505"
    new_port = 9505
    grpc_client.port_update(new_port)

    new_grpc_client = ControllerClient(new_url)
    v = new_grpc_client.volume_get()
    assert v.replicaCount == 2

    cleanup(new_grpc_client)
    old_port = 9501
    new_grpc_client.port_update(old_port)