Skip to content

Commit

Permalink
test: assert the returned error of DeleteDevice()
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Su <[email protected]>
  • Loading branch information
derekbit committed Apr 26, 2024
1 parent 9a8e1a4 commit a797602
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/spdk/spdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ import (

commonTypes "github.com/longhorn/go-common-libs/types"

"github.com/longhorn/go-spdk-helper/pkg/jsonrpc"
"github.com/longhorn/go-spdk-helper/pkg/nvme"
"github.com/longhorn/go-spdk-helper/pkg/spdk/client"
"github.com/longhorn/go-spdk-helper/pkg/spdk/target"
spdktypes "github.com/longhorn/go-spdk-helper/pkg/spdk/types"
"github.com/longhorn/go-spdk-helper/pkg/types"
"github.com/longhorn/go-spdk-helper/pkg/util"

spdktypes "github.com/longhorn/go-spdk-helper/pkg/spdk/types"
)

var (
Expand Down Expand Up @@ -112,7 +114,9 @@ func (s *TestSuite) TestSPDKBasic(c *C) {

// Do blindly cleanup
err = spdkCli.DeleteDevice(defaultDeviceName, defaultDeviceName)
c.Assert(err, IsNil)
if err != nil {
c.Assert(jsonrpc.IsJSONRPCRespErrorNoSuchDevice(err), Equals, true)
}

bdevAioName, lvsName, lvsUUID, err := spdkCli.AddDevice(defaultDevicePath, defaultDeviceName, types.MiB)
c.Assert(err, IsNil)
Expand Down

0 comments on commit a797602

Please sign in to comment.