Skip to content

Commit 4ca9359

Browse files
authored
Merge pull request kubernetes#86147 from tanjunchen/use-framework-Equal-20191211
test/e2e/storage : use framework.Equal() replace gomega.Expect(...).To(gomega.BeTrue(),...)
2 parents 2f66bcf + f8e0c6b commit 4ca9359

12 files changed

+41
-47
lines changed

test/e2e/storage/csi_mock_volume.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ var _ = utils.SIGDescribe("CSI mock volume", func() {
465465
sc, pvc, pod := createPod(false)
466466
gomega.Expect(pod).NotTo(gomega.BeNil(), "while creating pod for resizing")
467467

468-
gomega.Expect(*sc.AllowVolumeExpansion).To(gomega.BeTrue(), "failed creating sc with allowed expansion")
468+
framework.ExpectEqual(*sc.AllowVolumeExpansion, true, "failed creating sc with allowed expansion")
469469

470470
err = e2epod.WaitForPodNameRunningInNamespace(m.cs, pod.Name, pod.Namespace)
471471
framework.ExpectNoError(err, "Failed to start pod1: %v", err)
@@ -557,7 +557,7 @@ var _ = utils.SIGDescribe("CSI mock volume", func() {
557557
sc, pvc, pod := createPod(false)
558558
gomega.Expect(pod).NotTo(gomega.BeNil(), "while creating pod for resizing")
559559

560-
gomega.Expect(*sc.AllowVolumeExpansion).To(gomega.BeTrue(), "failed creating sc with allowed expansion")
560+
framework.ExpectEqual(*sc.AllowVolumeExpansion, true, "failed creating sc with allowed expansion")
561561

562562
err = e2epod.WaitForPodNameRunningInNamespace(m.cs, pod.Name, pod.Namespace)
563563
framework.ExpectNoError(err, "Failed to start pod1: %v", err)

test/e2e/storage/drivers/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ go_library(
3535
"//test/e2e/storage/vsphere:go_default_library",
3636
"//test/utils/image:go_default_library",
3737
"//vendor/github.com/onsi/ginkgo:go_default_library",
38-
"//vendor/github.com/onsi/gomega:go_default_library",
3938
],
4039
)
4140

test/e2e/storage/drivers/in_tree.go

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import (
4343
"time"
4444

4545
"github.com/onsi/ginkgo"
46-
"github.com/onsi/gomega"
4746
v1 "k8s.io/api/core/v1"
4847
rbacv1 "k8s.io/api/rbac/v1"
4948
storagev1 "k8s.io/api/storage/v1"
@@ -119,7 +118,7 @@ func (n *nfsDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
119118

120119
func (n *nfsDriver) GetVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) *v1.VolumeSource {
121120
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")
123122
return &v1.VolumeSource{
124123
NFS: &v1.NFSVolumeSource{
125124
Server: nv.serverIP,
@@ -131,7 +130,7 @@ func (n *nfsDriver) GetVolumeSource(readOnly bool, fsType string, volume testsui
131130

132131
func (n *nfsDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) (*v1.PersistentVolumeSource, *v1.VolumeNodeAffinity) {
133132
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")
135134
return &v1.PersistentVolumeSource{
136135
NFS: &v1.NFSVolumeSource{
137136
Server: nv.serverIP,
@@ -260,7 +259,7 @@ func (g *glusterFSDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern)
260259

261260
func (g *glusterFSDriver) GetVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) *v1.VolumeSource {
262261
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")
264263

265264
name := gv.prefix + "-server"
266265
return &v1.VolumeSource{
@@ -275,7 +274,7 @@ func (g *glusterFSDriver) GetVolumeSource(readOnly bool, fsType string, volume t
275274

276275
func (g *glusterFSDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) (*v1.PersistentVolumeSource, *v1.VolumeNodeAffinity) {
277276
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")
279278

280279
name := gv.prefix + "-server"
281280
return &v1.PersistentVolumeSource{
@@ -384,7 +383,7 @@ func (i *iSCSIDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
384383

385384
func (i *iSCSIDriver) GetVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) *v1.VolumeSource {
386385
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")
388387

389388
volSource := v1.VolumeSource{
390389
ISCSI: &v1.ISCSIVolumeSource{
@@ -402,7 +401,7 @@ func (i *iSCSIDriver) GetVolumeSource(readOnly bool, fsType string, volume tests
402401

403402
func (i *iSCSIDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) (*v1.PersistentVolumeSource, *v1.VolumeNodeAffinity) {
404403
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")
406405

407406
pvSource := v1.PersistentVolumeSource{
408407
ISCSI: &v1.ISCSIPersistentVolumeSource{
@@ -501,7 +500,7 @@ func (r *rbdDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
501500

502501
func (r *rbdDriver) GetVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) *v1.VolumeSource {
503502
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")
505504

506505
volSource := v1.VolumeSource{
507506
RBD: &v1.RBDVolumeSource{
@@ -523,7 +522,7 @@ func (r *rbdDriver) GetVolumeSource(readOnly bool, fsType string, volume testsui
523522

524523
func (r *rbdDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) (*v1.PersistentVolumeSource, *v1.VolumeNodeAffinity) {
525524
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")
527526

528527
f := rv.f
529528
ns := f.Namespace
@@ -624,7 +623,7 @@ func (c *cephFSDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
624623

625624
func (c *cephFSDriver) GetVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) *v1.VolumeSource {
626625
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")
628627

629628
return &v1.VolumeSource{
630629
CephFS: &v1.CephFSVolumeSource{
@@ -640,7 +639,7 @@ func (c *cephFSDriver) GetVolumeSource(readOnly bool, fsType string, volume test
640639

641640
func (c *cephFSDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) (*v1.PersistentVolumeSource, *v1.VolumeNodeAffinity) {
642641
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")
644643

645644
ns := cv.f.Namespace
646645

@@ -794,7 +793,7 @@ func (h *hostPathSymlinkDriver) SkipUnsupportedTest(pattern testpatterns.TestPat
794793

795794
func (h *hostPathSymlinkDriver) GetVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) *v1.VolumeSource {
796795
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")
798797

799798
// hostPathSymlink doesn't support readOnly volume
800799
if readOnly {
@@ -1013,7 +1012,7 @@ func (c *cinderDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
10131012

10141013
func (c *cinderDriver) GetVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) *v1.VolumeSource {
10151014
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")
10171016

10181017
volSource := v1.VolumeSource{
10191018
Cinder: &v1.CinderVolumeSource{
@@ -1029,7 +1028,7 @@ func (c *cinderDriver) GetVolumeSource(readOnly bool, fsType string, volume test
10291028

10301029
func (c *cinderDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) (*v1.PersistentVolumeSource, *v1.VolumeNodeAffinity) {
10311030
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")
10331032

10341033
pvSource := v1.PersistentVolumeSource{
10351034
Cinder: &v1.CinderPersistentVolumeSource{
@@ -1191,7 +1190,7 @@ func (g *gcePdDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
11911190

11921191
func (g *gcePdDriver) GetVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) *v1.VolumeSource {
11931192
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")
11951194
volSource := v1.VolumeSource{
11961195
GCEPersistentDisk: &v1.GCEPersistentDiskVolumeSource{
11971196
PDName: gv.volumeName,
@@ -1206,7 +1205,7 @@ func (g *gcePdDriver) GetVolumeSource(readOnly bool, fsType string, volume tests
12061205

12071206
func (g *gcePdDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) (*v1.PersistentVolumeSource, *v1.VolumeNodeAffinity) {
12081207
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")
12101209
pvSource := v1.PersistentVolumeSource{
12111210
GCEPersistentDisk: &v1.GCEPersistentDiskVolumeSource{
12121211
PDName: gv.volumeName,
@@ -1316,7 +1315,7 @@ func (v *vSphereDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
13161315

13171316
func (v *vSphereDriver) GetVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) *v1.VolumeSource {
13181317
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")
13201319

13211320
// vSphere driver doesn't seem to support readOnly volume
13221321
// TODO: check if it is correct
@@ -1336,7 +1335,7 @@ func (v *vSphereDriver) GetVolumeSource(readOnly bool, fsType string, volume tes
13361335

13371336
func (v *vSphereDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) (*v1.PersistentVolumeSource, *v1.VolumeNodeAffinity) {
13381337
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")
13401339

13411340
// vSphere driver doesn't seem to support readOnly volume
13421341
// TODO: check if it is correct
@@ -1445,8 +1444,7 @@ func (a *azureDiskDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern)
14451444

14461445
func (a *azureDiskDriver) GetVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) *v1.VolumeSource {
14471446
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")
14501448
diskName := av.volumeName[(strings.LastIndex(av.volumeName, "/") + 1):]
14511449

14521450
kind := v1.AzureManagedDisk
@@ -1466,7 +1464,7 @@ func (a *azureDiskDriver) GetVolumeSource(readOnly bool, fsType string, volume t
14661464

14671465
func (a *azureDiskDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) (*v1.PersistentVolumeSource, *v1.VolumeNodeAffinity) {
14681466
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")
14701468

14711469
diskName := av.volumeName[(strings.LastIndex(av.volumeName, "/") + 1):]
14721470

@@ -1579,7 +1577,7 @@ func (a *awsDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) {
15791577

15801578
func (a *awsDriver) GetVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) *v1.VolumeSource {
15811579
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")
15831581
volSource := v1.VolumeSource{
15841582
AWSElasticBlockStore: &v1.AWSElasticBlockStoreVolumeSource{
15851583
VolumeID: av.volumeName,
@@ -1594,7 +1592,7 @@ func (a *awsDriver) GetVolumeSource(readOnly bool, fsType string, volume testsui
15941592

15951593
func (a *awsDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) (*v1.PersistentVolumeSource, *v1.VolumeNodeAffinity) {
15961594
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")
15981596
pvSource := v1.PersistentVolumeSource{
15991597
AWSElasticBlockStore: &v1.AWSElasticBlockStoreVolumeSource{
16001598
VolumeID: av.volumeName,
@@ -1832,7 +1830,7 @@ func (l *localDriver) nodeAffinityForNode(node *v1.Node) *v1.VolumeNodeAffinity
18321830

18331831
func (l *localDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volume testsuites.TestVolume) (*v1.PersistentVolumeSource, *v1.VolumeNodeAffinity) {
18341832
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")
18361834
return &v1.PersistentVolumeSource{
18371835
Local: &v1.LocalVolumeSource{
18381836
Path: lv.ltr.Path,

test/e2e/storage/pv_protection.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"time"
2121

2222
"github.com/onsi/ginkgo"
23-
"github.com/onsi/gomega"
2423

2524
v1 "k8s.io/api/core/v1"
2625
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -86,7 +85,7 @@ var _ = utils.SIGDescribe("PV Protection", func() {
8685
ginkgo.By("Checking that PV Protection finalizer is set")
8786
pv, err = client.CoreV1().PersistentVolumes().Get(pv.Name, metav1.GetOptions{})
8887
framework.ExpectNoError(err, "While getting PV status")
89-
gomega.Expect(slice.ContainsString(pv.ObjectMeta.Finalizers, volumeutil.PVProtectionFinalizer, nil)).To(gomega.BeTrue(), "PV Protection finalizer(%v) is not set in %v", volumeutil.PVProtectionFinalizer, pv.ObjectMeta.Finalizers)
88+
framework.ExpectEqual(slice.ContainsString(pv.ObjectMeta.Finalizers, volumeutil.PVProtectionFinalizer, nil), true, "PV Protection finalizer(%v) is not set in %v", volumeutil.PVProtectionFinalizer, pv.ObjectMeta.Finalizers)
9089
})
9190

9291
ginkgo.AfterEach(func() {

test/e2e/storage/pvc_protection.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ package storage
1818

1919
import (
2020
"github.com/onsi/ginkgo"
21-
"github.com/onsi/gomega"
2221

2322
"fmt"
2423
"time"
2524

26-
"k8s.io/api/core/v1"
25+
v1 "k8s.io/api/core/v1"
2726
apierrs "k8s.io/apimachinery/pkg/api/errors"
2827
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2928
clientset "k8s.io/client-go/kubernetes"
@@ -95,7 +94,7 @@ var _ = utils.SIGDescribe("PVC Protection", func() {
9594
ginkgo.By("Checking that PVC Protection finalizer is set")
9695
pvc, err = client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Get(pvc.Name, metav1.GetOptions{})
9796
framework.ExpectNoError(err, "While getting PVC status")
98-
gomega.Expect(slice.ContainsString(pvc.ObjectMeta.Finalizers, volumeutil.PVCProtectionFinalizer, nil)).To(gomega.BeTrue(), "PVC Protection finalizer(%v) is not set in %v", volumeutil.PVCProtectionFinalizer, pvc.ObjectMeta.Finalizers)
97+
framework.ExpectEqual(slice.ContainsString(pvc.ObjectMeta.Finalizers, volumeutil.PVCProtectionFinalizer, nil), true, "PVC Protection finalizer(%v) is not set in %v", volumeutil.PVCProtectionFinalizer, pvc.ObjectMeta.Finalizers)
9998
})
10099

101100
ginkgo.AfterEach(func() {

test/e2e/storage/regional_pd.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ func testZonalFailover(c clientset.Interface, ns string) {
217217
err = waitForStatefulSetReplicasReady(statefulSet.Name, ns, c, framework.Poll, statefulSetReadyTimeout)
218218
if err != nil {
219219
pod := getPod(c, ns, regionalPDLabels)
220-
gomega.Expect(podutil.IsPodReadyConditionTrue(pod.Status)).To(gomega.BeTrue(),
221-
"The statefulset pod has the following conditions: %s", pod.Status.Conditions)
220+
framework.ExpectEqual(podutil.IsPodReadyConditionTrue(pod.Status), true, "The statefulset pod has the following conditions: %s", pod.Status.Conditions)
222221
framework.ExpectNoError(err)
223222
}
224223

@@ -269,8 +268,7 @@ func testZonalFailover(c clientset.Interface, ns string) {
269268
err = waitForStatefulSetReplicasReady(statefulSet.Name, ns, c, 3*time.Second, framework.RestartPodReadyAgainTimeout)
270269
if err != nil {
271270
pod := getPod(c, ns, regionalPDLabels)
272-
gomega.Expect(podutil.IsPodReadyConditionTrue(pod.Status)).To(gomega.BeTrue(),
273-
"The statefulset pod has the following conditions: %s", pod.Status.Conditions)
271+
framework.ExpectEqual(podutil.IsPodReadyConditionTrue(pod.Status), true, "The statefulset pod has the following conditions: %s", pod.Status.Conditions)
274272
framework.ExpectNoError(err)
275273
}
276274

test/e2e/storage/utils/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,14 @@ func TestVolumeUnmountsFromDeletedPodWithForceOption(c clientset.Interface, f *f
279279
result, err := e2essh.SSH(fmt.Sprintf("mount | grep %s | grep -v volume-subpaths", clientPod.UID), nodeIP, framework.TestContext.Provider)
280280
e2essh.LogResult(result)
281281
framework.ExpectNoError(err, "Encountered SSH error.")
282-
gomega.Expect(result.Code).To(gomega.BeZero(), fmt.Sprintf("Expected grep exit code of 0, got %d", result.Code))
282+
framework.ExpectEqual(result.Code, 0, fmt.Sprintf("Expected grep exit code of 0, got %d", result.Code))
283283

284284
if checkSubpath {
285285
ginkgo.By("Expecting the volume subpath mount to be found.")
286286
result, err := e2essh.SSH(fmt.Sprintf("cat /proc/self/mountinfo | grep %s | grep volume-subpaths", clientPod.UID), nodeIP, framework.TestContext.Provider)
287287
e2essh.LogResult(result)
288288
framework.ExpectNoError(err, "Encountered SSH error.")
289-
gomega.Expect(result.Code).To(gomega.BeZero(), fmt.Sprintf("Expected grep exit code of 0, got %d", result.Code))
289+
framework.ExpectEqual(result.Code, 0, fmt.Sprintf("Expected grep exit code of 0, got %d", result.Code))
290290
}
291291

292292
// This command is to make sure kubelet is started after test finishes no matter it fails or not.

test/e2e/storage/vsphere/vsphere_volume_diskformat.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func invokeTest(f *framework.Framework, client clientset.Interface, namespace st
153153
framework.ExpectNoError(err)
154154

155155
ginkgo.By("Verify Disk Format")
156-
gomega.Expect(verifyDiskFormat(client, nodeName, pv.Spec.VsphereVolume.VolumePath, diskFormat)).To(gomega.BeTrue(), "DiskFormat Verification Failed")
156+
framework.ExpectEqual(verifyDiskFormat(client, nodeName, pv.Spec.VsphereVolume.VolumePath, diskFormat), true, "DiskFormat Verification Failed")
157157

158158
var volumePaths []string
159159
volumePaths = append(volumePaths, pv.Spec.VsphereVolume.VolumePath)
@@ -195,7 +195,7 @@ func verifyDiskFormat(client clientset.Interface, nodeName string, pvVolumePath
195195
}
196196
}
197197

198-
gomega.Expect(diskFound).To(gomega.BeTrue(), "Failed to find disk")
198+
framework.ExpectEqual(diskFound, true, "Failed to find disk")
199199
isDiskFormatCorrect := false
200200
if diskFormat == "eagerzeroedthick" {
201201
if eagerlyScrub == true && thinProvisioned == false {

test/e2e/storage/vsphere/vsphere_volume_fstype.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func invokeTestForInvalidFstype(f *framework.Framework, client clientset.Interfa
145145
isFound = true
146146
}
147147
}
148-
gomega.Expect(isFound).To(gomega.BeTrue(), "Unable to verify MountVolume.MountDevice failure")
148+
framework.ExpectEqual(isFound, true, "Unable to verify MountVolume.MountDevice failure")
149149
}
150150

151151
func createVolume(client clientset.Interface, namespace string, scParameters map[string]string) (*v1.PersistentVolumeClaim, []*v1.PersistentVolume) {

0 commit comments

Comments
 (0)