@@ -31,11 +31,6 @@ import (
31
31
)
32
32
33
33
const (
34
- // DefTestVolumeSize defines the base size of dynamically
35
- // provisioned volumes. 10GB by default, can be overridden by
36
- // setting Config.TestVolumeSize.
37
- DefTestVolumeSize int64 = 10 * 1024 * 1024 * 1024
38
-
39
34
// DefTestVolumeExpand defines the size increment for volume
40
35
// expansion. It can be overriden by setting an
41
36
// Config.TestVolumeExpandSize, which will be taken as absolute
@@ -45,14 +40,11 @@ const (
45
40
MaxNameLength int = 128
46
41
)
47
42
48
- func TestVolumeSize (sc * SanityContext ) int64 {
49
- if sc .Config .TestVolumeSize > 0 {
50
- return sc .Config .TestVolumeSize
51
- }
52
- return DefTestVolumeSize
43
+ func TestVolumeSize (sc * TestContext ) int64 {
44
+ return sc .Config .TestVolumeSize
53
45
}
54
46
55
- func TestVolumeExpandSize (sc * SanityContext ) int64 {
47
+ func TestVolumeExpandSize (sc * TestContext ) int64 {
56
48
if sc .Config .TestVolumeExpandSize > 0 {
57
49
return sc .Config .TestVolumeExpandSize
58
50
}
@@ -92,7 +84,7 @@ func isControllerCapabilitySupported(
92
84
return false
93
85
}
94
86
95
- var _ = DescribeSanity ("Controller Service [Controller Server]" , func (sc * SanityContext ) {
87
+ var _ = DescribeSanity ("Controller Service [Controller Server]" , func (sc * TestContext ) {
96
88
var (
97
89
c csi.ControllerClient
98
90
n csi.NodeClient
@@ -1617,7 +1609,7 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *Sanity
1617
1609
})
1618
1610
})
1619
1611
1620
- var _ = DescribeSanity ("ListSnapshots [Controller Server]" , func (sc * SanityContext ) {
1612
+ var _ = DescribeSanity ("ListSnapshots [Controller Server]" , func (sc * TestContext ) {
1621
1613
var (
1622
1614
c csi.ControllerClient
1623
1615
)
@@ -1870,7 +1862,7 @@ var _ = DescribeSanity("ListSnapshots [Controller Server]", func(sc *SanityConte
1870
1862
1871
1863
})
1872
1864
1873
- var _ = DescribeSanity ("DeleteSnapshot [Controller Server]" , func (sc * SanityContext ) {
1865
+ var _ = DescribeSanity ("DeleteSnapshot [Controller Server]" , func (sc * TestContext ) {
1874
1866
var (
1875
1867
c csi.ControllerClient
1876
1868
)
@@ -1933,7 +1925,7 @@ var _ = DescribeSanity("DeleteSnapshot [Controller Server]", func(sc *SanityCont
1933
1925
})
1934
1926
})
1935
1927
1936
- var _ = DescribeSanity ("CreateSnapshot [Controller Server]" , func (sc * SanityContext ) {
1928
+ var _ = DescribeSanity ("CreateSnapshot [Controller Server]" , func (sc * TestContext ) {
1937
1929
var (
1938
1930
c csi.ControllerClient
1939
1931
)
@@ -2082,7 +2074,7 @@ var _ = DescribeSanity("CreateSnapshot [Controller Server]", func(sc *SanityCont
2082
2074
})
2083
2075
})
2084
2076
2085
- var _ = DescribeSanity ("ExpandVolume [Controller Server]" , func (sc * SanityContext ) {
2077
+ var _ = DescribeSanity ("ExpandVolume [Controller Server]" , func (sc * TestContext ) {
2086
2078
var (
2087
2079
c csi.ControllerClient
2088
2080
cl * Cleanup
@@ -2188,7 +2180,7 @@ var _ = DescribeSanity("ExpandVolume [Controller Server]", func(sc *SanityContex
2188
2180
})
2189
2181
})
2190
2182
2191
- func MakeCreateVolumeReq (sc * SanityContext , name string ) * csi.CreateVolumeRequest {
2183
+ func MakeCreateVolumeReq (sc * TestContext , name string ) * csi.CreateVolumeRequest {
2192
2184
size1 := TestVolumeSize (sc )
2193
2185
2194
2186
req := & csi.CreateVolumeRequest {
@@ -2217,7 +2209,7 @@ func MakeCreateVolumeReq(sc *SanityContext, name string) *csi.CreateVolumeReques
2217
2209
return req
2218
2210
}
2219
2211
2220
- func MakeCreateSnapshotReq (sc * SanityContext , name , sourceVolumeId string ) * csi.CreateSnapshotRequest {
2212
+ func MakeCreateSnapshotReq (sc * TestContext , name , sourceVolumeId string ) * csi.CreateSnapshotRequest {
2221
2213
req := & csi.CreateSnapshotRequest {
2222
2214
Name : name ,
2223
2215
SourceVolumeId : sourceVolumeId ,
@@ -2231,7 +2223,7 @@ func MakeCreateSnapshotReq(sc *SanityContext, name, sourceVolumeId string) *csi.
2231
2223
return req
2232
2224
}
2233
2225
2234
- func MakeDeleteSnapshotReq (sc * SanityContext , id string ) * csi.DeleteSnapshotRequest {
2226
+ func MakeDeleteSnapshotReq (sc * TestContext , id string ) * csi.DeleteSnapshotRequest {
2235
2227
delSnapReq := & csi.DeleteSnapshotRequest {
2236
2228
SnapshotId : id ,
2237
2229
}
@@ -2243,7 +2235,7 @@ func MakeDeleteSnapshotReq(sc *SanityContext, id string) *csi.DeleteSnapshotRequ
2243
2235
return delSnapReq
2244
2236
}
2245
2237
2246
- func MakeDeleteVolumeReq (sc * SanityContext , id string ) * csi.DeleteVolumeRequest {
2238
+ func MakeDeleteVolumeReq (sc * TestContext , id string ) * csi.DeleteVolumeRequest {
2247
2239
delVolReq := & csi.DeleteVolumeRequest {
2248
2240
VolumeId : id ,
2249
2241
}
@@ -2256,7 +2248,7 @@ func MakeDeleteVolumeReq(sc *SanityContext, id string) *csi.DeleteVolumeRequest
2256
2248
}
2257
2249
2258
2250
// MakeControllerPublishVolumeReq creates and returns a ControllerPublishVolumeRequest.
2259
- func MakeControllerPublishVolumeReq (sc * SanityContext , volID , nodeID string ) * csi.ControllerPublishVolumeRequest {
2251
+ func MakeControllerPublishVolumeReq (sc * TestContext , volID , nodeID string ) * csi.ControllerPublishVolumeRequest {
2260
2252
return & csi.ControllerPublishVolumeRequest {
2261
2253
VolumeId : volID ,
2262
2254
NodeId : nodeID ,
@@ -2274,7 +2266,7 @@ func MakeControllerPublishVolumeReq(sc *SanityContext, volID, nodeID string) *cs
2274
2266
}
2275
2267
2276
2268
// MakeControllerUnpublishVolumeReq creates and returns a ControllerUnpublishVolumeRequest.
2277
- func MakeControllerUnpublishVolumeReq (sc * SanityContext , volID , nodeID string ) * csi.ControllerUnpublishVolumeRequest {
2269
+ func MakeControllerUnpublishVolumeReq (sc * TestContext , volID , nodeID string ) * csi.ControllerUnpublishVolumeRequest {
2278
2270
return & csi.ControllerUnpublishVolumeRequest {
2279
2271
VolumeId : volID ,
2280
2272
NodeId : nodeID ,
@@ -2283,7 +2275,7 @@ func MakeControllerUnpublishVolumeReq(sc *SanityContext, volID, nodeID string) *
2283
2275
}
2284
2276
2285
2277
// CreateAndControllerPublishVolume creates and controller publishes a volume given a volume name and node ID.
2286
- func CreateAndControllerPublishVolume (sc * SanityContext , c csi.ControllerClient , volName , nodeID string ) (volID string , err error ) {
2278
+ func CreateAndControllerPublishVolume (sc * TestContext , c csi.ControllerClient , volName , nodeID string ) (volID string , err error ) {
2287
2279
vol , err := c .CreateVolume (context .Background (), MakeCreateVolumeReq (sc , volName ))
2288
2280
Expect (err ).NotTo (HaveOccurred ())
2289
2281
Expect (vol ).NotTo (BeNil ())
@@ -2298,7 +2290,7 @@ func CreateAndControllerPublishVolume(sc *SanityContext, c csi.ControllerClient,
2298
2290
}
2299
2291
2300
2292
// ControllerUnpublishAndDeleteVolume controller unpublishes and deletes a volume, given volume ID and node ID.
2301
- func ControllerUnpublishAndDeleteVolume (sc * SanityContext , c csi.ControllerClient , volID , nodeID string ) error {
2293
+ func ControllerUnpublishAndDeleteVolume (sc * TestContext , c csi.ControllerClient , volID , nodeID string ) error {
2302
2294
_ , err := c .ControllerUnpublishVolume (
2303
2295
context .Background (),
2304
2296
MakeControllerUnpublishVolumeReq (sc , volID , nodeID ),
0 commit comments