Skip to content

Commit

Permalink
Merge pull request #1266 from microsoft/enhancement-test-simulation
Browse files Browse the repository at this point in the history
[test] Simultaneous Close
  • Loading branch information
ppenna committed May 9, 2024
2 parents b7ee223 + 3c49169 commit dca2919
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nettest/input/close/close-local.pkt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// Send FIN segment.
+.0 > F. seq 1(0) ack 1 win 65535 <nop>
// Receive ACK on FIN segment.
+.6 < . seq 1(0) ack 2 win 65535 <nop>
+.1 < . seq 1(0) ack 2 win 65535 <nop>

// Receive FIN segment.
+.1 < F. seq 1(0) ack 2 win 65535 <nop>
Expand Down
29 changes: 29 additions & 0 deletions nettest/input/close/close-simultaneous.pkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Tests for simultaneous close.

// Establish a connection.
+.0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 500
+.2 connect(500, ..., ...) = 0

// Send SYN segment.
+.0 > S seq 0(0) win 65535 <mss 1450, wscale 0>
// Receive SYN-ACK segment.
+.1 < S. seq 0(0) ack 1 win 65535 <mss 1450, wscale 0>
// Send ACK on SYN-ACK segment.
+.0 > . seq 1(0) ack 1 win 65535 <nop>

// Succeed to establish connection.
+.0 wait(500, ...) = 0

// Close connection.
+.2 close(500) = 0

// Send FIN segment.
+.0 > F. seq 1(0) ack 1 win 65535 <nop>
// Receive ACK on FIN segment.
+.1 < F. seq 1(0) ack 2 win 65535 <nop>

// Send ACK on FIN segment.
+.0 > . seq 2(0) ack 2 win 65534 <nop>

// Succeed to close connection after 2 MLS.
+240 wait(500, ...) = 0

0 comments on commit dca2919

Please sign in to comment.