Skip to content

Commit 9a7938f

Browse files
committed
WIP
Signed-off-by: Derek Su <[email protected]>
1 parent e6def5a commit 9a7938f

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

pkg/nvme/nvmecli.go

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"strconv"
77
"strings"
88

9+
"github.com/sirupsen/logrus"
10+
911
commonns "github.com/longhorn/go-common-libs/ns"
1012

1113
"github.com/longhorn/go-spdk-helper/pkg/types"
@@ -278,6 +280,8 @@ func discovery(hostID, hostNQN, ip, port string, executor *commonns.Executor) ([
278280
// ]
279281
// }
280282

283+
logrus.Infof("Debug ======> %s %v", nvmeBinary, opts)
284+
281285
// nvme discover does not respect the -s option, so we need to filter the output
282286
outputStr, err := executor.Execute(nil, nvmeBinary, opts, types.ExecuteTimeout)
283287
if err != nil {
@@ -293,6 +297,8 @@ func discovery(hostID, hostNQN, ip, port string, executor *commonns.Executor) ([
293297
Entries []DiscoveryPageEntry `json:"records"`
294298
}
295299

300+
logrus.Infof("Debug ======> discover output: %s", jsonStr)
301+
296302
err = json.Unmarshal([]byte(jsonStr), &output)
297303
if err != nil {
298304
return nil, err

pkg/spdk/spdk_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
. "gopkg.in/check.v1"
1313

1414
commontypes "github.com/longhorn/go-common-libs/types"
15+
"github.com/sirupsen/logrus"
1516

1617
"github.com/longhorn/go-spdk-helper/pkg/jsonrpc"
1718
"github.com/longhorn/go-spdk-helper/pkg/nvme"
@@ -350,6 +351,8 @@ func (s *TestSuite) TestSPDKBasic(c *C) {
350351
c.Assert(err, IsNil)
351352

352353
dmDeviceBusy, err := initiator.Start(types.LocalIP, defaultPort1, true)
354+
logrus.Infof("Debug ===> dmDeviceBusy: %v, err: %v", dmDeviceBusy, err)
355+
time.Sleep(36000 * time.Second)
353356
c.Assert(dmDeviceBusy, Equals, false)
354357
c.Assert(err, IsNil)
355358
defer func() {

scripts/test

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ trap "umount /dev && umount /sys" EXIT
2929

3030
PACKAGES="$(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')"
3131

32-
go test -v -race -cover -coverprofile=coverage.out ${PACKAGES}
32+
go test -v -p 1 -race -cover -coverprofile=coverage.out ${PACKAGES}

0 commit comments

Comments
 (0)