]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
selinux: use text processing for audit.log 1400/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 23 Jan 2020 23:20:52 +0000 (15:20 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 23 Jan 2020 23:22:09 +0000 (15:22 -0800)
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 <pdonnell@redhat.com>
teuthology/task/selinux.py

index 6884edcb761ea39f2e4f08f3cb0bf36bae142edb..bf699f63df9e9e746c5b6ffef9311543c31ba38e 100644 (file)
@@ -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,