Whamcloud - gitweb
LU-7483 test: Modifying filtering in acl for SElinux feature 29/17529/4
authorSaurabh Tandan <saurabh.tandan@intel.com>
Wed, 9 Dec 2015 19:50:09 +0000 (12:50 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 25 Jan 2016 01:58:05 +0000 (01:58 +0000)
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 <saurabh.tandan@intel.com>
Change-Id: I725c1aa095f1a9feac521675cf29faa0a750598e
Reviewed-on: http://review.whamcloud.com/17529
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/acl/4924.test
lustre/tests/acl/974.test
lustre/tests/acl/cp.test
lustre/tests/acl/misc.test
lustre/tests/acl/permissions.test
lustre/tests/acl/setfacl.test

index 9b8a0c2..8f358d3 100644 (file)
@@ -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
        $ 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
        > -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
        > -rwxrwsr-- root root
        $ cd ..
        $ rm -rf 4924
index 070bd20..8f2923f 100644 (file)
@@ -4,7 +4,7 @@ LU-974 ignore umask when default acl with mask is set
        $ mkdir 974
 
        $ touch 974/f1
        $ 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
        > -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
 
        $ umask 077
        $ touch f3
-       $ ls -dl f3 | awk '{ print $1 }'
+       $ ls -dl f3 | awk '{sub(/\\./, "", $1); print $1 }'
        > -rw-------
 
        $ rm -rf 974
        > -rw-------
 
        $ rm -rf 974
index 9a7ea43..9997547 100644 (file)
@@ -9,7 +9,7 @@ The cp utility should only copy ACLs if `-p' is given.
        > -rw-rw-r--+
        
        $ cp f g
        > -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
        > -rw-r--r--
        
        $ rm g
index cf1d4a0..d8ace57 100644 (file)
@@ -253,7 +253,7 @@ Add some users and groups
 Symlink in directory with default ACL?
         
        $ ln -s d d/l
 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}'
        > lrwxrwxrwx
 
        $ ls -dl -L d/l | awk '{print $1}'
@@ -347,7 +347,7 @@ Remove the default ACL
 Reset to base entries
         
        $ setfacl -b d
 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
        > 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
 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
        > drwxrwxr-x
        
        $ getfacl --omit-header d
index a7ca8e0..b0b5cc1 100644 (file)
@@ -20,7 +20,7 @@ defined permissions.
        $ cd d
        $ umask 027
        $ touch f
        $ 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
 
 
        > -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
 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
        > -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
        $ 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
 
        > -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'.)
 
        > -rw-r----- root root
        (With the bug this gives: `ls: x/j: Permission denied'.)
 
index b503455..c82ece0 100644 (file)
@@ -8,7 +8,7 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support.
        $ sg bin
        $ umask 027
        $ touch g
        $ 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
        > -rw-r-----
        
        $ setfacl -m m:- g