diff options
| author | Mark Hatle <mark.hatle@windriver.com> | 2017-09-08 10:44:23 -0500 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@windriver.com> | 2017-09-14 08:29:01 -0500 |
| commit | 4fefe83c3203c11fadbe43637a3058284b60427b (patch) | |
| tree | af4b33f05100c12ed16851f5dd4129f0e176da25 /recipes-support/attr/files/fix-ptest-failures-when-selinux-enabled.patch | |
| parent | 694b8d1f1a590083e4445d6941f24b412ec0f206 (diff) | |
| download | meta-selinux-4fefe83c3203c11fadbe43637a3058284b60427b.tar.gz | |
Refactor to conform to YP Compat requirements
Change the references to check for the distribution flag of 'selinux' being
set before taking any action within the bbappends. This prevents the
signature from being modified.
Also remove PR changes, as they are no longer allowed.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'recipes-support/attr/files/fix-ptest-failures-when-selinux-enabled.patch')
| -rw-r--r-- | recipes-support/attr/files/fix-ptest-failures-when-selinux-enabled.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/recipes-support/attr/files/fix-ptest-failures-when-selinux-enabled.patch b/recipes-support/attr/files/fix-ptest-failures-when-selinux-enabled.patch new file mode 100644 index 0000000..e1eefa7 --- /dev/null +++ b/recipes-support/attr/files/fix-ptest-failures-when-selinux-enabled.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | When enable selinux, file has a default attribute: | ||
| 4 | |||
| 5 | # file: here | ||
| 6 | security.selinux="system_u:object_r:lib_t:s0" | ||
| 7 | |||
| 8 | That cause there is always more output than expected. | ||
| 9 | |||
| 10 | Filter out selinux related attribute info to make ptest pass. | ||
| 11 | |||
| 12 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
| 13 | --- | ||
| 14 | diff --git a/test/run b/test/run | ||
| 15 | index cf15252..945741e 100755 | ||
| 16 | --- a/test/run | ||
| 17 | +++ b/test/run | ||
| 18 | @@ -132,6 +132,23 @@ sub process_test($$$$) { | ||
| 19 | print "[$prog_line] \$ ", join(' ', | ||
| 20 | map { s/\s/\\$&/g; $_ } @$p), " -- "; | ||
| 21 | my $result = exec_test($prog, $in); | ||
| 22 | + | ||
| 23 | + # filter selinux related attributes info | ||
| 24 | + my @strip1; | ||
| 25 | + my @strip2; | ||
| 26 | + foreach (@$result) { | ||
| 27 | + unless (/security.selinux=.*\n/) { | ||
| 28 | + push @strip1, $_; | ||
| 29 | + } | ||
| 30 | + } | ||
| 31 | + for (my $i = 0; $i <= $#strip1; $i++) { | ||
| 32 | + if ($strip1[$i] =~ /^# file:.*/ && $strip1[$i+1] =~ /^\n$/) { | ||
| 33 | + $i++; | ||
| 34 | + } else { | ||
| 35 | + push @strip2, $strip1[$i]; | ||
| 36 | + } | ||
| 37 | + } | ||
| 38 | + $result = \@strip2; | ||
| 39 | my @good = (); | ||
| 40 | my $nmax = (@$out > @$result) ? @$out : @$result; | ||
| 41 | for (my $n=0; $n < $nmax; $n++) { | ||
