svn commit: r357778 - head/tests/sys/mac/portacl

Li-Wen Hsu lwhsu at FreeBSD.org
Tue Feb 11 20:41:52 UTC 2020


Author: lwhsu
Date: Tue Feb 11 20:41:51 2020
New Revision: 357778
URL: https://svnweb.freebsd.org/changeset/base/357778

Log:
  Reduce nc timeout in sys.mac.portacl.*
  
  It is not necessary to wait that long for localhost.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/tests/sys/mac/portacl/misc.sh

Modified: head/tests/sys/mac/portacl/misc.sh
==============================================================================
--- head/tests/sys/mac/portacl/misc.sh	Tue Feb 11 20:15:49 2020	(r357777)
+++ head/tests/sys/mac/portacl/misc.sh	Tue Feb 11 20:41:51 2020	(r357778)
@@ -17,6 +17,7 @@ check_bind() {
 	local host idtype name proto port udpflag
 
 	host="127.0.0.1"
+	timeout=1
 
 	idtype=${1}
 	name=${2}
@@ -28,7 +29,7 @@ check_bind() {
 	out=$(
 		case "${idtype}" in
 		uid|gid)
-			( echo -n | su -m ${name} -c "nc ${udpflag} -l -w 10 $host $port" 2>&1 ) &
+			( echo -n | su -m ${name} -c "nc ${udpflag} -l -w ${timeout} $host $port" 2>&1 ) &
 			;;
 		jail)
 			kill $$
@@ -37,7 +38,7 @@ check_bind() {
 			kill $$
 		esac
 		sleep 0.3
-		echo | nc ${udpflag} -w 10 $host $port >/dev/null 2>&1
+		echo | nc ${udpflag} -w ${timeout} $host $port >/dev/null 2>&1
 		wait
 	)
 	case "${out}" in


More information about the svn-src-all mailing list