Skip to content

Commit f7c57ea

Browse files
authored
Merge pull request #53 from davidz627/fix/stageUnstage
Fixes for drivers with STAGE_UNSTAGE_VOLUME capability
2 parents 392225c + 2f3426e commit f7c57ea

File tree

4 files changed

+183
-199
lines changed

4 files changed

+183
-199
lines changed

cmd/csi-sanity/sanity_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ const (
2929
)
3030

3131
var (
32-
VERSION = "(dev)"
33-
endpoint string
34-
mountPoint string
35-
version bool
32+
VERSION = "(dev)"
33+
endpoint string
34+
mountDir string
35+
version bool
3636
)
3737

3838
func init() {
3939
flag.StringVar(&endpoint, prefix+"endpoint", "", "CSI endpoint")
4040
flag.BoolVar(&version, prefix+"version", false, "Version of this program")
41-
flag.StringVar(&mountPoint, prefix+"mountpoint", os.TempDir()+"/csi", "Mount point for NodePublish")
41+
flag.StringVar(&mountDir, prefix+"mountdir", os.TempDir()+"/csi", "Mount point for NodePublish")
4242
flag.Parse()
4343
}
4444

@@ -50,5 +50,5 @@ func TestSanity(t *testing.T) {
5050
if len(endpoint) == 0 {
5151
t.Fatalf("--%sendpoint must be provided with an CSI endpoint", prefix)
5252
}
53-
sanity.Test(t, endpoint, mountPoint)
53+
sanity.Test(t, endpoint, mountDir)
5454
}

pkg/sanity/controller.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func verifyVolumeInfo(v *csi.Volume) {
3434
Expect(v.GetId()).NotTo(BeEmpty())
3535
}
3636

37-
func isCapabilitySupported(
37+
func isControllerCapabilitySupported(
3838
c csi.ControllerClient,
3939
capType csi.ControllerServiceCapability_RPC_Type,
4040
) bool {
@@ -97,7 +97,7 @@ var _ = Describe("GetCapacity [Controller Server]", func() {
9797
BeforeEach(func() {
9898
c = csi.NewControllerClient(conn)
9999

100-
if !isCapabilitySupported(c, csi.ControllerServiceCapability_RPC_GET_CAPACITY) {
100+
if !isControllerCapabilitySupported(c, csi.ControllerServiceCapability_RPC_GET_CAPACITY) {
101101
Skip("GetCapacity not supported")
102102
}
103103
})
@@ -121,7 +121,7 @@ var _ = Describe("ListVolumes [Controller Server]", func() {
121121
BeforeEach(func() {
122122
c = csi.NewControllerClient(conn)
123123

124-
if !isCapabilitySupported(c, csi.ControllerServiceCapability_RPC_LIST_VOLUMES) {
124+
if !isControllerCapabilitySupported(c, csi.ControllerServiceCapability_RPC_LIST_VOLUMES) {
125125
Skip("ListVolumes not supported")
126126
}
127127
})
@@ -152,7 +152,7 @@ var _ = Describe("CreateVolume [Controller Server]", func() {
152152
BeforeEach(func() {
153153
c = csi.NewControllerClient(conn)
154154

155-
if !isCapabilitySupported(c, csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME) {
155+
if !isControllerCapabilitySupported(c, csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME) {
156156
Skip("CreateVolume not supported")
157157
}
158158
})
@@ -419,7 +419,7 @@ var _ = Describe("DeleteVolume [Controller Server]", func() {
419419
BeforeEach(func() {
420420
c = csi.NewControllerClient(conn)
421421

422-
if !isCapabilitySupported(c, csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME) {
422+
if !isControllerCapabilitySupported(c, csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME) {
423423
Skip("DeleteVolume not supported")
424424
}
425425
})
@@ -585,7 +585,7 @@ var _ = Describe("ControllerPublishVolume [Controller Server]", func() {
585585
c = csi.NewControllerClient(conn)
586586
n = csi.NewNodeClient(conn)
587587

588-
if !isCapabilitySupported(c, csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME) {
588+
if !isControllerCapabilitySupported(c, csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME) {
589589
Skip("ControllerPublishVolume not supported")
590590
}
591591
})
@@ -715,7 +715,7 @@ var _ = Describe("ControllerUnpublishVolume [Controller Server]", func() {
715715
c = csi.NewControllerClient(conn)
716716
n = csi.NewNodeClient(conn)
717717

718-
if !isCapabilitySupported(c, csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME) {
718+
if !isControllerCapabilitySupported(c, csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME) {
719719
Skip("ControllerUnpublishVolume not supported")
720720
}
721721
})

0 commit comments

Comments
 (0)