Example #1
0
def share_replica_with_the_same_protocol(
    mayastor_instance, current_replicas, replica_uuid
):
    replica = current_replicas[replica_uuid]
    mayastor_instance.ms.ShareReplica(
        pb.ShareReplicaRequest(uuid=replica.uuid, share=replica.share)
    )
Example #2
0
def attempt_to_share_replica_with_different_protocol(
    mayastor_instance, current_replicas, replica_uuid
):
    replica = current_replicas[replica_uuid]
    share = pb.REPLICA_ISCSI if replica.share == pb.REPLICA_NVMF else pb.REPLICA_NVMF
    with pytest.raises(grpc.RpcError) as error:
        mayastor_instance.ms.ShareReplica(
            pb.ShareReplicaRequest(uuid=replica.uuid, share=share)
        )
    assert error.value.code() == grpc.StatusCode.INTERNAL
Example #3
0
def unshare_replica(mayastor_instance, replica_uuid):
    mayastor_instance.ms.ShareReplica(
        pb.ShareReplicaRequest(uuid=replica_uuid, share=pb.REPLICA_NONE)
    )
Example #4
0
def share_replica(mayastor_instance, replica_uuid, share):
    mayastor_instance.ms.ShareReplica(
        pb.ShareReplicaRequest(uuid=replica_uuid, share=share_protocol(share))
    )
Example #5
0
def attempt_to_share_replica_over_iscsi(mayastor_instance, replica_uuid):
    with pytest.raises(grpc.RpcError) as error:
        mayastor_instance.ms.ShareReplica(
            pb.ShareReplicaRequest(uuid=replica_uuid, share=pb.REPLICA_ISCSI)
        )
    assert error.value.code() == grpc.StatusCode.INTERNAL