Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update opi-api digest and api changes #874

Merged
merged 6 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'}"
Expand All @@ -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'}"
Expand Down
8 changes: 4 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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(),
)
Expand All @@ -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(),
)
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
13 changes: 2 additions & 11 deletions pkg/backend/aio_test.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -479,15 +479,6 @@ 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: "",
},
}

// run tests
Expand All @@ -498,7 +489,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) {
Expand Down
7 changes: 3 additions & 4 deletions pkg/backend/null.go
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
28 changes: 9 additions & 19 deletions pkg/backend/null_test.go
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
)
Expand Down Expand Up @@ -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,
},
Expand All @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand All @@ -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,
},
Expand All @@ -485,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
Expand All @@ -504,7 +494,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) {
Expand Down Expand Up @@ -577,7 +567,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,
},
Expand Down
6 changes: 3 additions & 3 deletions pkg/backend/nvme_path.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down
Loading
Loading