From 2c4bafe48ffa241b13cb21ed3dff606aa7aa2715 Mon Sep 17 00:00:00 2001 From: Mark Sanders Date: Thu, 18 Jan 2024 16:03:43 -0500 Subject: [PATCH 1/6] fix(deps): update opi-api digest and api changes Signed-off-by: Mark Sanders --- cmd/main.go | 6 +++--- go.mod | 2 +- go.sum | 7 +++++-- pkg/backend/null.go | 5 ++--- pkg/backend/null_test.go | 15 +++++++-------- pkg/backend/nvme_path.go | 2 +- pkg/backend/nvme_path_validate.go | 6 +++--- pkg/frontend/frontend.go | 2 +- pkg/frontend/nvme_controller_validate.go | 6 +++--- pkg/frontend/nvme_namespace_test.go | 7 +++---- pkg/kvm/nvme.go | 4 ++-- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 02de2904..2cd31457 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -147,8 +147,8 @@ func runGrpcServer(grpcPort int, useKvm bool, store gokv.Store, spdkAddress, qmp frontendServer := frontend.NewCustomizedServer(jsonRPC, store, map[pb.NvmeTransportType]frontend.NvmeTransport{ - pb.NvmeTransportType_NVME_TRANSPORT_TCP: frontend.NewNvmeTCPTransport(jsonRPC), - pb.NvmeTransportType_NVME_TRANSPORT_PCIE: kvm.NewNvmeVfiouserTransport(ctrlrDir, jsonRPC), + pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP: frontend.NewNvmeTCPTransport(jsonRPC), + pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE: kvm.NewNvmeVfiouserTransport(ctrlrDir, jsonRPC), }, frontend.NewVhostUserBlkTransport(), ) @@ -161,7 +161,7 @@ func runGrpcServer(grpcPort int, useKvm bool, store gokv.Store, spdkAddress, qmp frontendServer := frontend.NewCustomizedServer(jsonRPC, store, map[pb.NvmeTransportType]frontend.NvmeTransport{ - pb.NvmeTransportType_NVME_TRANSPORT_TCP: frontend.NewNvmeTCPTransport(jsonRPC), + pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP: frontend.NewNvmeTCPTransport(jsonRPC), }, frontend.NewVhostUserBlkTransport(), ) diff --git a/go.mod b/go.mod index 0fc75fa4..2e225299 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 github.com/onsi/ginkgo/v2 v2.14.0 github.com/opiproject/gospdk v0.0.0-20240108075015-92d689fff706 - github.com/opiproject/opi-api v0.0.0-20231211154947-aee3998dd0c2 + github.com/opiproject/opi-api v0.0.0-20240118183513-e44db269fba4 github.com/philippgille/gokv v0.6.0 github.com/philippgille/gokv/gomap v0.6.0 github.com/philippgille/gokv/redis v0.6.0 diff --git a/go.sum b/go.sum index 954a91d3..65b26c58 100644 --- a/go.sum +++ b/go.sum @@ -80,11 +80,13 @@ github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pO github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -451,8 +453,8 @@ github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= github.com/opiproject/gospdk v0.0.0-20240108075015-92d689fff706 h1:fZcUuXgfsfWIbSZTPCJG72wh7LyKIyrpPR9kH+rKEXI= github.com/opiproject/gospdk v0.0.0-20240108075015-92d689fff706/go.mod h1:9CMbTd9ptR6tl6HRRn8C33DPeWF85hTo4KZCa5iKftY= -github.com/opiproject/opi-api v0.0.0-20231211154947-aee3998dd0c2 h1:sWvDPuYS6Kbke3k5rpD46kHhGx//rBKMw3Z1/mDZxdk= -github.com/opiproject/opi-api v0.0.0-20231211154947-aee3998dd0c2/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY= +github.com/opiproject/opi-api v0.0.0-20240118183513-e44db269fba4 h1:YBjvYWQQAbNIGsAXvB6FwL9Encr1nzo3/w+bB/tXltM= +github.com/opiproject/opi-api v0.0.0-20240118183513-e44db269fba4/go.mod h1:92pv4ulvvPMuxCJ9ND3aYbmBfEMLx0VCjpkiR7ZTqPY= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.11.0 h1:OKBD80J/mLBrwnzXqGtFCzprFSGioo30JcmR4APsNwc= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= @@ -513,6 +515,7 @@ github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= diff --git a/pkg/backend/null.go b/pkg/backend/null.go index ab9af7da..72cf017c 100644 --- a/pkg/backend/null.go +++ b/pkg/backend/null.go @@ -13,7 +13,6 @@ import ( "sort" "github.com/opiproject/gospdk/spdk" - pc "github.com/opiproject/opi-api/common/v1/gen/go" pb "github.com/opiproject/opi-api/storage/v1alpha1/gen/go" "github.com/opiproject/opi-spdk-bridge/pkg/utils" @@ -203,7 +202,7 @@ func (s *Server) ListNullVolumes(ctx context.Context, in *pb.ListNullVolumesRequ Blobarray := make([]*pb.NullVolume, len(result)) for i := range result { r := &result[i] - Blobarray[i] = &pb.NullVolume{Name: r.Name, Uuid: &pc.Uuid{Value: r.UUID}, BlockSize: r.BlockSize, BlocksCount: r.NumBlocks} + Blobarray[i] = &pb.NullVolume{Name: r.Name, Uuid: r.UUID, BlockSize: r.BlockSize, BlocksCount: r.NumBlocks} } sortNullVolumes(Blobarray) return &pb.ListNullVolumesResponse{NullVolumes: Blobarray, NextPageToken: token}, nil @@ -235,7 +234,7 @@ func (s *Server) GetNullVolume(ctx context.Context, in *pb.GetNullVolumeRequest) msg := fmt.Sprintf("expecting exactly 1 result, got %d", len(result)) return nil, status.Errorf(codes.InvalidArgument, msg) } - return &pb.NullVolume{Name: result[0].Name, Uuid: &pc.Uuid{Value: result[0].UUID}, BlockSize: result[0].BlockSize, BlocksCount: result[0].NumBlocks}, nil + return &pb.NullVolume{Name: result[0].Name, Uuid: result[0].UUID, BlockSize: result[0].BlockSize, BlocksCount: result[0].NumBlocks}, nil } // StatsNullVolume gets a Null volume instance stats diff --git a/pkg/backend/null_test.go b/pkg/backend/null_test.go index c73cafc6..cd847ab7 100644 --- a/pkg/backend/null_test.go +++ b/pkg/backend/null_test.go @@ -17,7 +17,6 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - pc "github.com/opiproject/opi-api/common/v1/gen/go" pb "github.com/opiproject/opi-api/storage/v1alpha1/gen/go" "github.com/opiproject/opi-spdk-bridge/pkg/utils" ) @@ -393,13 +392,13 @@ func TestBackEnd_ListNullVolumes(t *testing.T) { out: []*pb.NullVolume{ { Name: "Malloc0", - Uuid: &pc.Uuid{Value: "11d3902e-d9bb-49a7-bb27-cd7261ef3217"}, + Uuid: "11d3902e-d9bb-49a7-bb27-cd7261ef3217", BlockSize: 512, BlocksCount: 131072, }, { Name: "Malloc1", - Uuid: &pc.Uuid{Value: "88112c76-8c49-4395-955a-0d695b1d2099"}, + Uuid: "88112c76-8c49-4395-955a-0d695b1d2099", BlockSize: 512, BlocksCount: 131072, }, @@ -418,13 +417,13 @@ func TestBackEnd_ListNullVolumes(t *testing.T) { out: []*pb.NullVolume{ { Name: "Malloc0", - Uuid: &pc.Uuid{Value: "11d3902e-d9bb-49a7-bb27-cd7261ef3217"}, + Uuid: "11d3902e-d9bb-49a7-bb27-cd7261ef3217", BlockSize: 512, BlocksCount: 131072, }, { Name: "Malloc1", - Uuid: &pc.Uuid{Value: "88112c76-8c49-4395-955a-0d695b1d2099"}, + Uuid: "88112c76-8c49-4395-955a-0d695b1d2099", BlockSize: 512, BlocksCount: 131072, }, @@ -458,7 +457,7 @@ func TestBackEnd_ListNullVolumes(t *testing.T) { out: []*pb.NullVolume{ { Name: "Malloc0", - Uuid: &pc.Uuid{Value: "11d3902e-d9bb-49a7-bb27-cd7261ef3217"}, + Uuid: "11d3902e-d9bb-49a7-bb27-cd7261ef3217", BlockSize: 512, BlocksCount: 131072, }, @@ -474,7 +473,7 @@ func TestBackEnd_ListNullVolumes(t *testing.T) { out: []*pb.NullVolume{ { Name: "Malloc1", - Uuid: &pc.Uuid{Value: "88112c76-8c49-4395-955a-0d695b1d2099"}, + Uuid: "88112c76-8c49-4395-955a-0d695b1d2099", BlockSize: 512, BlocksCount: 131072, }, @@ -577,7 +576,7 @@ func TestBackEnd_GetNullVolume(t *testing.T) { in: testNullVolumeName, out: &pb.NullVolume{ Name: "Malloc1", - Uuid: &pc.Uuid{Value: "88112c76-8c49-4395-955a-0d695b1d2099"}, + Uuid: "88112c76-8c49-4395-955a-0d695b1d2099", BlockSize: 512, BlocksCount: 131072, }, diff --git a/pkg/backend/nvme_path.go b/pkg/backend/nvme_path.go index 6db6e0e5..36e26ddf 100644 --- a/pkg/backend/nvme_path.go +++ b/pkg/backend/nvme_path.go @@ -63,7 +63,7 @@ func (s *Server) CreateNvmePath(ctx context.Context, in *pb.CreateNvmePathReques } // TODO: consider moving to _validate.go - if in.NvmePath.Trtype == pb.NvmeTransportType_NVME_TRANSPORT_PCIE && controller.Tcp != nil { + if in.NvmePath.Trtype == pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE && controller.Tcp != nil { err := status.Errorf(codes.FailedPrecondition, "pcie transport on tcp controller is not allowed") return nil, err } diff --git a/pkg/backend/nvme_path_validate.go b/pkg/backend/nvme_path_validate.go index ba71497c..d4711608 100644 --- a/pkg/backend/nvme_path_validate.go +++ b/pkg/backend/nvme_path_validate.go @@ -32,14 +32,14 @@ func (s *Server) validateCreateNvmePathRequest(in *pb.CreateNvmePathRequest) err } // validate Fabrics and Type coordinated switch in.NvmePath.Trtype { - case pb.NvmeTransportType_NVME_TRANSPORT_PCIE: + case pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE: if in.NvmePath.Fabrics != nil { err := status.Errorf(codes.InvalidArgument, "fabrics field is not allowed for pcie transport") return err } - case pb.NvmeTransportType_NVME_TRANSPORT_TCP: + case pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP: fallthrough - case pb.NvmeTransportType_NVME_TRANSPORT_RDMA: + case pb.NvmeTransportType_NVME_TRANSPORT_TYPE_RDMA: if in.NvmePath.Fabrics == nil { err := status.Errorf(codes.InvalidArgument, "missing required field for fabrics transports: fabrics") return err diff --git a/pkg/frontend/frontend.go b/pkg/frontend/frontend.go index 53c848d5..7c09b3c8 100644 --- a/pkg/frontend/frontend.go +++ b/pkg/frontend/frontend.go @@ -63,7 +63,7 @@ func NewServer(jsonRPC spdk.JSONRPC, store gokv.Store) *Server { Controllers: make(map[string]*pb.NvmeController), Namespaces: make(map[string]*pb.NvmeNamespace), transports: map[pb.NvmeTransportType]NvmeTransport{ - pb.NvmeTransportType_NVME_TRANSPORT_TCP: NewNvmeTCPTransport(jsonRPC), + pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP: NewNvmeTCPTransport(jsonRPC), }, }, Virt: VirtioParameters{ diff --git a/pkg/frontend/nvme_controller_validate.go b/pkg/frontend/nvme_controller_validate.go index e7defb87..7425d257 100644 --- a/pkg/frontend/nvme_controller_validate.go +++ b/pkg/frontend/nvme_controller_validate.go @@ -28,13 +28,13 @@ func (s *Server) validateCreateNvmeControllerRequest(in *pb.CreateNvmeController } switch in.NvmeController.Spec.Trtype { - case pb.NvmeTransportType_NVME_TRANSPORT_PCIE: + case pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE: if _, ok := in.NvmeController.Spec.Endpoint.(*pb.NvmeControllerSpec_PcieId); !ok { return errors.New("invalid endpoint type passed for transport") } - case pb.NvmeTransportType_NVME_TRANSPORT_TCP: + case pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP: fallthrough - case pb.NvmeTransportType_NVME_TRANSPORT_RDMA: + case pb.NvmeTransportType_NVME_TRANSPORT_TYPE_RDMA: if _, ok := in.NvmeController.Spec.Endpoint.(*pb.NvmeControllerSpec_FabricsId); !ok { return errors.New("invalid endpoint type passed for transport") } diff --git a/pkg/frontend/nvme_namespace_test.go b/pkg/frontend/nvme_namespace_test.go index 1856c496..b085510f 100644 --- a/pkg/frontend/nvme_namespace_test.go +++ b/pkg/frontend/nvme_namespace_test.go @@ -17,7 +17,6 @@ import ( "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/fieldmaskpb" - pc "github.com/opiproject/opi-api/common/v1/gen/go" pb "github.com/opiproject/opi-api/storage/v1alpha1/gen/go" "github.com/opiproject/opi-spdk-bridge/pkg/utils" ) @@ -40,14 +39,14 @@ func TestFrontEnd_CreateNvmeNamespace(t *testing.T) { spec := &pb.NvmeNamespaceSpec{ HostNsid: 0, VolumeNameRef: "Malloc1", - Uuid: &pc.Uuid{Value: "1b4e28ba-2fa1-11d2-883f-b9a761bde3fb"}, + Uuid: "1b4e28ba-2fa1-11d2-883f-b9a761bde3fb", Nguid: "1b4e28ba-2fa1-11d2-883f-b9a761bde3fb", Eui64: 1967554867335598546, } namespaceSpec := &pb.NvmeNamespaceSpec{ HostNsid: 22, VolumeNameRef: "Malloc1", - Uuid: &pc.Uuid{Value: "1b4e28ba-2fa1-11d2-883f-b9a761bde3fb"}, + Uuid: "1b4e28ba-2fa1-11d2-883f-b9a761bde3fb", Nguid: "1b4e28ba-2fa1-11d2-883f-b9a761bde3fb", Eui64: 1967554867335598546, } @@ -376,7 +375,7 @@ func TestFrontEnd_UpdateNvmeNamespace(t *testing.T) { spec := &pb.NvmeNamespaceSpec{ HostNsid: 22, VolumeNameRef: "Malloc1", - Uuid: &pc.Uuid{Value: "1b4e28ba-2fa1-11d2-883f-b9a761bde3fb"}, + Uuid: "1b4e28ba-2fa1-11d2-883f-b9a761bde3fb", Nguid: "1b4e28ba-2fa1-11d2-883f-b9a761bde3fb", Eui64: 1967554867335598546, } diff --git a/pkg/kvm/nvme.go b/pkg/kvm/nvme.go index 526fde78..c84de77d 100644 --- a/pkg/kvm/nvme.go +++ b/pkg/kvm/nvme.go @@ -19,7 +19,7 @@ import ( // CreateNvmeController creates an Nvme controller device and attaches it to QEMU instance func (s *Server) CreateNvmeController(ctx context.Context, in *pb.CreateNvmeControllerRequest) (*pb.NvmeController, error) { - if in.GetNvmeController().GetSpec().GetTrtype() != pb.NvmeTransportType_NVME_TRANSPORT_PCIE { + if in.GetNvmeController().GetSpec().GetTrtype() != pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE { return s.Server.CreateNvmeController(ctx, in) } @@ -80,7 +80,7 @@ func (s *Server) CreateNvmeController(ctx context.Context, in *pb.CreateNvmeCont // DeleteNvmeController deletes an Nvme controller device and detaches it from QEMU instance func (s *Server) DeleteNvmeController(ctx context.Context, in *pb.DeleteNvmeControllerRequest) (*emptypb.Empty, error) { controller, ok := s.Nvme.Controllers[in.GetName()] - if !ok || controller.GetSpec().GetTrtype() != pb.NvmeTransportType_NVME_TRANSPORT_PCIE { + if !ok || controller.GetSpec().GetTrtype() != pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE { return s.Server.DeleteNvmeController(ctx, in) } From 44968b359c21122b53dc4b499d6f7a8001efbacc Mon Sep 17 00:00:00 2001 From: Mark Sanders Date: Thu, 18 Jan 2024 17:25:14 -0500 Subject: [PATCH 2/6] fix(api): update tests for api changes Signed-off-by: Mark Sanders --- cmd/main.go | 2 +- pkg/backend/aio_test.go | 4 +- pkg/backend/null.go | 2 +- pkg/backend/null_test.go | 4 +- pkg/backend/nvme_path.go | 2 +- pkg/backend/nvme_path_test.go | 36 +++++++++--------- pkg/backend/nvme_path_validate.go | 2 +- pkg/frontend/blk_test.go | 4 +- pkg/frontend/frontend.go | 2 +- pkg/frontend/frontend_test.go | 6 +-- pkg/frontend/nvme_controller_test.go | 48 ++++++++++++------------ pkg/frontend/nvme_controller_validate.go | 2 +- pkg/frontend/nvme_namespace_test.go | 2 +- pkg/kvm/nvme.go | 1 + pkg/kvm/nvme_test.go | 17 +++++---- pkg/kvm/transport_test.go | 3 +- 16 files changed, 70 insertions(+), 67 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 2cd31457..a2030e4a 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Copyright (C) 2023 Intel Corporation package main diff --git a/pkg/backend/aio_test.go b/pkg/backend/aio_test.go index 9a3eeb34..1a94cf3a 100644 --- a/pkg/backend/aio_test.go +++ b/pkg/backend/aio_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Copyright (C) 2023 Intel Corporation // Package backend implememnts the BackEnd APIs (network facing) of the storage Server @@ -498,7 +498,7 @@ func TestBackEnd_ListAioVolumes(t *testing.T) { testEnv.opiSpdkServer.Pagination["existing-pagination-token"] = 1 - request := &pb.ListAioVolumesRequest{Parent: tt.in, PageSize: tt.size, PageToken: tt.token} + request := &pb.ListAioVolumesRequest{PageSize: tt.size, PageToken: tt.token} response, err := testEnv.client.ListAioVolumes(testEnv.ctx, request) if !utils.EqualProtoSlices(response.GetAioVolumes(), tt.out) { diff --git a/pkg/backend/null.go b/pkg/backend/null.go index 72cf017c..8f6cb0e8 100644 --- a/pkg/backend/null.go +++ b/pkg/backend/null.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Copyright (C) 2023 Intel Corporation // Package backend implememnts the BackEnd APIs (network facing) of the storage Server diff --git a/pkg/backend/null_test.go b/pkg/backend/null_test.go index cd847ab7..f81a7970 100644 --- a/pkg/backend/null_test.go +++ b/pkg/backend/null_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Copyright (C) 2023 Intel Corporation // Package backend implememnts the BackEnd APIs (network facing) of the storage Server @@ -503,7 +503,7 @@ func TestBackEnd_ListNullVolumes(t *testing.T) { testEnv.opiSpdkServer.Pagination["existing-pagination-token"] = 1 - request := &pb.ListNullVolumesRequest{Parent: tt.in, PageSize: tt.size, PageToken: tt.token} + request := &pb.ListNullVolumesRequest{PageSize: tt.size, PageToken: tt.token} response, err := testEnv.client.ListNullVolumes(testEnv.ctx, request) if !utils.EqualProtoSlices(response.GetNullVolumes(), tt.out) { diff --git a/pkg/backend/nvme_path.go b/pkg/backend/nvme_path.go index 36e26ddf..e17f8709 100644 --- a/pkg/backend/nvme_path.go +++ b/pkg/backend/nvme_path.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Copyright (C) 2023 Intel Corporation // Package backend implements the BackEnd APIs (network facing) of the storage Server diff --git a/pkg/backend/nvme_path_test.go b/pkg/backend/nvme_path_test.go index d5d6181d..e14bb5e5 100644 --- a/pkg/backend/nvme_path_test.go +++ b/pkg/backend/nvme_path_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Copyright (C) 2023 Intel Corporation // Package backend implememnts the BackEnd APIs (network facing) of the storage Server @@ -28,7 +28,7 @@ var ( testNvmePathID = "mytest" testNvmePathName = utils.ResourceIDToNvmePathName(testNvmeCtrlID, testNvmePathID) testNvmePath = pb.NvmePath{ - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, Traddr: "127.0.0.1", Fabrics: &pb.FabricsPath{ Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, @@ -156,12 +156,12 @@ func TestBackEnd_CreateNvmePath(t *testing.T) { "valid request with valid SPDK response for pcie": { id: testNvmePathID, in: &pb.NvmePath{ - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, Traddr: "0000:af:00.0", }, out: &pb.NvmePath{ Name: testNvmePathName, - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, Traddr: "0000:af:00.0", }, spdk: []string{`{"id":%d,"error":{"code":0,"message":""},"result":["mytest"]}`}, @@ -197,7 +197,7 @@ func TestBackEnd_CreateNvmePath(t *testing.T) { "tcp transport type missing fabrics": { id: testAioVolumeID, in: &pb.NvmePath{ - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, Traddr: "127.0.0.1", Fabrics: nil, }, @@ -211,7 +211,7 @@ func TestBackEnd_CreateNvmePath(t *testing.T) { "pcie transport type with specified fabrics message": { id: testAioVolumeID, in: &pb.NvmePath{ - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, Traddr: "0000:af:00.0", Fabrics: testNvmePath.Fabrics, }, @@ -225,7 +225,7 @@ func TestBackEnd_CreateNvmePath(t *testing.T) { "pcie transport type with specified tcp controller": { id: testAioVolumeID, in: &pb.NvmePath{ - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, Traddr: "0000:af:00.0", Fabrics: nil, }, @@ -239,13 +239,13 @@ func TestBackEnd_CreateNvmePath(t *testing.T) { "not supported transport type": { id: testNvmePathID, in: &pb.NvmePath{ - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_CUSTOM, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_CUSTOM, Traddr: testNvmePath.Traddr, }, out: nil, spdk: []string{}, errCode: codes.InvalidArgument, - errMsg: fmt.Sprintf("not supported transport type: %v", pb.NvmeTransportType_NVME_TRANSPORT_CUSTOM), + errMsg: fmt.Sprintf("not supported transport type: %v", pb.NvmeTransportType_NVME_TRANSPORT_TYPE_CUSTOM), exist: false, controller: &testNvmeCtrlWithName, }, @@ -536,7 +536,7 @@ func TestBackEnd_UpdateNvmePath(t *testing.T) { mask: nil, in: &pb.NvmePath{ Name: utils.ResourceIDToNvmePathName(testNvmeCtrlID, "unknown-id"), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, Traddr: "127.0.0.1", Fabrics: &pb.FabricsPath{ Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, @@ -554,7 +554,7 @@ func TestBackEnd_UpdateNvmePath(t *testing.T) { mask: nil, in: &pb.NvmePath{ Name: utils.ResourceIDToNvmePathName(testNvmeCtrlID, "unknown-id"), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, Traddr: "127.0.0.1", Fabrics: &pb.FabricsPath{ Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, @@ -673,14 +673,14 @@ func TestBackEnd_ListNvmePaths(t *testing.T) { // out: []*pb.NvmePath{ // { // Name: "Malloc0", - // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, // }, // { // Name: "Malloc1", - // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, @@ -700,14 +700,14 @@ func TestBackEnd_ListNvmePaths(t *testing.T) { // out: []*pb.NvmePath{ // { // Name: "Malloc0", - // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, // }, // { // Name: "Malloc1", - // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, @@ -742,7 +742,7 @@ func TestBackEnd_ListNvmePaths(t *testing.T) { // out: []*pb.NvmePath{ // { // Name: "Malloc0", - // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, @@ -759,7 +759,7 @@ func TestBackEnd_ListNvmePaths(t *testing.T) { // out: []*pb.NvmePath{ // { // Name: "Malloc1", - // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, @@ -864,7 +864,7 @@ func TestBackEnd_GetNvmePath(t *testing.T) { // in: testNvmePathName, // out: &pb.NvmePath{ // Name: "Malloc1", - // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, diff --git a/pkg/backend/nvme_path_validate.go b/pkg/backend/nvme_path_validate.go index d4711608..330e4a2f 100644 --- a/pkg/backend/nvme_path_validate.go +++ b/pkg/backend/nvme_path_validate.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Package backend implememnts the BackEnd APIs (network facing) of the storage Server package backend diff --git a/pkg/frontend/blk_test.go b/pkg/frontend/blk_test.go index e3722b6c..a1daab4e 100644 --- a/pkg/frontend/blk_test.go +++ b/pkg/frontend/blk_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Copyright (C) 2023 Intel Corporation // Package frontend implements the FrontEnd APIs (host facing) of the storage Server @@ -445,7 +445,7 @@ func TestFrontEnd_ListVirtioBlks(t *testing.T) { testEnv.opiSpdkServer.Pagination["existing-pagination-token"] = 1 - request := &pb.ListVirtioBlksRequest{Parent: tt.in, PageSize: tt.size, PageToken: tt.token} + request := &pb.ListVirtioBlksRequest{PageSize: tt.size, PageToken: tt.token} response, err := testEnv.client.ListVirtioBlks(testEnv.ctx, request) if !utils.EqualProtoSlices(response.GetVirtioBlks(), tt.out) { diff --git a/pkg/frontend/frontend.go b/pkg/frontend/frontend.go index 7c09b3c8..15003870 100644 --- a/pkg/frontend/frontend.go +++ b/pkg/frontend/frontend.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Copyright (C) 2023 Intel Corporation // Package frontend implements the FrontEnd APIs (host facing) of the storage Server diff --git a/pkg/frontend/frontend_test.go b/pkg/frontend/frontend_test.go index ce0b3fcb..13a2a363 100644 --- a/pkg/frontend/frontend_test.go +++ b/pkg/frontend/frontend_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Copyright (C) 2023 Intel Corporation // Package frontend implements the FrontEnd APIs (host facing) of the storage Server @@ -106,7 +106,7 @@ func dialer(opiSpdkServer *Server) func(context.Context, string) (net.Conn, erro func TestFrontEnd_NewCustomizedServer(t *testing.T) { validJSONRPC := spdk.NewClient("/some/path") validNvmeTransports := map[pb.NvmeTransportType]NvmeTransport{ - pb.NvmeTransportType_NVME_TRANSPORT_TCP: NewNvmeTCPTransport(validJSONRPC), + pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP: NewNvmeTCPTransport(validJSONRPC), } validVirtioBLkTransport := NewVhostUserBlkTransport() validStore := gomap.NewStore(gomap.DefaultOptions) @@ -136,7 +136,7 @@ func TestFrontEnd_NewCustomizedServer(t *testing.T) { jsonRPC: validJSONRPC, store: validStore, nvmeTransports: map[pb.NvmeTransportType]NvmeTransport{ - pb.NvmeTransportType_NVME_TRANSPORT_TCP: nil, + pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP: nil, }, virtioBlkTransport: validVirtioBLkTransport, wantPanic: true, diff --git a/pkg/frontend/nvme_controller_test.go b/pkg/frontend/nvme_controller_test.go index 1bba3c19..5803a821 100644 --- a/pkg/frontend/nvme_controller_test.go +++ b/pkg/frontend/nvme_controller_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Copyright (C) 2023 Intel Corporation // Package frontend implememnts the FrontEnd APIs (host facing) of the storage Server @@ -34,7 +34,7 @@ var ( Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, }, }, - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, NvmeControllerId: proto.Int32(17), }, Status: &pb.NvmeControllerStatus{ @@ -61,7 +61,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(1), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, }, nil, @@ -77,7 +77,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(1), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, }, nil, @@ -93,7 +93,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(1), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, }, nil, @@ -109,7 +109,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(1), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, }, nil, @@ -125,7 +125,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(1), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, }, nil, @@ -141,7 +141,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(17), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, }, &pb.NvmeController{ @@ -149,7 +149,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(-1), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, Status: &pb.NvmeControllerStatus{ Active: true, @@ -167,7 +167,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(17), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, }, &testController, @@ -183,7 +183,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(1), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, }, nil, @@ -208,7 +208,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { &pb.NvmeController{ Spec: &pb.NvmeControllerSpec{ NvmeControllerId: proto.Int32(1), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, }, nil, @@ -229,7 +229,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, }, }, - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, }, }, nil, @@ -250,7 +250,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { VirtualFunction: wrapperspb.Int32(0), }, }, - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, }, nil, @@ -271,13 +271,13 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { VirtualFunction: wrapperspb.Int32(0), }, }, - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_CUSTOM, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_CUSTOM, }, }, nil, []string{}, codes.Unknown, - fmt.Sprintf("not supported transport type: %v", pb.NvmeTransportType_NVME_TRANSPORT_CUSTOM), + fmt.Sprintf("not supported transport type: %v", pb.NvmeTransportType_NVME_TRANSPORT_TYPE_CUSTOM), false, testSubsystemName, }, @@ -292,13 +292,13 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { VirtualFunction: wrapperspb.Int32(0), }, }, - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, }, }, nil, []string{}, codes.NotFound, - fmt.Sprintf("handler for transport type %v is not registered", pb.NvmeTransportType_NVME_TRANSPORT_PCIE), + fmt.Sprintf("handler for transport type %v is not registered", pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE), false, testSubsystemName, }, @@ -439,7 +439,7 @@ func TestFrontEnd_DeleteNvmeController(t *testing.T) { &emptypb.Empty{}, []string{}, codes.NotFound, - fmt.Sprintf("handler for transport type %v is not registered", pb.NvmeTransportType_NVME_TRANSPORT_PCIE), + fmt.Sprintf("handler for transport type %v is not registered", pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE), false, &pb.NvmeController{ Name: testControllerName, @@ -451,7 +451,7 @@ func TestFrontEnd_DeleteNvmeController(t *testing.T) { VirtualFunction: wrapperspb.Int32(0), }, }, - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, }, }, }, @@ -491,7 +491,7 @@ func TestFrontEnd_UpdateNvmeController(t *testing.T) { spec := &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(17), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, } t.Cleanup(utils.CheckTestProtoObjectsNotChanged(spec)(t, t.Name())) t.Cleanup(checkGlobalTestProtoObjectsNotChanged(t, t.Name())) @@ -619,7 +619,7 @@ func TestFrontEnd_ListNvmeControllers(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(17), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, Status: &pb.NvmeControllerStatus{ Active: true, @@ -630,7 +630,7 @@ func TestFrontEnd_ListNvmeControllers(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(18), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, Status: &pb.NvmeControllerStatus{ Active: true, @@ -670,7 +670,7 @@ func TestFrontEnd_ListNvmeControllers(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: testController.Spec.Endpoint, NvmeControllerId: proto.Int32(18), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TCP, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, }, Status: &pb.NvmeControllerStatus{ Active: true, diff --git a/pkg/frontend/nvme_controller_validate.go b/pkg/frontend/nvme_controller_validate.go index 7425d257..9a992d5a 100644 --- a/pkg/frontend/nvme_controller_validate.go +++ b/pkg/frontend/nvme_controller_validate.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Package frontend implememnts the FrontEnd APIs (host facing) of the storage Server package frontend diff --git a/pkg/frontend/nvme_namespace_test.go b/pkg/frontend/nvme_namespace_test.go index b085510f..c19013fe 100644 --- a/pkg/frontend/nvme_namespace_test.go +++ b/pkg/frontend/nvme_namespace_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. +// Copyright (c) 2022-2024 Dell Inc, or its subsidiaries. // Copyright (C) 2023 Intel Corporation // Package frontend implememnts the FrontEnd APIs (host facing) of the storage Server diff --git a/pkg/kvm/nvme.go b/pkg/kvm/nvme.go index c84de77d..33237d1a 100644 --- a/pkg/kvm/nvme.go +++ b/pkg/kvm/nvme.go @@ -1,5 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright (C) 2023 Intel Corporation +// Copyright (C) 2024 Dell Inc, or its subsidiaries. // Package kvm automates plugging of SPDK devices to a QEMU instance package kvm diff --git a/pkg/kvm/nvme_test.go b/pkg/kvm/nvme_test.go index fa4c288e..34e0dbad 100644 --- a/pkg/kvm/nvme_test.go +++ b/pkg/kvm/nvme_test.go @@ -1,5 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright (C) 2023 Intel Corporation +// Copyright (C) 2024 Dell Inc, or its subsidiaries. // Package kvm automates plugging of SPDK devices to a QEMU instance package kvm @@ -47,7 +48,7 @@ var ( PortId: wrapperspb.Int32(0), }, }, - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, NvmeControllerId: proto.Int32(43), }, Status: &pb.NvmeControllerStatus{ @@ -143,7 +144,7 @@ func TestCreateNvmeController(t *testing.T) { }, }, NvmeControllerId: proto.Int32(43), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, }, Status: &pb.NvmeControllerStatus{ Active: true, @@ -166,7 +167,7 @@ func TestCreateNvmeController(t *testing.T) { VirtualFunction: wrapperspb.Int32(0), PortId: wrapperspb.Int32(0)}}, NvmeControllerId: proto.Int32(43), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, }, Status: &pb.NvmeControllerStatus{ Active: true, @@ -181,7 +182,7 @@ func TestCreateNvmeController(t *testing.T) { VirtualFunction: wrapperspb.Int32(0), PortId: wrapperspb.Int32(0)}}, NvmeControllerId: proto.Int32(-1), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, }, Status: &pb.NvmeControllerStatus{ Active: true, @@ -227,7 +228,7 @@ func TestCreateNvmeController(t *testing.T) { }, }, NvmeControllerId: proto.Int32(43), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, }, Status: &pb.NvmeControllerStatus{ Active: true, @@ -246,7 +247,7 @@ func TestCreateNvmeController(t *testing.T) { Spec: &pb.NvmeControllerSpec{ Endpoint: nil, NvmeControllerId: proto.Int32(43), - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, }, Status: &pb.NvmeControllerStatus{ Active: true, @@ -272,7 +273,7 @@ func TestCreateNvmeController(t *testing.T) { } opiSpdkServer := frontend.NewCustomizedServer(tt.jsonRPC, store, map[pb.NvmeTransportType]frontend.NvmeTransport{ - pb.NvmeTransportType_NVME_TRANSPORT_PCIE: NewNvmeVfiouserTransport(qmpServer.testDir, tt.jsonRPC), + pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE: NewNvmeVfiouserTransport(qmpServer.testDir, tt.jsonRPC), }, frontend.NewVhostUserBlkTransport()) opiSpdkServer.Nvme.Subsystems[testSubsystemName] = &testSubsystem kvmServer := NewServer(opiSpdkServer, qmpAddress, qmpServer.testDir, tt.buses) @@ -424,7 +425,7 @@ func TestDeleteNvmeController(t *testing.T) { } opiSpdkServer := frontend.NewCustomizedServer(tt.jsonRPC, store, map[pb.NvmeTransportType]frontend.NvmeTransport{ - pb.NvmeTransportType_NVME_TRANSPORT_PCIE: NewNvmeVfiouserTransport(qmpServer.testDir, tt.jsonRPC), + pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE: NewNvmeVfiouserTransport(qmpServer.testDir, tt.jsonRPC), }, frontend.NewVhostUserBlkTransport()) opiSpdkServer.Nvme.Subsystems[testSubsystemName] = &testSubsystem if !tt.noController { diff --git a/pkg/kvm/transport_test.go b/pkg/kvm/transport_test.go index f16681ca..c068bdb5 100644 --- a/pkg/kvm/transport_test.go +++ b/pkg/kvm/transport_test.go @@ -1,5 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright (C) 2023 Intel Corporation +// Copyright (C) 2024 Dell Inc, or its subsidiaries. // Package kvm automates plugging of SPDK devices to a QEMU instance package kvm @@ -144,7 +145,7 @@ func TestNvmeVfiouserTransportCreateController(t *testing.T) { VirtualFunction: wrapperspb.Int32(tt.vf), }, }, - Trtype: pb.NvmeTransportType_NVME_TRANSPORT_PCIE, + Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, }, }, &pb.NvmeSubsystem{ Spec: &pb.NvmeSubsystemSpec{ From a9224a688ff981744b7c572ba85ca546fe8e8552 Mon Sep 17 00:00:00 2001 From: Mark Sanders Date: Thu, 18 Jan 2024 17:40:51 -0500 Subject: [PATCH 3/6] fix(api): additional api changes sync Signed-off-by: Mark Sanders --- pkg/backend/nvme_path_test.go | 20 ++++++++++---------- pkg/frontend/nvme_controller_test.go | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/backend/nvme_path_test.go b/pkg/backend/nvme_path_test.go index e14bb5e5..25870e5e 100644 --- a/pkg/backend/nvme_path_test.go +++ b/pkg/backend/nvme_path_test.go @@ -31,7 +31,7 @@ var ( Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, Traddr: "127.0.0.1", Fabrics: &pb.FabricsPath{ - Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, Subnqn: "nqn.2016-06.io.spdk:cnode1", Hostnqn: "nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c", Trsvcid: 4444, @@ -539,7 +539,7 @@ func TestBackEnd_UpdateNvmePath(t *testing.T) { Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, Traddr: "127.0.0.1", Fabrics: &pb.FabricsPath{ - Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, Trsvcid: 4444, Subnqn: testNvmePath.Fabrics.Subnqn, }, @@ -557,7 +557,7 @@ func TestBackEnd_UpdateNvmePath(t *testing.T) { Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, Traddr: "127.0.0.1", Fabrics: &pb.FabricsPath{ - Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, Trsvcid: 4444, Subnqn: testNvmePath.Fabrics.Subnqn, }, @@ -674,14 +674,14 @@ func TestBackEnd_ListNvmePaths(t *testing.T) { // { // Name: "Malloc0", // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, - // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + // Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, // }, // { // Name: "Malloc1", // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, - // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + // Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, // }, @@ -701,14 +701,14 @@ func TestBackEnd_ListNvmePaths(t *testing.T) { // { // Name: "Malloc0", // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, - // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + // Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, // }, // { // Name: "Malloc1", // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, - // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + // Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, // }, @@ -743,7 +743,7 @@ func TestBackEnd_ListNvmePaths(t *testing.T) { // { // Name: "Malloc0", // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, - // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + // Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, // }, @@ -760,7 +760,7 @@ func TestBackEnd_ListNvmePaths(t *testing.T) { // { // Name: "Malloc1", // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, - // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + // Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, // }, @@ -865,7 +865,7 @@ func TestBackEnd_GetNvmePath(t *testing.T) { // out: &pb.NvmePath{ // Name: "Malloc1", // Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, - // Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + // Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, // Traddr: "127.0.0.1", // Trsvcid: 4444, // }, diff --git a/pkg/frontend/nvme_controller_test.go b/pkg/frontend/nvme_controller_test.go index 5803a821..112bab9f 100644 --- a/pkg/frontend/nvme_controller_test.go +++ b/pkg/frontend/nvme_controller_test.go @@ -31,7 +31,7 @@ var ( FabricsId: &pb.FabricsEndpoint{ Traddr: "127.0.0.1", Trsvcid: "4420", - Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, }, }, Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_TCP, @@ -226,7 +226,7 @@ func TestFrontEnd_CreateNvmeController(t *testing.T) { FabricsId: &pb.FabricsEndpoint{ Traddr: "127.0.0.1", Trsvcid: "4420", - Adrfam: pb.NvmeAddressFamily_NVME_ADRFAM_IPV4, + Adrfam: pb.NvmeAddressFamily_NVME_ADDRESS_FAMILY_IPV4, }, }, Trtype: pb.NvmeTransportType_NVME_TRANSPORT_TYPE_PCIE, From cd065a825b62282e45932bc75fef388089aa5108 Mon Sep 17 00:00:00 2001 From: Mark Sanders Date: Thu, 18 Jan 2024 20:02:06 -0500 Subject: [PATCH 4/6] fix(deps): depricate parent tests for api changes Signed-off-by: Mark Sanders --- pkg/backend/aio_test.go | 19 ++++++++++--------- pkg/frontend/blk_test.go | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/pkg/backend/aio_test.go b/pkg/backend/aio_test.go index 1a94cf3a..cb006abf 100644 --- a/pkg/backend/aio_test.go +++ b/pkg/backend/aio_test.go @@ -479,15 +479,16 @@ func TestBackEnd_ListAioVolumes(t *testing.T) { size: 1, token: "existing-pagination-token", }, - "no required field": { - in: "", - out: []*pb.AioVolume{}, - spdk: []string{}, - errCode: codes.Unknown, - errMsg: "missing required field: parent", - size: 0, - token: "", - }, + // Parent field not in message - depricate test + // "no required field": { + // in: "", + // out: []*pb.AioVolume{}, + // spdk: []string{}, + // errCode: codes.Unknown, + // errMsg: "missing required field: parent", + // size: 0, + // token: "", + // }, } // run tests diff --git a/pkg/frontend/blk_test.go b/pkg/frontend/blk_test.go index a1daab4e..cb909910 100644 --- a/pkg/frontend/blk_test.go +++ b/pkg/frontend/blk_test.go @@ -426,15 +426,16 @@ func TestFrontEnd_ListVirtioBlks(t *testing.T) { 1, "existing-pagination-token", }, - "no required field": { - "", - []*pb.VirtioBlk{}, - []string{}, - codes.Unknown, - "missing required field: parent", - 0, - "", - }, + // Parent field not in message - depricate test + // "no required field": { + // "", + // []*pb.VirtioBlk{}, + // []string{}, + // codes.Unknown, + // "missing required field: parent", + // 0, + // "", + // }, } // run tests From 1410bc73b6df5bd0de56540ebf4096445656df83 Mon Sep 17 00:00:00 2001 From: Mark Sanders Date: Fri, 19 Jan 2024 12:52:35 -0500 Subject: [PATCH 5/6] fix(deps): remove parent tests for api changes Signed-off-by: Mark Sanders --- pkg/backend/aio_test.go | 10 ---------- pkg/backend/null_test.go | 9 --------- pkg/frontend/blk_test.go | 10 ---------- 3 files changed, 29 deletions(-) diff --git a/pkg/backend/aio_test.go b/pkg/backend/aio_test.go index cb006abf..2a20cb6b 100644 --- a/pkg/backend/aio_test.go +++ b/pkg/backend/aio_test.go @@ -479,16 +479,6 @@ func TestBackEnd_ListAioVolumes(t *testing.T) { size: 1, token: "existing-pagination-token", }, - // Parent field not in message - depricate test - // "no required field": { - // in: "", - // out: []*pb.AioVolume{}, - // spdk: []string{}, - // errCode: codes.Unknown, - // errMsg: "missing required field: parent", - // size: 0, - // token: "", - // }, } // run tests diff --git a/pkg/backend/null_test.go b/pkg/backend/null_test.go index f81a7970..0f78d99a 100644 --- a/pkg/backend/null_test.go +++ b/pkg/backend/null_test.go @@ -484,15 +484,6 @@ func TestBackEnd_ListNullVolumes(t *testing.T) { size: 1, token: "existing-pagination-token", }, - "no required field": { - in: "", - out: []*pb.NullVolume{}, - spdk: []string{}, - errCode: codes.Unknown, - errMsg: "missing required field: parent", - size: 0, - token: "", - }, } // run tests diff --git a/pkg/frontend/blk_test.go b/pkg/frontend/blk_test.go index cb909910..4a1a2886 100644 --- a/pkg/frontend/blk_test.go +++ b/pkg/frontend/blk_test.go @@ -426,16 +426,6 @@ func TestFrontEnd_ListVirtioBlks(t *testing.T) { 1, "existing-pagination-token", }, - // Parent field not in message - depricate test - // "no required field": { - // "", - // []*pb.VirtioBlk{}, - // []string{}, - // codes.Unknown, - // "missing required field: parent", - // 0, - // "", - // }, } // run tests From 1d6c83bc4065f943974156e079d4d094e9b73829 Mon Sep 17 00:00:00 2001 From: Mark Sanders Date: Mon, 22 Jan 2024 11:21:13 -0500 Subject: [PATCH 6/6] fix(api): update for api changes to enum values Signed-off-by: Mark Sanders --- README.md | 8 ++++---- docker-compose.yml | 2 +- pkg/backend/nvme_path.go | 2 +- pkg/utils/server.go | 2 +- scripts/tests.sh | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 11ade212..48bf54d2 100644 --- a/README.md +++ b/README.md @@ -81,9 +81,9 @@ docker run --network=host --rm -it namely/grpc-cli ls --json_input --json_outp docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmeSubsystem "{nvme_subsystem : {spec : {nqn: 'nqn.2022-09.io.spdk:opitest2', serial_number: 'myserial2', model_number: 'mymodel2', max_namespaces: 11} }, nvme_subsystem_id : 'subsystem2' }" docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 ListNvmeSubsystems "{}" docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 GetNvmeSubsystem "{name : '//storage.opiproject.org/subsystems/subsystem2'}" -docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmeController "{parent: '//storage.opiproject.org/subsystems/subsystem2', nvme_controller : {spec : {nvme_controller_id: 2, pcie_id : {physical_function : 0, virtual_function : 0, port_id: 0}, max_nsq:5, max_ncq:5, 'trtype': 'NVME_TRANSPORT_PCIE' } }, nvme_controller_id : 'controller1'}" +docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmeController "{parent: '//storage.opiproject.org/subsystems/subsystem2', nvme_controller : {spec : {nvme_controller_id: 2, pcie_id : {physical_function : 0, virtual_function : 0, port_id: 0}, max_nsq:5, max_ncq:5, 'trtype': 'NVME_TRANSPORT_TYPE_PCIE' } }, nvme_controller_id : 'controller1'}" docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmeSubsystem "{nvme_subsystem : {spec : {nqn: 'nqn.2022-09.io.spdk:opitest3', serial_number: 'myserial2', model_number: 'mymodel2', max_namespaces: 11} }, nvme_subsystem_id : 'subsystem3' }" -docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmeController "{'parent':'//storage.opiproject.org/subsystems/subsystem3','nvme_controller':{'spec':{'nvme_controller_id':2,'fabrics_id':{'traddr': '127.0.0.1', trsvcid: '4421', adrfam: 'NVME_ADRFAM_IPV4'}, 'max_nsq':5,'max_ncq':5, 'trtype': 'NVME_TRANSPORT_TCP'}},'nvme_controller_id':'controller3'}" +docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmeController "{'parent':'//storage.opiproject.org/subsystems/subsystem3','nvme_controller':{'spec':{'nvme_controller_id':2,'fabrics_id':{'traddr': '127.0.0.1', trsvcid: '4421', adrfam: 'NVME_ADDRESS_FAMILY_IPV4'}, 'max_nsq':5,'max_ncq':5, 'trtype': 'NVME_TRANSPORT_TYPE_TCP'}},'nvme_controller_id':'controller3'}" docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 ListNvmeControllers "{parent : '//storage.opiproject.org/subsystems/subsystem2'}" docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 GetNvmeController "{name : '//storage.opiproject.org/subsystems/subsystem2/controllers/controller1'}" docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 GetNvmeController "{name : '//storage.opiproject.org/subsystems/subsystem3/controllers/controller3'}" @@ -94,9 +94,9 @@ docker run --network=host --rm -it namely/grpc-cli call --json_input --json_outp docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmeRemoteController "{nvme_remote_controller : {multipath: 'NVME_MULTIPATH_MULTIPATH', tcp: {hdgst: false, ddgst: false}}, nvme_remote_controller_id: 'nvmetcp12'}" docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 ListNvmeRemoteControllers "{}" docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 GetNvmeRemoteController "{name: '//storage.opiproject.org/nvmeRemoteControllers/nvmetcp12'}" -docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmePath "{parent: '//storage.opiproject.org/nvmeRemoteControllers/nvmetcp12', nvme_path : {traddr:'11.11.11.2', trtype:'NVME_TRANSPORT_TCP', fabrics:{subnqn:'nqn.2016-06.com.opi.spdk.target0', trsvcid:'4444', adrfam:'NVME_ADRFAM_IPV4', hostnqn:'nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c'}}, nvme_path_id: 'nvmetcp12path0'}" +docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmePath "{parent: '//storage.opiproject.org/nvmeRemoteControllers/nvmetcp12', nvme_path : {traddr:'11.11.11.2', trtype:'NVME_TRANSPORT_TYPE_TCP', fabrics:{subnqn:'nqn.2016-06.com.opi.spdk.target0', trsvcid:'4444', adrfam:'NVME_ADDRESS_FAMILY_IPV4', hostnqn:'nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c'}}, nvme_path_id: 'nvmetcp12path0'}" docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmeRemoteController "{nvme_remote_controller : {multipath: 'NVME_MULTIPATH_DISABLE'}, nvme_remote_controller_id: 'nvmepcie13'}" -docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmePath "{parent: '//storage.opiproject.org/nvmeRemoteControllers/nvmepcie13', nvme_path : {traddr:'0000:01:00.0', trtype:'NVME_TRANSPORT_PCIE'}, nvme_path_id: 'nvmepcie13path0'}" +docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 CreateNvmePath "{parent: '//storage.opiproject.org/nvmeRemoteControllers/nvmepcie13', nvme_path : {traddr:'0000:01:00.0', trtype:'NVME_TRANSPORT_TYPE_PCIE'}, nvme_path_id: 'nvmepcie13path0'}" docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 ListNvmePaths "{parent : '//storage.opiproject.org/nvmeRemoteControllers/nvmepcie13'}" docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 DeleteNvmePath "{name: '//storage.opiproject.org/nvmeRemoteControllers/nvmepcie13/nvmePaths/nvmepcie13path0'}" diff --git a/docker-compose.yml b/docker-compose.yml index ea095310..67e2d763 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -113,7 +113,7 @@ services: command: curl -qkL http://opi-spdk-server:8082/v1/inventory/1/inventory/2 opi-spdk-client: - image: ghcr.io/opiproject/godpu:main@sha256:f2a34f625f2f6dcb820b319dddc9caedfce5e7ce2577264aff46f77978289c2a + image: ghcr.io/opiproject/godpu:main@sha256:4301eadbb4bd4803eb993a9fd40ae52f132e1c5489996af60777ab320765a8e0 networks: - opi depends_on: diff --git a/pkg/backend/nvme_path.go b/pkg/backend/nvme_path.go index e17f8709..4aafcebd 100644 --- a/pkg/backend/nvme_path.go +++ b/pkg/backend/nvme_path.go @@ -273,7 +273,7 @@ func (s *Server) StatsNvmePath(ctx context.Context, in *pb.StatsNvmePathRequest) } func (s *Server) opiTransportToSpdk(transport pb.NvmeTransportType) string { - return strings.ReplaceAll(transport.String(), "NVME_TRANSPORT_", "") + return strings.ReplaceAll(transport.String(), "NVME_TRANSPORT_TYPE_", "") } func (s *Server) opiMultipathToSpdk(multipath pb.NvmeMultipath) string { diff --git a/pkg/utils/server.go b/pkg/utils/server.go index b0174263..96e4089a 100644 --- a/pkg/utils/server.go +++ b/pkg/utils/server.go @@ -148,5 +148,5 @@ func OpiAdressFamilyToSpdk(adrfam pb.NvmeAddressFamily) string { return "" } - return strings.ReplaceAll(adrfam.String(), "NVME_ADRFAM_", "") + return strings.ReplaceAll(adrfam.String(), "NVME_ADDRESS_FAMILY_", "") } diff --git a/scripts/tests.sh b/scripts/tests.sh index 136dcf9f..fc54e515 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -67,7 +67,7 @@ grep "Total" log.txt # test nvme "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmeSubsystem "{nvme_subsystem_id: 'subsystem1', nvme_subsystem : {spec : {nqn: 'nqn.2022-09.io.spdk:opitest1', serial_number: 'myserial1', model_number: 'mymodel1', max_namespaces: 11} } }" -"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmeController "{nvme_controller_id: 'controller1', parent: '//storage.opiproject.org/subsystems/subsystem1', nvme_controller : {spec : {nvme_controller_id: 2, 'fabrics_id':{'traddr': '${SPDK_IP}', trsvcid: '7777', adrfam: 'NVME_ADRFAM_IPV4'}, max_nsq:5, max_ncq:5, 'trtype': 'NVME_TRANSPORT_TCP' } } }" +"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmeController "{nvme_controller_id: 'controller1', parent: '//storage.opiproject.org/subsystems/subsystem1', nvme_controller : {spec : {nvme_controller_id: 2, 'fabrics_id':{'traddr': '${SPDK_IP}', trsvcid: '7777', adrfam: 'NVME_ADDRESS_FAMILY_IPV4'}, max_nsq:5, max_ncq:5, 'trtype': 'NVME_TRANSPORT_TYPE_TCP' } } }" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmeNamespace "{nvme_namespace_id: 'namespace1', parent: '//storage.opiproject.org/subsystems/subsystem1', nvme_namespace : {spec : {volume_name_ref : 'Malloc1', host_nsid : 1 } } }" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 GetNvmeSubsystem "{name : '//storage.opiproject.org/subsystems/subsystem1'}" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 GetNvmeController "{name : '//storage.opiproject.org/subsystems/subsystem1/controllers/controller1'}" @@ -76,7 +76,7 @@ docker run --rm --network=host --privileged -v /dev/hugepages:/dev/hugepages ghc docker run --rm --network=host --privileged -v /dev/hugepages:/dev/hugepages ghcr.io/opiproject/spdk:main spdk_nvme_perf -r 'traddr:127.0.0.1 trtype:TCP adrfam:IPv4 trsvcid:7777 subnqn:nqn.2022-09.io.spdk:opitest1 hostnqn:nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c' -c 0x1 -q 1 -o 4096 -w randread -t 10 | tee log.txt grep "Total" log.txt "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmeRemoteController "{nvme_remote_controller : {multipath: 'NVME_MULTIPATH_MULTIPATH', tcp: {hdgst: false, ddgst: false}}, nvme_remote_controller_id: 'nvmetcp12'}" -"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmePath "{parent: '//storage.opiproject.org/nvmeRemoteControllers/nvmetcp12', nvme_path : {traddr:\"$SPDK_IP\", trtype:'NVME_TRANSPORT_TCP', fabrics: { subnqn:'nqn.2022-09.io.spdk:opitest1', trsvcid:'7777', adrfam:'NVME_ADRFAM_IPV4', hostnqn:'nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c'}}, nvme_path_id: 'nvmetcp12path0'}" +"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmePath "{parent: '//storage.opiproject.org/nvmeRemoteControllers/nvmetcp12', nvme_path : {traddr:\"$SPDK_IP\", trtype:'NVME_TRANSPORT_TYPE_TCP', fabrics: { subnqn:'nqn.2022-09.io.spdk:opitest1', trsvcid:'7777', adrfam:'NVME_ADDRESS_FAMILY_IPV4', hostnqn:'nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c'}}, nvme_path_id: 'nvmetcp12path0'}" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 GetNvmeRemoteController "{name: '//storage.opiproject.org/nvmeRemoteControllers/nvmetcp12'}" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 GetNvmePath "{name: '//storage.opiproject.org/nvmeRemoteControllers/nvmetcp12/nvmePaths/nvmetcp12path0'}" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 DeleteNvmePath "{name: '//storage.opiproject.org/nvmeRemoteControllers/nvmetcp12/nvmePaths/nvmetcp12path0'}" @@ -87,7 +87,7 @@ grep "Total" log.txt # test nvme with TLS "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmeSubsystem "{nvme_subsystem_id: 'subsystem2', nvme_subsystem : {spec : {nqn: 'nqn.2022-09.io.spdk:opitest2', serial_number: 'myserial2', model_number: 'mymodel2', max_namespaces: 22, hostnqn: 'nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c', psk: 'TlZNZVRMU2tleS0xOjAxOk1EQXhNVEl5TXpNME5EVTFOalkzTnpnNE9UbGhZV0ppWTJOa1pHVmxabVp3SkVpUTo='} } }" -"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmeController "{nvme_controller_id: 'controller2', parent: '//storage.opiproject.org/subsystems/subsystem2', nvme_controller : {spec : {nvme_controller_id: 22, 'fabrics_id':{'traddr': '${SPDK_IP}', trsvcid: '8888', adrfam: 'NVME_ADRFAM_IPV4'}, max_nsq:5, max_ncq:5, 'trtype': 'NVME_TRANSPORT_TCP' } } }" +"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmeController "{nvme_controller_id: 'controller2', parent: '//storage.opiproject.org/subsystems/subsystem2', nvme_controller : {spec : {nvme_controller_id: 22, 'fabrics_id':{'traddr': '${SPDK_IP}', trsvcid: '8888', adrfam: 'NVME_ADDRESS_FAMILY_IPV4'}, max_nsq:5, max_ncq:5, 'trtype': 'NVME_TRANSPORT_TYPE_TCP' } } }" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmeNamespace "{nvme_namespace_id: 'namespace2', parent: '//storage.opiproject.org/subsystems/subsystem2', nvme_namespace : {spec : {volume_name_ref : 'Malloc1', host_nsid : 1 } } }" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 GetNvmeSubsystem "{name : '//storage.opiproject.org/subsystems/subsystem2'}" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 GetNvmeController "{name : '//storage.opiproject.org/subsystems/subsystem2/controllers/controller2'}" @@ -96,7 +96,7 @@ grep "Total" log.txt docker run --rm --network=host --privileged -v /dev/hugepages:/dev/hugepages -v /tmp/opikey.txt:/tmp/opikey.txt ghcr.io/opiproject/spdk:main spdk_nvme_perf -r 'traddr:127.0.0.1 trtype:TCP adrfam:IPv4 trsvcid:8888 subnqn:nqn.2022-09.io.spdk:opitest2 hostnqn:nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c' -c 0x1 -q 1 -o 4096 -w randread -t 10 -S ssl --psk-path /tmp/opikey.txt | tee log.txt grep "Total" log.txt "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmeRemoteController "{nvme_remote_controller : {multipath: 'NVME_MULTIPATH_MULTIPATH', tcp: {hdgst: false, ddgst: false, psk: 'TlZNZVRMU2tleS0xOjAxOk1EQXhNVEl5TXpNME5EVTFOalkzTnpnNE9UbGhZV0ppWTJOa1pHVmxabVp3SkVpUTo='}}, nvme_remote_controller_id: 'nvmetls17'}" -"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmePath "{parent: '//storage.opiproject.org/nvmeRemoteControllers/nvmetls17', nvme_path : {traddr:\"$SPDK_IP\", trtype:'NVME_TRANSPORT_TCP', fabrics: { subnqn:'nqn.2022-09.io.spdk:opitest2', trsvcid:'8888', adrfam:'NVME_ADRFAM_IPV4', hostnqn:'nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c'}}, nvme_path_id: 'nvmetls17path0'}" +"${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 CreateNvmePath "{parent: '//storage.opiproject.org/nvmeRemoteControllers/nvmetls17', nvme_path : {traddr:\"$SPDK_IP\", trtype:'NVME_TRANSPORT_TYPE_TCP', fabrics: { subnqn:'nqn.2022-09.io.spdk:opitest2', trsvcid:'8888', adrfam:'NVME_ADDRESS_FAMILY_IPV4', hostnqn:'nqn.2014-08.org.nvmexpress:uuid:feb98abe-d51f-40c8-b348-2753f3571d3c'}}, nvme_path_id: 'nvmetls17path0'}" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 GetNvmeRemoteController "{name: '//storage.opiproject.org/nvmeRemoteControllers/nvmetls17'}" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 GetNvmePath "{name: '//storage.opiproject.org/nvmeRemoteControllers/nvmetls17/nvmePaths/nvmetls17path0'}" "${grpc_cli[@]}" call --json_input --json_output opi-spdk-server:50051 DeleteNvmePath "{name: '//storage.opiproject.org/nvmeRemoteControllers/nvmetls17/nvmePaths/nvmetls17path0'}"