summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Zhe <zhe.he@windriver.com>2016-03-02 19:06:11 +0800
committerAndreas Gruenbacher <agruenba@redhat.com>2016-03-02 12:59:28 +0100
commit26a87d36f80d5e98bccb5878834d9e69dadfe3e9 (patch)
tree93e0c96b74d3c7c16cb0984ee3fba557871bf0e9
parent5dac69ce914202c587f00da638123403111ca673 (diff)
downloadacl-26a87d36f80d5e98bccb5878834d9e69dadfe3e9.tar.gz
test: fixups on SELinux machines for root testcases
ls adds a '.' at the end of the permission field list on SELinux machines, filter this out so root tests work on SELinux machines. Signed-off-by: He Zhe <zhe.he@windriver.com>
-rw-r--r--test/root/permissions.test8
-rw-r--r--test/root/restore.test2
-rw-r--r--test/root/setfacl.test2
3 files changed, 6 insertions, 6 deletions
diff --git a/test/root/permissions.test b/test/root/permissions.test
index 9b9e3de..665339a 100644
--- a/test/root/permissions.test
+++ b/test/root/permissions.test
@@ -19,7 +19,7 @@ defined permissions.
$ cd d
$ umask 027
$ touch f
- $ ls -l f | awk -- '{ print $1, $3, $4 }'
+ $ ls -l f | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
> -rw-r----- root root
@@ -39,7 +39,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 -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
> -rw-r----- bin bin
$ su bin
$ echo bin >> f
@@ -256,12 +256,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 -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
> -rw-r----- root root
$ setfacl -m u:daemon:r x
- $ ls -l x/j | awk -- '{ print $1, $3, $4 }'
+ $ ls -l x/j | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
> -rw-r----- root root
(With the bug this gives: `ls: x/j: Permission denied'.)
diff --git a/test/root/restore.test b/test/root/restore.test
index 63a9d01..c85097c 100644
--- a/test/root/restore.test
+++ b/test/root/restore.test
@@ -21,7 +21,7 @@ Cry immediately if we are not running as root.
$ chown bin passwd
$ chmod u+s passwd
$ setfacl --restore passwd.acl
- $ ls -dl passwd | awk '{print $1 " " $3 " " $4}'
+ $ ls -dl passwd | awk '{print $1 " " $3 " " $4}' | sed 's/\\.//g'
> -rwsr-xr-x root root
$ rm passwd passwd.acl
diff --git a/test/root/setfacl.test b/test/root/setfacl.test
index a46a9f4..7efbad7 100644
--- a/test/root/setfacl.test
+++ b/test/root/setfacl.test
@@ -12,7 +12,7 @@ Cry immediately if we are not running as root.
$ sg bin
$ umask 027
$ touch g
- $ ls -dl g | awk '{print $1}'
+ $ ls -dl g | awk '{print $1}' | sed 's/\\.//g'
> -rw-r-----
$ setfacl -m m:- g