@@ -30,7 +30,7 @@ import (
3030 admissionapi "k8s.io/pod-security-admission/api"
3131)
3232
33- var _ = ginkgo .Describe ("Dynamic Provisioning" , func () {
33+ var _ = ginkgo .Describe ("Dynamic Provisioning" , func (ctx ginkgo. SpecContext ) {
3434 f := framework .NewDefaultFramework ("smb" )
3535 f .NamespacePodSecurityEnforceLevel = admissionapi .LevelPrivileged
3636
@@ -40,7 +40,7 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
4040 testDriver driver.PVTestDriver
4141 )
4242
43- ginkgo .BeforeEach (func () {
43+ ginkgo .BeforeEach (func (ctx ginkgo. SpecContext ) {
4444 checkPodsRestart := testCmd {
4545 command : "sh" ,
4646 args : []string {"test/utils/check_driver_pods_restart.sh" },
@@ -54,7 +54,7 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
5454 })
5555
5656 testDriver = driver .InitSMBDriver ()
57- ginkgo .It ("should create a volume after driver restart [smb.csi.k8s.io]" , func () {
57+ ginkgo .It ("should create a volume after driver restart [smb.csi.k8s.io]" , func (ctx ginkgo. SpecContext ) {
5858 ginkgo .Skip ("test case is disabled since node logs would be lost after driver restart" )
5959 pod := testsuites.PodDetails {
6060 Cmd : convertToPowershellCommandIfNecessary ("echo 'hello world' >> /mnt/test-1/data && while true; do sleep 3600; done" ),
@@ -94,10 +94,10 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
9494 execTestCmd ([]testCmd {restartDriver })
9595 },
9696 }
97- test .Run (cs , ns )
97+ test .Run (ctx , cs , ns )
9898 })
9999
100- ginkgo .It ("should create a volume on demand with mount options [smb.csi.k8s.io] [Windows]" , func () {
100+ ginkgo .It ("should create a volume on demand with mount options [smb.csi.k8s.io] [Windows]" , func (ctx ginkgo. SpecContext ) {
101101 pods := []testsuites.PodDetails {
102102 {
103103 Cmd : convertToPowershellCommandIfNecessary ("echo 'hello world' > /mnt/test-1/data && grep 'hello world' /mnt/test-1/data" ),
@@ -128,10 +128,10 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
128128 StorageClassParameters : defaultStorageClassParameters ,
129129 }
130130
131- test .Run (cs , ns )
131+ test .Run (ctx , cs , ns )
132132 })
133133
134- ginkgo .It ("should create multiple PV objects, bind to PVCs and attach all to different pods on the same node [smb.csi.k8s.io] [Windows]" , func () {
134+ ginkgo .It ("should create multiple PV objects, bind to PVCs and attach all to different pods on the same node [smb.csi.k8s.io] [Windows]" , func (ctx ginkgo. SpecContext ) {
135135 pods := []testsuites.PodDetails {
136136 {
137137 Cmd : convertToPowershellCommandIfNecessary ("while true; do echo $(date -u) >> /mnt/test-1/data; sleep 100; done" ),
@@ -166,11 +166,11 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
166166 ColocatePods : true ,
167167 StorageClassParameters : defaultStorageClassParameters ,
168168 }
169- test .Run (cs , ns )
169+ test .Run (ctx , cs , ns )
170170 })
171171
172172 // Track issue https://github.com/kubernetes/kubernetes/issues/70505
173- ginkgo .It ("should create a volume on demand and mount it as readOnly in a pod [smb.csi.k8s.io]" , func () {
173+ ginkgo .It ("should create a volume on demand and mount it as readOnly in a pod [smb.csi.k8s.io]" , func (ctx ginkgo. SpecContext ) {
174174 // Windows volume does not support readOnly
175175 skipIfTestingInWindowsCluster ()
176176 pods := []testsuites.PodDetails {
@@ -194,10 +194,10 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
194194 Pods : pods ,
195195 StorageClassParameters : defaultStorageClassParameters ,
196196 }
197- test .Run (cs , ns )
197+ test .Run (ctx , cs , ns )
198198 })
199199
200- ginkgo .It ("should create a deployment object, write and read to it, delete the pod and write and read to it again [smb.csi.k8s.io] [Windows]" , func () {
200+ ginkgo .It ("should create a deployment object, write and read to it, delete the pod and write and read to it again [smb.csi.k8s.io] [Windows]" , func (ctx ginkgo. SpecContext ) {
201201 pod := testsuites.PodDetails {
202202 Cmd : convertToPowershellCommandIfNecessary ("echo 'hello world' >> /mnt/test-1/data && while true; do sleep 100; done" ),
203203 Volumes : []testsuites.VolumeDetails {
@@ -227,10 +227,10 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
227227 },
228228 StorageClassParameters : defaultStorageClassParameters ,
229229 }
230- test .Run (cs , ns )
230+ test .Run (ctx , cs , ns )
231231 })
232232
233- ginkgo .It (fmt .Sprintf ("should delete PV with reclaimPolicy %q [smb.csi.k8s.io] [Windows]" , v1 .PersistentVolumeReclaimDelete ), func () {
233+ ginkgo .It (fmt .Sprintf ("should delete PV with reclaimPolicy %q [smb.csi.k8s.io] [Windows]" , v1 .PersistentVolumeReclaimDelete ), func (ctx ginkgo. SpecContext ) {
234234 reclaimPolicy := v1 .PersistentVolumeReclaimDelete
235235 volumes := []testsuites.VolumeDetails {
236236 {
@@ -243,10 +243,10 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
243243 Volumes : volumes ,
244244 StorageClassParameters : defaultStorageClassParameters ,
245245 }
246- test .Run (cs , ns )
246+ test .Run (ctx , cs , ns )
247247 })
248248
249- ginkgo .It (fmt .Sprintf ("should retain PV with reclaimPolicy %q [smb.csi.k8s.io] [Windows]" , v1 .PersistentVolumeReclaimRetain ), func () {
249+ ginkgo .It (fmt .Sprintf ("should retain PV with reclaimPolicy %q [smb.csi.k8s.io] [Windows]" , v1 .PersistentVolumeReclaimRetain ), func (ctx ginkgo. SpecContext ) {
250250 reclaimPolicy := v1 .PersistentVolumeReclaimRetain
251251 volumes := []testsuites.VolumeDetails {
252252 {
@@ -260,10 +260,10 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
260260 Driver : smbDriver ,
261261 StorageClassParameters : defaultStorageClassParameters ,
262262 }
263- test .Run (cs , ns )
263+ test .Run (ctx , cs , ns )
264264 })
265265
266- ginkgo .It ("should create a pod with multiple volumes [smb.csi.k8s.io] [Windows]" , func () {
266+ ginkgo .It ("should create a pod with multiple volumes [smb.csi.k8s.io] [Windows]" , func (ctx ginkgo. SpecContext ) {
267267 volumes := []testsuites.VolumeDetails {}
268268 for i := 1 ; i <= 6 ; i ++ {
269269 volume := testsuites.VolumeDetails {
@@ -288,10 +288,10 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
288288 Pods : pods ,
289289 StorageClassParameters : subDirStorageClassParameters ,
290290 }
291- test .Run (cs , ns )
291+ test .Run (ctx , cs , ns )
292292 })
293293
294- ginkgo .It ("should create a pod with volume mount subpath [smb.csi.k8s.io] [Windows]" , func () {
294+ ginkgo .It ("should create a pod with volume mount subpath [smb.csi.k8s.io] [Windows]" , func (ctx ginkgo. SpecContext ) {
295295 pods := []testsuites.PodDetails {
296296 {
297297 Cmd : convertToPowershellCommandIfNecessary ("echo 'hello world' > /mnt/test-1/data && grep 'hello world' /mnt/test-1/data" ),
@@ -312,10 +312,10 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
312312 Pods : pods ,
313313 StorageClassParameters : noProvisionerSecretStorageClassParameters ,
314314 }
315- test .Run (cs , ns )
315+ test .Run (ctx , cs , ns )
316316 })
317317
318- ginkgo .It ("should clone a volume from an existing volume [smb.csi.k8s.io]" , func () {
318+ ginkgo .It ("should clone a volume from an existing volume [smb.csi.k8s.io]" , func (ctx ginkgo. SpecContext ) {
319319 skipIfTestingInWindowsCluster ()
320320
321321 pod := testsuites.PodDetails {
@@ -348,6 +348,6 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
348348 PodWithClonedVolume : podWithClonedVolume ,
349349 StorageClassParameters : defaultStorageClassParameters ,
350350 }
351- test .Run (cs , ns )
351+ test .Run (ctx , cs , ns )
352352 })
353353})
0 commit comments