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) )
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
def unshare_replica(mayastor_instance, replica_uuid): mayastor_instance.ms.ShareReplica( pb.ShareReplicaRequest(uuid=replica_uuid, share=pb.REPLICA_NONE) )
def share_replica(mayastor_instance, replica_uuid, share): mayastor_instance.ms.ShareReplica( pb.ShareReplicaRequest(uuid=replica_uuid, share=share_protocol(share)) )
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