Differential D16288 Diff 45628 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
Changeset View
Changeset View
Standalone View
Standalone View
cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
Show All 32 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) | ||||
# 3 x tcp:::send (2 during the TCP handshake, 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) | ||||
# 2 x tcp:::receive (1 during the TCP handshake, then the FIN ACK) | # 7 x tcp:::receive (3 during the setup, 4 during the teardown) | ||||
# The actual 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. | # source and destination events. | ||||
# | # | ||||
# 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 58 Lines • ▼ Show 20 Lines | |||||
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/ | /args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/ | ||||
{ | { | ||||
tcpreceive++; | tcpreceive++; | ||||
} | } | ||||
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 >= 5 ? "yes" : "no"); | printf("tcp:::send - %s\n", tcpsend >= 7 ? "yes" : "no"); | ||||
printf("tcp:::receive - %s\n", tcpreceive >= 5 ? "yes" : "no"); | printf("tcp:::receive - %s\n", tcpreceive >= 7 ? "yes" : "no"); | ||||
} | } | ||||
EODTRACE | EODTRACE | ||||
status=$? | status=$? | ||||
cd / | cd / | ||||
/bin/rm -rf $DIR | /bin/rm -rf $DIR | ||||
exit $status | exit $status |