Skip to content

Commit 8a6fede

Browse files
committed
remove dot imports in e2e/storage/vsphere
1 parent ef9e794 commit 8a6fede

22 files changed

+467
-467
lines changed

test/e2e/storage/vsphere/persistent_volumes-vsphere.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ package vsphere
1919
import (
2020
"time"
2121

22-
. "github.com/onsi/ginkgo"
23-
. "github.com/onsi/gomega"
22+
"github.com/onsi/ginkgo"
23+
"github.com/onsi/gomega"
2424
v1 "k8s.io/api/core/v1"
2525
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626
"k8s.io/apimachinery/pkg/labels"
@@ -58,7 +58,7 @@ var _ = utils.SIGDescribe("PersistentVolumes:vsphere", func() {
5858
4. Create a POD using the PVC.
5959
5. Verify Disk and Attached to the node.
6060
*/
61-
BeforeEach(func() {
61+
ginkgo.BeforeEach(func() {
6262
framework.SkipUnlessProviderIs("vsphere")
6363
Bootstrap(f)
6464
c = f.ClientSet
@@ -95,23 +95,23 @@ var _ = utils.SIGDescribe("PersistentVolumes:vsphere", func() {
9595
StorageClassName: &emptyStorageClass,
9696
}
9797
}
98-
By("Creating the PV and PVC")
98+
ginkgo.By("Creating the PV and PVC")
9999
pv, pvc, err = framework.CreatePVPVC(c, pvConfig, pvcConfig, ns, false)
100100
framework.ExpectNoError(err)
101101
framework.ExpectNoError(framework.WaitOnPVandPVC(c, ns, pv, pvc))
102102

103-
By("Creating the Client Pod")
103+
ginkgo.By("Creating the Client Pod")
104104
clientPod, err = framework.CreateClientPod(c, ns, pvc)
105105
framework.ExpectNoError(err)
106106
node = clientPod.Spec.NodeName
107107

108-
By("Verify disk should be attached to the node")
108+
ginkgo.By("Verify disk should be attached to the node")
109109
isAttached, err := diskIsAttached(volumePath, node)
110110
framework.ExpectNoError(err)
111-
Expect(isAttached).To(BeTrue(), "disk is not attached with the node")
111+
gomega.Expect(isAttached).To(gomega.BeTrue(), "disk is not attached with the node")
112112
})
113113

114-
AfterEach(func() {
114+
ginkgo.AfterEach(func() {
115115
e2elog.Logf("AfterEach: Cleaning up test resources")
116116
if c != nil {
117117
framework.ExpectNoError(framework.DeletePodWithWait(f, c, clientPod), "AfterEach: failed to delete pod ", clientPod.Name)
@@ -147,12 +147,12 @@ var _ = utils.SIGDescribe("PersistentVolumes:vsphere", func() {
147147
2. Delete POD, POD deletion should succeed.
148148
*/
149149

150-
It("should test that deleting a PVC before the pod does not cause pod deletion to fail on vsphere volume detach", func() {
151-
By("Deleting the Claim")
150+
ginkgo.It("should test that deleting a PVC before the pod does not cause pod deletion to fail on vsphere volume detach", func() {
151+
ginkgo.By("Deleting the Claim")
152152
framework.ExpectNoError(framework.DeletePersistentVolumeClaim(c, pvc.Name, ns), "Failed to delete PVC ", pvc.Name)
153153
pvc = nil
154154

155-
By("Deleting the Pod")
155+
ginkgo.By("Deleting the Pod")
156156
framework.ExpectNoError(framework.DeletePodWithWait(f, c, clientPod), "Failed to delete pod ", clientPod.Name)
157157
})
158158

@@ -163,12 +163,12 @@ var _ = utils.SIGDescribe("PersistentVolumes:vsphere", func() {
163163
1. Delete PV.
164164
2. Delete POD, POD deletion should succeed.
165165
*/
166-
It("should test that deleting the PV before the pod does not cause pod deletion to fail on vspehre volume detach", func() {
167-
By("Deleting the Persistent Volume")
166+
ginkgo.It("should test that deleting the PV before the pod does not cause pod deletion to fail on vspehre volume detach", func() {
167+
ginkgo.By("Deleting the Persistent Volume")
168168
framework.ExpectNoError(framework.DeletePersistentVolume(c, pv.Name), "Failed to delete PV ", pv.Name)
169169
pv = nil
170170

171-
By("Deleting the pod")
171+
ginkgo.By("Deleting the pod")
172172
framework.ExpectNoError(framework.DeletePodWithWait(f, c, clientPod), "Failed to delete pod ", clientPod.Name)
173173
})
174174
/*
@@ -178,7 +178,7 @@ var _ = utils.SIGDescribe("PersistentVolumes:vsphere", func() {
178178
2. Restart kubelet
179179
3. Verify that written file is accessible after kubelet restart
180180
*/
181-
It("should test that a file written to the vspehre volume mount before kubelet restart can be read after restart [Disruptive]", func() {
181+
ginkgo.It("should test that a file written to the vspehre volume mount before kubelet restart can be read after restart [Disruptive]", func() {
182182
utils.TestKubeletRestartsAndRestoresMount(c, f, clientPod)
183183
})
184184

@@ -193,7 +193,7 @@ var _ = utils.SIGDescribe("PersistentVolumes:vsphere", func() {
193193
4. Start kubelet.
194194
5. Verify that volume mount not to be found.
195195
*/
196-
It("should test that a vspehre volume mounted to a pod that is deleted while the kubelet is down unmounts when the kubelet returns [Disruptive]", func() {
196+
ginkgo.It("should test that a vspehre volume mounted to a pod that is deleted while the kubelet is down unmounts when the kubelet returns [Disruptive]", func() {
197197
utils.TestVolumeUnmountsFromDeletedPod(c, f, clientPod)
198198
})
199199

@@ -205,15 +205,15 @@ var _ = utils.SIGDescribe("PersistentVolumes:vsphere", func() {
205205
2. Wait for namespace to get deleted. (Namespace deletion should trigger deletion of belonging pods)
206206
3. Verify volume should be detached from the node.
207207
*/
208-
It("should test that deleting the Namespace of a PVC and Pod causes the successful detach of vsphere volume", func() {
209-
By("Deleting the Namespace")
208+
ginkgo.It("should test that deleting the Namespace of a PVC and Pod causes the successful detach of vsphere volume", func() {
209+
ginkgo.By("Deleting the Namespace")
210210
err := c.CoreV1().Namespaces().Delete(ns, nil)
211211
framework.ExpectNoError(err)
212212

213213
err = framework.WaitForNamespacesDeleted(c, []string{ns}, 3*time.Minute)
214214
framework.ExpectNoError(err)
215215

216-
By("Verifying Persistent Disk detaches")
216+
ginkgo.By("Verifying Persistent Disk detaches")
217217
waitForVSphereDiskToDetach(volumePath, node)
218218
})
219219
})

test/e2e/storage/vsphere/pv_reclaimpolicy.go

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020
"strconv"
2121
"time"
2222

23-
. "github.com/onsi/ginkgo"
24-
. "github.com/onsi/gomega"
23+
"github.com/onsi/ginkgo"
24+
"github.com/onsi/gomega"
2525
v1 "k8s.io/api/core/v1"
2626
apierrs "k8s.io/apimachinery/pkg/api/errors"
2727
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -42,14 +42,14 @@ var _ = utils.SIGDescribe("PersistentVolumes [Feature:ReclaimPolicy]", func() {
4242
nodeInfo *NodeInfo
4343
)
4444

45-
BeforeEach(func() {
45+
ginkgo.BeforeEach(func() {
4646
c = f.ClientSet
4747
ns = f.Namespace.Name
4848
framework.ExpectNoError(framework.WaitForAllNodesSchedulable(c, framework.TestContext.NodeSchedulableTimeout))
4949
})
5050

5151
utils.SIGDescribe("persistentvolumereclaim:vsphere", func() {
52-
BeforeEach(func() {
52+
ginkgo.BeforeEach(func() {
5353
framework.SkipUnlessProviderIs("vsphere")
5454
Bootstrap(f)
5555
nodeInfo = GetReadySchedulableRandomNodeInfo()
@@ -58,7 +58,7 @@ var _ = utils.SIGDescribe("PersistentVolumes [Feature:ReclaimPolicy]", func() {
5858
volumePath = ""
5959
})
6060

61-
AfterEach(func() {
61+
ginkgo.AfterEach(func() {
6262
testCleanupVSpherePersistentVolumeReclaim(c, nodeInfo, ns, volumePath, pv, pvc)
6363
})
6464

@@ -74,15 +74,15 @@ var _ = utils.SIGDescribe("PersistentVolumes [Feature:ReclaimPolicy]", func() {
7474
5. Delete PVC
7575
6. Verify PV is deleted automatically.
7676
*/
77-
It("should delete persistent volume when reclaimPolicy set to delete and associated claim is deleted", func() {
77+
ginkgo.It("should delete persistent volume when reclaimPolicy set to delete and associated claim is deleted", func() {
7878
var err error
7979
volumePath, pv, pvc, err = testSetupVSpherePersistentVolumeReclaim(c, nodeInfo, ns, v1.PersistentVolumeReclaimDelete)
8080
framework.ExpectNoError(err)
8181

8282
deletePVCAfterBind(c, ns, pvc, pv)
8383
pvc = nil
8484

85-
By("verify pv is deleted")
85+
ginkgo.By("verify pv is deleted")
8686
err = framework.WaitForPersistentVolumeDeleted(c, pv.Name, 3*time.Second, 300*time.Second)
8787
framework.ExpectNoError(err)
8888

@@ -102,43 +102,43 @@ var _ = utils.SIGDescribe("PersistentVolumes [Feature:ReclaimPolicy]", func() {
102102
8. Delete the pod.
103103
9. Verify PV should be detached from the node and automatically deleted.
104104
*/
105-
It("should not detach and unmount PV when associated pvc with delete as reclaimPolicy is deleted when it is in use by the pod", func() {
105+
ginkgo.It("should not detach and unmount PV when associated pvc with delete as reclaimPolicy is deleted when it is in use by the pod", func() {
106106
var err error
107107

108108
volumePath, pv, pvc, err = testSetupVSpherePersistentVolumeReclaim(c, nodeInfo, ns, v1.PersistentVolumeReclaimDelete)
109109
framework.ExpectNoError(err)
110110
// Wait for PV and PVC to Bind
111111
framework.ExpectNoError(framework.WaitOnPVandPVC(c, ns, pv, pvc))
112112

113-
By("Creating the Pod")
113+
ginkgo.By("Creating the Pod")
114114
pod, err := framework.CreateClientPod(c, ns, pvc)
115115
framework.ExpectNoError(err)
116116

117-
By("Deleting the Claim")
117+
ginkgo.By("Deleting the Claim")
118118
framework.ExpectNoError(framework.DeletePersistentVolumeClaim(c, pvc.Name, ns), "Failed to delete PVC ", pvc.Name)
119119
pvc = nil
120120

121121
// Verify PV is Present, after PVC is deleted and PV status should be Failed.
122122
pv, err := c.CoreV1().PersistentVolumes().Get(pv.Name, metav1.GetOptions{})
123123
framework.ExpectNoError(err)
124-
Expect(framework.WaitForPersistentVolumePhase(v1.VolumeFailed, c, pv.Name, 1*time.Second, 60*time.Second)).NotTo(HaveOccurred())
124+
gomega.Expect(framework.WaitForPersistentVolumePhase(v1.VolumeFailed, c, pv.Name, 1*time.Second, 60*time.Second)).NotTo(gomega.HaveOccurred())
125125

126-
By("Verify the volume is attached to the node")
126+
ginkgo.By("Verify the volume is attached to the node")
127127
isVolumeAttached, verifyDiskAttachedError := diskIsAttached(pv.Spec.VsphereVolume.VolumePath, pod.Spec.NodeName)
128-
Expect(verifyDiskAttachedError).NotTo(HaveOccurred())
129-
Expect(isVolumeAttached).To(BeTrue())
128+
gomega.Expect(verifyDiskAttachedError).NotTo(gomega.HaveOccurred())
129+
gomega.Expect(isVolumeAttached).To(gomega.BeTrue())
130130

131-
By("Verify the volume is accessible and available in the pod")
131+
ginkgo.By("Verify the volume is accessible and available in the pod")
132132
verifyVSphereVolumesAccessible(c, pod, []*v1.PersistentVolume{pv})
133133
e2elog.Logf("Verified that Volume is accessible in the POD after deleting PV claim")
134134

135-
By("Deleting the Pod")
135+
ginkgo.By("Deleting the Pod")
136136
framework.ExpectNoError(framework.DeletePodWithWait(f, c, pod), "Failed to delete pod ", pod.Name)
137137

138-
By("Verify PV is detached from the node after Pod is deleted")
139-
Expect(waitForVSphereDiskToDetach(pv.Spec.VsphereVolume.VolumePath, pod.Spec.NodeName)).NotTo(HaveOccurred())
138+
ginkgo.By("Verify PV is detached from the node after Pod is deleted")
139+
gomega.Expect(waitForVSphereDiskToDetach(pv.Spec.VsphereVolume.VolumePath, pod.Spec.NodeName)).NotTo(gomega.HaveOccurred())
140140

141-
By("Verify PV should be deleted automatically")
141+
ginkgo.By("Verify PV should be deleted automatically")
142142
framework.ExpectNoError(framework.WaitForPersistentVolumeDeleted(c, pv.Name, 1*time.Second, 30*time.Second))
143143
pv = nil
144144
volumePath = ""
@@ -162,7 +162,7 @@ var _ = utils.SIGDescribe("PersistentVolumes [Feature:ReclaimPolicy]", func() {
162162
11. Created POD using PVC created in Step 10 and verify volume content is matching.
163163
*/
164164

165-
It("should retain persistent volume when reclaimPolicy set to retain when associated claim is deleted", func() {
165+
ginkgo.It("should retain persistent volume when reclaimPolicy set to retain when associated claim is deleted", func() {
166166
var err error
167167
var volumeFileContent = "hello from vsphere cloud provider, Random Content is :" + strconv.FormatInt(time.Now().UnixNano(), 10)
168168

@@ -171,27 +171,27 @@ var _ = utils.SIGDescribe("PersistentVolumes [Feature:ReclaimPolicy]", func() {
171171

172172
writeContentToVSpherePV(c, pvc, volumeFileContent)
173173

174-
By("Delete PVC")
174+
ginkgo.By("Delete PVC")
175175
framework.ExpectNoError(framework.DeletePersistentVolumeClaim(c, pvc.Name, ns), "Failed to delete PVC ", pvc.Name)
176176
pvc = nil
177177

178-
By("Verify PV is retained")
178+
ginkgo.By("Verify PV is retained")
179179
e2elog.Logf("Waiting for PV %v to become Released", pv.Name)
180180
err = framework.WaitForPersistentVolumePhase(v1.VolumeReleased, c, pv.Name, 3*time.Second, 300*time.Second)
181181
framework.ExpectNoError(err)
182182
framework.ExpectNoError(framework.DeletePersistentVolume(c, pv.Name), "Failed to delete PV ", pv.Name)
183183

184-
By("Creating the PV for same volume path")
184+
ginkgo.By("Creating the PV for same volume path")
185185
pv = getVSpherePersistentVolumeSpec(volumePath, v1.PersistentVolumeReclaimRetain, nil)
186186
pv, err = c.CoreV1().PersistentVolumes().Create(pv)
187187
framework.ExpectNoError(err)
188188

189-
By("creating the pvc")
189+
ginkgo.By("creating the pvc")
190190
pvc = getVSpherePersistentVolumeClaimSpec(ns, nil)
191191
pvc, err = c.CoreV1().PersistentVolumeClaims(ns).Create(pvc)
192192
framework.ExpectNoError(err)
193193

194-
By("wait for the pv and pvc to bind")
194+
ginkgo.By("wait for the pv and pvc to bind")
195195
framework.ExpectNoError(framework.WaitOnPVandPVC(c, ns, pv, pvc))
196196
verifyContentOfVSpherePV(c, pvc, volumeFileContent)
197197

@@ -201,27 +201,27 @@ var _ = utils.SIGDescribe("PersistentVolumes [Feature:ReclaimPolicy]", func() {
201201

202202
// Test Setup for persistentvolumereclaim tests for vSphere Provider
203203
func testSetupVSpherePersistentVolumeReclaim(c clientset.Interface, nodeInfo *NodeInfo, ns string, persistentVolumeReclaimPolicy v1.PersistentVolumeReclaimPolicy) (volumePath string, pv *v1.PersistentVolume, pvc *v1.PersistentVolumeClaim, err error) {
204-
By("running testSetupVSpherePersistentVolumeReclaim")
205-
By("creating vmdk")
204+
ginkgo.By("running testSetupVSpherePersistentVolumeReclaim")
205+
ginkgo.By("creating vmdk")
206206
volumePath, err = nodeInfo.VSphere.CreateVolume(&VolumeOptions{}, nodeInfo.DataCenterRef)
207207
if err != nil {
208208
return
209209
}
210-
By("creating the pv")
210+
ginkgo.By("creating the pv")
211211
pv = getVSpherePersistentVolumeSpec(volumePath, persistentVolumeReclaimPolicy, nil)
212212
pv, err = c.CoreV1().PersistentVolumes().Create(pv)
213213
if err != nil {
214214
return
215215
}
216-
By("creating the pvc")
216+
ginkgo.By("creating the pvc")
217217
pvc = getVSpherePersistentVolumeClaimSpec(ns, nil)
218218
pvc, err = c.CoreV1().PersistentVolumeClaims(ns).Create(pvc)
219219
return
220220
}
221221

222222
// Test Cleanup for persistentvolumereclaim tests for vSphere Provider
223223
func testCleanupVSpherePersistentVolumeReclaim(c clientset.Interface, nodeInfo *NodeInfo, ns string, volumePath string, pv *v1.PersistentVolume, pvc *v1.PersistentVolumeClaim) {
224-
By("running testCleanupVSpherePersistentVolumeReclaim")
224+
ginkgo.By("running testCleanupVSpherePersistentVolumeReclaim")
225225
if len(volumePath) > 0 {
226226
err := nodeInfo.VSphere.DeleteVolume(volumePath, nodeInfo.DataCenterRef)
227227
framework.ExpectNoError(err)
@@ -238,10 +238,10 @@ func testCleanupVSpherePersistentVolumeReclaim(c clientset.Interface, nodeInfo *
238238
func deletePVCAfterBind(c clientset.Interface, ns string, pvc *v1.PersistentVolumeClaim, pv *v1.PersistentVolume) {
239239
var err error
240240

241-
By("wait for the pv and pvc to bind")
241+
ginkgo.By("wait for the pv and pvc to bind")
242242
framework.ExpectNoError(framework.WaitOnPVandPVC(c, ns, pv, pvc))
243243

244-
By("delete pvc")
244+
ginkgo.By("delete pvc")
245245
framework.ExpectNoError(framework.DeletePersistentVolumeClaim(c, pvc.Name, ns), "Failed to delete PVC ", pvc.Name)
246246
pvc, err = c.CoreV1().PersistentVolumeClaims(ns).Get(pvc.Name, metav1.GetOptions{})
247247
if !apierrs.IsNotFound(err) {

0 commit comments

Comments
 (0)