diff --git a/tests/e2e/dualstack/dualstack_test.go b/tests/e2e/dualstack/dualstack_test.go index 1e44da2ef8..85b0230aeb 100644 --- a/tests/e2e/dualstack/dualstack_test.go +++ b/tests/e2e/dualstack/dualstack_test.go @@ -105,7 +105,7 @@ var _ = Describe("Verify DualStack Configuration", Ordered, func() { if !strings.HasPrefix(pod.Name, "ds-clusterip-pod") { continue } - cmd := fmt.Sprintf("curl -L --insecure http://%s", ip) + cmd := fmt.Sprintf("curl -m 5 -s -f http://%s", ip) Eventually(func() (string, error) { return tc.Servers[0].RunCmdOnNode(cmd) }, "60s", "5s").Should(ContainSubstring("Welcome to nginx!"), "failed cmd: "+cmd) @@ -121,11 +121,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 http://%s/name.html", hostName, node.IPv4) + cmd := fmt.Sprintf("curl --header host:%s -m 5 -s -f http://%s/name.html", hostName, node.IPv4) Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "10s", "2s").Should(ContainSubstring("ds-clusterip-pod"), "failed cmd: "+cmd) - cmd = fmt.Sprintf("curl --header host:%s http://[%s]/name.html", hostName, node.IPv6) + cmd = fmt.Sprintf("curl --header host:%s -m 5 -s -f http://[%s]/name.html", hostName, node.IPv6) Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "5s", "1s").Should(ContainSubstring("ds-clusterip-pod"), "failed cmd: "+cmd) @@ -141,11 +141,11 @@ var _ = Describe("Verify DualStack Configuration", Ordered, func() { nodeIPs, err := e2e.GetNodeIPs(tc.KubeconfigFile) Expect(err).NotTo(HaveOccurred()) for _, node := range nodeIPs { - cmd = "curl -L --insecure http://" + node.IPv4 + ":" + nodeport + "/name.html" + cmd = "curl -m 5 -s -f http://" + node.IPv4 + ":" + nodeport + "/name.html" Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "10s", "1s").Should(ContainSubstring("ds-nodeport-pod"), "failed cmd: "+cmd) - cmd = "curl -L --insecure http://[" + node.IPv6 + "]:" + nodeport + "/name.html" + cmd = "curl -m 5 -s -f http://[" + node.IPv6 + "]:" + nodeport + "/name.html" Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "10s", "1s").Should(ContainSubstring("ds-nodeport-pod"), "failed cmd: "+cmd) @@ -154,13 +154,13 @@ var _ = Describe("Verify DualStack Configuration", Ordered, func() { It("Verifies podSelector Network Policy", func() { _, err := tc.DeployWorkload("pod_client.yaml") Expect(err).NotTo(HaveOccurred()) - cmd := "kubectl exec svc/client-curl -- curl -m7 ds-clusterip-svc/name.html" + cmd := "kubectl exec svc/client-curl -- curl -m 5 -s -f http://ds-clusterip-svc/name.html" Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "20s", "3s").Should(ContainSubstring("ds-clusterip-pod"), "failed cmd: "+cmd) _, err = tc.DeployWorkload("netpol-fail.yaml") Expect(err).NotTo(HaveOccurred()) - cmd = "kubectl exec svc/client-curl -- curl -m7 ds-clusterip-svc/name.html" + cmd = "kubectl exec svc/client-curl -- curl -m 5 -s -f http://ds-clusterip-svc/name.html" Eventually(func() error { _, err = e2e.RunCommand(cmd) Expect(err).To(HaveOccurred()) @@ -168,7 +168,7 @@ var _ = Describe("Verify DualStack Configuration", Ordered, func() { }, "20s", "3s") _, err = tc.DeployWorkload("netpol-work.yaml") Expect(err).NotTo(HaveOccurred()) - cmd = "kubectl exec svc/client-curl -- curl -m7 ds-clusterip-svc/name.html" + cmd = "kubectl exec svc/client-curl -- curl -m 5 -s -f http://ds-clusterip-svc/name.html" Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "20s", "3s").Should(ContainSubstring("ds-clusterip-pod"), "failed cmd: "+cmd) diff --git a/tests/e2e/externalip/externalip_test.go b/tests/e2e/externalip/externalip_test.go index e04805b274..46784ee3d2 100644 --- a/tests/e2e/externalip/externalip_test.go +++ b/tests/e2e/externalip/externalip_test.go @@ -127,7 +127,7 @@ var _ = Describe("Verify External-IP config", Ordered, func() { clientIPs, err := getClientIPs(tc.KubeconfigFile) Expect(err).NotTo(HaveOccurred()) for _, ip := range clientIPs { - cmd := "kubectl exec svc/client-curl -- curl -m7 " + ip.IPv4 + "/name.html" + cmd := "kubectl exec svc/client-curl -- curl -m 5 -s -f http://" + ip.IPv4 + "/name.html" Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "20s", "3s").Should(ContainSubstring("client-deployment"), "failed cmd: "+cmd) diff --git a/tests/e2e/privateregistry/privateregistry_test.go b/tests/e2e/privateregistry/privateregistry_test.go index c1a5817c87..ba989bf68c 100644 --- a/tests/e2e/privateregistry/privateregistry_test.go +++ b/tests/e2e/privateregistry/privateregistry_test.go @@ -123,7 +123,7 @@ var _ = Describe("Verify Create", Ordered, func() { g.Expect(string(pod.Status.Phase)).Should(Equal("Running")) }, "60s", "5s").Should(Succeed()) - cmd := "curl " + pod.Status.PodIP + cmd := "curl -m 5 -s -f http://" + pod.Status.PodIP Expect(tc.Servers[0].RunCmdOnNode(cmd)).To(ContainSubstring("Welcome to nginx!")) }) diff --git a/tests/e2e/splitserver/splitserver_test.go b/tests/e2e/splitserver/splitserver_test.go index 2094dd57cb..27c225c796 100644 --- a/tests/e2e/splitserver/splitserver_test.go +++ b/tests/e2e/splitserver/splitserver_test.go @@ -175,7 +175,7 @@ var _ = Describe("Verify Create", Ordered, func() { }, "240s", "5s").Should(ContainSubstring("test-clusterip"), "failed cmd: "+cmd) clusterip, _ := e2e.FetchClusterIP(tc.KubeconfigFile, "nginx-clusterip-svc", false) - cmd = "curl -L --insecure http://" + clusterip + "/name.html" + cmd = "curl -m 5 -s -f http://" + clusterip + "/name.html" for _, node := range cpNodes { Eventually(func() (string, error) { return node.RunCmdOnNode(cmd) @@ -198,7 +198,7 @@ var _ = Describe("Verify Create", Ordered, func() { return e2e.RunCommand(cmd) }, "240s", "5s").Should(ContainSubstring("test-nodeport"), "nodeport pod was not created") - cmd = "curl -L --insecure http://" + nodeExternalIP + ":" + nodeport + "/name.html" + cmd = "curl -m 5 -s -f http://" + nodeExternalIP + ":" + nodeport + "/name.html" Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "240s", "5s").Should(ContainSubstring("test-nodeport"), "failed cmd: "+cmd) @@ -221,7 +221,7 @@ var _ = Describe("Verify Create", Ordered, func() { return e2e.RunCommand(cmd) }, "240s", "5s").Should(ContainSubstring("test-loadbalancer"), "failed cmd: "+cmd) - cmd = "curl -L --insecure http://" + ip + ":" + port + "/name.html" + cmd = "curl -m 5 -s -f http://" + ip + ":" + port + "/name.html" Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "240s", "5s").Should(ContainSubstring("test-loadbalancer"), "failed cmd: "+cmd) @@ -234,7 +234,7 @@ var _ = Describe("Verify Create", Ordered, func() { for _, node := range cpNodes { ip, _ := node.FetchNodeExternalIP() - cmd := "curl --header host:foo1.bar.com" + " http://" + ip + "/name.html" + cmd := "curl --header host:foo1.bar.com -m 5 -s -f http://" + ip + "/name.html" Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "240s", "5s").Should(ContainSubstring("test-ingress"), "failed cmd: "+cmd) diff --git a/tests/e2e/svcpoliciesandfirewall/svcpoliciesandfirewall_test.go b/tests/e2e/svcpoliciesandfirewall/svcpoliciesandfirewall_test.go index 2112d1d42a..46d1032b97 100644 --- a/tests/e2e/svcpoliciesandfirewall/svcpoliciesandfirewall_test.go +++ b/tests/e2e/svcpoliciesandfirewall/svcpoliciesandfirewall_test.go @@ -132,14 +132,14 @@ var _ = Describe("Verify Services Traffic policies and firewall config", Ordered // Verify connectivity to the external IP of the lbsvc service and the IP should be the flannel interface IP because of MASQ for _, externalIP := range lbSvcExternalIPs { Eventually(func() (string, error) { - cmd := "curl -s " + externalIP + ":81/ip" + cmd := "curl -m 5 -s -f http://" + externalIP + ":81/ip" return e2e.RunCommand(cmd) }, "25s", "5s").Should(ContainSubstring("10.42")) } // Verify connectivity to the external IP of the lbsvcExt service and the IP should not be the flannel interface IP Eventually(func() (string, error) { - cmd := "curl -s " + lbSvcExtExternalIPs[0] + ":82/ip" + cmd := "curl -m 5 -s -f http://" + lbSvcExtExternalIPs[0] + ":82/ip" return e2e.RunCommand(cmd) }, "25s", "5s").ShouldNot(ContainSubstring("10.42")) @@ -150,7 +150,7 @@ var _ = Describe("Verify Services Traffic policies and firewall config", Ordered continue } Eventually(func() error { - cmd := "curl -s --max-time 5 " + externalIP + ":82/ip" + cmd := "curl -m 5 -s -f http://" + externalIP + ":82/ip" _, err := e2e.RunCommand(cmd) return err }, "40s", "5s").Should(MatchError(ContainSubstring("exit status"))) @@ -221,12 +221,12 @@ var _ = Describe("Verify Services Traffic policies and firewall config", Ordered var workingCmd, nonWorkingCmd string if serverNodeName == clientPod1Node { - workingCmd = "kubectl exec " + clientPod1 + " -- curl -s --max-time 5 nginx-loadbalancer-svc-int:83/ip" - nonWorkingCmd = "kubectl exec " + clientPod2 + " -- curl -s --max-time 5 nginx-loadbalancer-svc-int:83/ip" + workingCmd = "kubectl exec " + clientPod1 + " -- curl -m 5 -s -f http://nginx-loadbalancer-svc-int:83/ip" + nonWorkingCmd = "kubectl exec " + clientPod2 + " -- curl -m 5 -s -f http://nginx-loadbalancer-svc-int:83/ip" } if serverNodeName == clientPod2Node { - workingCmd = "kubectl exec " + clientPod2 + " -- curl -s --max-time 5 nginx-loadbalancer-svc-int:83/ip" - nonWorkingCmd = "kubectl exec " + clientPod1 + " -- curl -s --max-time 5 nginx-loadbalancer-svc-int:83/ip" + workingCmd = "kubectl exec " + clientPod2 + " -- curl -m 5 -s -f http://nginx-loadbalancer-svc-int:83/ip" + nonWorkingCmd = "kubectl exec " + clientPod1 + " -- curl -m 5 -s -f http://nginx-loadbalancer-svc-int:83/ip" } Eventually(func() (string, error) { @@ -249,7 +249,7 @@ var _ = Describe("Verify Services Traffic policies and firewall config", Ordered // curling a service with internal traffic policy=cluster. It should work on both pods for _, pod := range []string{clientPod1, clientPod2} { - cmd := "kubectl exec " + pod + " -- curl -s --max-time 5 nginx-loadbalancer-svc:81/ip" + cmd := "kubectl exec " + pod + " -- curl -m 5 -s -f http://nginx-loadbalancer-svc:81/ip" Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "20s", "5s").Should(SatisfyAny( @@ -328,13 +328,13 @@ selector: // Verify connectivity from nodes[0] works because we passed its IP to the loadBalancerSourceRanges Eventually(func() (string, error) { - cmd := "curl -s --max-time 5 " + node.InternalIP + ":82" + cmd := "curl -m 5 -s -f http://" + node.InternalIP + ":82" return sNode.RunCmdOnNode(cmd) }, "40s", "5s").Should(ContainSubstring("Welcome to nginx")) // Verify connectivity from nodes[1] fails because we did not pass its IP to the loadBalancerSourceRanges Eventually(func(g Gomega) error { - cmd := "curl -s --max-time 5 " + node.InternalIP + ":82" + cmd := "curl -m 5 -s -f http:// " + node.InternalIP + ":82" _, err := aNode.RunCmdOnNode(cmd) return err }, "40s", "5s").Should(MatchError(ContainSubstring("exit status"))) diff --git a/tests/e2e/upgradecluster/upgradecluster_test.go b/tests/e2e/upgradecluster/upgradecluster_test.go index 858cbe8147..14e284b209 100644 --- a/tests/e2e/upgradecluster/upgradecluster_test.go +++ b/tests/e2e/upgradecluster/upgradecluster_test.go @@ -80,7 +80,7 @@ var _ = Describe("Verify Upgrade", Ordered, func() { }, "240s", "5s").Should(ContainSubstring("test-clusterip"), "failed cmd: "+cmd) clusterip, _ := e2e.FetchClusterIP(tc.KubeconfigFile, "nginx-clusterip-svc", false) - cmd = "curl -L --insecure http://" + clusterip + "/name.html" + cmd = "curl -m 5 -s -f http://" + clusterip + "/name.html" for _, node := range tc.Servers { Eventually(func() (string, error) { return node.RunCmdOnNode(cmd) @@ -103,7 +103,7 @@ var _ = Describe("Verify Upgrade", Ordered, func() { return e2e.RunCommand(cmd) }, "240s", "5s").Should(ContainSubstring("test-nodeport"), "nodeport pod was not created") - cmd = "curl -L --insecure http://" + nodeExternalIP + ":" + nodeport + "/name.html" + cmd = "curl -m 5 -s -f http://" + nodeExternalIP + ":" + nodeport + "/name.html" fmt.Println(cmd) Eventually(func() (string, error) { return e2e.RunCommand(cmd) @@ -125,7 +125,7 @@ var _ = Describe("Verify Upgrade", Ordered, func() { return e2e.RunCommand(cmd) }, "240s", "5s").Should(ContainSubstring("test-loadbalancer")) - cmd = "curl -L --insecure http://" + ip + ":" + port + "/name.html" + cmd = "curl -m 5 -s -f http://" + ip + ":" + port + "/name.html" Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "240s", "5s").Should(ContainSubstring("test-loadbalancer"), "failed cmd: "+cmd) @@ -138,7 +138,7 @@ var _ = Describe("Verify Upgrade", Ordered, func() { for _, node := range tc.Servers { ip, _ := node.FetchNodeExternalIP() - cmd := "curl --header host:foo1.bar.com" + " http://" + ip + "/name.html" + cmd := "curl --header host:foo1.bar.com -m 5 -s -f http://" + ip + "/name.html" Eventually(func() (string, error) { return e2e.RunCommand(cmd) }, "240s", "5s").Should(ContainSubstring("test-ingress"), "failed cmd: "+cmd) @@ -260,7 +260,7 @@ var _ = Describe("Verify Upgrade", Ordered, func() { }, "420s", "5s").Should(ContainSubstring("test-clusterip")) clusterip, _ := e2e.FetchClusterIP(tc.KubeconfigFile, "nginx-clusterip-svc", false) - cmd := "curl -L --insecure http://" + clusterip + "/name.html" + cmd := "curl -m 5 -s -f http://" + clusterip + "/name.html" fmt.Println(cmd) for _, node := range tc.Servers { Eventually(func() (string, error) { @@ -282,7 +282,7 @@ var _ = Describe("Verify Upgrade", Ordered, func() { return e2e.RunCommand(cmd) }, "240s", "5s").Should(ContainSubstring("test-nodeport"), "nodeport pod was not created") - cmd = "curl -L --insecure http://" + nodeExternalIP + ":" + nodeport + "/name.html" + cmd = "curl -m 5 -s -f http://" + nodeExternalIP + ":" + nodeport + "/name.html" fmt.Println(cmd) Eventually(func() (string, error) { return e2e.RunCommand(cmd) @@ -297,7 +297,7 @@ var _ = Describe("Verify Upgrade", Ordered, func() { port, err := e2e.RunCommand(cmd) Expect(err).NotTo(HaveOccurred()) Eventually(func() (string, error) { - cmd := "curl -L --insecure http://" + ip + ":" + port + "/name.html" + cmd := "curl -m 5 -s -f http://" + ip + ":" + port + "/name.html" return e2e.RunCommand(cmd) }, "240s", "5s").Should(ContainSubstring("test-loadbalancer")) @@ -311,7 +311,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" + " http://" + ip + "/name.html" + cmd := "curl --header host:foo1.bar.com -m 5 -s -f http://" + ip + "/name.html" fmt.Println(cmd) Eventually(func() (string, error) { diff --git a/tests/e2e/validatecluster/validatecluster_test.go b/tests/e2e/validatecluster/validatecluster_test.go index 44997991af..d2967ac20b 100644 --- a/tests/e2e/validatecluster/validatecluster_test.go +++ b/tests/e2e/validatecluster/validatecluster_test.go @@ -86,7 +86,7 @@ var _ = Describe("Verify Create", Ordered, func() { }, "240s", "5s").Should(Succeed()) clusterip, _ := e2e.FetchClusterIP(tc.KubeconfigFile, "nginx-clusterip-svc", false) - cmd := "curl -L --insecure http://" + clusterip + "/name.html" + cmd := "curl -m 5 -s -f http://" + clusterip + "/name.html" for _, node := range tc.Servers { Eventually(func(g Gomega) { res, err := node.RunCmdOnNode(cmd) @@ -113,7 +113,7 @@ var _ = Describe("Verify Create", Ordered, func() { g.Expect(res).Should(ContainSubstring("test-nodeport"), "nodeport pod was not created") }, "240s", "5s").Should(Succeed()) - cmd = "curl -L --insecure http://" + nodeExternalIP + ":" + nodeport + "/name.html" + cmd = "curl -m 5 -s -f http://" + nodeExternalIP + ":" + nodeport + "/name.html" Eventually(func(g Gomega) { res, err := e2e.RunCommand(cmd) @@ -142,7 +142,7 @@ var _ = Describe("Verify Create", Ordered, func() { }, "240s", "5s").Should(Succeed()) Eventually(func(g Gomega) { - cmd = "curl -L --insecure http://" + ip + ":" + port + "/name.html" + cmd = "curl -m 5 -s -f http://" + ip + ":" + port + "/name.html" res, err := e2e.RunCommand(cmd) g.Expect(err).NotTo(HaveOccurred(), "failed cmd: %q result: %s", cmd, res) g.Expect(res).Should(ContainSubstring("test-loadbalancer")) @@ -156,7 +156,7 @@ var _ = Describe("Verify Create", Ordered, func() { for _, node := range tc.Servers { ip, _ := node.FetchNodeExternalIP() - cmd := "curl --header host:foo1.bar.com" + " http://" + ip + "/name.html" + cmd := "curl --header host:foo1.bar.com -m 5 -s -f http://" + ip + "/name.html" fmt.Println(cmd) Eventually(func(g Gomega) { diff --git a/tests/e2e/wasm/wasm_test.go b/tests/e2e/wasm/wasm_test.go index e86959a21d..a62fcf65bb 100644 --- a/tests/e2e/wasm/wasm_test.go +++ b/tests/e2e/wasm/wasm_test.go @@ -109,7 +109,7 @@ var _ = Describe("Verify K3s can run Wasm workloads", Ordered, func() { for _, endpoint := range endpoints { url := fmt.Sprintf("http://%s/%s", ingressIPs[0], endpoint) fmt.Printf("Connecting to Wasm web application at: %s\n", url) - cmd := "curl -sfv " + url + cmd := "curl -m 5 -s -f -v " + url Eventually(func() (string, error) { return e2e.RunCommand(cmd)