mirror of
https://github.com/k3s-io/k3s.git
synced 2026-05-28 04:34:19 -04:00
Fix inconsistent curl flags in tests
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
c3ca02aa75
commit
d337570de1
6 changed files with 14 additions and 14 deletions
|
|
@ -90,7 +90,7 @@ var _ = DescribeTableSubtree("DualStack Tests", Ordered, func(ipConfig string) {
|
|||
if strings.Contains(ip, "::") {
|
||||
ip = "[" + ip + "]"
|
||||
}
|
||||
cmd := fmt.Sprintf("curl -L --insecure http://%s", ip)
|
||||
cmd := fmt.Sprintf("curl -vksf -m 5 http://%s", ip)
|
||||
Eventually(func() (string, error) {
|
||||
return tc.Servers[0].RunCmdOnNode(cmd)
|
||||
}, "60s", "5s").Should(ContainSubstring("Welcome to nginx!"), "failed cmd: "+cmd)
|
||||
|
|
@ -110,10 +110,10 @@ var _ = DescribeTableSubtree("DualStack Tests", Ordered, func(ipConfig string) {
|
|||
if strings.Contains(ip, "::") {
|
||||
ip = "[" + ip + "]"
|
||||
}
|
||||
cmd := fmt.Sprintf("curl --header host:%s http://%s/name.html", hostName, ip)
|
||||
cmd := fmt.Sprintf("curl -vksf -m 5 -H 'Host: %s' http://%s/name.html", hostName, ip)
|
||||
Eventually(func() (string, error) {
|
||||
return tests.RunCommand(cmd)
|
||||
}, "10s", "2s").Should(ContainSubstring("ds-clusterip-pod"), "failed cmd: "+cmd)
|
||||
}, "30s", "5s").Should(ContainSubstring("ds-clusterip-pod"), "failed cmd: "+cmd)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -132,10 +132,10 @@ var _ = DescribeTableSubtree("DualStack Tests", Ordered, func(ipConfig string) {
|
|||
if strings.Contains(ip, "::") {
|
||||
ip = "[" + ip + "]"
|
||||
}
|
||||
cmd = "curl -L --insecure http://" + ip + ":" + nodeport + "/name.html"
|
||||
cmd = "curl -vksf -m 5 http://" + ip + ":" + nodeport + "/name.html"
|
||||
Eventually(func() (string, error) {
|
||||
return tests.RunCommand(cmd)
|
||||
}, "10s", "1s").Should(ContainSubstring("ds-nodeport-pod"), "failed cmd: "+cmd)
|
||||
}, "30s", "5s").Should(ContainSubstring("ds-nodeport-pod"), "failed cmd: "+cmd)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -91,11 +91,11 @@ kubelet-arg:
|
|||
for _, scheme := range []string{"http", "https"} {
|
||||
Eventually(func(g Gomega) {
|
||||
for _, server := range config.Servers {
|
||||
cmd := fmt.Sprintf("curl -vksf -H 'Host: example.com' %s://%s/", scheme, server.IP)
|
||||
cmd := fmt.Sprintf("curl -vksf -m 5 -H 'Host: example.com' %s://%s/", scheme, server.IP)
|
||||
g.Expect(tests.RunCommand(cmd)).Error().NotTo(HaveOccurred())
|
||||
}
|
||||
for _, agent := range config.Agents {
|
||||
cmd := fmt.Sprintf("curl -vksf -H 'Host: example.com' %s://%s/", scheme, agent.IP)
|
||||
cmd := fmt.Sprintf("curl -vksf -m 5 -H 'Host: example.com' %s://%s/", scheme, agent.IP)
|
||||
g.Expect(tests.RunCommand(cmd)).Error().NotTo(HaveOccurred())
|
||||
}
|
||||
}, "30s", "10s").Should(Succeed())
|
||||
|
|
@ -107,7 +107,7 @@ kubelet-arg:
|
|||
ports, err := tests.RunCommand(cmd)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
for _, port := range strings.Split(ports, " ") {
|
||||
cmd := fmt.Sprintf("curl -vksf -H 'Host: example.com' http://%s:%s", server.IP, port)
|
||||
cmd := fmt.Sprintf("curl -vksf -m 5 -H 'Host: example.com' http://%s:%s", server.IP, port)
|
||||
Expect(tests.RunCommand(cmd)).Error().NotTo(HaveOccurred())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,11 +120,11 @@ var _ = Describe("Verify DualStack Configuration", Ordered, func() {
|
|||
nodeIPs, err := e2e.GetNodeIPs(tc.KubeconfigFile)
|
||||
Expect(err).NotTo(HaveOccurred(), "failed cmd: "+cmd)
|
||||
for _, node := range nodeIPs {
|
||||
cmd := fmt.Sprintf("curl --header host:%s -m 5 -s -f http://%s/name.html", hostName, node.IPv4)
|
||||
cmd := fmt.Sprintf("curl -m 5 -s -f -H 'Host: %s' http://%s/name.html", hostName, node.IPv4)
|
||||
Eventually(func() (string, error) {
|
||||
return tests.RunCommand(cmd)
|
||||
}, "10s", "2s").Should(ContainSubstring("ds-clusterip-pod"), "failed cmd: "+cmd)
|
||||
cmd = fmt.Sprintf("curl --header host:%s -m 5 -s -f http://[%s]/name.html", hostName, node.IPv6)
|
||||
cmd = fmt.Sprintf("curl -m 5 -s -f -H 'Host: %s' http://[%s]/name.html", hostName, node.IPv6)
|
||||
Eventually(func() (string, error) {
|
||||
return tests.RunCommand(cmd)
|
||||
}, "5s", "1s").Should(ContainSubstring("ds-clusterip-pod"), "failed cmd: "+cmd)
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ var _ = DescribeTableSubtree("Verify Create", Ordered, func(startFlags string) {
|
|||
|
||||
for _, node := range cpNodes {
|
||||
ip, _ := node.FetchNodeExternalIP()
|
||||
cmd := "curl --header host:foo1.bar.com -m 5 -s -f http://" + ip + "/name.html"
|
||||
cmd := "curl -m 5 -s -f -H 'foo1.bar.com' http://" + ip + "/name.html"
|
||||
Eventually(func() (string, error) {
|
||||
return tests.RunCommand(cmd)
|
||||
}, "240s", "5s").Should(ContainSubstring("test-ingress"), "failed cmd: "+cmd)
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ var _ = Describe("Verify Upgrade", Ordered, func() {
|
|||
|
||||
for _, node := range tc.Servers {
|
||||
ip, _ := node.FetchNodeExternalIP()
|
||||
cmd := "curl --header host:foo1.bar.com -m 5 -s -f http://" + ip + "/name.html"
|
||||
cmd := "curl -m 5 -s -f -H 'Host: foo1.bar.com' http://" + ip + "/name.html"
|
||||
Eventually(func() (string, error) {
|
||||
return tests.RunCommand(cmd)
|
||||
}, "240s", "5s").Should(ContainSubstring("test-ingress"), "failed cmd: "+cmd)
|
||||
|
|
@ -302,7 +302,7 @@ var _ = Describe("Verify Upgrade", Ordered, func() {
|
|||
It("After upgrade verifies Ingress", func() {
|
||||
for _, node := range tc.Servers {
|
||||
ip, _ := node.FetchNodeExternalIP()
|
||||
cmd := "curl --header host:foo1.bar.com -m 5 -s -f http://" + ip + "/name.html"
|
||||
cmd := "curl -m 5 -s -f -H 'Host: foo1.bar.com' http://" + ip + "/name.html"
|
||||
fmt.Println(cmd)
|
||||
|
||||
Eventually(func() (string, error) {
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ var _ = Describe("Verify Create", Ordered, func() {
|
|||
|
||||
for _, node := range tc.Servers {
|
||||
ip, _ := node.FetchNodeExternalIP()
|
||||
cmd := "curl --header host:foo1.bar.com -m 5 -s -f http://" + ip + "/name.html"
|
||||
cmd := "curl -m 5 -s -f -H 'Host: foo1.bar.com' http://" + ip + "/name.html"
|
||||
fmt.Println(cmd)
|
||||
|
||||
Eventually(func(g Gomega) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue