svn commit: r316505 - head/usr.sbin/extattr/tests

Ngie Cooper ngie at FreeBSD.org
Tue Apr 4 21:36:15 UTC 2017


Author: ngie
Date: Tue Apr  4 21:36:13 2017
New Revision: 316505
URL: https://svnweb.freebsd.org/changeset/base/316505

Log:
  Don't assume NAME_MAX is 255
  
  Query the filesystem limit via getconf(3) instead
  
  MFC after:	2 months
  Sponsored by:	Dell EMC Isilon

Modified:
  head/usr.sbin/extattr/tests/extattr_test.sh

Modified: head/usr.sbin/extattr/tests/extattr_test.sh
==============================================================================
--- head/usr.sbin/extattr/tests/extattr_test.sh	Tue Apr  4 21:30:24 2017	(r316504)
+++ head/usr.sbin/extattr/tests/extattr_test.sh	Tue Apr  4 21:36:13 2017	(r316505)
@@ -70,10 +70,15 @@ long_name_head() {
 }
 long_name_body() {
 	check_fs
+
+	if ! NAME_MAX=$(getconf NAME_MAX .); then
+		atf_skip "Filesystem not reporting NAME_MAX; skipping testcase"
+	fi
+
 	# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208965
 	atf_expect_fail "BUG 208965 extattr(2) doesn't allow maxlen attr names"
 
-	ATTRNAME=`jot -b X -s "" 255 0`
+	ATTRNAME=`jot -b X -s "" $NAME_MAX 0`
 	touch foo
 	atf_check -s exit:0 -o empty setextattr user $ATTRNAME myvalue foo
 	atf_check -s exit:0 -o inline:"${ATTRNAME}\n" lsextattr -q user foo


More information about the svn-src-all mailing list