@@ -43,7 +43,6 @@ import (
43
43
"time"
44
44
45
45
"github.com/onsi/ginkgo"
46
- "github.com/onsi/gomega"
47
46
v1 "k8s.io/api/core/v1"
48
47
rbacv1 "k8s.io/api/rbac/v1"
49
48
storagev1 "k8s.io/api/storage/v1"
@@ -119,7 +118,7 @@ func (n *nfsDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
119
118
120
119
func (n * nfsDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
121
120
nv , ok := volume .(* nfsVolume )
122
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to NFS test volume" )
121
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to NFS test volume" )
123
122
return & v1.VolumeSource {
124
123
NFS : & v1.NFSVolumeSource {
125
124
Server : nv .serverIP ,
@@ -131,7 +130,7 @@ func (n *nfsDriver) GetVolumeSource(readOnly bool, fsType string, volume testsui
131
130
132
131
func (n * nfsDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
133
132
nv , ok := volume .(* nfsVolume )
134
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to NFS test volume" )
133
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to NFS test volume" )
135
134
return & v1.PersistentVolumeSource {
136
135
NFS : & v1.NFSVolumeSource {
137
136
Server : nv .serverIP ,
@@ -260,7 +259,7 @@ func (g *glusterFSDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern)
260
259
261
260
func (g * glusterFSDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
262
261
gv , ok := volume .(* glusterVolume )
263
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to Gluster test volume" )
262
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to Gluster test volume" )
264
263
265
264
name := gv .prefix + "-server"
266
265
return & v1.VolumeSource {
@@ -275,7 +274,7 @@ func (g *glusterFSDriver) GetVolumeSource(readOnly bool, fsType string, volume t
275
274
276
275
func (g * glusterFSDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
277
276
gv , ok := volume .(* glusterVolume )
278
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to Gluster test volume" )
277
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to Gluster test volume" )
279
278
280
279
name := gv .prefix + "-server"
281
280
return & v1.PersistentVolumeSource {
@@ -384,7 +383,7 @@ func (i *iSCSIDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
384
383
385
384
func (i * iSCSIDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
386
385
iv , ok := volume .(* iSCSIVolume )
387
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to iSCSI test volume" )
386
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to iSCSI test volume" )
388
387
389
388
volSource := v1.VolumeSource {
390
389
ISCSI : & v1.ISCSIVolumeSource {
@@ -402,7 +401,7 @@ func (i *iSCSIDriver) GetVolumeSource(readOnly bool, fsType string, volume tests
402
401
403
402
func (i * iSCSIDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
404
403
iv , ok := volume .(* iSCSIVolume )
405
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to iSCSI test volume" )
404
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to iSCSI test volume" )
406
405
407
406
pvSource := v1.PersistentVolumeSource {
408
407
ISCSI : & v1.ISCSIPersistentVolumeSource {
@@ -501,7 +500,7 @@ func (r *rbdDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
501
500
502
501
func (r * rbdDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
503
502
rv , ok := volume .(* rbdVolume )
504
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to RBD test volume" )
503
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to RBD test volume" )
505
504
506
505
volSource := v1.VolumeSource {
507
506
RBD : & v1.RBDVolumeSource {
@@ -523,7 +522,7 @@ func (r *rbdDriver) GetVolumeSource(readOnly bool, fsType string, volume testsui
523
522
524
523
func (r * rbdDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
525
524
rv , ok := volume .(* rbdVolume )
526
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to RBD test volume" )
525
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to RBD test volume" )
527
526
528
527
f := rv .f
529
528
ns := f .Namespace
@@ -624,7 +623,7 @@ func (c *cephFSDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
624
623
625
624
func (c * cephFSDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
626
625
cv , ok := volume .(* cephVolume )
627
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to Ceph test volume" )
626
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to Ceph test volume" )
628
627
629
628
return & v1.VolumeSource {
630
629
CephFS : & v1.CephFSVolumeSource {
@@ -640,7 +639,7 @@ func (c *cephFSDriver) GetVolumeSource(readOnly bool, fsType string, volume test
640
639
641
640
func (c * cephFSDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
642
641
cv , ok := volume .(* cephVolume )
643
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to Ceph test volume" )
642
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to Ceph test volume" )
644
643
645
644
ns := cv .f .Namespace
646
645
@@ -794,7 +793,7 @@ func (h *hostPathSymlinkDriver) SkipUnsupportedTest(pattern testpatterns.TestPat
794
793
795
794
func (h * hostPathSymlinkDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
796
795
hv , ok := volume .(* hostPathSymlinkVolume )
797
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to Hostpath Symlink test volume" )
796
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to Hostpath Symlink test volume" )
798
797
799
798
// hostPathSymlink doesn't support readOnly volume
800
799
if readOnly {
@@ -1013,7 +1012,7 @@ func (c *cinderDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
1013
1012
1014
1013
func (c * cinderDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
1015
1014
cv , ok := volume .(* cinderVolume )
1016
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to Cinder test volume" )
1015
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to Cinder test volume" )
1017
1016
1018
1017
volSource := v1.VolumeSource {
1019
1018
Cinder : & v1.CinderVolumeSource {
@@ -1029,7 +1028,7 @@ func (c *cinderDriver) GetVolumeSource(readOnly bool, fsType string, volume test
1029
1028
1030
1029
func (c * cinderDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
1031
1030
cv , ok := volume .(* cinderVolume )
1032
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to Cinder test volume" )
1031
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to Cinder test volume" )
1033
1032
1034
1033
pvSource := v1.PersistentVolumeSource {
1035
1034
Cinder : & v1.CinderPersistentVolumeSource {
@@ -1191,7 +1190,7 @@ func (g *gcePdDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
1191
1190
1192
1191
func (g * gcePdDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
1193
1192
gv , ok := volume .(* gcePdVolume )
1194
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to GCE PD test volume" )
1193
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to GCE PD test volume" )
1195
1194
volSource := v1.VolumeSource {
1196
1195
GCEPersistentDisk : & v1.GCEPersistentDiskVolumeSource {
1197
1196
PDName : gv .volumeName ,
@@ -1206,7 +1205,7 @@ func (g *gcePdDriver) GetVolumeSource(readOnly bool, fsType string, volume tests
1206
1205
1207
1206
func (g * gcePdDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
1208
1207
gv , ok := volume .(* gcePdVolume )
1209
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to GCE PD test volume" )
1208
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to GCE PD test volume" )
1210
1209
pvSource := v1.PersistentVolumeSource {
1211
1210
GCEPersistentDisk : & v1.GCEPersistentDiskVolumeSource {
1212
1211
PDName : gv .volumeName ,
@@ -1316,7 +1315,7 @@ func (v *vSphereDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
1316
1315
1317
1316
func (v * vSphereDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
1318
1317
vsv , ok := volume .(* vSphereVolume )
1319
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to vSphere test volume" )
1318
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to vSphere test volume" )
1320
1319
1321
1320
// vSphere driver doesn't seem to support readOnly volume
1322
1321
// TODO: check if it is correct
@@ -1336,7 +1335,7 @@ func (v *vSphereDriver) GetVolumeSource(readOnly bool, fsType string, volume tes
1336
1335
1337
1336
func (v * vSphereDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
1338
1337
vsv , ok := volume .(* vSphereVolume )
1339
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to vSphere test volume" )
1338
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to vSphere test volume" )
1340
1339
1341
1340
// vSphere driver doesn't seem to support readOnly volume
1342
1341
// TODO: check if it is correct
@@ -1445,8 +1444,7 @@ func (a *azureDiskDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern)
1445
1444
1446
1445
func (a * azureDiskDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
1447
1446
av , ok := volume .(* azureDiskVolume )
1448
- gomega .Expect (ok ).To (gomega .BeTrue (), "Failed to cast test volume to Azure test volume" )
1449
-
1447
+ framework .ExpectEqual (ok , true , "Failed to cast test volume to Azure test volume" )
1450
1448
diskName := av .volumeName [(strings .LastIndex (av .volumeName , "/" ) + 1 ):]
1451
1449
1452
1450
kind := v1 .AzureManagedDisk
@@ -1466,7 +1464,7 @@ func (a *azureDiskDriver) GetVolumeSource(readOnly bool, fsType string, volume t
1466
1464
1467
1465
func (a * azureDiskDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
1468
1466
av , ok := volume .(* azureDiskVolume )
1469
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to Azure test volume" )
1467
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to Azure test volume" )
1470
1468
1471
1469
diskName := av .volumeName [(strings .LastIndex (av .volumeName , "/" ) + 1 ):]
1472
1470
@@ -1579,7 +1577,7 @@ func (a *awsDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
1579
1577
1580
1578
func (a * awsDriver ) GetVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) * v1.VolumeSource {
1581
1579
av , ok := volume .(* awsVolume )
1582
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to AWS test volume" )
1580
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to AWS test volume" )
1583
1581
volSource := v1.VolumeSource {
1584
1582
AWSElasticBlockStore : & v1.AWSElasticBlockStoreVolumeSource {
1585
1583
VolumeID : av .volumeName ,
@@ -1594,7 +1592,7 @@ func (a *awsDriver) GetVolumeSource(readOnly bool, fsType string, volume testsui
1594
1592
1595
1593
func (a * awsDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
1596
1594
av , ok := volume .(* awsVolume )
1597
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to AWS test volume" )
1595
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to AWS test volume" )
1598
1596
pvSource := v1.PersistentVolumeSource {
1599
1597
AWSElasticBlockStore : & v1.AWSElasticBlockStoreVolumeSource {
1600
1598
VolumeID : av .volumeName ,
@@ -1832,7 +1830,7 @@ func (l *localDriver) nodeAffinityForNode(node *v1.Node) *v1.VolumeNodeAffinity
1832
1830
1833
1831
func (l * localDriver ) GetPersistentVolumeSource (readOnly bool , fsType string , volume testsuites.TestVolume ) (* v1.PersistentVolumeSource , * v1.VolumeNodeAffinity ) {
1834
1832
lv , ok := volume .(* localVolume )
1835
- gomega . Expect (ok ). To ( gomega . BeTrue () , "Failed to cast test volume to local test volume" )
1833
+ framework . ExpectEqual (ok , true , "Failed to cast test volume to local test volume" )
1836
1834
return & v1.PersistentVolumeSource {
1837
1835
Local : & v1.LocalVolumeSource {
1838
1836
Path : lv .ltr .Path ,
0 commit comments