Remove hard-coded names from e2e test and use local docker dependencies (#4502)
This commit is contained in:
parent
c7d2444cf4
commit
c85450c1e7
68 changed files with 894 additions and 293 deletions
|
|
@ -45,14 +45,14 @@ var _ = framework.IngressNginxDescribe("Load Balance - Configmap value", func()
|
|||
|
||||
f.UpdateNginxConfigMapData("load-balance", "ewma")
|
||||
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil))
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil))
|
||||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
return strings.Contains(server, "server_name load-balance.com")
|
||||
})
|
||||
time.Sleep(waitForLuaSync)
|
||||
|
||||
algorithm, err := f.GetLbAlgorithm("http-svc", 80)
|
||||
algorithm, err := f.GetLbAlgorithm(framework.EchoService, 80)
|
||||
Expect(err).Should(BeNil())
|
||||
Expect(algorithm).Should(Equal("ewma"))
|
||||
})
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package loadbalance
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
|
@ -41,18 +42,18 @@ var _ = framework.IngressNginxDescribe("Load Balance - EWMA", func() {
|
|||
It("does not fail requests", func() {
|
||||
host := "load-balance.com"
|
||||
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil))
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil))
|
||||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
return strings.Contains(server, "server_name load-balance.com")
|
||||
})
|
||||
time.Sleep(waitForLuaSync)
|
||||
|
||||
algorithm, err := f.GetLbAlgorithm("http-svc", 80)
|
||||
algorithm, err := f.GetLbAlgorithm(framework.EchoService, 80)
|
||||
Expect(err).Should(BeNil())
|
||||
Expect(algorithm).Should(Equal("ewma"))
|
||||
|
||||
re, _ := regexp.Compile(`http-svc.*`)
|
||||
re, _ := regexp.Compile(fmt.Sprintf(`%v.*`, framework.EchoService))
|
||||
replicaRequestCount := map[string]int{}
|
||||
|
||||
for i := 0; i < 30; i++ {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package loadbalance
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
|
|
@ -43,13 +44,13 @@ var _ = framework.IngressNginxDescribe("Load Balance - Round Robin", func() {
|
|||
It("should evenly distribute requests with round-robin (default algorithm)", func() {
|
||||
host := "load-balance.com"
|
||||
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil))
|
||||
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil))
|
||||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
return strings.Contains(server, "server_name load-balance.com")
|
||||
})
|
||||
|
||||
re, _ := regexp.Compile(`http-svc.*`)
|
||||
re, _ := regexp.Compile(fmt.Sprintf(`%v.*`, framework.EchoService))
|
||||
replicaRequestCount := map[string]int{}
|
||||
|
||||
for i := 0; i < 600; i++ {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue