Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | From d2f49ee6fe4850b8dda5b08676b36201d3c43710 Mon Sep 17 00:00:00 2001 |
| 2 | From: He Zhe <zhe.he@windriver.com> |
| 3 | Date: Wed, 2 Mar 2016 15:46:57 +0800 |
| 4 | Subject: [PATCH] test: fixups on SELinux machines for root testcases |
| 5 | |
| 6 | ls adds a '.' at the end of the permission field list on SELinux |
| 7 | machines, filter this out so root tests work on SELinux machines. |
| 8 | |
| 9 | Upstream-Status: Accepted |
| 10 | http://git.savannah.gnu.org/cgit/acl.git/commit/?id=26a87d36f80d5e98bccb5878834d9e69dadfe3e9 |
| 11 | |
| 12 | Signed-off-by: He Zhe <zhe.he@windriver.com> |
| 13 | --- |
| 14 | test/root/permissions.test | 8 ++++---- |
| 15 | test/root/restore.test | 2 +- |
| 16 | test/root/setfacl.test | 2 +- |
| 17 | 3 files changed, 6 insertions(+), 6 deletions(-) |
| 18 | |
| 19 | diff --git a/test/root/permissions.test b/test/root/permissions.test |
| 20 | index 9b9e3de..665339a 100644 |
| 21 | --- a/test/root/permissions.test |
| 22 | +++ b/test/root/permissions.test |
| 23 | @@ -19,7 +19,7 @@ defined permissions. |
| 24 | $ cd d |
| 25 | $ umask 027 |
| 26 | $ touch f |
| 27 | - $ ls -l f | awk -- '{ print $1, $3, $4 }' |
| 28 | + $ ls -l f | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g' |
| 29 | > -rw-r----- root root |
| 30 | |
| 31 | |
| 32 | @@ -39,7 +39,7 @@ Now, change the ownership of the file to bin:bin and verify that this |
| 33 | gives user bin write access. |
| 34 | |
| 35 | $ chown bin:bin f |
| 36 | - $ ls -l f | awk -- '{ print $1, $3, $4 }' |
| 37 | + $ ls -l f | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g' |
| 38 | > -rw-r----- bin bin |
| 39 | $ su bin |
| 40 | $ echo bin >> f |
| 41 | @@ -256,12 +256,12 @@ directories if the file has an ACL and only CAP_FOWNER would grant them. |
| 42 | $ mkdir -m 600 x |
| 43 | $ chown daemon:daemon x |
| 44 | $ echo j > x/j |
| 45 | - $ ls -l x/j | awk -- '{ print $1, $3, $4 }' |
| 46 | + $ ls -l x/j | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g' |
| 47 | > -rw-r----- root root |
| 48 | |
| 49 | $ setfacl -m u:daemon:r x |
| 50 | |
| 51 | - $ ls -l x/j | awk -- '{ print $1, $3, $4 }' |
| 52 | + $ ls -l x/j | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g' |
| 53 | > -rw-r----- root root |
| 54 | (With the bug this gives: `ls: x/j: Permission denied'.) |
| 55 | |
| 56 | diff --git a/test/root/restore.test b/test/root/restore.test |
| 57 | index 63a9d01..c85097c 100644 |
| 58 | --- a/test/root/restore.test |
| 59 | +++ b/test/root/restore.test |
| 60 | @@ -21,7 +21,7 @@ Cry immediately if we are not running as root. |
| 61 | $ chown bin passwd |
| 62 | $ chmod u+s passwd |
| 63 | $ setfacl --restore passwd.acl |
| 64 | - $ ls -dl passwd | awk '{print $1 " " $3 " " $4}' |
| 65 | + $ ls -dl passwd | awk '{print $1 " " $3 " " $4}' | sed 's/\\.//g' |
| 66 | > -rwsr-xr-x root root |
| 67 | |
| 68 | $ rm passwd passwd.acl |
| 69 | diff --git a/test/root/setfacl.test b/test/root/setfacl.test |
| 70 | index a46a9f4..7efbad7 100644 |
| 71 | --- a/test/root/setfacl.test |
| 72 | +++ b/test/root/setfacl.test |
| 73 | @@ -12,7 +12,7 @@ Cry immediately if we are not running as root. |
| 74 | $ sg bin |
| 75 | $ umask 027 |
| 76 | $ touch g |
| 77 | - $ ls -dl g | awk '{print $1}' |
| 78 | + $ ls -dl g | awk '{print $1}' | sed 's/\\.//g' |
| 79 | > -rw-r----- |
| 80 | |
| 81 | $ setfacl -m m:- g |
| 82 | -- |
| 83 | 1.9.1 |
| 84 | |