From owner-svn-src-user@freebsd.org Tue Apr 30 08:09:34 2019 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 139971587B4D for ; Tue, 30 Apr 2019 08:09:34 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA5D992564; Tue, 30 Apr 2019 08:09:33 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A7516C54; Tue, 30 Apr 2019 08:09:33 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U89XtW074008; Tue, 30 Apr 2019 08:09:33 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U89X0K074007; Tue, 30 Apr 2019 08:09:33 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201904300809.x3U89X0K074007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Tue, 30 Apr 2019 08:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r346953 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 346953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA5D992564 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 08:09:34 -0000 Author: pho Date: Tue Apr 30 08:09:32 2019 New Revision: 346953 URL: https://svnweb.freebsd.org/changeset/base/346953 Log: Added two multicast test cases. Sponsored by: Dell EMC Isilon Added: user/pho/stress2/misc/multicast.sh (contents, props changed) user/pho/stress2/misc/multicast2.sh (contents, props changed) Added: user/pho/stress2/misc/multicast.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/multicast.sh Tue Apr 30 08:09:32 2019 (r346953) @@ -0,0 +1,120 @@ +#!/bin/sh + +# Multicast test example by Mark Claypool, claypool at cs.wpi.edu +# https://web.cs.wpi.edu/~claypool/courses/4514-B99/samples/multicast.c + +# Kernel page fault seen with WiP branch: +# https://people.freebsd.org/~pho/stress/log/kip036.txt + +# $FreeBSD$ + +. ../default.cfg + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/multicast.c +mycc -o multicast -Wall -Wextra -O0 -g multicast.c || exit 1 +rm -f multicast.c +cd $odir + +cd $dir +( + timeout -k 1s 20s ./multicast & + sleep 1 + timeout -k 1s 25s ./multicast 1 +) > /dev/null +wait + +rm -f $dir/multicast +exit $s +EOF +/* +multicast.c + +The following program sends or receives multicast packets. If invoked +with one argument, it sends a packet containing the current time to an +arbitrarily chosen multicast group and UDP port. If invoked with no +arguments, it receives and prints these packets. Start it as a sender on +just one host and as a receiver on all the other hosts + +*/ + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#define EXAMPLE_PORT 6000 +#define EXAMPLE_GROUP "239.0.0.1" + +int +main(int argc, char *argv[] __unused) +{ + struct ip_mreq mreq; + struct sockaddr_in addr; + socklen_t addrlen; + int cnt, sock; + char message[50]; + + /* set up socket */ + sock = socket(AF_INET, SOCK_DGRAM, 0); + if (sock < 0) { + perror("socket"); + exit(1); + } + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_ANY); + addr.sin_port = htons(EXAMPLE_PORT); + addrlen = sizeof(addr); + + if (argc > 1) { + /* send */ + addr.sin_addr.s_addr = inet_addr(EXAMPLE_GROUP); + while (1) { + time_t t = time(0); + sprintf(message, "time is %-24.24s", ctime(&t)); + printf("sending: %s\n", message); + cnt = sendto(sock, message, sizeof(message), 0, + (struct sockaddr *) &addr, addrlen); + if (cnt < 0) { + perror("sendto"); + exit(1); + } + sleep(5); + } + } else { + + /* receive */ + if (bind(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + perror("bind"); + exit(1); + } + mreq.imr_multiaddr.s_addr = inet_addr(EXAMPLE_GROUP); + mreq.imr_interface.s_addr = htonl(INADDR_ANY); + if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, + &mreq, sizeof(mreq)) < 0) { + perror("setsockopt mreq"); + exit(1); + } + while (1) { + cnt = recvfrom(sock, message, sizeof(message), 0, + (struct sockaddr *) &addr, &addrlen); + if (cnt < 0) { + perror("recvfrom"); + exit(1); + } else if (cnt == 0) { + break; + } + printf("%s: message = \"%s\"\n", inet_ntoa(addr.sin_addr), message); + } + } +} Added: user/pho/stress2/misc/multicast2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/multicast2.sh Tue Apr 30 08:09:32 2019 (r346953) @@ -0,0 +1,26 @@ +#!/bin/sh + +# D19886 Fix numerous refcount bugs in multicast + +# Page fault in in6_pcbpurgeif0+0xc8 seen. +# https://people.freebsd.org/~pho/stress/log/mmacy035.txt +# Test scenario by mmacy + +# $FreeBSD$ + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +[ -x /usr/local/bin/mDNSResponderPosix ] || + { echo "mDNSResponder not installed"; exit 0; } + +(cd ../testcases/swap; ./swap -t 2m -i 50 -v -h -l 100) & +sleep 2 + +service mdnsd onestart +ifconfig vtnet0 delete 2>/dev/null +ifconfig epair create +ifconfig epair0a 0/24 up +ifconfig epair0a destroy +service mdnsd onestop + +while pkill swap; do :; done +wait