@@ -123,6 +123,13 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *TestCo
123
123
AfterEach (func () {
124
124
cl .DeleteVolumes ()
125
125
})
126
+ idempotentcount := sc .Config .IdempotentCount
127
+ // Negative value for Idempotency repeat count means "skip idempotency testing"
128
+ // We also do not want zero as that would skip as well, so in special cases we
129
+ // reset the loop count to 1 to make this happen as regular testing.
130
+ if idempotentcount < 1 {
131
+ idempotentcount = 1
132
+ }
126
133
127
134
Describe ("ControllerGetCapabilities" , func () {
128
135
It ("should return appropriate capabilities" , func () {
@@ -1110,19 +1117,21 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *TestCo
1110
1117
// ControllerPublishVolume
1111
1118
By ("calling controllerpublish on that volume" )
1112
1119
1113
- conpubvol , err := c .ControllerPublishVolume (
1114
- context .Background (),
1115
- & csi.ControllerPublishVolumeRequest {
1116
- VolumeId : vol .GetVolume ().GetVolumeId (),
1117
- NodeId : ni .GetNodeId (),
1118
- VolumeCapability : TestVolumeCapabilityWithAccessType (sc , csi .VolumeCapability_AccessMode_SINGLE_NODE_WRITER ),
1119
- Readonly : false ,
1120
- Secrets : sc .Secrets .ControllerPublishVolumeSecret ,
1121
- },
1122
- )
1123
- Expect (err ).NotTo (HaveOccurred ())
1120
+ for i := 0 ; i < idempotentcount ; i ++ {
1121
+ conpubvol , err := c .ControllerPublishVolume (
1122
+ context .Background (),
1123
+ & csi.ControllerPublishVolumeRequest {
1124
+ VolumeId : vol .GetVolume ().GetVolumeId (),
1125
+ NodeId : ni .GetNodeId (),
1126
+ VolumeCapability : TestVolumeCapabilityWithAccessType (sc , csi .VolumeCapability_AccessMode_SINGLE_NODE_WRITER ),
1127
+ Readonly : false ,
1128
+ Secrets : sc .Secrets .ControllerPublishVolumeSecret ,
1129
+ },
1130
+ )
1131
+ Expect (err ).NotTo (HaveOccurred ())
1132
+ Expect (conpubvol ).NotTo (BeNil ())
1133
+ }
1124
1134
cl .RegisterVolume (name , VolumeInfo {VolumeID : vol .GetVolume ().GetVolumeId (), NodeID : ni .GetNodeId ()})
1125
- Expect (conpubvol ).NotTo (BeNil ())
1126
1135
1127
1136
By ("cleaning up unpublishing the volume" )
1128
1137
0 commit comments