From: Patrick Donnelly Date: Thu, 23 Jan 2020 23:20:52 +0000 (-0800) Subject: selinux: use text processing for audit.log X-Git-Tag: 1.1.0~163^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1400%2Fhead;p=teuthology.git selinux: use text processing for audit.log We ran into some odd grep bug treating the audit.log as binary and wrongly returning a match result. Fixes: https://tracker.ceph.com/issues/43797 Signed-off-by: Patrick Donnelly --- diff --git a/teuthology/task/selinux.py b/teuthology/task/selinux.py index 6884edcb7..bf699f63d 100644 --- a/teuthology/task/selinux.py +++ b/teuthology/task/selinux.py @@ -137,8 +137,8 @@ class SELinux(Task): ignore_known_denials = '\'\(' + str.join('\|', known_denials) + '\)\'' for remote in self.cluster.remotes.keys(): proc = remote.run( - args=['sudo', 'grep', 'avc: .*denied', - '/var/log/audit/audit.log', run.Raw('|'), 'grep', '-v', + args=['sudo', 'grep', '-a', 'avc: .*denied', + '/var/log/audit/audit.log', run.Raw('|'), 'grep', '-av', run.Raw(ignore_known_denials)], stdout=StringIO(), check_status=False,