Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2016 22:12:03 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r294748 - user/ngie/socket-tests/tests/sys/kern/sockets
Message-ID:  <201601252212.u0PMC30Z058857@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Mon Jan 25 22:12:03 2016
New Revision: 294748
URL: https://svnweb.freebsd.org/changeset/base/294748

Log:
  Put in initial work for integrating sigpipe_test into the FreeBSD test suite

Modified:
  user/ngie/socket-tests/tests/sys/kern/sockets/Makefile
  user/ngie/socket-tests/tests/sys/kern/sockets/sigpipe_test.c

Modified: user/ngie/socket-tests/tests/sys/kern/sockets/Makefile
==============================================================================
--- user/ngie/socket-tests/tests/sys/kern/sockets/Makefile	Mon Jan 25 20:35:15 2016	(r294747)
+++ user/ngie/socket-tests/tests/sys/kern/sockets/Makefile	Mon Jan 25 22:12:03 2016	(r294748)
@@ -14,9 +14,7 @@ PLAIN_TESTS_C+=	rtsocket_test
 PLAIN_TESTS_C+=	sblock_test
 PLAIN_TESTS_C+=	sendfile_test
 PLAIN_TESTS_C+=	shutdown_test
-# XXX: make the test function in a standalone manner instead of having it be a
-# test program
-#PLAIN_TESTS_C+=	sigpipe_test
+PLAIN_TESTS_C+=	sigpipe_test
 PLAIN_TESTS_C+=	so_setfib_test
 PLAIN_TESTS_C+=	socketpair_test
 PLAIN_TESTS_C+=	unix_bindconnect_test

Modified: user/ngie/socket-tests/tests/sys/kern/sockets/sigpipe_test.c
==============================================================================
--- user/ngie/socket-tests/tests/sys/kern/sockets/sigpipe_test.c	Mon Jan 25 20:35:15 2016	(r294747)
+++ user/ngie/socket-tests/tests/sys/kern/sockets/sigpipe_test.c	Mon Jan 25 22:12:03 2016	(r294748)
@@ -39,23 +39,7 @@
 #include <string.h>
 #include <unistd.h>
 
-/*
- * This regression test is intended to verify whether or not SIGPIPE is
- * properly generated in several simple test cases, as well as testing
- * whether SO_NOSIGPIPE disables SIGPIPE, if available on the system.
- * SIGPIPE is generated if a write or send is attempted on a socket that has
- * been shutdown for write.  This test runs several test cases with UNIX
- * domain sockets and TCP sockets to confirm that either EPIPE or SIGPIPE is
- * properly returned.
- *
- * For the purposes of testing TCP, an unused port number must be specified.
- */
-static void
-usage(void)
-{
-
-	errx(-1, "usage: sigpipe tcpport");
-}
+#define	DEFAULT_PORT 10000
 
 /*
  * Signal catcher.  Set a global flag that can be tested by the caller.
@@ -252,14 +236,7 @@ main(int argc, char *argv[])
 {
 	char *dummy;
 	int sock[2];
-	long port;
-
-	if (argc != 2)
-		usage();
-
-	port = strtol(argv[1], &dummy, 10);
-	if (port < 0 || port > 65535 || *dummy != '\0')
-		usage();
+	in_port_t port = DEFAULT_PORT;
 
 #ifndef SO_NOSIGPIPE
 	warnx("sigpipe: SO_NOSIGPIPE not defined, skipping some tests");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601252212.u0PMC30Z058857>