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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to