summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorHe Zhe <zhe.he@windriver.com>2016-03-03 02:16:43 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-07 00:11:38 +0000
commite2107f5b97c95aa59447f8459958e4b1a2849711 (patch)
tree7e344083e65f38b20c927129efb07ce55f1de55d /meta
parent82a80645f8bf4438aa8cf39d3759046dc5bdbf75 (diff)
downloadpoky-e2107f5b97c95aa59447f8459958e4b1a2849711.tar.gz
acl: Fix re pattern in test cases
ls adds a '.' at the end of the permission field list on SELinux machines, filter this out so root tests work on SELinux machines. And backport one patch for other tests. (From OE-Core rev: 2981d026460658fd2db7df3618d718fe6e8bfca0) Signed-off-by: He Zhe <zhe.he@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-support/attr/acl.inc2
-rw-r--r--meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch108
-rw-r--r--meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch84
3 files changed, 194 insertions, 0 deletions
diff --git a/meta/recipes-support/attr/acl.inc b/meta/recipes-support/attr/acl.inc
index b2bc8bac28..198fb4fed9 100644
--- a/meta/recipes-support/attr/acl.inc
+++ b/meta/recipes-support/attr/acl.inc
@@ -12,6 +12,8 @@ DEPENDS = "attr"
12SRC_URI = "${SAVANNAH_GNU_MIRROR}/acl/${BP}.src.tar.gz \ 12SRC_URI = "${SAVANNAH_GNU_MIRROR}/acl/${BP}.src.tar.gz \
13 file://run-ptest \ 13 file://run-ptest \
14 file://acl-fix-the-order-of-expected-output-of-getfacl.patch \ 14 file://acl-fix-the-order-of-expected-output-of-getfacl.patch \
15 file://test-fix-insufficient-quoting-of.patch \
16 file://test-fixups-on-SELinux-machines-for-root-testcases.patch \
15" 17"
16 18
17require ea-acl.inc 19require ea-acl.inc
diff --git a/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch b/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch
new file mode 100644
index 0000000000..0b350be563
--- /dev/null
+++ b/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch
@@ -0,0 +1,108 @@
1From e98ce8acf84d12ea67a3ac76bf63c6d87d9af86d Mon Sep 17 00:00:00 2001
2From: Kamil Dudka <kdudka@redhat.com>
3Date: Mon, 20 May 2013 16:38:06 +0200
4Subject: [PATCH] test: fix insufficient quoting of '\'
5
6This is a follow-up to 7f2c91b8369242a8dbc2b304a5b71b2a85f5b855, which
7caused sbits-restore.test to fail in the following way in case SELinux
8was disabled:
9
10*** sbits-restore.test ***
11[3] $ umask 022 -- ok
12[4] $ mkdir d -- ok
13[5] $ touch d/g -- ok
14[6] $ touch d/u -- ok
15[7] $ chmod u+s d/u -- ok
16[8] $ chmod g+s d/g -- ok
17[9] $ chmod +t d -- ok
18[10] $ getfacl -R d > d.acl -- ok
19[11] $ rm -R d -- ok
20[12] $ mkdir d -- ok
21[13] $ touch d/g -- ok
22[14] $ touch d/u -- ok
23[15] $ setfacl --restore d.acl -- ok
24[16] $ ls -dl d | awk '{print $1}' | sed 's/.$//g' -- failed
25drwxr-xr- != drwxr-xr-t
26[18] $ ls -dl d/u | awk '{print $1}' | sed 's/.$//g' -- failed
27-rwSr--r- != -rwSr--r--
28[20] $ ls -dl d/g | awk '{print $1}' | sed 's/.$//g' -- failed
29-rw-r-Sr- != -rw-r-Sr--
30[22] $ rm -Rf d -- ok
3117 commands (14 passed, 3 failed)
32
33Upstream-Status: Backport
34http://git.savannah.gnu.org/cgit/acl.git/commit/?id=e98ce8acf84d12ea67a3ac76bf63c6d87d9af86d
35
36Signed-off-by: Kamil Dudka <kdudka@redhat.com>
37Signed-off-by: He Zhe <zhe.he@windriver.com>
38---
39 test/cp.test | 2 +-
40 test/misc.test | 6 +++---
41 test/sbits-restore.test | 6 +++---
42 3 files changed, 7 insertions(+), 7 deletions(-)
43
44diff --git a/test/cp.test b/test/cp.test
45index 0867f63..a927195 100644
46--- a/test/cp.test
47+++ b/test/cp.test
48@@ -9,7 +9,7 @@ The cp utility should only copy ACLs if `-p' is given.
49 > -rw-rw-r--+
50
51 $ cp f g
52- $ ls -l g | awk -- '{ print $1 }' | sed 's/\.$//g'
53+ $ ls -l g | awk -- '{ print $1 }' | sed 's/\\.$//g'
54 > -rw-r--r--
55
56 $ rm g
57diff --git a/test/misc.test b/test/misc.test
58index 6e98053..29372b7 100644
59--- a/test/misc.test
60+++ b/test/misc.test
61@@ -254,7 +254,7 @@ Add some users and groups
62 Symlink in directory with default ACL?
63
64 $ ln -s d d/l
65- $ ls -dl d/l | awk '{print $1}' | sed 's/\.$//g'
66+ $ ls -dl d/l | awk '{print $1}' | sed 's/\\.$//g'
67 > lrwxrwxrwx
68
69 $ ls -dl -L d/l | awk '{print $1}'
70@@ -343,7 +343,7 @@ Remove the default ACL
71 Reset to base entries
72
73 $ setfacl -b d
74- $ ls -dl d | awk '{print $1}' | sed 's/\.$//g'
75+ $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g'
76 > drwxr-x---
77
78 $ getfacl --omit-header d
79@@ -355,7 +355,7 @@ Reset to base entries
80 Now, chmod should change the group_obj entry
81
82 $ chmod 775 d
83- $ ls -dl d | awk '{print $1}' | sed 's/\.$//g'
84+ $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g'
85 > drwxrwxr-x
86
87 $ getfacl --omit-header d
88diff --git a/test/sbits-restore.test b/test/sbits-restore.test
89index de21340..5899b0a 100644
90--- a/test/sbits-restore.test
91+++ b/test/sbits-restore.test
92@@ -13,10 +13,10 @@ Ensure setting of SUID/SGID/sticky via --restore works
93 $ touch d/g
94 $ touch d/u
95 $ setfacl --restore d.acl
96- $ ls -dl d | awk '{print $1}' | sed 's/\.$//g'
97+ $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g'
98 > drwxr-xr-t
99- $ ls -dl d/u | awk '{print $1}' | sed 's/\.$//g'
100+ $ ls -dl d/u | awk '{print $1}' | sed 's/\\.$//g'
101 > -rwSr--r--
102- $ ls -dl d/g | awk '{print $1}' | sed 's/\.$//g'
103+ $ ls -dl d/g | awk '{print $1}' | sed 's/\\.$//g'
104 > -rw-r-Sr--
105 $ rm -Rf d
106--
1071.9.1
108
diff --git a/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch b/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch
new file mode 100644
index 0000000000..8cc11a63e1
--- /dev/null
+++ b/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch
@@ -0,0 +1,84 @@
1From d2f49ee6fe4850b8dda5b08676b36201d3c43710 Mon Sep 17 00:00:00 2001
2From: He Zhe <zhe.he@windriver.com>
3Date: Wed, 2 Mar 2016 15:46:57 +0800
4Subject: [PATCH] test: fixups on SELinux machines for root testcases
5
6ls adds a '.' at the end of the permission field list on SELinux
7machines, filter this out so root tests work on SELinux machines.
8
9Upstream-Status: Accepted
10http://git.savannah.gnu.org/cgit/acl.git/commit/?id=26a87d36f80d5e98bccb5878834d9e69dadfe3e9
11
12Signed-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
19diff --git a/test/root/permissions.test b/test/root/permissions.test
20index 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
56diff --git a/test/root/restore.test b/test/root/restore.test
57index 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
69diff --git a/test/root/setfacl.test b/test/root/setfacl.test
70index 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--
831.9.1
84