Use framework.ExpectNoError() for test/e2e/storage/persistent_volumes.go

This commit is contained in:
Masaki Kimura 2019-04-04 18:41:22 +00:00
parent 15188268b4
commit f2e39e42b8

View File

@ -348,16 +348,16 @@ var _ = utils.SIGDescribe("PersistentVolumes", func() {
spec := makeStatefulSetWithPVCs(ns, writeCmd, mounts, claims, probe) spec := makeStatefulSetWithPVCs(ns, writeCmd, mounts, claims, probe)
ss, err := c.AppsV1().StatefulSets(ns).Create(spec) ss, err := c.AppsV1().StatefulSets(ns).Create(spec)
Expect(err).NotTo(HaveOccurred()) framework.ExpectNoError(err)
ssTester.WaitForRunningAndReady(1, ss) ssTester.WaitForRunningAndReady(1, ss)
By("Deleting the StatefulSet but not the volumes") By("Deleting the StatefulSet but not the volumes")
// Scale down to 0 first so that the Delete is quick // Scale down to 0 first so that the Delete is quick
ss, err = ssTester.Scale(ss, 0) ss, err = ssTester.Scale(ss, 0)
Expect(err).NotTo(HaveOccurred()) framework.ExpectNoError(err)
ssTester.WaitForStatusReplicas(ss, 0) ssTester.WaitForStatusReplicas(ss, 0)
err = c.AppsV1().StatefulSets(ns).Delete(ss.Name, &metav1.DeleteOptions{}) err = c.AppsV1().StatefulSets(ns).Delete(ss.Name, &metav1.DeleteOptions{})
Expect(err).NotTo(HaveOccurred()) framework.ExpectNoError(err)
By("Creating a new Statefulset and validating the data") By("Creating a new Statefulset and validating the data")
validateCmd := "true" validateCmd := "true"
@ -368,7 +368,7 @@ var _ = utils.SIGDescribe("PersistentVolumes", func() {
spec = makeStatefulSetWithPVCs(ns, validateCmd, mounts, claims, probe) spec = makeStatefulSetWithPVCs(ns, validateCmd, mounts, claims, probe)
ss, err = c.AppsV1().StatefulSets(ns).Create(spec) ss, err = c.AppsV1().StatefulSets(ns).Create(spec)
Expect(err).NotTo(HaveOccurred()) framework.ExpectNoError(err)
ssTester.WaitForRunningAndReady(1, ss) ssTester.WaitForRunningAndReady(1, ss)
}) })
}) })