From: Saurabh Tandan Date: Wed, 9 Dec 2015 19:50:09 +0000 (-0700) Subject: LU-7483 test: Modifying filtering in acl for SElinux feature X-Git-Tag: 2.7.66~24 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=6c61075bcf2f310a83a8d4c9173c9b9f4370f5ac LU-7483 test: Modifying filtering in acl for SElinux feature With SElinux feature enabled on Client, sanity.sh test_103a failed with 'Host key verification failure'. "ls -l" command was producing '.' at the end to indicate extra security attributes when SElinux is is enabled. Hence, modifying filtering by not allowing '.' in the output. Files modified are as follows: cp.test, misc.test, permission.test, setfacl.test, 974.test, 4924.test . Signed-off-by: Saurabh Tandan Change-Id: I725c1aa095f1a9feac521675cf29faa0a750598e Reviewed-on: http://review.whamcloud.com/17529 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/acl/4924.test b/lustre/tests/acl/4924.test index 9b8a0c2..8f358d3 100644 --- a/lustre/tests/acl/4924.test +++ b/lustre/tests/acl/4924.test @@ -4,10 +4,10 @@ LU-4924 - chmod g+s, touch should not clear sgid bit $ cd 4924 $ touch f $ chmod u=rwx,g=rwxs f - $ ls -l f | awk -- '{ print $1, $3, $4 }' + $ ls -l f | awk -- '{sub(/\\./, "", $1); print $1, $3, $4 }' > -rwxrwsr-- root root $ touch f - $ ls -l f | awk -- '{ print $1, $3, $4 }' + $ ls -l f | awk -- '{sub(/\\./, "", $1); print $1, $3, $4 }' > -rwxrwsr-- root root $ cd .. $ rm -rf 4924 diff --git a/lustre/tests/acl/974.test b/lustre/tests/acl/974.test index 070bd20..8f2923f 100644 --- a/lustre/tests/acl/974.test +++ b/lustre/tests/acl/974.test @@ -4,7 +4,7 @@ LU-974 ignore umask when default acl with mask is set $ mkdir 974 $ touch 974/f1 - $ ls -dl 974/f1 | awk '{ print $1 }' + $ ls -dl 974/f1 | awk '{sub(/\\./, "", $1); print $1 }' > -rw-r--r-- $ setfacl -R -d -m mask:007 974 @@ -14,7 +14,7 @@ LU-974 ignore umask when default acl with mask is set $ umask 077 $ touch f3 - $ ls -dl f3 | awk '{ print $1 }' + $ ls -dl f3 | awk '{sub(/\\./, "", $1); print $1 }' > -rw------- $ rm -rf 974 diff --git a/lustre/tests/acl/cp.test b/lustre/tests/acl/cp.test index 9a7ea43..9997547 100644 --- a/lustre/tests/acl/cp.test +++ b/lustre/tests/acl/cp.test @@ -9,7 +9,7 @@ The cp utility should only copy ACLs if `-p' is given. > -rw-rw-r--+ $ cp f g - $ ls -l g | awk -- '{ print $1 }' + $ ls -l g | awk -- '{sub(/\\./, "", $1); print $1 }' > -rw-r--r-- $ rm g diff --git a/lustre/tests/acl/misc.test b/lustre/tests/acl/misc.test index cf1d4a0..d8ace57 100644 --- a/lustre/tests/acl/misc.test +++ b/lustre/tests/acl/misc.test @@ -253,7 +253,7 @@ Add some users and groups Symlink in directory with default ACL? $ ln -s d d/l - $ ls -dl d/l | awk '{print $1}' + $ ls -dl d/l | awk 'sub(/\\./, "", $1); {print $1}' > lrwxrwxrwx $ ls -dl -L d/l | awk '{print $1}' @@ -347,7 +347,7 @@ Remove the default ACL Reset to base entries $ setfacl -b d - $ ls -dl d | awk '{print $1}' + $ ls -dl d | awk '{sub(/\\./, "", $1); print $1}' > drwxr-x--- $ getfacl --omit-header d @@ -359,7 +359,7 @@ Reset to base entries Now, chmod should change the group_obj entry $ chmod 775 d - $ ls -dl d | awk '{print $1}' + $ ls -dl d | awk '{sub(/\\./, "", $1); print $1}' > drwxrwxr-x $ getfacl --omit-header d diff --git a/lustre/tests/acl/permissions.test b/lustre/tests/acl/permissions.test index a7ca8e0..b0b5cc1 100644 --- a/lustre/tests/acl/permissions.test +++ b/lustre/tests/acl/permissions.test @@ -20,7 +20,7 @@ defined permissions. $ cd d $ umask 027 $ touch f - $ ls -l f | awk -- '{ print $1, $3, $4 }' + $ ls -l f | awk -- '{sub(/\\./, "", $1); print $1, $3, $4 }' > -rw-r----- root root @@ -40,7 +40,7 @@ Now, change the ownership of the file to bin:bin and verify that this gives user bin write access. $ chown bin:bin f - $ ls -l f | awk -- '{ print $1, $3, $4 }' + $ ls -l f | awk -- '{sub(/\\./, "", $1); print $1, $3, $4 }' > -rw-r----- bin bin $ su bin $ echo bin >> f @@ -262,12 +262,12 @@ directories if the file has an ACL and only CAP_FOWNER would grant them. $ mkdir -m 600 x $ chown daemon:daemon x $ echo j > x/j - $ ls -l x/j | awk -- '{ print $1, $3, $4 }' + $ ls -l x/j | awk -- '{sub(/\\./, "", $1); print $1, $3, $4 }' > -rw-r----- root root $ setfacl -m u:daemon:r x - $ ls -l x/j | awk -- '{ print $1, $3, $4 }' + $ ls -l x/j | awk -- '{sub(/\\./, "", $1); print $1, $3, $4 }' > -rw-r----- root root (With the bug this gives: `ls: x/j: Permission denied'.) diff --git a/lustre/tests/acl/setfacl.test b/lustre/tests/acl/setfacl.test index b503455..c82ece0 100644 --- a/lustre/tests/acl/setfacl.test +++ b/lustre/tests/acl/setfacl.test @@ -8,7 +8,7 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support. $ sg bin $ umask 027 $ touch g - $ ls -dl g | awk '{print $1}' + $ ls -dl g | awk '{sub(/\\./, "", $1); print $1}' > -rw-r----- $ setfacl -m m:- g