Test that the dtrace UDP receive probe fires.
This test ensures that the fix committed in https://svnweb.freebsd.org/changeset/base/336551 actually works. Reviewed by: dteske@, markj@, rrs@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16046
This commit is contained in:
parent
e1526d5a5b
commit
be029a4979
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336552
@ -25,7 +25,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test ip:::{send,receive} of IPv4 UDP to a local address.
|
# Test {ip,udp}:::{send,receive} of IPv4 UDP to a local address.
|
||||||
#
|
#
|
||||||
# This may fail due to:
|
# This may fail due to:
|
||||||
#
|
#
|
||||||
@ -42,11 +42,11 @@
|
|||||||
# 1 x ip:::send (UDP sent to UDP port 33434)
|
# 1 x ip:::send (UDP sent to UDP port 33434)
|
||||||
# 1 x udp:::send (UDP sent to UDP port 33434)
|
# 1 x udp:::send (UDP sent to UDP port 33434)
|
||||||
# 1 x ip:::receive (UDP received)
|
# 1 x ip:::receive (UDP received)
|
||||||
|
# 1 x udp:::receive (UDP received)
|
||||||
#
|
#
|
||||||
# No udp:::receive event is expected since the UDP packet elicts
|
# A udp:::receive event is expected even if the received UDP packet
|
||||||
# an ICMP PORT_UNREACHABLE response rather than a UDP packet, and locally
|
# elicits an ICMP PORT_UNREACHABLE message since there is no UDP
|
||||||
# the echo request UDP packet only reaches IP, so the udp:::receive probe
|
# socket for receiving the packet.
|
||||||
# is not triggered by it.
|
|
||||||
#
|
#
|
||||||
|
|
||||||
if (( $# != 1 )); then
|
if (( $# != 1 )); then
|
||||||
@ -77,7 +77,7 @@ EOPERL
|
|||||||
$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
|
$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
|
||||||
BEGIN
|
BEGIN
|
||||||
{
|
{
|
||||||
ipsend = udpsend = ipreceive = 0;
|
ipsend = udpsend = ipreceive = udpreceive = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ip:::send
|
ip:::send
|
||||||
@ -100,12 +100,19 @@ ip:::receive
|
|||||||
ipreceive++;
|
ipreceive++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
udp:::receive
|
||||||
|
/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/
|
||||||
|
{
|
||||||
|
udpreceive++;
|
||||||
|
}
|
||||||
|
|
||||||
END
|
END
|
||||||
{
|
{
|
||||||
printf("Minimum UDP events seen\n\n");
|
printf("Minimum UDP events seen\n\n");
|
||||||
printf("ip:::send - %s\n", ipsend >= 1 ? "yes" : "no");
|
printf("ip:::send - %s\n", ipsend >= 1 ? "yes" : "no");
|
||||||
printf("ip:::receive - %s\n", ipreceive >= 1 ? "yes" : "no");
|
printf("ip:::receive - %s\n", ipreceive >= 1 ? "yes" : "no");
|
||||||
printf("udp:::send - %s\n", udpsend >= 1 ? "yes" : "no");
|
printf("udp:::send - %s\n", udpsend >= 1 ? "yes" : "no");
|
||||||
|
printf("udp:::receive - %s\n", udpreceive >= 1 ? "yes" : "no");
|
||||||
}
|
}
|
||||||
EODTRACE
|
EODTRACE
|
||||||
|
|
||||||
|
@ -3,4 +3,5 @@ Minimum UDP events seen
|
|||||||
ip:::send - yes
|
ip:::send - yes
|
||||||
ip:::receive - yes
|
ip:::receive - yes
|
||||||
udp:::send - yes
|
udp:::send - yes
|
||||||
|
udp:::receive - yes
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user