Skip to content

Commit 8880a4f

Browse files
committed
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.
1 parent 99d40d3 commit 8880a4f

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

test/images/agnhost/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ For example, let's consider the following `pod.yaml` file:
4040
containers:
4141
- args:
4242
- dns-suffix
43-
image: gcr.io/kubernetes-e2e-test-images/agnhost:2.2
43+
image: gcr.io/kubernetes-e2e-test-images/agnhost:2.7
4444
name: agnhost
4545
dnsConfig:
4646
nameservers:
@@ -258,14 +258,14 @@ Examples:
258258

259259
```console
260260
docker run -i \
261-
gcr.io/kubernetes-e2e-test-images/agnhost:2.2 \
261+
gcr.io/kubernetes-e2e-test-images/agnhost:2.7 \
262262
logs-generator --log-lines-total 10 --run-duration 1s
263263
```
264264

265265
```console
266266
kubectl run logs-generator \
267267
--generator=run-pod/v1 \
268-
--image=gcr.io/kubernetes-e2e-test-images/agnhost:2.2 \
268+
--image=gcr.io/kubernetes-e2e-test-images/agnhost:2.7 \
269269
--restart=Never \
270270
-- logs-generator -t 10 -d 1s
271271
```
@@ -392,7 +392,7 @@ Usage:
392392
```console
393393
kubectl run test-agnhost \
394394
--generator=run-pod/v1 \
395-
--image=gcr.io/kubernetes-e2e-test-images/agnhost:2.2 \
395+
--image=gcr.io/kubernetes-e2e-test-images/agnhost:2.7 \
396396
--restart=Never \
397397
--env "POD_IP=<POD_IP>" \
398398
--env "NODE_IP=<NODE_IP>" \
@@ -447,7 +447,7 @@ Usage:
447447
```console
448448
kubectl run test-agnhost \
449449
--generator=run-pod/v1 \
450-
--image=gcr.io/kubernetes-e2e-test-images/agnhost:2.1 \
450+
--image=gcr.io/kubernetes-e2e-test-images/agnhost:2.7 \
451451
--restart=Never \
452452
--env "BIND_ADDRESS=localhost" \
453453
--env "BIND_PORT=8080" \
@@ -534,6 +534,6 @@ The image contains `iperf`.
534534

535535
## Image
536536

537-
The image can be found at `gcr.io/kubernetes-e2e-test-images/agnhost:2.2` for Linux
538-
containers, and `e2eteam/agnhost:2.2` for Windows containers. In the future, the same
537+
The image can be found at `gcr.io/kubernetes-e2e-test-images/agnhost:2.7` for Linux
538+
containers, and `e2eteam/agnhost:2.7` for Windows containers. In the future, the same
539539
repository can be used for both OSes.

test/images/agnhost/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6
1+
2.7

test/images/agnhost/agnhost.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import (
4444
)
4545

4646
func main() {
47-
rootCmd := &cobra.Command{Use: "app", Version: "2.6"}
47+
rootCmd := &cobra.Command{Use: "app", Version: "2.7"}
4848

4949
rootCmd.AddCommand(auditproxy.CmdAuditProxy)
5050
rootCmd.AddCommand(connect.CmdConnect)

test/images/agnhost/netexec/netexec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ func dialUDP(request string, remoteAddress *net.UDPAddr) (string, error) {
288288
if err != nil {
289289
return "", fmt.Errorf("udp connection write failed. err:%v", err)
290290
}
291-
udpResponse := make([]byte, 1024)
291+
udpResponse := make([]byte, 2048)
292292
Conn.SetReadDeadline(time.Now().Add(5 * time.Second))
293293
count, err := Conn.Read(udpResponse)
294294
if err != nil || count == 0 {
@@ -393,7 +393,7 @@ func startUDPServer(udpPort int) {
393393
serverConn, err := net.ListenUDP("udp", serverAddress)
394394
assertNoError(err)
395395
defer serverConn.Close()
396-
buf := make([]byte, 1024)
396+
buf := make([]byte, 2048)
397397

398398
log.Printf("Started UDP server")
399399
// Start responding to readiness probes.

0 commit comments

Comments
 (0)