move some acl funcs into common.attr
[xfstests-dev.git] / 051
diff --git a/051 b/051
index afd4690c34a02ea2afe4cc795aeb538474ffe3fc..90e0a3f6404fb20813efab9f12b8cd598057dc8a 100755 (executable)
--- a/051
+++ b/051
@@ -85,8 +85,7 @@ rm -f $seq.full
 
 _need_to_be_root
 _acl_setup_ids
-
-[ ! -x /bin/chacl -a ! -x /usr/bin/chacl ] && _notrun "chacl command not found"
+_acl_requirements
 [ -x $runas ] || _notrun "$runas executable not found"
 
 # get dir
@@ -95,15 +94,6 @@ rm -rf $seq.dir1
 mkdir $seq.dir1
 cd $seq.dir1
 
-# test if acl_get syscall is operational
-# and hence the ACL config has been turned on  
-touch syscalltest
-if chacl -l syscalltest 2>&1 | tee -a $here/$seq.full | grep 'Function not implemented' >/dev/null
-then
-  cd $here
-  _notrun "requires kernel ACL support"
-fi
-
 #-------------------------------------------------------
 # real QA test starts here
 echo "QA output created by $seq"
@@ -344,8 +334,40 @@ chacl m:user1:rwx file1
 chacl a::rwx file1
 set +x
 
+#-------------------------------------------------------
 
-
+echo ""
+echo "=== Test out large ACLs  ==="
+touch largeaclfile
+XFS_ACL_MAX_ENTRIES=25
+num_aces_pre=`expr $XFS_ACL_MAX_ENTRIES - 1`
+num_aces_post=`expr $XFS_ACL_MAX_ENTRIES + 1`
+
+acl1=`_create_n_aces $num_aces_pre`
+acl2=`_create_n_aces $XFS_ACL_MAX_ENTRIES`
+acl3=`_create_n_aces $num_aces_post`
+acl4=`_create_n_aces 16` # Andreas G. libacl size for initial get
+acl5=`_create_n_aces 17` # 1 over A.G. libacl initial size
+
+echo "1 below xfs acl max"
+chacl $acl1 largeaclfile
+getfacl largeaclfile | _filter_aces
+
+echo "xfs acl max"
+chacl $acl2 largeaclfile
+getfacl largeaclfile | _filter_aces
+
+echo "1 above xfs acl max"
+chacl $acl3 largeaclfile
+getfacl largeaclfile | _filter_aces
+
+echo "use 16 aces"
+chacl $acl4 largeaclfile
+getfacl largeaclfile | _filter_aces
+
+echo "use 17 aces"
+chacl $acl5 largeaclfile
+getfacl largeaclfile | _filter_aces
 
 #-------------------------------------------------------