@@ -59,6 +59,10 @@ func (t *gcsFuseCSIFileCacheTestSuite) SkipUnsupportedTests(_ storageframework.T
5959}
6060
6161func (t * gcsFuseCSIFileCacheTestSuite ) DefineTests (driver storageframework.TestDriver , pattern storageframework.TestPattern ) {
62+ gcsfuseDriver , ok := driver .(* specs.GCSFuseCSITestDriver )
63+ if ! ok {
64+ framework .Failf ("This test requires a GCSFuseCSITestDriver but received a %T" , driver )
65+ }
6266 type local struct {
6367 config * storageframework.PerTestConfig
6468 volumeResource * storageframework.VolumeResource
@@ -94,9 +98,9 @@ func (t *gcsFuseCSIFileCacheTestSuite) DefineTests(driver storageframework.TestD
9498 // The test driver uses config.Prefix to pass the bucket names back to the test suite.
9599 bucketName := l .config .Prefix
96100
97- // Create files using gsutil
101+ // Create files using go client
98102 fileName := uuid .NewString ()
99- specs .CreateTestFileInBucket (fileName , bucketName )
103+ gcsfuseDriver .CreateTestFileInBucket (ctx , fileName , bucketName )
100104
101105 ginkgo .By ("Configuring the pod" )
102106 tPod := specs .NewTestPod (f .ClientSet , f .Namespace )
@@ -129,9 +133,9 @@ func (t *gcsFuseCSIFileCacheTestSuite) DefineTests(driver storageframework.TestD
129133 // The test driver uses config.Prefix to pass the bucket names back to the test suite.
130134 bucketName := l .config .Prefix
131135
132- // Create files using gsutil
136+ // Create files using go client
133137 fileName := uuid .NewString ()
134- specs .CreateTestFileInBucket (fileName , bucketName )
138+ gcsfuseDriver .CreateTestFileInBucket (ctx , fileName , bucketName )
135139
136140 ginkgo .By ("Configuring the pod" )
137141 tPod := specs .NewTestPod (f .ClientSet , f .Namespace )
@@ -170,9 +174,9 @@ func (t *gcsFuseCSIFileCacheTestSuite) DefineTests(driver storageframework.TestD
170174 // The test driver uses config.Prefix to pass the bucket names back to the test suite.
171175 bucketName := l .config .Prefix
172176
173- // Create files using gsutil
177+ // Create files using go client
174178 fileName := uuid .NewString ()
175- specs .CreateTestFileInBucket (fileName , bucketName )
179+ gcsfuseDriver .CreateTestFileInBucket (ctx , fileName , bucketName )
176180
177181 ginkgo .By ("Configuring the pod" )
178182 tPod := specs .NewTestPod (f .ClientSet , f .Namespace )
@@ -212,9 +216,9 @@ func (t *gcsFuseCSIFileCacheTestSuite) DefineTests(driver storageframework.TestD
212216 // The test driver uses config.Prefix to pass the bucket names back to the test suite.
213217 bucketName := l .config .Prefix
214218
215- // Create files using gsutil
219+ // Create files using go client
216220 fileName := uuid .NewString ()
217- specs .CreateTestFileInBucket (fileName , bucketName )
221+ gcsfuseDriver .CreateTestFileInBucket (ctx , fileName , bucketName )
218222
219223 ginkgo .By ("Configuring the pod" )
220224 tPod := specs .NewTestPod (f .ClientSet , f .Namespace )
@@ -246,7 +250,7 @@ func (t *gcsFuseCSIFileCacheTestSuite) DefineTests(driver storageframework.TestD
246250 // Create files using gsutil
247251 fileName := uuid .NewString ()
248252 // The file size 110 MB is larger than the 100 MB fileCacheCapacity
249- specs .CreateTestFileWithSizeInBucket (fileName , bucketName , 110 * 1024 * 1024 )
253+ gcsfuseDriver .CreateTestFileWithSizeInBucket (ctx , fileName , bucketName , 110 * 1024 * 1024 )
250254
251255 ginkgo .By ("Configuring the pod" )
252256 tPod := specs .NewTestPod (f .ClientSet , f .Namespace )
@@ -276,7 +280,7 @@ func (t *gcsFuseCSIFileCacheTestSuite) DefineTests(driver storageframework.TestD
276280 // Create files using gsutil
277281 fileName := uuid .NewString ()
278282 // The file size 2 GB is larger than the 1 GB PD
279- specs .CreateTestFileWithSizeInBucket (fileName , bucketName , 2 * 1024 * 1024 * 1024 )
283+ gcsfuseDriver .CreateTestFileWithSizeInBucket (ctx , fileName , bucketName , 2 * 1024 * 1024 * 1024 )
280284
281285 ginkgo .By ("Configuring the pod" )
282286 tPod := specs .NewTestPod (f .ClientSet , f .Namespace )
0 commit comments