* fix: Replace curl list backend with dbg command #9716 Signed-off-by: Son Bui <sonbv00@gmail.com> * fix: Remove curl dependencies in e2e tests #9716 Signed-off-by: Son Bui <sonbv00@gmail.com> --------- Signed-off-by: Son Bui <sonbv00@gmail.com>
This commit is contained in:
parent
53c2f2742f
commit
a92e7b4857
4 changed files with 25 additions and 31 deletions
|
|
@ -25,8 +25,6 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"k8s.io/ingress-nginx/test/e2e/framework"
|
||||
|
||||
"k8s.io/ingress-nginx/internal/nginx"
|
||||
)
|
||||
|
||||
var _ = framework.DescribeAnnotation("service-upstream", func() {
|
||||
|
|
@ -59,10 +57,10 @@ var _ = framework.DescribeAnnotation("service-upstream", func() {
|
|||
|
||||
ginkgo.By("checking if the Service Cluster IP and Port are used")
|
||||
s := f.GetService(f.Namespace, framework.EchoService)
|
||||
curlCmd := fmt.Sprintf("curl --fail --silent http://localhost:%v/configuration/backends", nginx.StatusPort)
|
||||
output, err := f.ExecIngressPod(curlCmd)
|
||||
dbgCmd := "/dbg backends all"
|
||||
output, err := f.ExecIngressPod(dbgCmd)
|
||||
assert.Nil(ginkgo.GinkgoT(), err)
|
||||
assert.Contains(ginkgo.GinkgoT(), output, fmt.Sprintf(`{"address":"%s"`, s.Spec.ClusterIP))
|
||||
assert.Contains(ginkgo.GinkgoT(), output, fmt.Sprintf(`"address": "%s"`, s.Spec.ClusterIP))
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -88,10 +86,10 @@ var _ = framework.DescribeAnnotation("service-upstream", func() {
|
|||
|
||||
ginkgo.By("checking if the Service Cluster IP and Port are used")
|
||||
s := f.GetService(f.Namespace, framework.EchoService)
|
||||
curlCmd := fmt.Sprintf("curl --fail --silent http://localhost:%v/configuration/backends", nginx.StatusPort)
|
||||
output, err := f.ExecIngressPod(curlCmd)
|
||||
dbgCmd := "/dbg backends all"
|
||||
output, err := f.ExecIngressPod(dbgCmd)
|
||||
assert.Nil(ginkgo.GinkgoT(), err)
|
||||
assert.Contains(ginkgo.GinkgoT(), output, fmt.Sprintf(`{"address":"%s"`, s.Spec.ClusterIP))
|
||||
assert.Contains(ginkgo.GinkgoT(), output, fmt.Sprintf(`"address": "%s"`, s.Spec.ClusterIP))
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -119,10 +117,10 @@ var _ = framework.DescribeAnnotation("service-upstream", func() {
|
|||
|
||||
ginkgo.By("checking if the Service Cluster IP and Port are not used")
|
||||
s := f.GetService(f.Namespace, framework.EchoService)
|
||||
curlCmd := fmt.Sprintf("curl --fail --silent http://localhost:%v/configuration/backends", nginx.StatusPort)
|
||||
output, err := f.ExecIngressPod(curlCmd)
|
||||
dbgCmd := "/dbg backends all"
|
||||
output, err := f.ExecIngressPod(dbgCmd)
|
||||
assert.Nil(ginkgo.GinkgoT(), err)
|
||||
assert.NotContains(ginkgo.GinkgoT(), output, fmt.Sprintf(`{"address":"%s"`, s.Spec.ClusterIP))
|
||||
assert.NotContains(ginkgo.GinkgoT(), output, fmt.Sprintf(`"address": "%s"`, s.Spec.ClusterIP))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue