Differential D16288 Diff 45628 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
Changeset View
Changeset View
Standalone View
Standalone View
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
Show All 36 Lines | |||||
# which is the reason we are testing. | # which is the reason we are testing. | ||||
# 2. The lo0 interface missing or not up. | # 2. The lo0 interface missing or not up. | ||||
# 3. An unlikely race causes the unlocked global send/receive | # 3. An unlikely race causes the unlocked global send/receive | ||||
# variables to be corrupted. | # variables to be corrupted. | ||||
# | # | ||||
# This test performs a TCP connection and checks that at least the | # This test performs a TCP connection and checks that at least the | ||||
# following packet counts were traced: | # following packet counts were traced: | ||||
# | # | ||||
# 3 x ip:::send (2 during the TCP handshake, then a FIN) | # 7 x ip:::send (3 during the setup, 4 during the teardown) | ||||
# 4 x tcp:::send (2 during the TCP handshake, 1 message then a FIN) | # 7 x tcp:::send (3 during the setup, 4 during the teardown) | ||||
# 2 x ip:::receive (1 during the TCP handshake, then the FIN ACK) | # 7 x ip:::receive (3 during the setup, 4 during the teardown) | ||||
# 3 x tcp:::receive (1 during the TCP handshake, 1 message then the FIN ACK) | # 7 x tcp:::receive (3 during the setup, 4 during the teardown) | ||||
# | # | ||||
# The actual ip count tested is 5 each way, since we are tracing both | # The actual count tested is 7 each way, since we are tracing both | ||||
# source and destination events. The actual tcp count tested is 7 | # source and destination events. | ||||
# each way, since the TCP fusion send/receive events will not reach IP. | |||||
# | # | ||||
# For this test to work, we are assuming that the TCP handshake and | |||||
# TCP close will enter the IP code path and not use tcp fusion. | |||||
# | |||||
if (( $# != 1 )); then | if (( $# != 1 )); then | ||||
print -u2 "expected one argument: <dtrace-path>" | print -u2 "expected one argument: <dtrace-path>" | ||||
exit 2 | exit 2 | ||||
fi | fi | ||||
dtrace=$1 | dtrace=$1 | ||||
local=127.0.0.1 | local=127.0.0.1 | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | |||||
args[4]->tcp_dport == $tcpport/ | args[4]->tcp_dport == $tcpport/ | ||||
{ | { | ||||
connaccept++; | connaccept++; | ||||
} | } | ||||
END | END | ||||
{ | { | ||||
printf("Minimum TCP events seen\n\n"); | printf("Minimum TCP events seen\n\n"); | ||||
printf("ip:::send - %s\n", ipsend >= 5 ? "yes" : "no"); | printf("ip:::send - %s\n", ipsend >= 7 ? "yes" : "no"); | ||||
printf("ip:::receive - %s\n", ipreceive >= 5 ? "yes" : "no"); | printf("ip:::receive - %s\n", ipreceive >= 7 ? "yes" : "no"); | ||||
printf("tcp:::send - %s\n", tcpsend >= 7 ? "yes" : "no"); | printf("tcp:::send - %s\n", tcpsend >= 7 ? "yes" : "no"); | ||||
printf("tcp:::receive - %s\n", tcpreceive >= 7 ? "yes" : "no"); | printf("tcp:::receive - %s\n", tcpreceive >= 7 ? "yes" : "no"); | ||||
printf("tcp:::state-change to syn-sent - %s\n", | printf("tcp:::state-change to syn-sent - %s\n", | ||||
state_event[TCP_STATE_SYN_SENT] >=1 ? "yes" : "no"); | state_event[TCP_STATE_SYN_SENT] >=1 ? "yes" : "no"); | ||||
printf("tcp:::state-change to syn-received - %s\n", | printf("tcp:::state-change to syn-received - %s\n", | ||||
state_event[TCP_STATE_SYN_RECEIVED] >=1 ? "yes" : "no"); | state_event[TCP_STATE_SYN_RECEIVED] >=1 ? "yes" : "no"); | ||||
printf("tcp:::state-change to established - %s\n", | printf("tcp:::state-change to established - %s\n", | ||||
state_event[TCP_STATE_ESTABLISHED] >= 2 ? "yes" : "no"); | state_event[TCP_STATE_ESTABLISHED] >= 2 ? "yes" : "no"); | ||||
Show All 25 Lines |