use framework refactor code in test/e2e/common

This commit is contained in:
tanjunchen
2019-11-28 18:03:01 +08:00
parent 3dcc1a14df
commit 52ac2783bc
3 changed files with 5 additions and 6 deletions

View File

@@ -829,14 +829,14 @@ var _ = framework.KubeDescribe("Pods", func() {
ginkgo.By("submitting the pod to kubernetes")
podClient.CreateSync(pod)
gomega.Expect(podClient.PodIsReady(podName)).To(gomega.BeFalse(), "Expect pod's Ready condition to be false initially.")
framework.ExpectEqual(podClient.PodIsReady(podName), false, "Expect pod's Ready condition to be false initially.")
ginkgo.By(fmt.Sprintf("patching pod status with condition %q to true", readinessGate1))
_, err := podClient.Patch(podName, types.StrategicMergePatchType, []byte(fmt.Sprintf(patchStatusFmt, readinessGate1, "True")), "status")
framework.ExpectNoError(err)
// Sleep for 10 seconds.
time.Sleep(maxReadyStatusUpdateTolerance)
gomega.Expect(podClient.PodIsReady(podName)).To(gomega.BeFalse(), "Expect pod's Ready condition to be false with only one condition in readinessGates equal to True")
framework.ExpectEqual(podClient.PodIsReady(podName), false, "Expect pod's Ready condition to be false with only one condition in readinessGates equal to True")
ginkgo.By(fmt.Sprintf("patching pod status with condition %q to true", readinessGate2))
_, err = podClient.Patch(podName, types.StrategicMergePatchType, []byte(fmt.Sprintf(patchStatusFmt, readinessGate2, "True")), "status")