aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2018-07-20 15:37:29 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2018-07-20 15:37:29 +0000
commitbe029a4979f40d472ab142c6612f85c2fb67a95b (patch)
tree60b8c08b5401cde2c6c6fdf511633cda4cd1dce3 /cddl/contrib/opensolaris/cmd/dtrace/test/tst/common
parente1526d5a5bf98de1b4ffef7c6cba4dc04be1eb7a (diff)
downloadsrc-be029a4979f40d472ab142c6612f85c2fb67a95b.tar.gz
src-be029a4979f40d472ab142c6612f85c2fb67a95b.zip
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
Notes
Notes: svn path=/head/; revision=336552
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/dtrace/test/tst/common')
-rwxr-xr-xcddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh19
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out1
2 files changed, 14 insertions, 6 deletions
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
index 323a6e56acbf..196448b66027 100755
--- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
@@ -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:
#
@@ -42,11 +42,11 @@
# 1 x ip:::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 udp:::receive (UDP received)
#
-# No udp:::receive event is expected since the UDP packet elicts
-# an ICMP PORT_UNREACHABLE response rather than a UDP packet, and locally
-# the echo request UDP packet only reaches IP, so the udp:::receive probe
-# is not triggered by it.
+# A udp:::receive event is expected even if the received UDP packet
+# elicits an ICMP PORT_UNREACHABLE message since there is no UDP
+# socket for receiving the packet.
#
if (( $# != 1 )); then
@@ -77,7 +77,7 @@ EOPERL
$dtrace -c 'perl test.pl' -qs /dev/stdin <<EODTRACE
BEGIN
{
- ipsend = udpsend = ipreceive = 0;
+ ipsend = udpsend = ipreceive = udpreceive = 0;
}
ip:::send
@@ -100,12 +100,19 @@ ip:::receive
ipreceive++;
}
+udp:::receive
+/args[2]->ip_saddr == "$local" && args[2]->ip_daddr == "$local"/
+{
+ udpreceive++;
+}
+
END
{
printf("Minimum UDP events seen\n\n");
printf("ip:::send - %s\n", ipsend >= 1 ? "yes" : "no");
printf("ip:::receive - %s\n", ipreceive >= 1 ? "yes" : "no");
printf("udp:::send - %s\n", udpsend >= 1 ? "yes" : "no");
+ printf("udp:::receive - %s\n", udpreceive >= 1 ? "yes" : "no");
}
EODTRACE
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out
index bca55327ef57..d94aa3104dad 100644
--- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out
+++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out
@@ -3,4 +3,5 @@ Minimum UDP events seen
ip:::send - yes
ip:::receive - yes
udp:::send - yes
+udp:::receive - yes