add error check for network policy test

This commit is contained in:
Artur Gadelshin 2020-04-13 22:23:30 +02:00
parent 4164b5c892
commit bf30bdddb1

View File

@ -104,12 +104,13 @@ var _ = SIGDescribe("NetworkPolicy [LinuxOnly]", func() {
nsB, err := f.CreateNamespace(nsBName, map[string]string{ nsB, err := f.CreateNamespace(nsBName, map[string]string{
"ns-name": nsBName, "ns-name": nsBName,
}) })
framework.ExpectNoError(err, "Error occurred while creating namespace-b.")
ginkgo.By("Creating a simple server in another namespace that serves on port 80 and 81.") ginkgo.By("Creating a simple server in another namespace that serves on port 80 and 81.")
_, serviceB := createServerPodAndService(f, nsB, "pod-b", []int{80, 81}) podB, serviceB := createServerPodAndService(f, nsB, "pod-b", []int{80, 81})
ginkgo.By("Waiting for pod ready", func() { ginkgo.By("Waiting for pod ready", func() {
err := e2epod.WaitTimeoutForPodReadyInNamespace(f.ClientSet, podServer.Name, f.Namespace.Name, framework.PodStartTimeout) err := e2epod.WaitTimeoutForPodReadyInNamespace(f.ClientSet, podB.Name, nsB.Name, framework.PodStartTimeout)
framework.ExpectNoError(err) framework.ExpectNoError(err)
}) })