From 5b55643c4509b39156b55edcb80a4810477a4e4a Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 20 Jul 2017 21:22:04 -0700 Subject: [PATCH] tests: remove generic/099 This IRIX-specific ACL test was nearly identical to shared/051, which has been better maintained and will be made a generic test in the next commit. Therefore, remove the existing generic/099. Signed-off-by: Eric Biggers Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- common/attr | 12 -- tests/generic/099 | 331 ------------------------------------------ tests/generic/099.out | 215 --------------------------- tests/generic/group | 1 - 4 files changed, 559 deletions(-) delete mode 100755 tests/generic/099 delete mode 100644 tests/generic/099.out diff --git a/common/attr b/common/attr index 21ebbcd0..8a5c9eac 100644 --- a/common/attr +++ b/common/attr @@ -117,18 +117,6 @@ _acl_ls() _ls_l -n $* | awk '{ print $1, $3, $4, $NF }' | _acl_filter_id } -# -_acl_list() -{ - _file1=$1 - - if [ $HOSTOS = "IRIX" ]; then - ls -dD $_file1 | _acl_filter_id - else - chacl -l $_file1 | _acl_filter_id - fi -} - # create an ACL with n ACEs in it # _create_n_aces() diff --git a/tests/generic/099 b/tests/generic/099 deleted file mode 100755 index 4af588c8..00000000 --- a/tests/generic/099 +++ /dev/null @@ -1,331 +0,0 @@ -#! /bin/bash -# FS QA Test No. 099. Modified from UDFQA test 036. -# -# ACL test -#----------------------------------------------------------------------- -# Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -#----------------------------------------------------------------------- -# -#_acl_list -# modifier - -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter -. ./common/attr - -TARGET_DIR=$SCRATCH_MNT -[ "$FSTYP" == "xfs" ] && TARGET_DIR=$TEST_DIR - -_cleanup() -{ - rm -f $tmp.* - cd $TARGET_DIR - rm -rf $seq.dir1 - cd / -} - -# ----- -# minimal access ACL has ACEs: USER_OBJ, GROUP_OBJ, OTHER_OBJ -# This is set with chacl(1) and can be changed by chmod(1). -# -# Test that this is being set for ACL and for std unix permissions -# Test that we can get back the same ACL. -# Test std permissions for rwx. -# ----- -# -# Test out default ACLs and that the ACL is being PASSed -# onto the children of the dir. -# -# ----- -# Test out access check for extended ACLs. -# -> 3 extra ACEs: MASK, GROUP, USER -# -> the GROUP compares with egid of process _and_ the supplementary -# groups (as found in /etc/group) -# -# Test that mask works for USER, GROUP, GROUP_OBJ -# Test that the ACE type priority is working -# -> this would be done by simultaneously matching on ACEs -# -> interesting if it allows user to specify ACEs in any order -# -rm -f $seqres.full - -#------------------------------------------------------- -# real QA test starts here -_supported_fs generic -_supported_os IRIX - -_require_test -_acl_setup_ids -_require_acls -_require_runas - -# get dir -#export FILE_SYS=xfs -_require_scratch - -cd $TARGET_DIR -rm -rf $seq.dir1 # in case file is left over from previous runs. -mkdir $seq.dir1 -cd $seq.dir1 - -echo "" -echo "=== Test minimal ACE ===" - -echo "Setup file" -# Note: as this is a shell script, -# will need read and execute permission set -# in order to execute it. -touch file1 -cat <file1 -#!/bin/bash -echo "Test was executed" -EOF -chmod u=rwx file1 -chmod g=rw- file1 -chmod o=r-- file1 -chown $acl1.$acl2 file1 -_acl_ls file1 - -echo "" -echo "--- Test get and set of ACL ---" -echo "Note: IRIX interface gave an empty ACL - Linux outputs an ACL" -_acl_list file1 -echo "Try using single colon separator" -echo "Note: IRIX interface FAILs because of single colon - Linux one allows it" -chacl u::r--,g::rwx,o:rw- file1 2>&1 -echo "Expect to PASS" -chacl u::r--,g::rwx,o::rw- file1 2>&1 -_acl_list file1 - -echo "" -echo "--- Test sync of ACL with std permissions ---" -_acl_ls file1 -chmod u+w file1 -_acl_ls file1 -_acl_list file1 - -echo "" -echo "--- Test owner permissions ---" -chacl u::r-x,g::---,o::--- file1 2>&1 -_acl_list file1 -# change to owner -echo "Expect to PASS" -_runas -u $acl1 -g $acl1 ./file1 2>&1 -echo "Expect to FAIL" -_runas -u $acl2 -g $acl2 ./file1 2>&1 - -echo "" -echo "--- Test group permissions ---" -chacl u::---,g::r-x,o::--- file1 2>&1 -_acl_list file1 -echo "Expect to FAIL - acl1 is owner" -_runas -u $acl1 -g $acl1 ./file1 2>&1 -echo "Expect to PASS - acl2 matches group" -_runas -u $acl2 -g $acl2 ./file1 2>&1 -echo "Expect to PASS - acl2 matches sup group" -_runas -u $acl2 -g $acl3 -s $acl2 ./file1 2>&1 -echo "Expect to FAIL - acl3 is not in group" -_runas -u $acl3 -g $acl3 ./file1 2>&1 - -echo "" -echo "--- Test other permissions ---" -chacl u::---,g::---,o::r-x file1 2>&1 -_acl_list file1 -echo "Expect to FAIL - acl1 is owner" -_runas -u $acl1 -g $acl1 ./file1 2>&1 -echo "Expect to FAIL - acl2 is in group" -_runas -u $acl2 -g $acl2 ./file1 2>&1 -echo "Expect to FAIL - acl2 is in sup. group" -_runas -u $acl2 -g $acl3 -s $acl2 ./file1 2>&1 -echo "Expect to PASS - acl3 is not owner or in group" -_runas -u $acl3 -g $acl3 ./file1 2>&1 - -#------------------------------------------------------- - -echo "" -echo "=== Test Extended ACLs ===" - -echo "" -echo "--- Test adding a USER ACE ---" -echo "Expect to FAIL as no MASK provided" -chacl u::---,g::---,o::---,u:$acl2:r-x file1 2>&1 | _acl_filter_id -echo "Ensure that ACL has not been changed" -_acl_list file1 -echo "Expect to PASS - USER ACE matches user" -chacl u::---,g::---,o::---,u:$acl2:r-x,m::rwx file1 2>&1 -_acl_list file1 -_runas -u $acl2 -g $acl2 ./file1 2>&1 -echo "Expect to FAIL - USER ACE does not match user" -_runas -u $acl3 -g $acl3 ./file1 2>&1 - -echo "" -echo "--- Test adding a GROUP ACE ---" -echo "Expect to FAIL as no MASK provided" -chacl u::---,g::---,o::---,g:$acl2:r-x file1 2>&1 | _acl_filter_id -echo "Ensure that ACL has not been changed" -_acl_list file1 -chacl u::---,g::---,o::---,g:$acl2:r-x,m::rwx file1 2>&1 -_acl_list file1 | _acl_filter_id -echo "Expect to PASS - GROUP ACE matches group" -_runas -u $acl2 -g $acl2 ./file1 2>&1 -echo "Expect to PASS - GROUP ACE matches sup group" -_runas -u $acl2 -g $acl1 -s $acl2 ./file1 2>&1 -echo "Expect to FAIL - GROUP ACE does not match group" -_runas -u $acl3 -g $acl3 ./file1 2>&1 - -#------------------------------------------------------- - -echo "" -echo "--- Test MASK ---" - -# group -chacl u::---,g::---,o::---,g:$acl2:r-x,m::-w- file1 2>&1 -_acl_list file1 -echo "Expect to FAIL as MASK prohibits execution" -_runas -u $acl2 -g $acl2 ./file1 2>&1 - -# user -chacl u::---,g::---,o::---,u:$acl2:r-x,m::-w- file1 2>&1 -echo "Expect to FAIL as MASK prohibits execution" -_runas -u $acl2 -g $acl2 ./file1 2>&1 - -# user -chacl u::---,g::---,o::---,u:$acl2:r-x,m::r-x file1 2>&1 -echo "Expect to PASS as MASK allows execution" -_runas -u $acl2 -g $acl2 ./file1 2>&1 - -#------------------------------------------------------- - -echo "" -echo "--- Test ACE priority ---" - -chacl o::rwx,g::rwx,u:$acl1:rwx,u::---,m::rwx file1 2>&1 -echo "Expect to FAIL as should match on owner" -_runas -u $acl1 -g $acl2 ./file1 2>&1 - -chacl o::---,g::---,u:$acl2:rwx,u::---,m::rwx file1 2>&1 -echo "Expect to PASS as should match on user" -_runas -u $acl2 -g $acl2 ./file1 2>&1 - -#------------------------------------------------------- - -echo "" -echo "=== Test can read ACLs without access permissions ===" -# This was a bug in kernel code where syscred wasn't being used -# to override the capabilities -chacl o::---,g::---,u::--- file1 2>&1 -_acl_list file1 - -#------------------------------------------------------- - -echo "" -echo "=== Test Default ACLs ===" -# make test clearer by testing with and without umask -umask 0 - -mkdir acldir -chacl -b "u::rwx,g::rwx,o::rwx" "u::r-x,g::r--,o::---" acldir 2>&1 -_acl_list acldir -cd acldir - -touch file2 -_acl_ls file2 -_acl_list file2 - -#ensure that umask is not having an effect -#so set it and see -umask 722 -touch file3 -_acl_ls file3 -_acl_list file3 - -cd .. -umask 022 - -#------------------------------------------------------- - -echo "" -echo "=== Removing ACLs ===" -_acl_list file1 -_acl_list acldir -_acl_list acldir/file2 -echo "Remove ACLs..." -chacl -R file1 -chacl -B acldir -chacl -R acldir/file2 -echo "Note: IRIX interface would mean empty ACLs - Linux would show mode ACLs" -_acl_list file1 -_acl_list acldir -_acl_list acldir/file2 - -#------------------------------------------------------- - -echo "" -echo "=== Test out error messages for ACL text parsing ===" - -touch file1 -set -x -chacl u file1 -chacl u: file1 -chacl u:rumpledumpleunknownuser file1 -chacl u:rumpledumpleunknownuser: file1 -chacl g:rumpledumpleunknowngrp file1 -chacl g:rumpledumpleunknowngrp: file1 -chacl o:user1:rwx file1 -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` - -echo "1 below xfs acl max" -chacl $acl1 largeaclfile -_acl_list largeaclfile | _filter_aces_notypes - -echo "xfs acl max" -chacl $acl2 largeaclfile -_acl_list largeaclfile | _filter_aces_notypes - -echo "1 above xfs acl max" -chacl $acl3 largeaclfile -_acl_list largeaclfile | _filter_aces_notypes - -#------------------------------------------------------- -# success, all done -status=0 -exit diff --git a/tests/generic/099.out b/tests/generic/099.out deleted file mode 100644 index 3f4f663f..00000000 --- a/tests/generic/099.out +++ /dev/null @@ -1,215 +0,0 @@ -QA output created by 099 - -=== Test minimal ACE === -Setup file --rwxrw-r-- id1 id2 file1 - ---- Test get and set of ACL --- -Note: IRIX interface gave an empty ACL - Linux outputs an ACL -file1 [] -Try using single colon separator -Note: IRIX interface FAILs because of single colon - Linux one allows it -chacl: "u::r--,g::rwx,o:rw-" is an invalid ACL specification. -Expect to PASS -file1 [u::r--,g::rwx,o::rw-] - ---- Test sync of ACL with std permissions --- --r--rwxrw-+ id1 id2 file1 --rw-rwxrw-+ id1 id2 file1 -file1 [u::rw-,g::rwx,o::rw-] - ---- Test owner permissions --- -file1 [u::r-x,g::---,o::---] -Expect to PASS -Test was executed -Expect to FAIL -./file1: Permission denied - ---- Test group permissions --- -file1 [u::---,g::r-x,o::---] -Expect to FAIL - acl1 is owner -./file1: Permission denied -Expect to PASS - acl2 matches group -Test was executed -Expect to PASS - acl2 matches sup group -Test was executed -Expect to FAIL - acl3 is not in group -./file1: Permission denied - ---- Test other permissions --- -file1 [u::---,g::---,o::r-x] -Expect to FAIL - acl1 is owner -./file1: Permission denied -Expect to FAIL - acl2 is in group -./file1: Permission denied -Expect to FAIL - acl2 is in sup. group -./file1: Permission denied -Expect to PASS - acl3 is not owner or in group -Test was executed - -=== Test Extended ACLs === - ---- Test adding a USER ACE --- -Expect to FAIL as no MASK provided -chacl: error setting access acl on "file1":Invalid argument -Ensure that ACL has not been changed -file1 [u::---,g::---,o::r-x] -Expect to PASS - USER ACE matches user -file1 [u::---,g::---,o::---,u:id2:r-x,m::rwx] -Test was executed -Expect to FAIL - USER ACE does not match user -./file1: Permission denied - ---- Test adding a GROUP ACE --- -Expect to FAIL as no MASK provided -chacl: error setting access acl on "file1":Invalid argument -Ensure that ACL has not been changed -file1 [u::---,g::---,o::---,u:id2:r-x,m::rwx] -file1 [u::---,g::---,o::---,g:id2:r-x,m::rwx] -Expect to PASS - GROUP ACE matches group -Test was executed -Expect to PASS - GROUP ACE matches sup group -Test was executed -Expect to FAIL - GROUP ACE does not match group -./file1: Permission denied - ---- Test MASK --- -file1 [u::---,g::---,o::---,g:id2:r-x,m::-w-] -Expect to FAIL as MASK prohibits execution -./file1: Permission denied -Expect to FAIL as MASK prohibits execution -./file1: Permission denied -Expect to PASS as MASK allows execution -Test was executed - ---- Test ACE priority --- -Expect to FAIL as should match on owner -./file1: Permission denied -Expect to PASS as should match on user -Test was executed - -=== Test can read ACLs without access permissions === -file1 [o::---,g::---,u::---] - -=== Test Default ACLs === -acldir [u::rwx,g::rwx,o::rwx/u::r-x,g::r--,o::---] --r--r-----+ 0 0 file2 -file2 [u::r--,g::r--,o::---] --r--r-----+ 0 0 file3 -file3 [u::r--,g::r--,o::---] - -=== Removing ACLs === -file1 [o::---,g::---,u::---] -acldir [u::rwx,g::rwx,o::rwx/u::r-x,g::r--,o::---] -acldir/file2 [u::r--,g::r--,o::---] -Remove ACLs... -Note: IRIX interface would mean empty ACLs - Linux would show mode ACLs -file1 [] -acldir [] -acldir/file2 [] - -=== Test out error messages for ACL text parsing === -+ chacl u file1 -chacl: "u" is an invalid ACL specification. -+ chacl u: file1 -chacl: "u:" is an invalid ACL specification. -+ chacl u:rumpledumpleunknownuser file1 -chacl: "u:rumpledumpleunknownuser" is an invalid ACL specification. -+ chacl u:rumpledumpleunknownuser: file1 -chacl: "u:rumpledumpleunknownuser:" is an invalid ACL specification. -+ chacl g:rumpledumpleunknowngrp file1 -chacl: "g:rumpledumpleunknowngrp" is an invalid ACL specification. -+ chacl g:rumpledumpleunknowngrp: file1 -chacl: "g:rumpledumpleunknowngrp:" is an invalid ACL specification. -+ chacl o:user1:rwx file1 -chacl: "o:user1:rwx" is an invalid ACL specification. -+ chacl m:user1:rwx file1 -chacl: "m:user1:rwx" is an invalid ACL specification. -+ chacl a::rwx file1 -chacl: "a::rwx" is an invalid ACL specification. - -=== Test out large ACLs === -1 below xfs acl max -largeaclfile -user::rwx -group::rwx -other::rwx -mask::rwx -user:20:rwx -user:19:rwx -user:18:rwx -user:17:rwx -user:16:rwx -user:15:rwx -user:14:rwx -user:13:rwx -user:12:rwx -user:11:rwx -user:10:rwx -user:9:rwx -user:8:rwx -user:7:rwx -user:6:rwx -user:5:rwx -user:4:rwx -user:3:rwx -user:2:rwx -user:1:rwx - -xfs acl max -largeaclfile -user::rwx -group::rwx -other::rwx -mask::rwx -user:21:rwx -user:20:rwx -user:19:rwx -user:18:rwx -user:17:rwx -user:16:rwx -user:15:rwx -user:14:rwx -user:13:rwx -user:12:rwx -user:11:rwx -user:10:rwx -user:9:rwx -user:8:rwx -user:7:rwx -user:6:rwx -user:5:rwx -user:4:rwx -user:3:rwx -user:2:rwx -user:1:rwx - -1 above xfs acl max -chacl: error setting access acl on "largeaclfile":Error 0 -largeaclfile -user::rwx -group::rwx -other::rwx -mask::rwx -user:21:rwx -user:20:rwx -user:19:rwx -user:18:rwx -user:17:rwx -user:16:rwx -user:15:rwx -user:14:rwx -user:13:rwx -user:12:rwx -user:11:rwx -user:10:rwx -user:9:rwx -user:8:rwx -user:7:rwx -user:6:rwx -user:5:rwx -user:4:rwx -user:3:rwx -user:2:rwx -user:1:rwx - diff --git a/tests/generic/group b/tests/generic/group index 036cbb79..ae847c8a 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -101,7 +101,6 @@ 096 auto prealloc quick zero 097 attr auto quick 098 auto quick metadata -099 udf auto 100 udf auto 101 auto quick metadata 102 auto rw -- 2.47.3