summaryrefslogtreecommitdiffhomepage
path: root/test/packetimpact/tests
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2021-02-17 13:15:14 -0800
committergVisor bot <gvisor-bot@google.com>2021-02-17 13:17:06 -0800
commit0e0bc35879982ace060bd7d32f91732bfaf990a9 (patch)
tree5fb567c99370ab74395385049ef6bb98533fd70c /test/packetimpact/tests
parentd8590f6337525416783ee859b6e59ecf17f94066 (diff)
Clean up test style
- Wrap comments at 80 columns - Avoid duplicating the number of retries (5) - Reduce indentation - Use (*testing.T).Fatal rather than (*testing.T).Fatalf PiperOrigin-RevId: 358017412
Diffstat (limited to 'test/packetimpact/tests')
-rw-r--r--test/packetimpact/tests/tcp_synrcvd_reset_test.go17
1 files changed, 7 insertions, 10 deletions
diff --git a/test/packetimpact/tests/tcp_synrcvd_reset_test.go b/test/packetimpact/tests/tcp_synrcvd_reset_test.go
index 4ab9509ec..32271d7b2 100644
--- a/test/packetimpact/tests/tcp_synrcvd_reset_test.go
+++ b/test/packetimpact/tests/tcp_synrcvd_reset_test.go
@@ -45,19 +45,16 @@ func TestTCPSynRcvdReset(t *testing.T) {
// Expect the connection to have transitioned SYN-RCVD to CLOSED.
//
- // Retransmit the ACK a few times to give time for the DUT to
- // transition to CLOSED. We cannot use TCP_INFO to lookup the state
- // as this is a passive DUT connection.
- i := 0
- for ; i < 5; i++ {
+ // Retransmit the ACK a few times to give time for the DUT to transition to
+ // CLOSED. We cannot use TCP_INFO to lookup the state as this is a passive
+ // DUT connection.
+ for i := 0; i < 5; i++ {
conn.Send(t, testbench.TCP{Flags: testbench.Uint8(header.TCPFlagAck)})
if _, err := conn.ExpectData(t, &testbench.TCP{Flags: testbench.Uint8(header.TCPFlagRst)}, nil, time.Second); err != nil {
t.Logf("retransmit%d ACK as we did not get the expected RST, %s", i, err)
- } else {
- break
+ continue
}
+ return
}
- if i == 5 {
- t.Fatalf("expected a TCP RST")
- }
+ t.Fatal("did not receive a TCP RST")
}