From 8880a4f74fa5125dc6e509cc3bac4e4d0d87d35a Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Wed, 16 Oct 2019 04:21:14 -0700 Subject: [PATCH] tests: Extends agnhost netexec udp buffers Currently, the UDP buffer sizes are set to 1024 bytes. Larger requests will not be read entirely by the UDP handlers, which can lead to tests relying on this to fail. --- test/images/agnhost/README.md | 14 +++++++------- test/images/agnhost/VERSION | 2 +- test/images/agnhost/agnhost.go | 2 +- test/images/agnhost/netexec/netexec.go | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/images/agnhost/README.md b/test/images/agnhost/README.md index bf1578d411e..4e91d3cbf78 100644 --- a/test/images/agnhost/README.md +++ b/test/images/agnhost/README.md @@ -40,7 +40,7 @@ For example, let's consider the following `pod.yaml` file: containers: - args: - dns-suffix - image: gcr.io/kubernetes-e2e-test-images/agnhost:2.2 + image: gcr.io/kubernetes-e2e-test-images/agnhost:2.7 name: agnhost dnsConfig: nameservers: @@ -258,14 +258,14 @@ Examples: ```console docker run -i \ - gcr.io/kubernetes-e2e-test-images/agnhost:2.2 \ + gcr.io/kubernetes-e2e-test-images/agnhost:2.7 \ logs-generator --log-lines-total 10 --run-duration 1s ``` ```console kubectl run logs-generator \ --generator=run-pod/v1 \ - --image=gcr.io/kubernetes-e2e-test-images/agnhost:2.2 \ + --image=gcr.io/kubernetes-e2e-test-images/agnhost:2.7 \ --restart=Never \ -- logs-generator -t 10 -d 1s ``` @@ -392,7 +392,7 @@ Usage: ```console kubectl run test-agnhost \ --generator=run-pod/v1 \ - --image=gcr.io/kubernetes-e2e-test-images/agnhost:2.2 \ + --image=gcr.io/kubernetes-e2e-test-images/agnhost:2.7 \ --restart=Never \ --env "POD_IP=" \ --env "NODE_IP=" \ @@ -447,7 +447,7 @@ Usage: ```console kubectl run test-agnhost \ --generator=run-pod/v1 \ - --image=gcr.io/kubernetes-e2e-test-images/agnhost:2.1 \ + --image=gcr.io/kubernetes-e2e-test-images/agnhost:2.7 \ --restart=Never \ --env "BIND_ADDRESS=localhost" \ --env "BIND_PORT=8080" \ @@ -534,6 +534,6 @@ The image contains `iperf`. ## Image -The image can be found at `gcr.io/kubernetes-e2e-test-images/agnhost:2.2` for Linux -containers, and `e2eteam/agnhost:2.2` for Windows containers. In the future, the same +The image can be found at `gcr.io/kubernetes-e2e-test-images/agnhost:2.7` for Linux +containers, and `e2eteam/agnhost:2.7` for Windows containers. In the future, the same repository can be used for both OSes. diff --git a/test/images/agnhost/VERSION b/test/images/agnhost/VERSION index 5154b3f68e9..1effb003408 100644 --- a/test/images/agnhost/VERSION +++ b/test/images/agnhost/VERSION @@ -1 +1 @@ -2.6 +2.7 diff --git a/test/images/agnhost/agnhost.go b/test/images/agnhost/agnhost.go index ae60526f7a0..01a45660eba 100644 --- a/test/images/agnhost/agnhost.go +++ b/test/images/agnhost/agnhost.go @@ -44,7 +44,7 @@ import ( ) func main() { - rootCmd := &cobra.Command{Use: "app", Version: "2.6"} + rootCmd := &cobra.Command{Use: "app", Version: "2.7"} rootCmd.AddCommand(auditproxy.CmdAuditProxy) rootCmd.AddCommand(connect.CmdConnect) diff --git a/test/images/agnhost/netexec/netexec.go b/test/images/agnhost/netexec/netexec.go index 94cae02d1af..a3d2ad2af9a 100644 --- a/test/images/agnhost/netexec/netexec.go +++ b/test/images/agnhost/netexec/netexec.go @@ -288,7 +288,7 @@ func dialUDP(request string, remoteAddress *net.UDPAddr) (string, error) { if err != nil { return "", fmt.Errorf("udp connection write failed. err:%v", err) } - udpResponse := make([]byte, 1024) + udpResponse := make([]byte, 2048) Conn.SetReadDeadline(time.Now().Add(5 * time.Second)) count, err := Conn.Read(udpResponse) if err != nil || count == 0 { @@ -393,7 +393,7 @@ func startUDPServer(udpPort int) { serverConn, err := net.ListenUDP("udp", serverAddress) assertNoError(err) defer serverConn.Close() - buf := make([]byte, 1024) + buf := make([]byte, 2048) log.Printf("Started UDP server") // Start responding to readiness probes.