@@ -215,7 +215,7 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() {
215
215
writeCmd := createWriteCmd (volumeDir , testFile , testFileContent , testVol .localVolumeType )
216
216
217
217
ginkgo .By ("Writing in pod1" )
218
- podRWCmdExec (pod1 , writeCmd )
218
+ podRWCmdExec (f , pod1 , writeCmd )
219
219
})
220
220
221
221
ginkgo .AfterEach (func () {
@@ -226,28 +226,28 @@ var _ = utils.SIGDescribe("PersistentVolumes-local ", func() {
226
226
ginkgo .It ("should be able to mount volume and read from pod1" , func () {
227
227
ginkgo .By ("Reading in pod1" )
228
228
// testFileContent was written in BeforeEach
229
- testReadFileContent (volumeDir , testFile , testFileContent , pod1 , testVolType )
229
+ testReadFileContent (f , volumeDir , testFile , testFileContent , pod1 , testVolType )
230
230
})
231
231
232
232
ginkgo .It ("should be able to mount volume and write from pod1" , func () {
233
233
// testFileContent was written in BeforeEach
234
- testReadFileContent (volumeDir , testFile , testFileContent , pod1 , testVolType )
234
+ testReadFileContent (f , volumeDir , testFile , testFileContent , pod1 , testVolType )
235
235
236
236
ginkgo .By ("Writing in pod1" )
237
237
writeCmd := createWriteCmd (volumeDir , testFile , testVol .ltr .Path /*writeTestFileContent*/ , testVolType )
238
- podRWCmdExec (pod1 , writeCmd )
238
+ podRWCmdExec (f , pod1 , writeCmd )
239
239
})
240
240
})
241
241
242
242
ginkgo .Context ("Two pods mounting a local volume at the same time" , func () {
243
243
ginkgo .It ("should be able to write from pod1 and read from pod2" , func () {
244
- twoPodsReadWriteTest (config , testVol )
244
+ twoPodsReadWriteTest (f , config , testVol )
245
245
})
246
246
})
247
247
248
248
ginkgo .Context ("Two pods mounting a local volume one after the other" , func () {
249
249
ginkgo .It ("should be able to write from pod1 and read from pod2" , func () {
250
- twoPodsReadWriteSerialTest (config , testVol )
250
+ twoPodsReadWriteSerialTest (f , config , testVol )
251
251
})
252
252
})
253
253
@@ -703,7 +703,7 @@ func testPodWithNodeConflict(config *localTestConfig, testVolType localVolumeTyp
703
703
// The tests below are run against multiple mount point types
704
704
705
705
// Test two pods at the same time, write from pod1, and read from pod2
706
- func twoPodsReadWriteTest (config * localTestConfig , testVol * localTestVolume ) {
706
+ func twoPodsReadWriteTest (f * framework. Framework , config * localTestConfig , testVol * localTestVolume ) {
707
707
ginkgo .By ("Creating pod1 to write to the PV" )
708
708
pod1 , pod1Err := createLocalPod (config , testVol , nil )
709
709
framework .ExpectNoError (pod1Err )
@@ -712,26 +712,26 @@ func twoPodsReadWriteTest(config *localTestConfig, testVol *localTestVolume) {
712
712
writeCmd := createWriteCmd (volumeDir , testFile , testFileContent , testVol .localVolumeType )
713
713
714
714
ginkgo .By ("Writing in pod1" )
715
- podRWCmdExec (pod1 , writeCmd )
715
+ podRWCmdExec (f , pod1 , writeCmd )
716
716
717
717
// testFileContent was written after creating pod1
718
- testReadFileContent (volumeDir , testFile , testFileContent , pod1 , testVol .localVolumeType )
718
+ testReadFileContent (f , volumeDir , testFile , testFileContent , pod1 , testVol .localVolumeType )
719
719
720
720
ginkgo .By ("Creating pod2 to read from the PV" )
721
721
pod2 , pod2Err := createLocalPod (config , testVol , nil )
722
722
framework .ExpectNoError (pod2Err )
723
723
verifyLocalPod (config , testVol , pod2 , config .node0 .Name )
724
724
725
725
// testFileContent was written after creating pod1
726
- testReadFileContent (volumeDir , testFile , testFileContent , pod2 , testVol .localVolumeType )
726
+ testReadFileContent (f , volumeDir , testFile , testFileContent , pod2 , testVol .localVolumeType )
727
727
728
728
writeCmd = createWriteCmd (volumeDir , testFile , testVol .ltr .Path /*writeTestFileContent*/ , testVol .localVolumeType )
729
729
730
730
ginkgo .By ("Writing in pod2" )
731
- podRWCmdExec (pod2 , writeCmd )
731
+ podRWCmdExec (f , pod2 , writeCmd )
732
732
733
733
ginkgo .By ("Reading in pod1" )
734
- testReadFileContent (volumeDir , testFile , testVol .ltr .Path , pod1 , testVol .localVolumeType )
734
+ testReadFileContent (f , volumeDir , testFile , testVol .ltr .Path , pod1 , testVol .localVolumeType )
735
735
736
736
ginkgo .By ("Deleting pod1" )
737
737
e2epod .DeletePodOrFail (config .client , config .ns , pod1 .Name )
@@ -740,7 +740,7 @@ func twoPodsReadWriteTest(config *localTestConfig, testVol *localTestVolume) {
740
740
}
741
741
742
742
// Test two pods one after other, write from pod1, and read from pod2
743
- func twoPodsReadWriteSerialTest (config * localTestConfig , testVol * localTestVolume ) {
743
+ func twoPodsReadWriteSerialTest (f * framework. Framework , config * localTestConfig , testVol * localTestVolume ) {
744
744
ginkgo .By ("Creating pod1" )
745
745
pod1 , pod1Err := createLocalPod (config , testVol , nil )
746
746
framework .ExpectNoError (pod1Err )
@@ -749,10 +749,10 @@ func twoPodsReadWriteSerialTest(config *localTestConfig, testVol *localTestVolum
749
749
writeCmd := createWriteCmd (volumeDir , testFile , testFileContent , testVol .localVolumeType )
750
750
751
751
ginkgo .By ("Writing in pod1" )
752
- podRWCmdExec (pod1 , writeCmd )
752
+ podRWCmdExec (f , pod1 , writeCmd )
753
753
754
754
// testFileContent was written after creating pod1
755
- testReadFileContent (volumeDir , testFile , testFileContent , pod1 , testVol .localVolumeType )
755
+ testReadFileContent (f , volumeDir , testFile , testFileContent , pod1 , testVol .localVolumeType )
756
756
757
757
ginkgo .By ("Deleting pod1" )
758
758
e2epod .DeletePodOrFail (config .client , config .ns , pod1 .Name )
@@ -763,7 +763,7 @@ func twoPodsReadWriteSerialTest(config *localTestConfig, testVol *localTestVolum
763
763
verifyLocalPod (config , testVol , pod2 , config .node0 .Name )
764
764
765
765
ginkgo .By ("Reading in pod2" )
766
- testReadFileContent (volumeDir , testFile , testFileContent , pod2 , testVol .localVolumeType )
766
+ testReadFileContent (f , volumeDir , testFile , testFileContent , pod2 , testVol .localVolumeType )
767
767
768
768
ginkgo .By ("Deleting pod2" )
769
769
e2epod .DeletePodOrFail (config .client , config .ns , pod2 .Name )
@@ -1015,16 +1015,16 @@ func createReadCmd(testFileDir string, testFile string, volumeType localVolumeTy
1015
1015
}
1016
1016
1017
1017
// Read testFile and evaluate whether it contains the testFileContent
1018
- func testReadFileContent (testFileDir string , testFile string , testFileContent string , pod * v1.Pod , volumeType localVolumeType ) {
1018
+ func testReadFileContent (f * framework. Framework , testFileDir string , testFile string , testFileContent string , pod * v1.Pod , volumeType localVolumeType ) {
1019
1019
readCmd := createReadCmd (testFileDir , testFile , volumeType )
1020
- readOut := podRWCmdExec (pod , readCmd )
1020
+ readOut := podRWCmdExec (f , pod , readCmd )
1021
1021
gomega .Expect (readOut ).To (gomega .ContainSubstring (testFileContent ))
1022
1022
}
1023
1023
1024
1024
// Execute a read or write command in a pod.
1025
1025
// Fail on error
1026
- func podRWCmdExec (pod * v1.Pod , cmd string ) string {
1027
- out , err := utils .PodExec (pod , cmd )
1026
+ func podRWCmdExec (f * framework. Framework , pod * v1.Pod , cmd string ) string {
1027
+ out , err := utils .PodExec (f , pod , cmd )
1028
1028
framework .Logf ("podRWCmdExec out: %q err: %v" , out , err )
1029
1029
framework .ExpectNoError (err )
1030
1030
return out
0 commit comments